/** * Create a protocol buffer MutationProto based on a client Mutation. Does NOT include data. * Understanding is that the Cell will be transported other than via protobuf. * @param type * @param mutation * @param builder * @return a protobuf'd Mutation * @throws IOException */ public static MutationProto toMutationNoData(final MutationType type, final Mutation mutation, final MutationProto.Builder builder) throws IOException { return toMutationNoData(type, mutation, builder, HConstants.NO_NONCE); }
/** * Create a protocol buffer MutationProto based on a client Mutation. Does NOT include data. * Understanding is that the Cell will be transported other than via protobuf. * @param type * @param mutation * @return a protobuf'd Mutation * @throws IOException */ public static MutationProto toMutationNoData(final MutationType type, final Mutation mutation) throws IOException { MutationProto.Builder builder = MutationProto.newBuilder(); return toMutationNoData(type, mutation, builder); }
@Override public void write(final DataOutput out) throws IOException { ProtobufUtil.toMutationNoData(MutationType.PUT, put).writeDelimitedTo(DataOutputOutputStream.from(out)); out.writeInt(put.size()); CellScanner scanner = put.cellScanner(); while(scanner.advance()) { KeyValue kv = KeyValueUtil.ensureKeyValue(scanner.current()); KeyValue.write(kv, out); } } }
/** * Create a protocol buffer MutationProto based on a client Mutation. Does NOT include data. * Understanding is that the Cell will be transported other than via protobuf. * @param type * @param mutation * @param builder * @return a protobuf'd Mutation * @throws IOException */ public static MutationProto toMutationNoData(final MutationType type, final Mutation mutation, final MutationProto.Builder builder) throws IOException { return toMutationNoData(type, mutation, builder, HConstants.NO_NONCE); }
/** * Create a protocol buffer MutationProto based on a client Mutation. Does NOT include data. * Understanding is that the Cell will be transported other than via protobuf. * @param type * @param mutation * @return a protobuf'd Mutation * @throws IOException */ public static MutationProto toMutationNoData(final MutationType type, final Mutation mutation) throws IOException { MutationProto.Builder builder = MutationProto.newBuilder(); return toMutationNoData(type, mutation, builder); }
/** * Create a protocol buffer MutationProto based on a client Mutation. Does NOT include data. * Understanding is that the Cell will be transported other than via protobuf. * @param type * @param mutation * @param builder * @return a protobuf'd Mutation * @throws IOException */ public static MutationProto toMutationNoData(final MutationType type, final Mutation mutation, final MutationProto.Builder builder) throws IOException { return toMutationNoData(type, mutation, builder, HConstants.NO_NONCE); }
/** * Create a protocol buffer MutationProto based on a client Mutation. Does NOT include data. * Understanding is that the Cell will be transported other than via protobuf. * @param type * @param mutation * @param builder * @return a protobuf'd Mutation * @throws IOException */ public static MutationProto toMutationNoData(final MutationType type, final Mutation mutation, final MutationProto.Builder builder) throws IOException { return toMutationNoData(type, mutation, builder, HConstants.NO_NONCE); }
/** * Create a protocol buffer MutationProto based on a client Mutation. Does NOT include data. * Understanding is that the Cell will be transported other than via protobuf. * @param type * @param mutation * @return a protobuf'd Mutation * @throws IOException */ public static MutationProto toMutationNoData(final MutationType type, final Mutation mutation) throws IOException { MutationProto.Builder builder = MutationProto.newBuilder(); return toMutationNoData(type, mutation, builder); }
/** * Create a protocol buffer MutationProto based on a client Mutation. Does NOT include data. * Understanding is that the Cell will be transported other than via protobuf. * @param type * @param mutation * @return a protobuf'd Mutation * @throws IOException */ public static MutationProto toMutationNoData(final MutationType type, final Mutation mutation) throws IOException { MutationProto.Builder builder = MutationProto.newBuilder(); return toMutationNoData(type, mutation, builder); }
@Override public void write(final DataOutput out) throws IOException { ProtobufUtil.toMutationNoData(MutationType.PUT, put).writeDelimitedTo(DataOutputOutputStream.from(out)); out.writeInt(put.size()); CellScanner scanner = put.cellScanner(); while(scanner.advance()) { KeyValue kv = KeyValueUtil.ensureKeyValue(scanner.current()); KeyValue.write(kv, out); } } }
MutationProto mp = ProtobufUtil.toMutationNoData(type, mutation, mutationBuilder); cells.add(mutation); actionBuilder.clear();
cells.add(p); builder.addAction(actionBuilder. setMutation(ProtobufUtil.toMutationNoData(MutationType.PUT, p, mutationBuilder))); } else if (row instanceof Delete) { Delete d = (Delete)row; cells.add(d); builder.addAction(actionBuilder. setMutation(ProtobufUtil.toMutationNoData(MutationType.DELETE, d, mutationBuilder))); } else { builder.addAction(actionBuilder. Append a = (Append)row; cells.add(a); builder.addAction(actionBuilder.setMutation(ProtobufUtil.toMutationNoData( MutationType.APPEND, a, mutationBuilder, action.getNonce()))); } else if (row instanceof Increment) { Increment i = (Increment)row; cells.add(i); builder.addAction(actionBuilder.setMutation(ProtobufUtil.toMutationNoData( MutationType.INCREMENT, i, mutationBuilder, action.getNonce()))); } else if (row instanceof RegionCoprocessorServiceExec) {