public class GetCandidateSetOperation extends AbstractOperation
RankingSingleQueryOperation
and returns a candidate set requested size for
this operation. The candidate set is returned in form of queue of string locators. It is possible that an algorithm
returns the operation immediately after the processing starts and other threads continue in processing afterwards.
After the processing is really finished, it is expected that method AbstractOperation.endOperation(messif.utility.ErrorCode)
is called; at the same time, the answer queue should stop blockingAbstractOperation.OperationConstructor, AbstractOperation.OperationName
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.BlockingQueue<java.lang.String> |
candidateSetLocators
Output of the operation stored in a blocking queue.
|
suppData, uuidOperationComparator
Constructor and Description |
---|
GetCandidateSetOperation(RankingSingleQueryOperation encapsulatedOperation,
int candidateSetSize)
Creates a new operation given a query operation and required size of candidate set.
|
GetCandidateSetOperation(RankingSingleQueryOperation encapsulatedOperation,
int candidateSetSize,
java.util.concurrent.BlockingQueue<java.lang.String> candidateLocatorQueue)
Creates a new operation given a query operation and required size of candidate set.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addAll(java.util.Iterator<AbstractObject> it)
Adds all objects from the iterator to the answer queue of this operation.
|
void |
endOperation()
End operation successfully.
|
java.lang.Object |
getArgument(int index)
Returns argument that was passed while constructing instance.
|
int |
getArgumentCount()
Returns number of arguments that were passed while constructing this instance.
|
java.util.concurrent.BlockingQueue<java.lang.String> |
getCandidateSetLocators()
Returns the queue of candidate locators.
|
int |
getCandidateSetSize()
Get the required size of candidate set
|
RankingSingleQueryOperation |
getEncapsulatedOperation()
Get the encapsulated query operation.
|
void |
updateFrom(AbstractOperation operation)
Update the error code of this operation from another operation.
|
boolean |
wasSuccessful()
Returns true if this operation has finished successfuly.
|
appendArguments, appendErrorCode, clearSurplusData, clone, containsParameter, createOperation, endOperation, equals, getAnnotatedConstructor, getAnnotatedConstructor, getArgumentString, getConstructorArgumentDescriptions, getConstructorArgumentDescriptions, getConstructorArguments, getConstructorArguments, getConstructorDescription, getErrorCode, getName, getName, getOperationID, getParameter, getParameter, getParameter, getParameterCount, getParameterMap, getParameterNames, getRequiredParameter, getRequiredParameter, hashCode, isErrorCode, isFinished, removeParameter, setParameter, toString
protected final java.util.concurrent.BlockingQueue<java.lang.String> candidateSetLocators
public GetCandidateSetOperation(RankingSingleQueryOperation encapsulatedOperation, int candidateSetSize)
encapsulatedOperation
- encapsulated query operationcandidateSetSize
- required size of candidate setpublic GetCandidateSetOperation(RankingSingleQueryOperation encapsulatedOperation, int candidateSetSize, java.util.concurrent.BlockingQueue<java.lang.String> candidateLocatorQueue)
encapsulatedOperation
- encapsulated query operationcandidateSetSize
- required size of candidate setcandidateLocatorQueue
- queue to be used for storing the candidate locatorspublic int getCandidateSetSize()
public java.util.concurrent.BlockingQueue<java.lang.String> getCandidateSetLocators()
candidateSetSize
.public RankingSingleQueryOperation getEncapsulatedOperation()
public boolean addAll(java.util.Iterator<AbstractObject> it)
it
- iterator over objects to be added to the answerpublic java.lang.Object getArgument(int index) throws java.lang.IndexOutOfBoundsException
AbstractOperation
getArgument
in class AbstractOperation
index
- zero-based index of an argument passed to constructorjava.lang.IndexOutOfBoundsException
- if index parameter is out of rangepublic int getArgumentCount()
AbstractOperation
getArgumentCount
in class AbstractOperation
public void updateFrom(AbstractOperation operation) throws java.lang.ClassCastException
AbstractOperation
updateFrom
in class AbstractOperation
operation
- the source operation from which to get the updatejava.lang.ClassCastException
- if the specified operation is incompatible with this operationpublic boolean wasSuccessful()
AbstractOperation
wasSuccessful
in class AbstractOperation
public void endOperation()
AbstractOperation
endOperation
in class AbstractOperation