Search in sources :

Example 1 with IncCounterProcessorResponse

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

the class TestRowProcessorEndpoint method incrementCounter.

private int incrementCounter(Table table) throws Throwable {
    CoprocessorRpcChannel channel = table.coprocessorService(ROW);
    RowProcessorEndpoint.IncrementCounterProcessor processor = new RowProcessorEndpoint.IncrementCounterProcessor(ROW);
    RowProcessorService.BlockingInterface service = RowProcessorService.newBlockingStub(channel);
    ProcessRequest request = RowProcessorClient.getRowProcessorPB(processor);
    ProcessResponse protoResult = service.process(null, request);
    IncCounterProcessorResponse response = IncCounterProcessorResponse.parseFrom(protoResult.getRowProcessorResult());
    Integer result = response.getResponse();
    return result;
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) RowProcessorService(org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.RowProcessorService) CoprocessorRpcChannel(org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel) ProcessRequest(org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.ProcessRequest) IncCounterProcessorResponse(org.apache.hadoop.hbase.coprocessor.protobuf.generated.IncrementCounterProcessorTestProtos.IncCounterProcessorResponse) ProcessResponse(org.apache.hadoop.hbase.protobuf.generated.RowProcessorProtos.ProcessResponse)

Aggregations

AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 IncCounterProcessorResponse (org.apache.hadoop.hbase.coprocessor.protobuf.generated.IncrementCounterProcessorTestProtos.IncCounterProcessorResponse)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