public class BatchMutatorClient extends Object
| Constructor and Description |
|---|
BatchMutatorClient(ai.grakn.Keyspace keyspace,
String uri,
boolean debugOn,
int maxRetries) |
BatchMutatorClient(ai.grakn.Keyspace keyspace,
String uri,
java.util.function.Consumer<TaskResult> onCompletionOfTask,
boolean reportStats,
boolean debugOn,
int maxRetries) |
BatchMutatorClient(ai.grakn.Keyspace keyspace,
String uri,
java.util.function.Consumer<TaskResult> onCompletionOfTask,
boolean debugOn,
int maxRetries) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Query query)
Add an insert query to the queue.
|
void |
close()
Wait for all of the submitted tasks to have been completed
|
int |
getBatchSize()
Get the number of queries in each transaction
|
BatchMutatorClient |
setBatchSize(int size)
Set the size of the each transaction in terms of number of vars.
|
BatchMutatorClient |
setNumberActiveTasks(int size)
Number of active tasks running on the server at any one time.
|
BatchMutatorClient |
setTaskCompletionConsumer(java.util.function.Consumer<TaskResult> onCompletionOfTask)
Provide a consumer function to execute upon task completion
|
void |
waitToFinish()
Wait for all of the submitted tasks to have been completed
|
public BatchMutatorClient(ai.grakn.Keyspace keyspace,
String uri,
boolean debugOn,
int maxRetries)
public BatchMutatorClient(ai.grakn.Keyspace keyspace,
String uri,
java.util.function.Consumer<TaskResult> onCompletionOfTask,
boolean debugOn,
int maxRetries)
public BatchMutatorClient(ai.grakn.Keyspace keyspace,
String uri,
java.util.function.Consumer<TaskResult> onCompletionOfTask,
boolean reportStats,
boolean debugOn,
int maxRetries)
public BatchMutatorClient setTaskCompletionConsumer(java.util.function.Consumer<TaskResult> onCompletionOfTask)
onCompletionOfTask - function applied to the last state of the taskpublic BatchMutatorClient setBatchSize(int size)
size - number of vars in each transactionpublic int getBatchSize()
public BatchMutatorClient setNumberActiveTasks(int size)
add(Query) method will block on the value of this field.size - number of tasks to allow to run at any given timepublic void add(Query query)
setNumberActiveTasks(int).
It will become unblocked as tasks are completed.query - insert query to be executedpublic void waitToFinish()
public void close()
Copyright © 2017 Grakn Labs Ltd. All rights reserved.