public abstract class Loader extends Object
| Modifier and Type | Field and Description |
|---|---|
protected int |
batchSize |
protected AtomicInteger |
enqueuedJobs |
protected AtomicInteger |
errorJobs |
protected AtomicInteger |
finishedJobs |
protected AtomicInteger |
loadingJobs |
protected Collection<InsertQuery> |
queries |
protected int |
threadsNumber |
| Constructor and Description |
|---|
Loader() |
| 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.
|
int |
getBatchSize() |
protected void |
handleError(Exception e,
int i) |
void |
printLoaderState()
Method that logs the current state of loading transactions
|
protected abstract void |
sendQueriesToLoader(Collection<InsertQuery> batch)
Method to load data into the graph.
|
Loader |
setBatchSize(int size)
Set the size of the each transaction in terms of number of vars.
|
Loader |
setThreadsNumber(int number)
Set the number of thread that will execute insert transactions at a time
|
abstract void |
waitToFinish()
Wait for all loading to terminate.
|
protected AtomicInteger enqueuedJobs
protected AtomicInteger loadingJobs
protected AtomicInteger finishedJobs
protected AtomicInteger errorJobs
protected Collection<InsertQuery> queries
protected int batchSize
protected int threadsNumber
protected abstract void sendQueriesToLoader(Collection<InsertQuery> batch)
public abstract void waitToFinish()
public void add(InsertQuery query)
query - insert query to be executedpublic Loader setBatchSize(int size)
size - number of vars in each transactionpublic int getBatchSize()
public Loader setThreadsNumber(int number)
public void flush()
public void printLoaderState()
protected void handleError(Exception e, int i)
Copyright © 2016 Grakn Labs Ltd. All rights reserved.