MCPcopy Create free account
hub / github.com/e2wugui/zeze / get

Method get

ZezeJava/ZezeJava/src/main/java/Zeze/Dbh2/Dbh2Agent.java:65–81  ·  view source on GitHub ↗
(String databaseName, String tableName, Binary key)

Source from the content-addressed store, hash-verified

63 }
64
65 public KV<Boolean, ByteBuffer> get(String databaseName, String tableName, Binary key) {
66 var r = new Get();
67 r.Argument.setDatabase(databaseName);
68 r.Argument.setTable(tableName);
69 r.Argument.setKey(key);
70 r.setTimeout(config.getRpcTimeout());
71 raftClient.sendForWait(r).await();
72
73 if (r.getResultCode() == errorCode(eBucketMismatch))
74 return KV.create(false, null);
75
76 if (r.getResultCode() != 0 && r.getResultCode() != Procedure.RaftApplied)
77 throw new RuntimeException("fail! code=" + r.getResultCode());
78
79 var bb = r.Result.isNull() ? null : ByteBuffer.Wrap(r.Result.getValue());
80 return KV.create(true, bb);
81 }
82
83 public TaskCompletionSourceX<RaftRpc<BPrepareBatch.Data, BRefused.Data>> prepareBatch(BPrepareBatch.Data batch) {
84 var r = new PrepareBatch();

Callers

nothing calls this directly

Calls 13

createMethod · 0.95
WrapMethod · 0.95
setTimeoutMethod · 0.80
sendForWaitMethod · 0.80
errorCodeMethod · 0.80
awaitMethod · 0.65
isNullMethod · 0.65
getValueMethod · 0.65
setDatabaseMethod · 0.45
setTableMethod · 0.45
setKeyMethod · 0.45
getRpcTimeoutMethod · 0.45

Tested by

no test coverage detected