Examples of MutationProto


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

        mutateType = MutationType.DELETE;
      } else {
        throw new DoNotRetryIOException("RowMutations supports only put and delete, not " +
          mutation.getClass().getName());
      }
      MutationProto mp = ProtobufUtil.toMutation(mutateType, mutation);
      builder.addAction(MultiAction.newBuilder().setMutation(mp).build());
    }
    return builder.build();
  }
View Full Code Here

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

        type = MutationType.DELETE;
      } else {
        throw new DoNotRetryIOException("RowMutations supports only put and delete, not " +
          mutation.getClass().getName());
      }
      MutationProto mp = ProtobufUtil.toMutationNoData(type, mutation);
      cells.add(mutation);
      builder.addAction(MultiAction.newBuilder().setMutation(mp).build());
    }
    return builder.build();
  }
View Full Code Here

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

    try {
      checkOpen();
      requestCount.increment();
      HRegion region = getRegion(request.getRegion());
      MutateResponse.Builder builder = MutateResponse.newBuilder();
      MutationProto mutation = request.getMutation();
      if (!region.getRegionInfo().isMetaTable()) {
        cacheFlusher.reclaimMemStoreMemory();
      }
      long nonceGroup = request.hasNonceGroup()
          ? request.getNonceGroup() : HConstants.NO_NONCE;
      Result r = null;
      Boolean processed = null;
      MutationType type = mutation.getMutateType();
      switch (type) {
      case APPEND:
        // TODO: this doesn't actually check anything.
        r = append(region, mutation, cellScanner, nonceGroup);
        break;
View Full Code Here

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

    long before = EnvironmentEdgeManager.currentTimeMillis();
    boolean batchContainsPuts = false, batchContainsDelete = false;
    try {
      int i = 0;
      for (ClientProtos.Action action: mutations) {
        MutationProto m = action.getMutation();
        Mutation mutation;
        if (m.getMutateType() == MutationType.PUT) {
          mutation = ProtobufUtil.toPut(m, cells);
          batchContainsPuts = true;
        } else {
          mutation = ProtobufUtil.toDelete(m, cells);
          batchContainsDelete = true;
View Full Code Here

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

    controller.setCellScanner(null);
    try {
      requestCount.increment();
      HRegion region = getRegion(request.getRegion());
      MutateResponse.Builder builder = MutateResponse.newBuilder();
      MutationProto mutation = request.getMutation();
      if (!region.getRegionInfo().isMetaTable()) {
        cacheFlusher.reclaimMemStoreMemory();
      }
      Result r = null;
      Boolean processed = null;
      MutationType type = mutation.getMutateType();
      switch (type) {
      case APPEND:
        r = append(region, mutation, cellScanner);
        break;
      case INCREMENT:
View Full Code Here

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

                // 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()) {
View Full Code Here

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

   * @throws IOException
   */
  protected void mutateRows(final HRegion region, final List<MutationProto> mutations,
      final CellScanner cellScanner)
  throws IOException {
    MutationProto firstMutate = mutations.get(0);
    if (!region.getRegionInfo().isMetaTable()) {
      cacheFlusher.reclaimMemStoreMemory();
    }
    byte [] row = firstMutate.getRow().toByteArray();
    RowMutations rm = new RowMutations(row);
    for (MutationProto mutate: mutations) {
      MutationType type = mutate.getMutateType();
      switch (mutate.getMutateType()) {
      case PUT:
View Full Code Here

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

    final byte [] ROW1 = Bytes.toBytes("testRow1");

    HTable t = TEST_UTIL.createTable(TABLENAME, FAMILY);
    Put p = new Put(ROW);
    p.add(FAMILY, QUALIFIER, VALUE);
    MutationProto m1 = ProtobufUtil.toMutation(MutationType.PUT, p);

    p = new Put(ROW1);
    p.add(FAMILY, QUALIFIER, VALUE);
    MutationProto m2 = ProtobufUtil.toMutation(MutationType.PUT, p);

    MutateRowsRequest.Builder mrmBuilder = MutateRowsRequest.newBuilder();
    mrmBuilder.addMutationRequest(m1);
    mrmBuilder.addMutationRequest(m2);
    MutateRowsRequest mrm = mrmBuilder.build();
View Full Code Here

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

        mutateType = MutationType.DELETE;
      } else {
        throw new DoNotRetryIOException("RowMutations supports only put and delete, not " +
          mutation.getClass().getName());
      }
      MutationProto mp = ProtobufUtil.toMutation(mutateType, mutation);
      builder.addAction(MultiAction.newBuilder().setMutation(mp).build());
    }
    return builder.build();
  }
View Full Code Here

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

        type = MutationType.DELETE;
      } else {
        throw new DoNotRetryIOException("RowMutations supports only put and delete, not " +
          mutation.getClass().getName());
      }
      MutationProto mp = ProtobufUtil.toMutationNoData(type, mutation);
      cells.add(mutation);
      builder.addAction(MultiAction.newBuilder().setMutation(mp).build());
    }
    return builder.build();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.