Class RowCountEndpoint

java.lang.Object
org.apache.hadoop.hbase.shaded.coprocessor.example.generated.RowCountProtos.RowCountService
org.apache.hadoop.hbase.coprocessor.example.RowCountEndpoint
All Implemented Interfaces:
Coprocessor, RegionCoprocessor, org.apache.hbase.thirdparty.com.google.protobuf.Service

@Private public class RowCountEndpoint extends org.apache.hadoop.hbase.shaded.coprocessor.example.generated.RowCountProtos.RowCountService implements RegionCoprocessor
Sample coprocessor endpoint exposing a Service interface for counting rows and key values.

For the protocol buffer definition of the RowCountService, see the source file located under hbase-examples/src/main/protobuf/Examples.proto.

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.hadoop.hbase.shaded.coprocessor.example.generated.RowCountProtos.RowCountService

    org.apache.hadoop.hbase.shaded.coprocessor.example.generated.RowCountProtos.RowCountService.BlockingInterface, org.apache.hadoop.hbase.shaded.coprocessor.example.generated.RowCountProtos.RowCountService.Interface, org.apache.hadoop.hbase.shaded.coprocessor.example.generated.RowCountProtos.RowCountService.Stub

    Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.Coprocessor

    Coprocessor.State
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     

    Fields inherited from interface org.apache.hadoop.hbase.Coprocessor

    PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    getKeyValueCount(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.coprocessor.example.generated.RowCountProtos.CountRequest request, org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.shaded.coprocessor.example.generated.RowCountProtos.CountResponse> done)
    Returns a count of all KeyValues in the region where this coprocessor is loaded.
    void
    getRowCount(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.coprocessor.example.generated.RowCountProtos.CountRequest request, org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.shaded.coprocessor.example.generated.RowCountProtos.CountResponse> done)
    Returns a count of the rows in the region where this coprocessor is loaded.
    Iterable<org.apache.hbase.thirdparty.com.google.protobuf.Service>
    Just returns a reference to this object, which implements the RowCounterService interface.
    void
    Stores a reference to the coprocessor environment provided by the RegionCoprocessorHost from the region where this coprocessor is loaded.
    void
    Called by the CoprocessorEnvironment during it's own shutdown to stop the coprocessor.

    Methods inherited from class org.apache.hadoop.hbase.shaded.coprocessor.example.generated.RowCountProtos.RowCountService

    callMethod, getDescriptor, getDescriptorForType, getRequestPrototype, getResponsePrototype, newBlockingStub, newReflectiveBlockingService, newReflectiveService, newStub

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.hadoop.hbase.coprocessor.RegionCoprocessor

    getBulkLoadObserver, getEndpointObserver, getRegionObserver
  • Field Details

  • Constructor Details

  • Method Details

    • getServices

      public Iterable<org.apache.hbase.thirdparty.com.google.protobuf.Service> getServices()
      Just returns a reference to this object, which implements the RowCounterService interface.
      Specified by:
      getServices in interface Coprocessor
      Returns:
      Iterable of Services or empty collection. Implementations should never return null.
    • getRowCount

      public void getRowCount(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.coprocessor.example.generated.RowCountProtos.CountRequest request, org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.shaded.coprocessor.example.generated.RowCountProtos.CountResponse> done)
      Returns a count of the rows in the region where this coprocessor is loaded.
      Specified by:
      getRowCount in class org.apache.hadoop.hbase.shaded.coprocessor.example.generated.RowCountProtos.RowCountService
    • getKeyValueCount

      public void getKeyValueCount(org.apache.hbase.thirdparty.com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.shaded.coprocessor.example.generated.RowCountProtos.CountRequest request, org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.shaded.coprocessor.example.generated.RowCountProtos.CountResponse> done)
      Returns a count of all KeyValues in the region where this coprocessor is loaded.
      Specified by:
      getKeyValueCount in class org.apache.hadoop.hbase.shaded.coprocessor.example.generated.RowCountProtos.RowCountService
    • start

      public void start(CoprocessorEnvironment env) throws IOException
      Stores a reference to the coprocessor environment provided by the RegionCoprocessorHost from the region where this coprocessor is loaded. Since this is a coprocessor endpoint, it always expects to be loaded on a table region, so always expects this to be an instance of RegionCoprocessorEnvironment.
      Specified by:
      start in interface Coprocessor
      Parameters:
      env - the environment provided by the coprocessor host
      Throws:
      IOException - if the provided environment is not an instance of RegionCoprocessorEnvironment
    • stop

      public void stop(CoprocessorEnvironment env) throws IOException
      Description copied from interface: Coprocessor
      Called by the CoprocessorEnvironment during it's own shutdown to stop the coprocessor.
      Specified by:
      stop in interface Coprocessor
      Throws:
      IOException