Package org.apache.hadoop.hbase.protobuf.generated.ClientProtos

Examples of org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MultiRequest


      public Void call() throws IOException {
        try {
          RegionAction.Builder regionMutationBuilder = RequestConverter.buildRegionAction(
            getLocation().getRegionInfo().getRegionName(), rm);
          regionMutationBuilder.setAtomic(true);
          MultiRequest request =
            MultiRequest.newBuilder().addRegionAction(regionMutationBuilder.build()).build();
          PayloadCarryingRpcController pcrc = new PayloadCarryingRpcController();
          pcrc.setPriority(tableName);
          getStub().multi(null, request);
        } catch (ServiceException se) {
View Full Code Here


      public Void call() throws IOException {
        try {
          RegionAction.Builder regionMutationBuilder = RequestConverter.buildRegionAction(
            getLocation().getRegionInfo().getRegionName(), rm);
          regionMutationBuilder.setAtomic(true);
          MultiRequest request =
            MultiRequest.newBuilder().addRegionAction(regionMutationBuilder.build()).build();
          PayloadCarryingRpcController pcrc = new PayloadCarryingRpcController();
          pcrc.setPriority(tableName);
          getStub().multi(null, request);
        } catch (ServiceException se) {
View Full Code Here

      public Void call() throws IOException {
        try {
          RegionAction.Builder regionMutationBuilder = RequestConverter.buildRegionAction(
            getLocation().getRegionInfo().getRegionName(), rm);
          regionMutationBuilder.setAtomic(true);
          MultiRequest request =
            MultiRequest.newBuilder().addRegionAction(regionMutationBuilder.build()).build();
          PayloadCarryingRpcController pcrc = new PayloadCarryingRpcController();
          pcrc.setPriority(tableName);
          getStub().multi(null, request);
        } catch (ServiceException se) {
View Full Code Here

      public Void call() throws IOException {
        try {
          RegionAction.Builder regionMutationBuilder = RequestConverter.buildRegionAction(
            getLocation().getRegionInfo().getRegionName(), rm);
          regionMutationBuilder.setAtomic(true);
          MultiRequest request =
            MultiRequest.newBuilder().addRegionAction(regionMutationBuilder.build()).build();
          PayloadCarryingRpcController pcrc = new PayloadCarryingRpcController();
          pcrc.setPriority(tableName);
          getStub().multi(null, request);
        } catch (ServiceException se) {
View Full Code Here

            RowMutations rms = (RowMutations)row;
            // Stick all Cells for all RowMutations in here into 'cells'.  Populated when we call
            // buildNoDataMultiRequest in the below.
            List<CellScannable> cells = new ArrayList<CellScannable>(rms.getMutations().size());
            // Build a multi request absent its Cell payload (this is the 'nodata' in the below).
            MultiRequest multiRequest =
                RequestConverter.buildNoDataMultiRequest(regionName, rms, cells);
            // Carry the cells over the proxy/pb Service interface using the payload carrying
            // rpc controller.
            getStub().multi(new PayloadCarryingRpcController(cells), multiRequest);
            // This multi call does not return results.
            response.add(regionName, action.getOriginalIndex(), Result.EMPTY_RESULT);
          } catch (ServiceException se) {
            response.add(regionName, action.getOriginalIndex(),
              ProtobufUtil.getRemoteException(se));
          }
          rowMutations++;
        }
      }
      // Are there any non-RowMutation actions to send for this region?
      if (actions.size() > rowMutations) {
        Exception ex = null;
        List<Object> results = null;
        // Stick all Cells for the multiRequest in here into 'cells'.  Gets filled in when we
        // call buildNoDataMultiRequest
        List<CellScannable> cells = new ArrayList<CellScannable>(actions.size() - rowMutations);
        try {
          // The call to buildNoDataMultiRequest will skip RowMutations.  They have
          // already been handled above.
          MultiRequest multiRequest =
              RequestConverter.buildNoDataMultiRequest(regionName, actions, cells);
          // Controller optionally carries cell data over the proxy/service boundary and also
          // optionally ferries cell response data back out again.
          PayloadCarryingRpcController controller = new PayloadCarryingRpcController(cells);
          ClientProtos.MultiResponse responseProto = getStub().multi(controller, multiRequest);
View Full Code Here

    }

    private void replayToServer(HRegionInfo regionInfo, List<Action<Row>> actions)
        throws IOException, ServiceException {
      AdminService.BlockingInterface remoteSvr = conn.getAdmin(getLocation().getServerName());
      MultiRequest request = RequestConverter.buildMultiRequest(regionInfo.getRegionName(),
        actions);
      MultiResponse protoResults = remoteSvr.replay(null, request);
      // check if it's a partial success
      List<ActionResult> resultList = protoResults.getResultList();
      for (int i = 0, n = resultList.size(); i < n; i++) {
View Full Code Here

  public void mutateRow(final RowMutations rm) throws IOException {
    RegionServerCallable<Void> callable =
        new RegionServerCallable<Void>(connection, getName(), rm.getRow()) {
      public Void call() throws IOException {
        try {
          MultiRequest request = RequestConverter.buildMultiRequest(
            getLocation().getRegionInfo().getRegionName(), rm);
          getStub().multi(null, request);
        } catch (ServiceException se) {
          throw ProtobufUtil.getRemoteException(se);
        }
View Full Code Here

  public void mutateRow(final RowMutations rm) throws IOException {
    new ServerCallable<Void>(connection, tableName, rm.getRow(),
        operationTimeout) {
      public Void call() throws IOException {
        try {
          MultiRequest request = RequestConverter.buildMultiRequest(
            location.getRegionInfo().getRegionName(), rm);
          server.multi(null, request);
        } catch (ServiceException se) {
          throw ProtobufUtil.getRemoteException(se);
        }
View Full Code Here

            RowMutations rms = (RowMutations)row;
            // Stick all Cells for all RowMutations in here into 'cells'.  Populated when we call
            // buildNoDataMultiRequest in the below.
            List<CellScannable> cells = new ArrayList<CellScannable>(rms.getMutations().size());
            // Build a multi request absent its Cell payload (this is the 'nodata' in the below).
            MultiRequest multiRequest =
                RequestConverter.buildNoDataMultiRequest(regionName, rms, cells);
            // Carry the cells over the proxy/pb Service interface using the payload carrying
            // rpc controller.
            server.multi(new PayloadCarryingRpcController(cells), multiRequest);
            // This multi call does not return results.
            response.add(regionName, action.getOriginalIndex(), Result.EMPTY_RESULT);
          } catch (ServiceException se) {
            response.add(regionName, action.getOriginalIndex(),
              ProtobufUtil.getRemoteException(se));
          }
          rowMutations++;
        }
      }
      // Are there any non-RowMutation actions to send for this region?
      if (actions.size() > rowMutations) {
        Exception ex = null;
        List<Object> results = null;
        // Stick all Cells for the multiRequest in here into 'cells'.  Gets filled in when we
        // call buildNoDataMultiRequest
        List<CellScannable> cells = new ArrayList<CellScannable>(actions.size() - rowMutations);
        try {
          // The call to buildNoDataMultiRequest will skip RowMutations.  They have
          // already been handled above.
          MultiRequest multiRequest =
              RequestConverter.buildNoDataMultiRequest(regionName, actions, cells);
          // Controller optionally carries cell data over the proxy/service boundary and also
          // optionally ferries cell response data back out again.
          PayloadCarryingRpcController controller = new PayloadCarryingRpcController(cells);
          ClientProtos.MultiResponse responseProto = server.multi(controller, multiRequest);
View Full Code Here

        controller.setCallTimeout(callTimeout);
        try {
          RegionAction.Builder regionMutationBuilder = RequestConverter.buildRegionAction(
            getLocation().getRegionInfo().getRegionName(), rm);
          regionMutationBuilder.setAtomic(true);
          MultiRequest request =
            MultiRequest.newBuilder().addRegionAction(regionMutationBuilder.build()).build();
          getStub().multi(controller, request);
        } catch (ServiceException se) {
          throw ProtobufUtil.getRemoteException(se);
        }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MultiRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.