Search in sources :

Example 1 with FriendsOfFriendsProcessorResponse

use of org.apache.hadoop.hbase.coprocessor.protobuf.generated.IncrementCounterProcessorTestProtos.FriendsOfFriendsProcessorResponse in project hbase by apache.

the class TestRowProcessorEndpoint method testDoubleScan.

@Test
public void testDoubleScan() throws Throwable {
    prepareTestData();
    CoprocessorRpcChannel channel = table.coprocessorService(ROW);
    RowProcessorEndpoint.FriendsOfFriendsProcessor processor = new RowProcessorEndpoint.FriendsOfFriendsProcessor(ROW, A);
    RowProcessorService.BlockingInterface service = RowProcessorService.newBlockingStub(channel);
    ProcessRequest request = RowProcessorClient.getRowProcessorPB(processor);
    ProcessResponse protoResult = service.process(null, request);
    FriendsOfFriendsProcessorResponse response = FriendsOfFriendsProcessorResponse.parseFrom(protoResult.getRowProcessorResult());
    Set<String> result = new HashSet<>();
    result.addAll(response.getResultList());
    Set<String> expected = new HashSet<>(Arrays.asList(new String[] { "d", "e", "f", "g" }));
    Get get = new Get(ROW);
    LOG.debug("row keyvalues:" + stringifyKvs(table.get(get).listCells()));
    assertEquals(expected, result);
}
Also used : CoprocessorRpcChannel(org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel) ProcessRequest(org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.ProcessRequest) FriendsOfFriendsProcessorResponse(org.apache.hadoop.hbase.coprocessor.protobuf.generated.IncrementCounterProcessorTestProtos.FriendsOfFriendsProcessorResponse) ProcessResponse(org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.ProcessResponse) RowProcessorService(org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.RowProcessorService) Get(org.apache.hadoop.hbase.client.Get) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

HashSet (java.util.HashSet)1 Get (org.apache.hadoop.hbase.client.Get)1 FriendsOfFriendsProcessorResponse (org.apache.hadoop.hbase.coprocessor.protobuf.generated.IncrementCounterProcessorTestProtos.FriendsOfFriendsProcessorResponse)1 CoprocessorRpcChannel (org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel)1 ProcessRequest (org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.ProcessRequest)1 ProcessResponse (org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.ProcessResponse)1 RowProcessorService (org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.RowProcessorService)1 Test (org.junit.Test)1