-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
I want to insert Person vertex like
person{
_key: xxxx,
age: xxxx
ctime: xxxxx
sequence: xxxxx
}
Below is my java code:
private void saveVertices(List<Map<String, Object>> itemList) {
long startTime = System.currentTimeMillis();
DgraphClient.Transaction transaction = dgraphClient.newTransaction();
try {
try {
String json = JSON.toJSONString(itemList);
DgraphProto.Mutation mutation = DgraphProto.Mutation.newBuilder().setSetJson(ByteString.copyFromUtf8(json)).build();
transaction.mutate(mutation);
} catch (Exception e) {
logger.error("Node create error: ", e);
}
transaction.commit();
} finally {
transaction.discard();
}
logger.info("save {} items costs {}ms", itemList.size(), System.currentTimeMillis() - startTime);
}
I can only insert 2000 person per second. It seems too slow, how I can insert them more fast I java clinet(not Live Loader nor Bulk Loader)
Metadata
Metadata
Assignees
Labels
No labels