Skip to content

Bigtable: Using cleaner number input for snippets #1787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public static void writeBatch(String projectId, String instanceId, String tableI

try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) {
long timestamp = System.currentTimeMillis() * 1000;
ByteString one = ByteString.copyFrom(new byte[] {0, 0, 0, 0, 0, 0, 0, 1});

BulkMutation bulkMutation =
BulkMutation.create(tableId)
Expand All @@ -44,7 +43,7 @@ public static void writeBatch(String projectId, String instanceId, String tableI
COLUMN_FAMILY_NAME,
ByteString.copyFrom("connected_wifi".getBytes()),
timestamp,
one)
1)
.setCell(COLUMN_FAMILY_NAME, "os_build", timestamp, "12155.0.0-rc1"))
.add(
"tablet#a0b81f74#20190502",
Expand All @@ -53,7 +52,7 @@ public static void writeBatch(String projectId, String instanceId, String tableI
COLUMN_FAMILY_NAME,
ByteString.copyFrom("connected_wifi".getBytes()),
timestamp,
one)
1)
.setCell(COLUMN_FAMILY_NAME, "os_build", timestamp, "12155.0.0-rc6"));

dataClient.bulkMutateRows(bulkMutation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,19 @@ public static void writeSimple(String projectId, String instanceId, String table
long timestamp = System.currentTimeMillis() * 1000;

String rowkey = "phone#4c410523#20190501";
ByteString one = ByteString.copyFrom(new byte[] {0, 0, 0, 0, 0, 0, 0, 1});

RowMutation rowMutation =
RowMutation.create(tableId, rowkey)
.setCell(
COLUMN_FAMILY_NAME,
ByteString.copyFrom("connected_cell".getBytes()),
timestamp,
one)
1)
.setCell(
COLUMN_FAMILY_NAME,
ByteString.copyFrom("connected_wifi".getBytes()),
timestamp,
one)
1)
.setCell(COLUMN_FAMILY_NAME, "os_build", timestamp, "PQ2A.190405.003");

dataClient.mutateRow(rowMutation);
Expand Down