/** * 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(); }
setMutateType(other.getMutateType());
/** * Convert a MutateRequest to Mutation * * @param proto the protocol buffer Mutate to convert * @return the converted Mutation * @throws IOException */ public static Mutation toMutation(final MutationProto proto) throws IOException { MutationType type = proto.getMutateType(); if (type == MutationType.APPEND) { return toAppend(proto, null); } if (type == MutationType.DELETE) { return toDelete(proto, null); } if (type == MutationType.PUT) { return toPut(proto, null); } throw new IOException("Unknown mutation type " + type); }
/** * Convert a protocol buffer Mutate to an Increment * * @param proto the protocol buffer Mutate to convert * @return the converted client Increment * @throws IOException */ public static Increment toIncrement(final MutationProto proto, final CellScanner cellScanner) throws IOException { MutationType type = proto.getMutateType(); assert type == MutationType.INCREMENT : type.name(); Increment increment = toDelta((Bytes row) -> new Increment(row.get(), row.getOffset(), row.getLength()), Increment::add, proto, cellScanner); if (proto.hasTimeRange()) { TimeRange timeRange = protoToTimeRange(proto.getTimeRange()); increment.setTimeRange(timeRange.getMin(), timeRange.getMax()); } return increment; }
/** * 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(); }
/** * 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(); }
throws IOException { MutationType type = proto.getMutateType(); assert type == MutationType.PUT: type.name(); long timestamp = proto.hasTimestamp()? proto.getTimestamp(): HConstants.LATEST_TIMESTAMP;
MutationType type = proto.getMutateType(); assert type == MutationType.DELETE : type.name(); long timestamp = proto.hasTimestamp() ? proto.getTimestamp() : HConstants.LATEST_TIMESTAMP;
MutationType type = proto.getMutateType(); assert type == MutationType.INCREMENT || type == MutationType.APPEND : type.name(); byte[] row = proto.hasRow() ? proto.getRow().toByteArray() : null;
/** * Convert a protocol buffer Mutate to an Increment * * @param proto the protocol buffer Mutate to convert * @return the converted client Increment * @throws IOException */ public static Increment toIncrement(final MutationProto proto, final CellScanner cellScanner) throws IOException { MutationType type = proto.getMutateType(); assert type == MutationType.INCREMENT : type.name(); Increment increment = toDelta((Bytes row) -> new Increment(row.get(), row.getOffset(), row.getLength()), Increment::add, proto, cellScanner); if (proto.hasTimeRange()) { TimeRange timeRange = protoToTimeRange(proto.getTimeRange()); increment.setTimeRange(timeRange.getMin(), timeRange.getMax()); } return increment; }
/** * Convert a MutateRequest to Mutation * * @param proto the protocol buffer Mutate to convert * @return the converted Mutation * @throws IOException */ public static Mutation toMutation(final MutationProto proto) throws IOException { MutationType type = proto.getMutateType(); if (type == MutationType.APPEND) { return toAppend(proto, null); } if (type == MutationType.DELETE) { return toDelete(proto, null); } if (type == MutationType.PUT) { return toPut(proto, null); } throw new IOException("Unknown mutation type " + type); }
/** * Convert a protocol buffer Mutate to an Append * @param cellScanner * @param proto the protocol buffer Mutate to convert * @return the converted client Append * @throws IOException */ public static Append toAppend(final MutationProto proto, final CellScanner cellScanner) throws IOException { MutationType type = proto.getMutateType(); assert type == MutationType.APPEND : type.name(); Append append = toDelta((Bytes row) -> new Append(row.get(), row.getOffset(), row.getLength()), Append::add, proto, cellScanner); if (proto.hasTimeRange()) { TimeRange timeRange = protoToTimeRange(proto.getTimeRange()); append.setTimeRange(timeRange.getMin(), timeRange.getMax()); } return append; }
/** * 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(); }
throws IOException { MutationType type = proto.getMutateType(); assert type == MutationType.PUT: type.name(); long timestamp = proto.hasTimestamp()? proto.getTimestamp(): HConstants.LATEST_TIMESTAMP;
MutationType type = proto.getMutateType(); assert type == MutationType.DELETE : type.name(); long timestamp = proto.hasTimestamp() ? proto.getTimestamp() : HConstants.LATEST_TIMESTAMP;
MutationType type = proto.getMutateType(); assert type == MutationType.INCREMENT || type == MutationType.APPEND : type.name(); byte[] row = proto.hasRow() ? proto.getRow().toByteArray() : null;
if (hasMutateType()) { result = result && (getMutateType() == other.getMutateType());
hash = (53 * hash) + hashEnum(getMutateType());
/** * Convert a protocol buffer Mutate to an Increment * * @param proto the protocol buffer Mutate to convert * @return the converted client Increment * @throws IOException */ public static Increment toIncrement(final MutationProto proto, final CellScanner cellScanner) throws IOException { MutationType type = proto.getMutateType(); assert type == MutationType.INCREMENT : type.name(); Increment increment = toDelta((Bytes row) -> new Increment(row.get(), row.getOffset(), row.getLength()), Increment::add, proto, cellScanner); if (proto.hasTimeRange()) { TimeRange timeRange = protoToTimeRange(proto.getTimeRange()); increment.setTimeRange(timeRange.getMin(), timeRange.getMax()); } return increment; }
/** * Convert a protocol buffer Mutate to an Append * @param cellScanner * @param proto the protocol buffer Mutate to convert * @return the converted client Append * @throws IOException */ public static Append toAppend(final MutationProto proto, final CellScanner cellScanner) throws IOException { MutationType type = proto.getMutateType(); assert type == MutationType.APPEND : type.name(); Append append = toDelta((Bytes row) -> new Append(row.get(), row.getOffset(), row.getLength()), Append::add, proto, cellScanner); if (proto.hasTimeRange()) { TimeRange timeRange = protoToTimeRange(proto.getTimeRange()); append.setTimeRange(timeRange.getMin(), timeRange.getMax()); } return append; }