use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class GremlinJobAPI method execute.
public long execute(GremlinRequest request) {
RestResult result = this.client.post(this.path(), request);
@SuppressWarnings("unchecked") Map<String, Object> task = result.readObject(Map.class);
return TaskAPI.parseTaskId(task);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class IndexLabelAPI method append.
public IndexLabel append(IndexLabel indexLabel) {
if (this.client.apiVersionLt("0.50")) {
throw new NotSupportException("action append on index label");
}
String id = indexLabel.name();
Map<String, Object> params = ImmutableMap.of("action", "append");
Object il = this.checkCreateOrUpdate(indexLabel);
RestResult result = this.client.put(this.path(), id, il, params);
return result.readObject(IndexLabel.class);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class IndexLabelAPI method eliminate.
public IndexLabel eliminate(IndexLabel indexLabel) {
if (this.client.apiVersionLt("0.50")) {
throw new NotSupportException("action eliminate on index label");
}
String id = indexLabel.name();
Map<String, Object> params = ImmutableMap.of("action", "eliminate");
Object il = this.checkCreateOrUpdate(indexLabel);
RestResult result = this.client.put(this.path(), id, il, params);
return result.readObject(IndexLabel.class);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class IndexLabelAPI method delete.
public long delete(String name) {
RestResult result = this.client.delete(this.path(), name);
@SuppressWarnings("unchecked") Map<String, Object> task = result.readObject(Map.class);
return TaskAPI.parseTaskId(task);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class IndexLabelAPI method create.
public IndexLabel.IndexLabelWithTask create(IndexLabel indexLabel) {
Object il = this.checkCreateOrUpdate(indexLabel);
RestResult result = this.client.post(this.path(), il);
return result.readObject(IndexLabel.IndexLabelWithTask.class);
}
Aggregations