public class QueryStepRunner extends java.lang.Object implements StepRunner
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
logger |
Constructor and Description |
---|
QueryStepRunner(HubConfig hubConfig) |
Modifier and Type | Method and Description |
---|---|
void |
awaitCompletion()
Blocks until the step execution is complete.
|
void |
awaitCompletion(long timeout,
java.util.concurrent.TimeUnit unit)
Blocks until the step execution is complete.
|
int |
getBatchSize()
Returns the batch size
|
StepRunner |
onFinished(StepFinishedListener listener)
Sets the finished listener for when the item has processed (similar to a finally)
|
StepRunner |
onItemComplete(StepItemCompleteListener listener)
Sets a listener on each item completing
|
StepRunner |
onItemFailed(StepItemFailureListener listener)
Sets the failure listener for each item in the flow
|
StepRunner |
onStatusChanged(StepStatusListener listener)
Sets the status change listener on the flowrunner object
|
RunStepResponse |
run()
Runs the flow and creates the job
|
RunStepResponse |
run(java.util.Collection uris)
Runs the flow and creates the job.
|
void |
stop()
Stops the step run
|
StepRunner |
withBatchSize(int batchSize)
Sets the batch size for the step runner
|
StepRunner |
withDestinationDatabase(java.lang.String destinationDatabase)
Sets the database where flow output data will be persisted to
|
StepRunner |
withFlow(Flow flow)
Sets the flow to be used with the step runner
|
StepRunner |
withJobId(java.lang.String jobId)
Sets the batch size for the step runner
|
StepRunner |
withOptions(java.util.Map<java.lang.String,java.lang.Object> options)
Sets the options to be passed into the xqy or sjs flow in the $options or options variables of main.
|
StepRunner |
withSourceClient(com.marklogic.client.DatabaseClient stagingClient)
Sets the source client on the step runner.
|
StepRunner |
withStep(java.lang.String step)
Sets the batch size for the step runner
|
StepRunner |
withStepConfig(java.util.Map<java.lang.String,java.lang.Object> stepConfig)
Sets the config to be used in orchestrating the step.
|
StepRunner |
withStepDefinition(StepDefinition stepDefinition) |
StepRunner |
withStopOnFailure(boolean stopOnFailure)
Sets if this will stop the job on a failure, or if it will continue on
|
StepRunner |
withThreadCount(int threadCount)
Sets the thread count for the flowrunner
|
public QueryStepRunner(HubConfig hubConfig)
public StepRunner withFlow(Flow flow)
StepRunner
withFlow
in interface StepRunner
flow
- the flow object to be usedpublic StepRunner withStep(java.lang.String step)
StepRunner
withStep
in interface StepRunner
step
- - the step to be run in the flowpublic StepRunner withJobId(java.lang.String jobId)
StepRunner
withJobId
in interface StepRunner
jobId
- - the id of the jobpublic StepRunner withStepDefinition(StepDefinition stepDefinition)
public StepRunner withBatchSize(int batchSize)
StepRunner
withBatchSize
in interface StepRunner
batchSize
- - the size of the batch in integer formpublic StepRunner withThreadCount(int threadCount)
StepRunner
withThreadCount
in interface StepRunner
threadCount
- - the number of threads for the step runner to usepublic StepRunner withSourceClient(com.marklogic.client.DatabaseClient stagingClient)
StepRunner
withSourceClient
in interface StepRunner
stagingClient
- - the client that will be usedpublic StepRunner withDestinationDatabase(java.lang.String destinationDatabase)
StepRunner
withDestinationDatabase
in interface StepRunner
destinationDatabase
- - the name of the destination databasepublic StepRunner withStopOnFailure(boolean stopOnFailure)
StepRunner
withStopOnFailure
in interface StepRunner
stopOnFailure
- - true to stop the job if a failure happenspublic StepRunner withOptions(java.util.Map<java.lang.String,java.lang.Object> options)
StepRunner
withOptions
in interface StepRunner
options
- - the object map of options as string/object pairpublic StepRunner withStepConfig(java.util.Map<java.lang.String,java.lang.Object> stepConfig)
StepRunner
withStepConfig
in interface StepRunner
stepConfig
- - the object map of configurations for the step to execute as string/object pairpublic StepRunner onItemComplete(StepItemCompleteListener listener)
StepRunner
onItemComplete
in interface StepRunner
listener
- the listen object to setpublic StepRunner onItemFailed(StepItemFailureListener listener)
StepRunner
onItemFailed
in interface StepRunner
listener
- the listener for the failures in the flowpublic StepRunner onStatusChanged(StepStatusListener listener)
StepRunner
onStatusChanged
in interface StepRunner
listener
- - the listener for when the status changespublic StepRunner onFinished(StepFinishedListener listener)
StepRunner
onFinished
in interface StepRunner
listener
- - the listener for the flow item when it finishespublic void awaitCompletion()
StepRunner
awaitCompletion
in interface StepRunner
public void awaitCompletion(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
StepRunner
awaitCompletion
in interface StepRunner
timeout
- the maximum time to waitunit
- the time unit of the timeout argumentjava.lang.InterruptedException
- if interrupted while waitingjava.util.concurrent.TimeoutException
- if times outpublic RunStepResponse run()
StepRunner
run
in interface StepRunner
public void stop()
StepRunner
stop
in interface StepRunner
public RunStepResponse run(java.util.Collection uris)
StepRunner
run
in interface StepRunner
uris
- the ids to pass to the harmonization flowpublic int getBatchSize()
StepRunner
getBatchSize
in interface StepRunner