MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / getRequest

Method getRequest

test/PBufResponses.java:59–75  ·  view source on GitHub ↗

Generate a full getRequest response with frame length and meta for decode() @param id The RPC ID to encode @param kvs The KVs to serialize @return A buffer to pass upstream

(final int id, final List<KeyValue> kvs)

Source from the content-addressed store, hash-verified

57 * @return A buffer to pass upstream
58 */
59 public static ChannelBuffer getRequest(final int id, final List<KeyValue> kvs)
60 throws Exception {
61 final ClientPB.Result.Builder result = ClientPB.Result.newBuilder();
62 for (final KeyValue kv : kvs) {
63 result.addCell(kvToCell(kv));
64 }
65
66 final ClientPB.GetResponse response = ClientPB.GetResponse.newBuilder()
67 .setResult(result.build()).build();
68
69 final RPCPB.ResponseHeader header = RPCPB.ResponseHeader.newBuilder()
70 .setCallId(id)
71 //.setCellBlockMeta(meta)
72 .build();
73
74 return writeToBuffer(header, response);
75 }
76
77 /**
78 * Serializes a PBuf response with a frame length for upstream processing

Callers

nothing calls this directly

Calls 2

kvToCellMethod · 0.95
writeToBufferMethod · 0.95

Tested by

no test coverage detected