public class Migrator extends Object
Abstract migrator class containing methods and functionality needed by all extending migrator classes.
| Modifier and Type | Field and Description |
|---|---|
static int |
ACTIVE_TASKS |
static int |
BATCH_SIZE |
static int |
DEFAULT_MAX_RETRY |
| Modifier and Type | Method and Description |
|---|---|
void |
load(String template,
java.util.stream.Stream<Map<String,Object>> converter)
Migrate data constrained by this migrator using a loader configured
by the provided parameters.
|
void |
load(String template,
java.util.stream.Stream<Map<String,Object>> converter,
int batchSize,
int numberActiveTasks,
int retrySize,
boolean debug)
Migrate data constrained by this migrator using a loader configured
by the provided parameters.
|
void |
print(String template,
java.util.stream.Stream<Map<String,Object>> converter)
Template the data and print to standard out.
|
Migrator |
registerMacro(ai.grakn.graql.macro.Macro macro)
Register a macro to use in templating
|
protected java.util.stream.Stream<ai.grakn.graql.Query> |
template(String template,
Map<String,Object> data) |
static Migrator |
to(String uri,
ai.grakn.Keyspace keyspace) |
public static final int BATCH_SIZE
public static final int ACTIVE_TASKS
public static final int DEFAULT_MAX_RETRY
public Migrator registerMacro(ai.grakn.graql.macro.Macro macro)
public void load(String template, java.util.stream.Stream<Map<String,Object>> converter)
template - converter - public void print(String template, java.util.stream.Stream<Map<String,Object>> converter)
template - converter - public void load(String template, java.util.stream.Stream<Map<String,Object>> converter, int batchSize, int numberActiveTasks, int retrySize, boolean debug)
template - converter - batchSize - The number of queries to execute in one transaction. Default is 25.numberActiveTasks - Number of tasks running on the server at any one time. Consider this a safeguard
to bot the system load. Default is 25.retrySize - If the Loader should continue attempt to send tasks when Engine is not available or an exception occursprotected java.util.stream.Stream<ai.grakn.graql.Query> template(String template, Map<String,Object> data)
template - a string representing a templated graql querydata - data used in the templateCopyright © 2017 Grakn Labs Ltd. All rights reserved.