Package org.apache.hadoop.hbase.exceptions

Examples of org.apache.hadoop.hbase.exceptions.DoNotRetryIOException


      ClientProtos.Get get = request.getGet();
      Boolean existence = null;
      Result r = null;
      if (request.getClosestRowBefore()) {
        if (get.getColumnCount() != 1) {
          throw new DoNotRetryIOException(
            "get ClosestRowBefore supports one and only one family now, not "
              + get.getColumnCount() + " families");
        }
        byte[] row = get.getRow().toByteArray();
        byte[] family = get.getColumn(0).getFamily().toByteArray();
View Full Code Here


      {
        Boolean existence = null;
        Result r = null;
        if (request.getClosestRowBefore()) {
          if (get.getColumnCount() != 1) {
            throw new DoNotRetryIOException(
              "get ClosestRowBefore supports one and only one family now, not "
                + get.getColumnCount() + " families");
          }
          byte[] row = get.getRow().toByteArray();
          byte[] family = get.getColumn(0).getFamily().toByteArray();
View Full Code Here

          region.delete(delete, delete.getWriteToWAL());
          processed = Boolean.TRUE;
        }
        break;
        default:
          throw new DoNotRetryIOException(
            "Unsupported mutate type: " + type.name());
      }
      CellScannable cellsToReturn = null;
      if (processed != null) {
        builder.setProcessed(processed.booleanValue());
View Full Code Here

      final ScanRequest request) throws ServiceException {
    Leases.Lease lease = null;
    String scannerName = null;
    try {
      if (!request.hasScannerId() && !request.hasScan()) {
        throw new DoNotRetryIOException(
          "Missing required input: scannerId or scan");
      }
      long scannerId = -1;
      if (request.hasScannerId()) {
        scannerId = request.getScannerId();
View Full Code Here

        // MultiAction is union type.  Has a Get or a Mutate.
        for (ClientProtos.MultiAction actionUnion : request.getActionList()) {
          if (actionUnion.hasMutation()) {
            mutations.add(actionUnion.getMutation());
          } else {
            throw new DoNotRetryIOException("Unsupported atomic action type: " + actionUnion);
          }
        }
        // TODO: We are not updating a metric here.  Should we up requestCount?
        if (!mutations.isEmpty()) mutateRows(region, mutations, cellScanner);
      } else {
        // Do a bunch of Actions.
        ActionResult.Builder resultBuilder = null;
        cellsToReturn = new ArrayList<CellScannable>(request.getActionCount());
        for (ClientProtos.MultiAction actionUnion : request.getActionList()) {
          this.requestCount.increment();
          ClientProtos.Result result = null;
          try {
            if (actionUnion.hasGet()) {
              Get get = ProtobufUtil.toGet(actionUnion.getGet());
              Result r = region.get(get);
              if (r != null) {
                // Get a result with no data.  The data will be carried alongside pbs, not as pbs.
                result = ProtobufUtil.toResultNoData(r);
                // Add the Result to controller so it gets serialized apart from pb.  Get
                // Results could be big so good if they are not serialized as pb.
                cellsToReturn.add(r);
              }
            } else if (actionUnion.hasMutation()) {
              MutationProto mutation = actionUnion.getMutation();
              MutationType type = mutation.getMutateType();
              if (type != MutationType.PUT && type != MutationType.DELETE) {
                if (!mutations.isEmpty()) {
                  doBatchOp(builder, region, mutations, cellScanner);
                  mutations.clear();
                } else if (!region.getRegionInfo().isMetaTable()) {
                  cacheFlusher.reclaimMemStoreMemory();
                }
              }
              Result r = null;
              switch (type) {
              case APPEND:
                r = append(region, mutation, cellScanner);
                break;
              case INCREMENT:
                r = increment(region, mutation, cellScanner);
                break;
              case PUT:
              case DELETE:
                mutations.add(mutation);
                break;
              default:
                throw new DoNotRetryIOException("Unsupported mutate type: " + type.name());
              }
              if (r != null) {
                // Put the data into the cellsToReturn and the metadata about the result is all that
                // we will pass back in the protobuf result.
                result = ProtobufUtil.toResultNoData(r);
                cellsToReturn.add(r);
              }
            } else {
              LOG.warn("Error: invalid action: " + actionUnion + ". "
                + "it must be a Get, Mutate, or Exec.");
              throw new DoNotRetryIOException("Invalid action, "
                + "it must be a Get, Mutate, or Exec.");
            }
            if (result != null) {
              if (resultBuilder == null) {
                resultBuilder = ActionResult.newBuilder();
View Full Code Here

            builder.setResult(i, result);
            break;

          default:
            result = ResponseConverter.buildActionResult(
                new DoNotRetryIOException(codes[i].getExceptionMsg()));
            builder.setResult(i, result);
            break;

          case SUCCESS:
            break;
View Full Code Here

        break;
      case DELETE:
        rm.add(ProtobufUtil.toDelete(mutate, cellScanner));
        break;
        default:
          throw new DoNotRetryIOException(
            "mutate supports atomic put and/or delete, not "
              + type.name());
      }
    }
    region.mutateRow(rm);
View Full Code Here

      // Since this is an explicit request not to use any caching, finding
      // disabled tables should not be desirable.  This will ensure that an exception is thrown when
      // the first time a disabled table is interacted with.
      if (isTableDisabled(tableName)) {
        throw new DoNotRetryIOException(Bytes.toString(tableName) + " is disabled.");
      }

      return locateRegion(tableName, row, false, true);
    }
View Full Code Here

      } else if (m instanceof Delete) {
        Delete d = (Delete) m;
        region.prepareDelete(d);
        region.prepareDeleteTimestamps(d.getFamilyMap(), byteNow);
      } else {
        throw new DoNotRetryIOException(
            "Action must be Put or Delete. But was: "
            + m.getClass().getName());
      }
      for (List<? extends Cell> cells: m.getFamilyMap().values()) {
        boolean writeToWAL = m.getWriteToWAL();
View Full Code Here

            }
            if (e instanceof OutOfOrderScannerNextException) {
              if (retryAfterOutOfOrderException) {
                retryAfterOutOfOrderException = false;
              } else {
                throw new DoNotRetryIOException("Failed after retry"
                    + ", it could be cause by rpc timeout", e);
              }
            }
            // Clear region
            this.currentRegion = null;
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.exceptions.DoNotRetryIOException

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.