public class LoaderClient extends Object
| Constructor and Description |
|---|
LoaderClient(String keyspace,
String uri) |
LoaderClient(String keyspace,
String uri,
java.util.function.Consumer<mjson.Json> onCompletionOfTask) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(InsertQuery query)
Add an insert query to the queue.
|
void |
flush()
Load any remaining batches in the queue.
|
LoaderClient |
setBatchSize(int size)
Set the size of the each transaction in terms of number of vars.
|
LoaderClient |
setNumberActiveTasks(int size)
Number of active tasks running on the server at any one time.
|
void |
waitToFinish()
Wait for all of the submitted tasks to have been completed
TODO If the submitted tasks are never marked as COMPLETED/STOPPED/FAILED this
TODO wait will hang forever.
|
public LoaderClient(String keyspace, String uri, java.util.function.Consumer<mjson.Json> onCompletionOfTask)
public LoaderClient setBatchSize(int size)
size - number of vars in each transactionpublic LoaderClient setNumberActiveTasks(int size)
add(InsertQuery) method will block on the value of this field.size - number of tasks to allow to run at any given timepublic void add(InsertQuery query)
blockerSize which can be set with setNumberActiveTasks(int).
It will become unblocked as tasks are completed.query - insert query to be executedpublic void flush()
public void waitToFinish()
Copyright © 2017 Grakn Labs Ltd. All rights reserved.