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

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


    org.apache.hadoop.hbase.client.MultiResponse results =
      new org.apache.hadoop.hbase.client.MultiResponse();

    for (int i = 0; i < responseRegionActionResultCount; i++) {
      RegionAction actions = request.getRegionAction(i);
      RegionActionResult actionResult = response.getRegionActionResult(i);
      byte[] regionName = actions.getRegion().toByteArray();

      if (actionResult.hasException()){
        Throwable regionException =  ProtobufUtil.toException(actionResult.getException());
        for (ClientProtos.Action a : actions.getActionList()){
          results.add(regionName, new Pair<Integer, Object>(a.getIndex(), regionException));
        }
        continue;
      }

      if (actions.getActionCount() != actionResult.getResultOrExceptionCount()) {
        throw new IllegalStateException("actions.getActionCount=" + actions.getActionCount() +
            ", actionResult.getResultOrExceptionCount=" +
            actionResult.getResultOrExceptionCount() + " for region " + actions.getRegion());
      }

      for (ResultOrException roe : actionResult.getResultOrExceptionList()) {
        if (roe.hasException()) {
          results.add(regionName, new Pair<Integer, Object>(roe.getIndex(),
              ProtobufUtil.toException(roe.getException())));
        } else if (roe.hasResult()) {
          results.add(regionName, new Pair<Integer, Object>(roe.getIndex(),
View Full Code Here


    org.apache.hadoop.hbase.client.MultiResponse results =
      new org.apache.hadoop.hbase.client.MultiResponse();

    for (int i = 0; i < responseRegionActionResultCount; i++) {
      RegionAction actions = request.getRegionAction(i);
      RegionActionResult actionResult = response.getRegionActionResult(i);
      HBaseProtos.RegionSpecifier rs = actions.getRegion();
      if (rs.hasType() &&
          (rs.getType() != HBaseProtos.RegionSpecifier.RegionSpecifierType.REGION_NAME)){
        throw new IllegalArgumentException(
            "We support only encoded types for protobuf multi response.");
      }
      byte[] regionName = rs.getValue().toByteArray();

      if (actionResult.hasException()){
        Throwable regionException =  ProtobufUtil.toException(actionResult.getException());
        results.addException(regionName, regionException);
        continue;
      }

      if (actions.getActionCount() != actionResult.getResultOrExceptionCount()) {
        throw new IllegalStateException("actions.getActionCount=" + actions.getActionCount() +
            ", actionResult.getResultOrExceptionCount=" +
            actionResult.getResultOrExceptionCount() + " for region " + actions.getRegion());
      }

      for (ResultOrException roe : actionResult.getResultOrExceptionList()) {
        if (roe.hasException()) {
          results.add(regionName, new Pair<Integer, Object>(roe.getIndex(),
              ProtobufUtil.toException(roe.getException())));
        } else if (roe.hasResult()) {
          results.add(regionName, new Pair<Integer, Object>(roe.getIndex(),
View Full Code Here

          "VisibilityController not yet initialized"), response);
    }
    try {
      checkCallingUserAuth();
      List<Mutation> puts = new ArrayList<Mutation>(labels.size());
      RegionActionResult successResult = RegionActionResult.newBuilder().build();
      for (VisibilityLabel visLabel : labels) {
        byte[] label = visLabel.getLabel().toByteArray();
        String labelStr = Bytes.toString(label);
        if (VisibilityLabelsValidator.isValidLabel(label)) {
          if (this.visibilityManager.getLabelOrdinal(labelStr) > 0) {
View Full Code Here

  private void setExceptionResults(int size, IOException e,
      VisibilityLabelsResponse.Builder response) {
    RegionActionResult.Builder failureResultBuilder = RegionActionResult.newBuilder();
    failureResultBuilder.setException(ResponseConverter.buildException(e));
    RegionActionResult failureResult = failureResultBuilder.build();
    for (int i = 0; i < size; i++) {
      response.addResult(i, failureResult);
    }
  }
View Full Code Here

    }
    byte[] user = request.getUser().toByteArray();
    try {
      checkCallingUserAuth();
      List<Mutation> puts = new ArrayList<Mutation>(auths.size());
      RegionActionResult successResult = RegionActionResult.newBuilder().build();
      for (ByteString authBS : auths) {
        byte[] auth = authBS.toByteArray();
        String authStr = Bytes.toString(auth);
        int labelOrdinal = this.visibilityManager.getLabelOrdinal(authStr);
        if (labelOrdinal == 0) {
View Full Code Here

    byte[] user = request.getUser().toByteArray();
    try {
      checkCallingUserAuth();
      List<String> currentAuths = this.getUserAuthsFromLabelsTable(user);
      List<Mutation> deletes = new ArrayList<Mutation>(auths.size());
      RegionActionResult successResult = RegionActionResult.newBuilder().build();
      for (ByteString authBS : auths) {
        byte[] auth = authBS.toByteArray();
        String authStr = Bytes.toString(auth);
        if (currentAuths.contains(authStr)) {
          int labelOrdinal = this.visibilityManager.getLabelOrdinal(authStr);
View Full Code Here

          "VisibilityController not yet initialized"), response);
    }
    try {
      checkCallingUserAuth();
      List<Mutation> puts = new ArrayList<Mutation>(labels.size());
      RegionActionResult successResult = RegionActionResult.newBuilder().build();
      for (VisibilityLabel visLabel : labels) {
        byte[] label = visLabel.getLabel().toByteArray();
        String labelStr = Bytes.toString(label);
        if (VisibilityLabelsValidator.isValidLabel(label)) {
          if (this.visibilityManager.getLabelOrdinal(labelStr) > 0) {
View Full Code Here

  private void setExceptionResults(int size, IOException e,
      VisibilityLabelsResponse.Builder response) {
    RegionActionResult.Builder failureResultBuilder = RegionActionResult.newBuilder();
    failureResultBuilder.setException(ResponseConverter.buildException(e));
    RegionActionResult failureResult = failureResultBuilder.build();
    for (int i = 0; i < size; i++) {
      response.addResult(i, failureResult);
    }
  }
View Full Code Here

    }
    byte[] user = request.getUser().toByteArray();
    try {
      checkCallingUserAuth();
      List<Mutation> puts = new ArrayList<Mutation>(auths.size());
      RegionActionResult successResult = RegionActionResult.newBuilder().build();
      for (ByteString authBS : auths) {
        byte[] auth = authBS.toByteArray();
        String authStr = Bytes.toString(auth);
        int labelOrdinal = this.visibilityManager.getLabelOrdinal(authStr);
        if (labelOrdinal == 0) {
View Full Code Here

    byte[] user = request.getUser().toByteArray();
    try {
      checkCallingUserAuth();
      List<String> currentAuths = this.getUserAuthsFromLabelsTable(user);
      List<Mutation> deletes = new ArrayList<Mutation>(auths.size());
      RegionActionResult successResult = RegionActionResult.newBuilder().build();
      for (ByteString authBS : auths) {
        byte[] auth = authBS.toByteArray();
        String authStr = Bytes.toString(auth);
        if (currentAuths.contains(authStr)) {
          int labelOrdinal = this.visibilityManager.getLabelOrdinal(authStr);
View Full Code Here

TOP

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

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.