public class BulkServiceImpl extends Object implements BulkService
BulkService
.Modifier and Type | Field and Description |
---|---|
static long |
ABORTED_TTL_SECONDS |
static String |
BULK_KV_STORE_NAME |
static String |
BULK_LOG_MANAGER_NAME |
static String |
COMMAND_PREFIX |
static String |
COMMAND_STREAM |
static long |
COMPLETED_TTL_SECONDS |
static String |
DONE_STREAM |
static String |
PRODUCE_IMMEDIATE_OPTION |
static String |
RECORD_CODEC |
static String |
STATUS_PREFIX |
static String |
STATUS_STREAM |
Constructor and Description |
---|
BulkServiceImpl() |
Modifier and Type | Method and Description |
---|---|
BulkStatus |
abort(String commandId)
Aborts an asynchronous task.
|
boolean |
await(Duration duration)
Waits for completion of all bulk commands.
|
boolean |
await(String commandId,
Duration duration)
Waits for completion of given bulk command.
|
BulkCommand |
getCommand(String commandId)
Returns the command or null if the command is not found or aborted.
|
KeyValueStore |
getKvStore() |
Map<String,Serializable> |
getResult(String commandId)
Retrieves the command execution result.
|
BulkStatus |
getStatus(String commandId)
Returns the status of a task.
|
List<BulkStatus> |
getStatuses(String username)
Gets the list of action statuses triggered by the given user.
|
byte[] |
setCommand(BulkCommand command)
Stores the command in the kv store, returns the encoded command.
|
byte[] |
setStatus(BulkStatus status)
Stores the status in the kv store returns the encoded status
|
String |
submit(BulkCommand command)
Submits a
BulkCommand that will be processed asynchronously. |
public static final String BULK_LOG_MANAGER_NAME
public static final String BULK_KV_STORE_NAME
public static final String COMMAND_STREAM
public static final String STATUS_STREAM
public static final String DONE_STREAM
public static final String RECORD_CODEC
public static final String COMMAND_PREFIX
public static final String STATUS_PREFIX
public static final String PRODUCE_IMMEDIATE_OPTION
public static final long COMPLETED_TTL_SECONDS
public static final long ABORTED_TTL_SECONDS
public BulkServiceImpl()
public String submit(BulkCommand command)
BulkService
BulkCommand
that will be processed asynchronously.submit
in interface BulkService
command
- the command to submitpublic BulkStatus getStatus(String commandId)
AsyncService
getStatus
in interface AsyncService<String,BulkStatus,Map<String,Serializable>>
public byte[] setStatus(BulkStatus status)
public BulkCommand getCommand(String commandId)
BulkService
getCommand
in interface BulkService
public BulkStatus abort(String commandId)
AsyncService
abort
in interface AsyncService<String,BulkStatus,Map<String,Serializable>>
public Map<String,Serializable> getResult(String commandId)
AsyncService
getResult
in interface AsyncService<String,BulkStatus,Map<String,Serializable>>
public byte[] setCommand(BulkCommand command)
public boolean await(String commandId, Duration duration) throws InterruptedException
BulkService
await
in interface BulkService
commandId
- the command to waitduration
- the duration to waittrue
if bulk command completed or false
if computation has not finished after the timeoutInterruptedException
public KeyValueStore getKvStore()
public boolean await(Duration duration) throws InterruptedException
BulkService
await
in interface BulkService
duration
- the duration to waittrue
if all bulk commands completed or false
if one or more has not finished after the
timeoutInterruptedException
public List<BulkStatus> getStatuses(String username)
BulkService
getStatuses
in interface BulkService
username
- the user nameCopyright © 2019 Nuxeo. All rights reserved.