/** * Print out some subset of a MutationProto rather than all of it and its data * @param proto Protobuf to print out * @return Short String of mutation proto */ static String toShortString(final MutationProto proto) { return "row=" + Bytes.toString(proto.getRow().toByteArray()) + ", type=" + proto.getMutateType().toString(); }
public Builder mergeFrom(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto other) { if (other == org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.getDefaultInstance()) return this; if (other.hasRow()) { setRow(other.getRow());
private static <T extends Mutation> T toDelta(Function<Bytes, T> supplier, ConsumerWithException<T, Cell> consumer, final MutationProto proto, final CellScanner cellScanner) throws IOException { byte[] row = proto.hasRow() ? proto.getRow().toByteArray() : null; T mutation = row == null ? null : supplier.apply(new Bytes(row)); int cellCount = proto.hasAssociatedCellCount() ? proto.getAssociatedCellCount() : 0;
/** * Starts the nonce operation for a mutation, if needed. * @param mutation Mutation. * @param nonceGroup Nonce group from the request. * @returns Nonce used (can be NO_NONCE). */ private long startNonceOperation(final MutationProto mutation, long nonceGroup) throws IOException, OperationConflictException { if (regionServer.nonceManager == null || !mutation.hasNonce()) return HConstants.NO_NONCE; boolean canProceed = false; try { canProceed = regionServer.nonceManager.startOperation( nonceGroup, mutation.getNonce(), regionServer); } catch (InterruptedException ex) { throw new InterruptedIOException("Nonce start operation interrupted"); } if (!canProceed) { // TODO: instead, we could convert append/increment to get w/mvcc String message = "The operation with nonce {" + nonceGroup + ", " + mutation.getNonce() + "} on row [" + Bytes.toString(mutation.getRow().toByteArray()) + "] may have already completed"; throw new OperationConflictException(message); } return mutation.getNonce(); }
/** * <code>optional bytes row = 1;</code> */ public Builder clearRow() { bitField0_ = (bitField0_ & ~0x00000001); row_ = getDefaultInstance().getRow(); onChanged(); return this; }
/** * Print out some subset of a MutationProto rather than all of it and its data * @param proto Protobuf to print out * @return Short String of mutation proto */ static String toShortString(final MutationProto proto) { return "row=" + Bytes.toString(proto.getRow().toByteArray()) + ", type=" + proto.getMutateType().toString(); }
/** * <code>optional bytes row = 1;</code> */ public Builder clearRow() { bitField0_ = (bitField0_ & ~0x00000001); row_ = getDefaultInstance().getRow(); onChanged(); return this; }
/** * Print out some subset of a MutationProto rather than all of it and its data * @param proto Protobuf to print out * @return Short String of mutation proto */ static String toShortString(final MutationProto proto) { return "row=" + Bytes.toString(proto.getRow().toByteArray()) + ", type=" + proto.getMutateType().toString(); }
/** * <code>optional bytes row = 1;</code> */ public Builder clearRow() { bitField0_ = (bitField0_ & ~0x00000001); row_ = getDefaultInstance().getRow(); onChanged(); return this; }
assert type == MutationType.PUT: type.name(); long timestamp = proto.hasTimestamp()? proto.getTimestamp(): HConstants.LATEST_TIMESTAMP; Put put = proto.hasRow() ? new Put(proto.getRow().toByteArray(), timestamp) : null; int cellCount = proto.hasAssociatedCellCount()? proto.getAssociatedCellCount(): 0; if (cellCount > 0) {
assert type == MutationType.DELETE : type.name(); long timestamp = proto.hasTimestamp() ? proto.getTimestamp() : HConstants.LATEST_TIMESTAMP; Delete delete = proto.hasRow() ? new Delete(proto.getRow().toByteArray(), timestamp) : null; int cellCount = proto.hasAssociatedCellCount()? proto.getAssociatedCellCount(): 0; if (cellCount > 0) {
MutationType type = proto.getMutateType(); assert type == MutationType.INCREMENT || type == MutationType.APPEND : type.name(); byte[] row = proto.hasRow() ? proto.getRow().toByteArray() : null; Get get = null; int cellCount = proto.hasAssociatedCellCount() ? proto.getAssociatedCellCount() : 0;
private static <T extends Mutation> T toDelta(Function<Bytes, T> supplier, ConsumerWithException<T, Cell> consumer, final MutationProto proto, final CellScanner cellScanner) throws IOException { byte[] row = proto.hasRow() ? proto.getRow().toByteArray() : null; T mutation = row == null ? null : supplier.apply(new Bytes(row)); int cellCount = proto.hasAssociatedCellCount() ? proto.getAssociatedCellCount() : 0;
/** * Print out some subset of a MutationProto rather than all of it and its data * @param proto Protobuf to print out * @return Short String of mutation proto */ static String toShortString(final MutationProto proto) { return "row=" + Bytes.toString(proto.getRow().toByteArray()) + ", type=" + proto.getMutateType().toString(); }
assert type == MutationType.PUT: type.name(); long timestamp = proto.hasTimestamp()? proto.getTimestamp(): HConstants.LATEST_TIMESTAMP; Put put = proto.hasRow() ? new Put(proto.getRow().toByteArray(), timestamp) : null; int cellCount = proto.hasAssociatedCellCount()? proto.getAssociatedCellCount(): 0; if (cellCount > 0) {
assert type == MutationType.DELETE : type.name(); long timestamp = proto.hasTimestamp() ? proto.getTimestamp() : HConstants.LATEST_TIMESTAMP; Delete delete = proto.hasRow() ? new Delete(proto.getRow().toByteArray(), timestamp) : null; int cellCount = proto.hasAssociatedCellCount()? proto.getAssociatedCellCount(): 0; if (cellCount > 0) {
MutationType type = proto.getMutateType(); assert type == MutationType.INCREMENT || type == MutationType.APPEND : type.name(); byte[] row = proto.hasRow() ? proto.getRow().toByteArray() : null; Get get = null; int cellCount = proto.hasAssociatedCellCount() ? proto.getAssociatedCellCount() : 0;
if (hasRow()) { hash = (37 * hash) + ROW_FIELD_NUMBER; hash = (53 * hash) + getRow().hashCode();
/** * <code>optional bytes row = 1;</code> */ public Builder clearRow() { bitField0_ = (bitField0_ & ~0x00000001); row_ = getDefaultInstance().getRow(); onChanged(); return this; }