use of com.baidu.hugegraph.structure.Task in project incubator-hugegraph-toolchain by apache.
the class JobApiTest method testRebuildEdgeLabel.
@Test
public void testRebuildEdgeLabel() {
EdgeLabel created = schema().getEdgeLabel("created");
long taskId = rebuildAPI.rebuild(created);
Task task = taskAPI.get(taskId);
Assert.assertNotNull(task);
Assert.assertEquals(taskId, task.id());
waitUntilTaskCompleted(taskId);
}
use of com.baidu.hugegraph.structure.Task in project incubator-hugegraph-toolchain by apache.
the class JobApiTest method testRebuildVertexLabel.
@Test
public void testRebuildVertexLabel() {
VertexLabel person = schema().getVertexLabel("person");
long taskId = rebuildAPI.rebuild(person);
Task task = taskAPI.get(taskId);
Assert.assertNotNull(task);
Assert.assertEquals(taskId, task.id());
waitUntilTaskCompleted(taskId);
}
use of com.baidu.hugegraph.structure.Task 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