Class DocprocService

java.lang.Object
com.yahoo.component.AbstractComponent
com.yahoo.docproc.DocprocService
All Implemented Interfaces:
com.yahoo.component.Component, com.yahoo.component.Deconstructable, Comparable<com.yahoo.component.Component>

@Deprecated(forRemoval=true, since="7") public class DocprocService extends com.yahoo.component.AbstractComponent
Deprecated, for removal: This API element is subject to removal in a future version.
Will be removed in Vespa 8. Only for internal use.

The document processing service. Use this to set up a document processing chain and to process documents using that chain. Note that there may be multiple named instances of this service in the same runtime. The default service is called "default" and is always present.

To create a server which receives documents from the network and processes them, have a look at com.yahoo.docproc.server.Server.

This class is thread safe.

Author:
bratseth
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static SchemaMap
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Fields inherited from class com.yahoo.component.AbstractComponent

    isDeconstructable
  • Constructor Summary

    Constructors
    Constructor
    Description
    DocprocService(com.yahoo.component.ComponentId id)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    DocprocService(com.yahoo.component.ComponentId id, CallStack stack, com.yahoo.document.DocumentTypeManager mgr)
    Deprecated.
    DocprocService(com.yahoo.component.ComponentId id, CallStack stack, com.yahoo.document.DocumentTypeManager mgr, int numThreads)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a new docproc service, which is set to be in service.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a service with a name with an unbounded input queue.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Do some work in this service.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Do some work in this service.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the processing chain of this service.
    com.yahoo.document.DocumentTypeManager
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the DocprocExecutor of this DocprocService.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if this service currently accepts new incoming processings via process(...). Default is true.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if this is currently processing incoming processings (in service), or false if they are just queued up (out of service).
    void
    process(Processing processing)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Asynchronously process the given Processing using the processing chain of this service
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Asynchronously process the given Processing using the processing chain of this service, and call the specified ProcessingEndpoint when done.
    void
    process(com.yahoo.document.DocumentOperation documentOperation)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Asynchronously process the given document operation using the processing chain of this service.
    void
    process(com.yahoo.document.DocumentOperation documentOperation, ProcessingEndpoint endp)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Asynchronously process the given document put or document update using the processing chain of this service, and call the specified ProcessingEndpoint when done.
    void
    processDocumentOperations(List<com.yahoo.document.DocumentOperation> documentOperations)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Asynchronously process the given document operations as one unit using the processing chain of this service.
    void
    processDocumentOperations(List<com.yahoo.document.DocumentOperation> documentOperations, ProcessingEndpoint endp)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Asynchronously process the given document operations as one unit using the processing chain of this service, and call the specified ProcessingEndpoint when done.
    void
    setAcceptingNewProcessings(boolean acceptingNewProcessings)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets whether this service should accept new incoming processings via process(...).
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets a new processing stack for this service.
    void
    setDocumentTypeManager(com.yahoo.document.DocumentTypeManager documentTypeManager)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    setInService(boolean inService)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets whether this should currently perform any processing.

    Methods inherited from class com.yahoo.component.AbstractComponent

    clone, compareTo, getClassName, getId, getIdString, hasInitializedId, initId, isDeconstructable, setIsDeconstructable, toString

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • schemaMap

      public static SchemaMap schemaMap
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • DocprocService

      public DocprocService(com.yahoo.component.ComponentId id)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • DocprocService

      public DocprocService(com.yahoo.component.ComponentId id, CallStack stack, com.yahoo.document.DocumentTypeManager mgr, int numThreads)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new docproc service, which is set to be in service.
      Parameters:
      id - the component id of the new service.
      stack - the call stack to use.
      mgr - the document type manager to use.
      numThreads - to have in the thread pool
    • DocprocService

      @Deprecated public DocprocService(com.yahoo.component.ComponentId id, CallStack stack, com.yahoo.document.DocumentTypeManager mgr)
      Deprecated.
    • DocprocService

      public DocprocService(String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a service with a name with an unbounded input queue. If the given name is null or the empty string, it will become the name "default". Testing only
  • Method Details

    • deconstruct

      public void deconstruct()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      deconstruct in interface com.yahoo.component.Deconstructable
      Overrides:
      deconstruct in class com.yahoo.component.AbstractComponent
    • getDocumentTypeManager

      public com.yahoo.document.DocumentTypeManager getDocumentTypeManager()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setDocumentTypeManager

      public void setDocumentTypeManager(com.yahoo.document.DocumentTypeManager documentTypeManager)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getQueueSize

      public int getQueueSize()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getExecutor

      public DocprocExecutor getExecutor()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the DocprocExecutor of this DocprocService. This can be used to synchronously process one Processing.
      Returns:
      the DocprocExecutor of this DocprocService, or null if a CallStack has not yet been set.
    • getThreadPoolExecutor

      public ThreadPoolExecutor getThreadPoolExecutor()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setInService

      public void setInService(boolean inService)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets whether this should currently perform any processing. New processings will be accepted also when this is out of service, but no processing will happen when it is out of service.
    • isInService

      public boolean isInService()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns true if this is currently processing incoming processings (in service), or false if they are just queued up (out of service). By default, this is out of service.
    • isAcceptingNewProcessings

      public boolean isAcceptingNewProcessings()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns true if this service currently accepts new incoming processings via process(...). Default is true.
      Returns:
      true if accepting new incoming processings
    • setAcceptingNewProcessings

      public void setAcceptingNewProcessings(boolean acceptingNewProcessings)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets whether this service should accept new incoming processings via process(...).
      Parameters:
      acceptingNewProcessings - true if service should accept new incoming processings
    • getName

      public String getName()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getCallStack

      public CallStack getCallStack()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the processing chain of this service. This stack can not be modified. To change the stack, set a new one.
    • setCallStack

      public void setCallStack(CallStack stack)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets a new processing stack for this service. This will be the Prototype for the call stacks of individual processings in this service
    • process

      public void process(Processing processing, ProcessingEndpoint endp)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Asynchronously process the given Processing using the processing chain of this service, and call the specified ProcessingEndpoint when done.
      Throws:
      RuntimeException - caused by a QueueFullException if this DocprocService has a bounded input queue and the queue is full
      IllegalStateException - if this DocprocService is not accepting new incoming processings
    • process

      public void process(Processing processing)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Asynchronously process the given Processing using the processing chain of this service
      Throws:
      RuntimeException - caused by a QueueFullException if this DocprocService has a bounded input queue and the queue is full
      IllegalStateException - if this DocprocService is not accepting new incoming processings
    • process

      public void process(com.yahoo.document.DocumentOperation documentOperation, ProcessingEndpoint endp)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Asynchronously process the given document put or document update using the processing chain of this service, and call the specified ProcessingEndpoint when done.
      Throws:
      RuntimeException - caused by a QueueFullException if this DocprocService has a bounded input queue and the queue is full
      IllegalStateException - if this DocprocService is not accepting new incoming processings
    • process

      public void process(com.yahoo.document.DocumentOperation documentOperation)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Asynchronously process the given document operation using the processing chain of this service.
      Throws:
      RuntimeException - caused by a QueueFullException if this DocprocService has a bounded input queue and the queue is full
      IllegalStateException - if this DocprocService is not accepting new incoming processings
    • processDocumentOperations

      public void processDocumentOperations(List<com.yahoo.document.DocumentOperation> documentOperations, ProcessingEndpoint endp)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Asynchronously process the given document operations as one unit using the processing chain of this service, and call the specified ProcessingEndpoint when done.
      Throws:
      RuntimeException - caused by a QueueFullException if this DocprocService has a bounded input queue and the queue is full
      IllegalStateException - if this DocprocService is not accepting new incoming processings
    • processDocumentOperations

      public void processDocumentOperations(List<com.yahoo.document.DocumentOperation> documentOperations)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Asynchronously process the given document operations as one unit using the processing chain of this service.
      Throws:
      RuntimeException - caused by a QueueFullException if this DocprocService has a bounded input queue and the queue is full
      IllegalStateException - if this DocprocService is not accepting new incoming processings
    • doWork

      public boolean doWork()
      Deprecated, for removal: This API element is subject to removal in a future version.

      Do some work in this service. This will perform some processing and return in a "short" while, as long as individual processors also returns.

      This method is thread safe - multiple threads may call doWork at any time. Note that processors should be non-blocking, so multiple threads should be used primarily to utilize multiple processors.

      Returns:
      true if some work was performed, false if no work could be performed at this time, because there are no outstanding processings, or because this is out of service. Note that since processings may arrive or be put back by another thread at any time, this return value does not mean that no work will be available if doWork as called again immediately.
    • doWorkBlocking

      public boolean doWorkBlocking() throws InterruptedException
      Deprecated, for removal: This API element is subject to removal in a future version.

      Do some work in this service. This will perform some processing and return in a "short" while, as long as individual processors also returns. Note that if the internal queue is empty when this method is called, it will block until some work is submitted by a call to process() by another thread.

      This method is thread safe - multiple threads may call doWorkBlocking at any time. Note that processors should be non-blocking, so multiple threads should be used primarily to utilize multiple processors.

      Returns:
      always true, since if the internal queue is empty when this method is called, it will block until some work is submitted by a call to process() by another thread.
      Throws:
      InterruptedException - if a call to this method is interrupted while waiting for data to become available