use of com.baidu.hugegraph.api.task.TaskAPI in project incubator-hugegraph-toolchain by apache.
the class BaseApiTest method init.
@BeforeClass
public static void init() {
BaseClientTest.init();
if (client == null) {
initClient();
}
versionAPI = new VersionAPI(client);
client.apiVersion(VersionUtil.Version.of(versionAPI.get().get("api")));
graphsAPI = new GraphsAPI(client);
propertyKeyAPI = new PropertyKeyAPI(client, GRAPH);
vertexLabelAPI = new VertexLabelAPI(client, GRAPH);
edgeLabelAPI = new EdgeLabelAPI(client, GRAPH);
indexLabelAPI = new IndexLabelAPI(client, GRAPH);
schemaAPI = new SchemaAPI(client, GRAPH);
vertexAPI = new VertexAPI(client, GRAPH);
edgeAPI = new EdgeAPI(client, GRAPH);
variablesAPI = new VariablesAPI(client, GRAPH);
taskAPI = new TaskAPI(client, GRAPH);
rebuildAPI = new RebuildAPI(client, GRAPH);
}
use of com.baidu.hugegraph.api.task.TaskAPI in project incubator-hugegraph-toolchain by apache.
the class TaskCache method asyncQueryTask.
private void asyncQueryTask() {
for (Map.Entry<TaskAPI, Map<Long, Task>> query : this.taskTable.entrySet()) {
TaskAPI api = query.getKey();
Map<Long, Task> targets = query.getValue();
if (targets == null || targets.isEmpty()) {
this.taskTable.remove(api);
continue;
}
List<Long> taskIds = new ArrayList<>(targets.keySet());
List<Task> results = api.list(taskIds);
for (Task task : results) {
targets.put(task.id(), task);
}
}
}
Aggregations