(String databaseName, String tableName, Binary key)
| 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(); |
nothing calls this directly
no test coverage detected