Skip to content

Commit ba2f901

Browse files
author
Rael
committed
Changed tags and renamed files
1 parent 000a10f commit ba2f901

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

bigtable/api/src/getting_a_row.php renamed to bigtable/api/src/hw_get_with_filter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
}
3131
list($_, $project_id, $instance_id, $table_id) = $argv;
3232

33-
// [START getting_a_row]
33+
// [START bigtable_hw_get_with_filter]
3434

3535
use Google\Cloud\Bigtable\BigtableClient;
3636
use Google\Cloud\Bigtable\Table;
@@ -65,4 +65,4 @@
6565
'rowFilter' => $row_filter
6666
]);
6767
printf('%s' . PHP_EOL, $row[$columnFamilyId][$column][0]['value']);
68-
// [END getting_a_row]
68+
// [END bigtable_hw_get_with_filter]

bigtable/api/src/scanning_all_rows.php renamed to bigtable/api/src/hw_scan_all.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
}
3131
list($_, $project_id, $instance_id, $table_id) = $argv;
3232

33-
// [START scanning_all_rows]
33+
// [START bigtable_hw_scan_all]
3434

3535
use Google\Cloud\Bigtable\Admin\V2\StorageType;
3636
use Google\Cloud\Bigtable\Admin\V2\Cluster;
@@ -58,7 +58,6 @@
5858
printf('Scanning for all greetings:' . PHP_EOL);
5959
$partial_rows = $table->readRows([])->readAll();
6060
foreach ($partial_rows as $row) {
61-
//print_r( $row[$columnFamilyId][$column] );
6261
printf('%s' . PHP_EOL, $row[$columnFamilyId][$column][0]['value']);
6362
}
64-
// [END scanning_all_rows]
63+
// [END bigtable_hw_scan_all]

bigtable/api/src/writing_rows.php renamed to bigtable/api/src/hw_write_rows.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
}
3131
list($_, $project_id, $instance_id, $table_id) = $argv;
3232

33-
// [START writing_rows]
33+
// [START bigtable_hw_write_rows]
3434

3535
use Google\Cloud\Bigtable\Admin\V2\StorageType;
3636
use Google\Cloud\Bigtable\Admin\V2\Cluster;
@@ -66,4 +66,4 @@
6666
$entries[$row_key] = $rowMutation;
6767
}
6868
$table->mutateRows($entries);
69-
// [END writing_rows]
69+
// [END bigtable_hw_write_rows]

bigtable/api/src/insert.php renamed to bigtable/api/src/insert_update_rows.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
*/
1717
require __DIR__ . '/../vendor/autoload.php';
1818

19+
$instance_id = 'quickstart-instance-php'; # instance-id
20+
$table_id = 'bigtable-php-table'; # my-table
21+
$project_id = getenv('PROJECT_ID');
22+
23+
// [START bigtable_insert_update_rows]
24+
1925
use Google\Cloud\Bigtable\Admin\V2\BigtableInstanceAdminClient;
2026
use Google\Cloud\Bigtable\Admin\V2\BigtableTableAdminClient;
2127
use Google\Cloud\Bigtable\Admin\V2\ColumnFamily;
@@ -24,9 +30,7 @@
2430
use Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest\Modification;
2531
use Google\Cloud\Bigtable\Admin\V2\Table as TableClass;
2632
use Google\ApiCore\ApiException;
27-
$instance_id = 'quickstart-instance-php'; # instance-id
28-
$table_id = 'bigtable-php-table'; # my-table
29-
$project_id = getenv('PROJECT_ID');
33+
3034
$dataClient = new BigtableClient([
3135
'projectId' => $project_id,
3236
]);
@@ -68,4 +72,5 @@ function time_in_microseconds(){
6872
]
6973
]
7074
];
71-
$table->upsert($insertRows);
75+
$table->upsert($insertRows);
76+
// [END bigtable_insert_update_rows]

bigtable/api/src/quickstart.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@
5353
'projectId' => $project_id,
5454
]);
5555
$table = $dataClient->table($instance_id, $table_id);
56-
$key = 'rk5';
56+
$key = 'r1';
5757
// Read a row from my-table using a row key
5858
$row = $table->readRow($key);
5959

6060
$column_family_id = 'cf1';
61-
$column_id = 'cq5';
61+
$column_id = 'c1';
6262
// Get the Value from the Row, using the column_family_id and column_id
6363

6464
$value = $row[$column_family_id][$column_id][0]['value'];

0 commit comments

Comments
 (0)