Package com.yahoo.documentapi
Class VisitorParameters
- java.lang.Object
-
- com.yahoo.documentapi.Parameters
-
- com.yahoo.documentapi.VisitorParameters
-
- Direct Known Subclasses:
DocumentVisitor
public class VisitorParameters extends Parameters
Parameters for creating or opening a visitor session- Author:
- Håkon Humberset
-
-
Constructor Summary
Constructors Constructor Description VisitorParameters(VisitorParameters params)
Copy constructor.VisitorParameters(java.lang.String documentSelection)
Creates visitor parameters from a document selection expression, using defaults for other parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
fieldSet()
void
fieldSet(java.lang.String fieldSet)
Set field set to use.java.lang.String
getBucketSpace()
java.util.Set<com.yahoo.document.BucketId>
getBucketsToVisit()
VisitorControlHandler
getControlHandler()
java.lang.String
getDocumentSelection()
boolean
getDynamicallyIncreaseMaxBucketsPerVisitor()
float
getDynamicMaxBucketsIncreaseFactor()
java.lang.String
getFieldSet()
long
getFromTimestamp()
java.util.Map<java.lang.String,byte[]>
getLibraryParameters()
com.yahoo.documentapi.messagebus.loadtypes.LoadType
getLoadType()
VisitorDataHandler
getLocalDataHandler()
int
getMaxBucketsPerVisitor()
long
getMaxFirstPassHits()
int
getMaxPending()
long
getMaxTotalHits()
DocumentProtocol.Priority
getPriority()
java.lang.String
getRemoteDataHandler()
java.lang.String
getResumeFileName()
ProgressToken
getResumeToken()
com.yahoo.messagebus.routing.Route
getRoute()
long
getSessionTimeoutMs()
com.yahoo.messagebus.ThrottlePolicy
getThrottlePolicy()
long
getTimeoutMs()
long
getToTimestamp()
int
getTraceLevel()
boolean
getVisitHeadersOnly()
Deprecated.boolean
getVisitInconsistentBuckets()
java.lang.String
getVisitorLibrary()
boolean
getVisitRemoves()
void
setBucketSpace(java.lang.String bucketSpace)
Set which (single) bucket space this visiting will be against.void
setBucketsToVisit(java.util.Set<com.yahoo.document.BucketId> buckets)
void
setControlHandler(VisitorControlHandler controlHandler)
Set control handler.void
setDocumentSelection(java.lang.String selection)
Set the document selection expressionvoid
setDynamicallyIncreaseMaxBucketsPerVisitor(boolean dynamicallyIncreaseMaxBucketsPerVisitor)
Set whether or not max buckets per visitor value should be dynamically increased when using orderdoc and visitors do not return at least half the desired amount of documentsvoid
setDynamicMaxBucketsIncreaseFactor(float dynamicMaxBucketsIncreaseFactor)
Set factor with which max buckets are dynamically increased each timevoid
setFieldSet(java.lang.String fieldSet)
void
setFromTimestamp(long timestamp)
Set from timestamp in microseconds.void
setLibraryParameter(java.lang.String param, byte[] value)
Set a visitor library specific parameter.void
setLibraryParameter(java.lang.String param, java.lang.String value)
Set a visitor library specific parameter.void
setLibraryParameters(java.util.Map<java.lang.String,byte[]> params)
Set all visitor library specific parameters.void
setLoadType(com.yahoo.documentapi.messagebus.loadtypes.LoadType loadType)
void
setLocalDataHandler(VisitorDataHandler localDataHandler)
Set local data handler.void
setMaxBucketsPerVisitor(int max)
void
setMaxFirstPassHits(long max)
Set the maximum number of documents to visit (max documents returned by the visitor)void
setMaxPending(int maxPending)
Set maximum pending messages one storage visitor will have pending to this client before stalling, waiting for acks.void
setMaxTotalHits(long max)
Set the maximum number of documents to visit (max documents returned by the visitor)void
setPriority(DocumentProtocol.Priority priority)
void
setRemoteDataHandler(java.lang.String remoteDataHandler)
Set address for the remote data handler.void
setResumeFileName(java.lang.String fileName)
Set filename for reading/storing progress token.void
setResumeToken(ProgressToken token)
Set progress token, which can be used to resume visitor.void
setRoute(com.yahoo.messagebus.routing.Route route)
Set the route to visit.void
setRoute(java.lang.String route)
Set the name of the storage cluster route to visit.void
setSessionTimeoutMs(long timeoutMs)
Sets timeout for the entire visiting session, in milliseconds.void
setThrottlePolicy(com.yahoo.messagebus.ThrottlePolicy policy)
void
setTimeoutMs(long timeoutMs)
Set the timeout for each visitor command in milliseconds.void
setToTimestamp(long timestamp)
Set to timestamp in microseconds.void
setTraceLevel(int traceLevel)
void
setVisitHeadersOnly(boolean headersOnly)
Deprecated.this option is ignoredvoid
setVisitInconsistentBuckets(boolean visitInconsistentBuckets)
void
setVisitorLibrary(java.lang.String library)
Set which visitor library is used for visiting in storage.void
setVisitRemoves(boolean visitRemoves)
boolean
skipBucketsOnFatalErrors()
void
skipBucketsOnFatalErrors(boolean skipBucketsOnFatalErrors)
java.lang.String
toString()
boolean
visitInconsistentBuckets()
void
visitInconsistentBuckets(boolean visitInconsistentBuckets)
Set whether to visit inconsistent buckets.boolean
visitRemoves()
void
visitRemoves(boolean visitRemoves)
Set whether to visit remove entries.
-
-
-
Constructor Detail
-
VisitorParameters
public VisitorParameters(java.lang.String documentSelection)
Creates visitor parameters from a document selection expression, using defaults for other parameters.- Parameters:
documentSelection
- document selection expression
-
VisitorParameters
public VisitorParameters(VisitorParameters params)
Copy constructor.- Parameters:
params
- object to copy
-
-
Method Detail
-
getDocumentSelection
public java.lang.String getDocumentSelection()
- Returns:
- The selection string used for visiting.
-
getBucketSpace
public java.lang.String getBucketSpace()
- Returns:
- The bucket space to visit
-
getVisitorLibrary
public java.lang.String getVisitorLibrary()
- Returns:
- What visitor library to use for the visiting. The library in question must be installed on each storage node in the target cluster.
-
getMaxPending
public int getMaxPending()
- Returns:
- The maximum number of messages each storage visitor will have pending before waiting for acks from client.
-
getTimeoutMs
public long getTimeoutMs()
- Returns:
- The timeout for each sent visitor operation in milliseconds.
-
getSessionTimeoutMs
public long getSessionTimeoutMs()
- Returns:
- Session timeout in milliseconds, or -1 if not timeout has been set. -1 implies that session will run to completion without automatically timing out.
-
getFromTimestamp
public long getFromTimestamp()
- Returns:
- The minimum timestamp (in microsecs) of documents the visitor will visit.
-
getToTimestamp
public long getToTimestamp()
- Returns:
- The maximum timestamp (in microsecs) of documents the visitor will visit.
-
visitRemoves
public boolean visitRemoves()
- Returns:
- If this method returns true, the visitor will visit remove entries as well as documents (you can see what documents have been deleted).
-
getVisitRemoves
public boolean getVisitRemoves()
-
getVisitHeadersOnly
@Deprecated public boolean getVisitHeadersOnly()
Deprecated.
-
fieldSet
public java.lang.String fieldSet()
- Returns:
- The field set to use.
-
getFieldSet
public java.lang.String getFieldSet()
-
visitInconsistentBuckets
public boolean visitInconsistentBuckets()
- Returns:
- If this method returns true, the visitor will visit inconsistent buckets.
-
getVisitInconsistentBuckets
public boolean getVisitInconsistentBuckets()
-
getLibraryParameters
public java.util.Map<java.lang.String,byte[]> getLibraryParameters()
- Returns:
- Returns a map of string → string of arguments that are passed to the visitor library.
-
getResumeToken
public ProgressToken getResumeToken()
- Returns:
- The progress token, which can be used to resume visitor.
-
getResumeFileName
public java.lang.String getResumeFileName()
- Returns:
- The filename for reading/storing progress token.
-
getRemoteDataHandler
public java.lang.String getRemoteDataHandler()
- Returns:
- Address to the remote data handler.
-
getLocalDataHandler
public VisitorDataHandler getLocalDataHandler()
- Returns:
- The local data handler.
-
getControlHandler
public VisitorControlHandler getControlHandler()
- Returns:
- The control handler.
-
getDynamicallyIncreaseMaxBucketsPerVisitor
public boolean getDynamicallyIncreaseMaxBucketsPerVisitor()
- Returns:
- Whether or not max buckets per visitor value should be dynamically increased when using orderdoc and visitors do not return at least half the desired amount of documents
-
getDynamicMaxBucketsIncreaseFactor
public float getDynamicMaxBucketsIncreaseFactor()
- Returns:
- Factor with which max buckets are dynamically increased each time
-
getPriority
public DocumentProtocol.Priority getPriority()
-
setDocumentSelection
public void setDocumentSelection(java.lang.String selection)
Set the document selection expression
-
setBucketSpace
public void setBucketSpace(java.lang.String bucketSpace)
Set which (single) bucket space this visiting will be against.
-
setVisitorLibrary
public void setVisitorLibrary(java.lang.String library)
Set which visitor library is used for visiting in storage. DumpVisitor is most common implementation.
-
setMaxPending
public void setMaxPending(int maxPending)
Set maximum pending messages one storage visitor will have pending to this client before stalling, waiting for acks.
-
setTimeoutMs
public void setTimeoutMs(long timeoutMs)
Set the timeout for each visitor command in milliseconds.
-
setSessionTimeoutMs
public void setSessionTimeoutMs(long timeoutMs)
Sets timeout for the entire visiting session, in milliseconds. -1 implies infinity. If the session takes more time than this to complete, it will automatically be failed with CompletionCode.TIMEOUT. If no session timeout has been explicitly set (or it has been set to -1), visiting will continue until it completes or abort()/destroy() is called on the session instance.
-
setFromTimestamp
public void setFromTimestamp(long timestamp)
Set from timestamp in microseconds. Documents put/updated before this timestamp will not be visited.
-
setToTimestamp
public void setToTimestamp(long timestamp)
Set to timestamp in microseconds. Documents put/updated after this timestamp will not be visited.
-
visitRemoves
public void visitRemoves(boolean visitRemoves)
Set whether to visit remove entries. That is, entries saying that some document has been removed.
-
setVisitRemoves
public void setVisitRemoves(boolean visitRemoves)
-
setVisitHeadersOnly
@Deprecated public void setVisitHeadersOnly(boolean headersOnly)
Deprecated.this option is ignored
-
fieldSet
public void fieldSet(java.lang.String fieldSet)
Set field set to use.
-
setFieldSet
public void setFieldSet(java.lang.String fieldSet)
-
visitInconsistentBuckets
public void visitInconsistentBuckets(boolean visitInconsistentBuckets)
Set whether to visit inconsistent buckets.
-
setVisitInconsistentBuckets
public void setVisitInconsistentBuckets(boolean visitInconsistentBuckets)
-
setLibraryParameter
public void setLibraryParameter(java.lang.String param, java.lang.String value)
Set a visitor library specific parameter.
-
setLibraryParameter
public void setLibraryParameter(java.lang.String param, byte[] value)
Set a visitor library specific parameter.
-
setLibraryParameters
public void setLibraryParameters(java.util.Map<java.lang.String,byte[]> params)
Set all visitor library specific parameters.
-
setResumeToken
public void setResumeToken(ProgressToken token)
Set progress token, which can be used to resume visitor.
-
setResumeFileName
public void setResumeFileName(java.lang.String fileName)
Set filename for reading/storing progress token. If the file exists and contains progress data, visitor should resume visiting from this point.
-
setRemoteDataHandler
public void setRemoteDataHandler(java.lang.String remoteDataHandler)
Set address for the remote data handler.
-
setLocalDataHandler
public void setLocalDataHandler(VisitorDataHandler localDataHandler)
Set local data handler.
-
setControlHandler
public void setControlHandler(VisitorControlHandler controlHandler)
Set control handler.
-
setRoute
public void setRoute(java.lang.String route)
Set the name of the storage cluster route to visit. Default is "storage/cluster.storage".
-
setRoute
public void setRoute(com.yahoo.messagebus.routing.Route route)
Set the route to visit.
-
getRoute
public com.yahoo.messagebus.routing.Route getRoute()
- Returns:
- Returns the name of the storage cluster to visit.
-
setMaxFirstPassHits
public void setMaxFirstPassHits(long max)
Set the maximum number of documents to visit (max documents returned by the visitor)
-
getMaxFirstPassHits
public long getMaxFirstPassHits()
- Returns:
- Returns the maximum number of documents to visit (max documents returned by the visitor)
-
setMaxTotalHits
public void setMaxTotalHits(long max)
Set the maximum number of documents to visit (max documents returned by the visitor)
-
getMaxTotalHits
public long getMaxTotalHits()
- Returns:
- Returns the maximum number of documents to visit (max documents returned by the visitor)
-
getBucketsToVisit
public java.util.Set<com.yahoo.document.BucketId> getBucketsToVisit()
-
setBucketsToVisit
public void setBucketsToVisit(java.util.Set<com.yahoo.document.BucketId> buckets)
-
getMaxBucketsPerVisitor
public int getMaxBucketsPerVisitor()
-
setMaxBucketsPerVisitor
public void setMaxBucketsPerVisitor(int max)
-
setTraceLevel
public void setTraceLevel(int traceLevel)
-
getTraceLevel
public int getTraceLevel()
-
setPriority
public void setPriority(DocumentProtocol.Priority priority)
-
getThrottlePolicy
public com.yahoo.messagebus.ThrottlePolicy getThrottlePolicy()
-
setThrottlePolicy
public void setThrottlePolicy(com.yahoo.messagebus.ThrottlePolicy policy)
-
setLoadType
public void setLoadType(com.yahoo.documentapi.messagebus.loadtypes.LoadType loadType)
-
getLoadType
public com.yahoo.documentapi.messagebus.loadtypes.LoadType getLoadType()
-
skipBucketsOnFatalErrors
public boolean skipBucketsOnFatalErrors()
-
skipBucketsOnFatalErrors
public void skipBucketsOnFatalErrors(boolean skipBucketsOnFatalErrors)
-
setDynamicallyIncreaseMaxBucketsPerVisitor
public void setDynamicallyIncreaseMaxBucketsPerVisitor(boolean dynamicallyIncreaseMaxBucketsPerVisitor)
Set whether or not max buckets per visitor value should be dynamically increased when using orderdoc and visitors do not return at least half the desired amount of documents- Parameters:
dynamicallyIncreaseMaxBucketsPerVisitor
- whether or not to increase
-
setDynamicMaxBucketsIncreaseFactor
public void setDynamicMaxBucketsIncreaseFactor(float dynamicMaxBucketsIncreaseFactor)
Set factor with which max buckets are dynamically increased each time- Parameters:
dynamicMaxBucketsIncreaseFactor
- increase factor (must be 1 or more)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-