/** * <code>optional .hbase.pb.Result result = 2;</code> */ public Builder mergeResult(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result value) { if (resultBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002) && result_ != org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result.getDefaultInstance()) { result_ = org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result.newBuilder(result_).mergeFrom(value).buildPartial(); } else { result_ = value; } onChanged(); } else { resultBuilder_.mergeFrom(value); } bitField0_ |= 0x00000002; return this; } /**
@Override public void write(final DataOutput out) throws IOException { ProtobufUtil.toResultNoData(result).writeDelimitedTo(DataOutputOutputStream.from(out)); out.writeInt(result.size()); for(Cell cell : result.listCells()) { KeyValue kv = KeyValueUtil.ensureKeyValue(cell); KeyValue.write(kv, out); } } }
public Builder mergeFrom(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result other) { if (other == org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result.getDefaultInstance()) return this; if (cellBuilder_ == null) { if (!other.cell_.isEmpty()) { if (other.hasAssociatedCellCount()) { setAssociatedCellCount(other.getAssociatedCellCount()); if (other.hasExists()) { setExists(other.getExists()); if (other.hasStale()) { setStale(other.getStale()); if (other.hasPartial()) { setPartial(other.getPartial()); this.mergeUnknownFields(other.getUnknownFields()); return this;
public Builder mergeFrom(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result other) { if (other == org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result.getDefaultInstance()) return this; if (cellBuilder_ == null) { if (!other.cell_.isEmpty()) { if (other.hasAssociatedCellCount()) { setAssociatedCellCount(other.getAssociatedCellCount()); if (other.hasExists()) { setExists(other.getExists()); if (other.hasStale()) { setStale(other.getStale()); if (other.hasPartial()) { setPartial(other.getPartial()); this.mergeUnknownFields(other.getUnknownFields()); return this;
List<CellProtos.Cell> values = proto.getCellList(); if (proto.hasExists()) { if ((values != null && !values.isEmpty()) || (proto.hasAssociatedCellCount() && proto.getAssociatedCellCount() > 0)) { throw new IllegalArgumentException("bad proto: exists with cells is no allowed " + proto); if (proto.getStale()) { return proto.getExists() ? EMPTY_RESULT_EXISTS_TRUE_STALE :EMPTY_RESULT_EXISTS_FALSE_STALE; return proto.getExists() ? EMPTY_RESULT_EXISTS_TRUE : EMPTY_RESULT_EXISTS_FALSE; if (proto.hasAssociatedCellCount()) { int count = proto.getAssociatedCellCount(); cells = new ArrayList<Cell>(count + values.size()); for (int i = 0; i < count; i++) { ? (proto.getStale() ? EMPTY_RESULT_STALE : EMPTY_RESULT) : Result.create(cells, null, proto.getStale());
public Builder mergeFrom(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result other) { if (other == org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result.getDefaultInstance()) return this; if (cellBuilder_ == null) { if (!other.cell_.isEmpty()) { if (other.hasAssociatedCellCount()) { setAssociatedCellCount(other.getAssociatedCellCount()); if (other.hasExists()) { setExists(other.getExists()); if (other.hasStale()) { setStale(other.getStale()); if (other.hasPartial()) { setPartial(other.getPartial()); this.mergeUnknownFields(other.getUnknownFields()); return this;
List<CellProtos.Cell> values = proto.getCellList(); if (proto.hasExists()) { if ((values != null && !values.isEmpty()) || (proto.hasAssociatedCellCount() && proto.getAssociatedCellCount() > 0)) { throw new IllegalArgumentException("bad proto: exists with cells is no allowed " + proto); if (proto.getStale()) { return proto.getExists() ? EMPTY_RESULT_EXISTS_TRUE_STALE :EMPTY_RESULT_EXISTS_FALSE_STALE; return proto.getExists() ? EMPTY_RESULT_EXISTS_TRUE : EMPTY_RESULT_EXISTS_FALSE; if (proto.hasAssociatedCellCount()) { int count = proto.getAssociatedCellCount(); cells = new ArrayList<>(count + values.size()); for (int i = 0; i < count; i++) { ? (proto.getStale() ? EMPTY_RESULT_STALE : EMPTY_RESULT) : Result.create(cells, null, proto.getStale());
public Builder mergeFrom(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result other) { if (other == org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result.getDefaultInstance()) return this; if (cellBuilder_ == null) { if (!other.cell_.isEmpty()) { if (other.hasAssociatedCellCount()) { setAssociatedCellCount(other.getAssociatedCellCount()); if (other.hasExists()) { setExists(other.getExists()); if (other.hasStale()) { setStale(other.getStale()); if (other.hasPartial()) { setPartial(other.getPartial()); this.mergeUnknownFields(other.getUnknownFields()); return this;
result = result && getCellList() .equals(other.getCellList()); result = result && (hasAssociatedCellCount() == other.hasAssociatedCellCount()); if (hasAssociatedCellCount()) { result = result && (getAssociatedCellCount() == other.getAssociatedCellCount()); result = result && (hasExists() == other.hasExists()); if (hasExists()) { result = result && (getExists() == other.getExists()); result = result && (hasStale() == other.hasStale()); if (hasStale()) { result = result && (getStale() == other.getStale()); result = result && (hasPartial() == other.hasPartial()); if (hasPartial()) { result = result && (getPartial() == other.getPartial()); getUnknownFields().equals(other.getUnknownFields()); return result;
result = result && getCellList() .equals(other.getCellList()); result = result && (hasAssociatedCellCount() == other.hasAssociatedCellCount()); if (hasAssociatedCellCount()) { result = result && (getAssociatedCellCount() == other.getAssociatedCellCount()); result = result && (hasExists() == other.hasExists()); if (hasExists()) { result = result && (getExists() == other.getExists()); result = result && (hasStale() == other.hasStale()); if (hasStale()) { result = result && (getStale() == other.getStale()); result = result && (hasPartial() == other.hasPartial()); if (hasPartial()) { result = result && (getPartial() == other.getPartial()); getUnknownFields().equals(other.getUnknownFields()); return result;
result = result && getCellList() .equals(other.getCellList()); result = result && (hasAssociatedCellCount() == other.hasAssociatedCellCount()); if (hasAssociatedCellCount()) { result = result && (getAssociatedCellCount() == other.getAssociatedCellCount()); result = result && (hasExists() == other.hasExists()); if (hasExists()) { result = result && (getExists() == other.getExists()); result = result && (hasStale() == other.hasStale()); if (hasStale()) { result = result && (getStale() == other.getStale()); result = result && (hasPartial() == other.hasPartial()); if (hasPartial()) { result = result && (getPartial() == other.getPartial()); getUnknownFields().equals(other.getUnknownFields()); return result;
hash = (19 * hash) + getDescriptorForType().hashCode(); if (getCellCount() > 0) { hash = (37 * hash) + CELL_FIELD_NUMBER; hash = (53 * hash) + getCellList().hashCode(); if (hasAssociatedCellCount()) { hash = (37 * hash) + ASSOCIATED_CELL_COUNT_FIELD_NUMBER; hash = (53 * hash) + getAssociatedCellCount(); if (hasExists()) { hash = (37 * hash) + EXISTS_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getExists()); if (hasStale()) { hash = (37 * hash) + STALE_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getStale()); if (hasPartial()) { hash = (37 * hash) + PARTIAL_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getPartial()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash;
hash = (19 * hash) + getDescriptorForType().hashCode(); if (getCellCount() > 0) { hash = (37 * hash) + CELL_FIELD_NUMBER; hash = (53 * hash) + getCellList().hashCode(); if (hasAssociatedCellCount()) { hash = (37 * hash) + ASSOCIATED_CELL_COUNT_FIELD_NUMBER; hash = (53 * hash) + getAssociatedCellCount(); if (hasExists()) { hash = (37 * hash) + EXISTS_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getExists()); if (hasStale()) { hash = (37 * hash) + STALE_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getStale()); if (hasPartial()) { hash = (37 * hash) + PARTIAL_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getPartial()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash;
hash = (19 * hash) + getDescriptorForType().hashCode(); if (getCellCount() > 0) { hash = (37 * hash) + CELL_FIELD_NUMBER; hash = (53 * hash) + getCellList().hashCode(); if (hasAssociatedCellCount()) { hash = (37 * hash) + ASSOCIATED_CELL_COUNT_FIELD_NUMBER; hash = (53 * hash) + getAssociatedCellCount(); if (hasExists()) { hash = (37 * hash) + EXISTS_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getExists()); if (hasStale()) { hash = (37 * hash) + STALE_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getStale()); if (hasPartial()) { hash = (37 * hash) + PARTIAL_FIELD_NUMBER; hash = (53 * hash) + hashBoolean(getPartial()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash;
/** * Convert a client Result to a protocol buffer Result * * @param result the client Result to convert * @return the converted protocol buffer Result */ public static ClientProtos.Result toResult(final Result result) { if (result.getExists() != null) { return toResult(result.getExists(), result.isStale()); } Cell[] cells = result.rawCells(); if (cells == null || cells.length == 0) { return result.isStale() ? EMPTY_RESULT_PB_STALE : EMPTY_RESULT_PB; } ClientProtos.Result.Builder builder = ClientProtos.Result.newBuilder(); for (Cell c : cells) { builder.addCell(toCell(c)); } builder.setStale(result.isStale()); builder.setPartial(result.isPartial()); return builder.build(); }
/** * Convert a client Result to a protocol buffer Result * * @param result the client Result to convert * @return the converted protocol buffer Result */ public static ClientProtos.Result toResult(final Result result) { if (result.getExists() != null) { return toResult(result.getExists(), result.isStale()); } Cell[] cells = result.rawCells(); if (cells == null || cells.length == 0) { return result.isStale() ? EMPTY_RESULT_PB_STALE : EMPTY_RESULT_PB; } ClientProtos.Result.Builder builder = ClientProtos.Result.newBuilder(); for (Cell c : cells) { builder.addCell(toCell(c)); } builder.setStale(result.isStale()); builder.setPartial(result.mayHaveMoreCellsInRow()); return builder.build(); }
/** * Convert a protocol buffer Result to a client Result * * @param proto the protocol buffer Result to convert * @return the converted client Result */ public static Result toResult(final ClientProtos.Result proto) { if (proto.hasExists()) { if (proto.getStale()) { return proto.getExists() ? EMPTY_RESULT_EXISTS_TRUE_STALE :EMPTY_RESULT_EXISTS_FALSE_STALE; } return proto.getExists() ? EMPTY_RESULT_EXISTS_TRUE : EMPTY_RESULT_EXISTS_FALSE; } List<CellProtos.Cell> values = proto.getCellList(); if (values.isEmpty()){ return proto.getStale() ? EMPTY_RESULT_STALE : EMPTY_RESULT; } List<Cell> cells = new ArrayList<Cell>(values.size()); for (CellProtos.Cell c : values) { cells.add(toCell(c)); } return Result.create(cells, null, proto.getStale(), proto.getPartial()); }
/** * Convert a protocol buffer Result to a client Result * * @param proto the protocol buffer Result to convert * @return the converted client Result */ public static Result toResult(final ClientProtos.Result proto) { if (proto.hasExists()) { if (proto.getStale()) { return proto.getExists() ? EMPTY_RESULT_EXISTS_TRUE_STALE :EMPTY_RESULT_EXISTS_FALSE_STALE; } return proto.getExists() ? EMPTY_RESULT_EXISTS_TRUE : EMPTY_RESULT_EXISTS_FALSE; } List<CellProtos.Cell> values = proto.getCellList(); if (values.isEmpty()){ return proto.getStale() ? EMPTY_RESULT_STALE : EMPTY_RESULT; } List<Cell> cells = new ArrayList<>(values.size()); ExtendedCellBuilder builder = ExtendedCellBuilderFactory.create(CellBuilderType.SHALLOW_COPY); for (CellProtos.Cell c : values) { cells.add(toCell(builder, c)); } return Result.create(cells, null, proto.getStale(), proto.getPartial()); }
/** * <code>optional .Result result = 1;</code> */ public Builder mergeResult(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result value) { if (resultBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001) && result_ != org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result.getDefaultInstance()) { result_ = org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result.newBuilder(result_).mergeFrom(value).buildPartial(); } else { result_ = value; } onChanged(); } else { resultBuilder_.mergeFrom(value); } bitField0_ |= 0x00000001; return this; } /**
/** * <code>optional .Result result = 2;</code> */ public Builder mergeResult(org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result value) { if (resultBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002) && result_ != org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result.getDefaultInstance()) { result_ = org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Result.newBuilder(result_).mergeFrom(value).buildPartial(); } else { result_ = value; } onChanged(); } else { resultBuilder_.mergeFrom(value); } bitField0_ |= 0x00000002; return this; } /**