@Test public void setCellWithServerSideTimestamp() { Mutation mutation = Mutation.createUnsafe(); mutation.setCell( "fake-family", ByteString.copyFromUtf8("fake-qualifier"), Mutation.SERVER_SIDE_TIMESTAMP, ByteString.copyFromUtf8("fake-value")); List<com.google.bigtable.v2.Mutation> actual = mutation.getMutations(); assertThat(actual.get(0).getSetCell().getTimestampMicros()) .isEqualTo(Mutation.SERVER_SIDE_TIMESTAMP); }
case 1: hash = (37 * hash) + SET_CELL_FIELD_NUMBER; hash = (53 * hash) + getSetCell().hashCode(); break; case 2:
switch (mutationCase_) { case 1: result = result && getSetCell().equals(other.getSetCell()); break; case 2:
case SET_CELL: mergeSetCell(other.getSetCell()); break;
private static final boolean allCellsHaveTimestamps(Iterable<Mutation> mutations) { for (Mutation mut : mutations) { if (mut.getSetCell().getTimestampMicros() <= 0) { return false; } } return true; }
"Cannot process mutation of type: " + mutation.getMutationCase()); SetCell setCell = mutation.getSetCell(); long timestampHbase; if (setCell.getTimestampMicros() == -1) {
case 1: hash = (37 * hash) + SET_CELL_FIELD_NUMBER; hash = (53 * hash) + getSetCell().hashCode(); break; case 2:
"Cannot process mutation of type: " + mutation.getMutationCase()); SetCell setCell = mutation.getSetCell(); long timestampHbase; if (setCell.getTimestampMicros() == -1) {
case 1: hash = (37 * hash) + SET_CELL_FIELD_NUMBER; hash = (53 * hash) + getSetCell().hashCode(); break; case 2:
@Override public CompletionStage<MutateRowResponse> writeRecord( KV<ByteString, Iterable<Mutation>> record) { service.verifyTableExists(tableId); Map<ByteString, ByteString> table = service.getTable(tableId); ByteString key = record.getKey(); for (Mutation m : record.getValue()) { SetCell cell = m.getSetCell(); if (cell.getValue().isEmpty()) { CompletableFuture<MutateRowResponse> result = new CompletableFuture<>(); result.completeExceptionally(new IOException("cell value missing")); return result; } table.put(key, cell.getValue()); } return CompletableFuture.completedFuture(MutateRowResponse.getDefaultInstance()); }
switch (mutationCase_) { case 1: result = result && getSetCell().equals(other.getSetCell()); break; case 2:
switch (mutationCase_) { case 1: result = result && getSetCell() .equals(other.getSetCell()); break; case 2:
public Builder mergeFrom(com.google.bigtable.v2.Mutation other) { if (other == com.google.bigtable.v2.Mutation.getDefaultInstance()) return this; switch (other.getMutationCase()) { case SET_CELL: { mergeSetCell(other.getSetCell()); break; } case DELETE_FROM_COLUMN: { mergeDeleteFromColumn(other.getDeleteFromColumn()); break; } case DELETE_FROM_FAMILY: { mergeDeleteFromFamily(other.getDeleteFromFamily()); break; } case DELETE_FROM_ROW: { mergeDeleteFromRow(other.getDeleteFromRow()); break; } case MUTATION_NOT_SET: { break; } } onChanged(); return this; }
case SET_CELL: mergeSetCell(other.getSetCell()); break;