| Constructor and Description |
|---|
LoaderClient(String keyspace,
Collection<String> hosts) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(InsertQuery query)
Add an insert query to the queue
|
void |
checkForStatusLoop()
Loop checking the status of the hosts every 30 seconds.
|
void |
flush()
Load any remaining batches in the queue.
|
int |
getBatchSize() |
void |
printLoaderState()
Method that logs the current state of loading transactions
|
void |
printLoaderState(int created,
int scheduled,
int completed,
int running,
int failed,
int stopped)
Method that logs the current state of loading transactions
|
void |
sendQueriesToLoader(Collection<InsertQuery> queries) |
Loader |
setBatchSize(int size)
Set the size of the each transaction in terms of number of vars.
|
void |
setPollingFrequency(long number)
Amount of time to wait before checking number completed jobs with slaves
|
Loader |
setQueueSize(int size)
Set the size of the queue- this is equivalent to the size of the semaphore.
|
void |
waitToFinish()
Block the main thread until all of the transactions have finished loading
|
void |
waitToFinish(int time)
Wait for all tasks to finish.
|
public LoaderClient(String keyspace, Collection<String> hosts)
public int getBatchSize()
getBatchSize in interface Loaderpublic Loader setBatchSize(int size)
setBatchSize in interface Loadersize - number of vars in each transactionpublic Loader setQueueSize(int size)
setQueueSize in interface Loadersize - the size of the queuepublic void add(InsertQuery query)
public void setPollingFrequency(long number)
public void flush()
public void waitToFinish()
waitToFinish in interface Loaderpublic void waitToFinish(int time)
LoaderwaitToFinish in interface Loadertime - amount of time (in ms) to wait.public void sendQueriesToLoader(Collection<InsertQuery> queries)
public void checkForStatusLoop()
public void printLoaderState()
printLoaderState in interface Loaderpublic void printLoaderState(int created,
int scheduled,
int completed,
int running,
int failed,
int stopped)
Copyright © 2016 Grakn Labs Ltd. All rights reserved.