Migrating Google Cloud Bigtable from V1 to V2
How to upgrade
Update your google/cloud-bigtable dependency to ^2.0:
{
"require": {
"google/cloud-bigtable": "^2.0"
}
}
Changes
Filter Option change
The rowFilter option for Table::readRows is now called filter:
use Google\Cloud\Bigtable\BigtableClient;
use Google\Cloud\Bigtable\V2\RowFilter;
// Only retrieve the most recent version of the cell.
$rowFilter = (new RowFilter())->setCellsPerColumnLimitFilter(1);
$bigtable = new BigtableClient(['projectId' => $projectId]);
$table = $bigtable->table($instanceId, $tableId);
$row = $table->readRow($key, [
'filter' => $rowFilter
]);
Retry Options changes
The retries parameter in the following RPC calls is changed to retrySettings.maxRetries:
- Google\Cloud\Bigtable\Table::mutateRows
- Google\Cloud\Bigtable\Table::upsert
- Google\Cloud\Bigtable\Table::readRows
For example:
$table->readRows([
'retrySettings' => [
'maxRetries' => 3
]
]);
OR
$retrySettings = RetrySettings::constructDefault();
$retrySettings = $retrySettings->with(['maxRetries' => 3])
$table->readRows([
'retrySettings' => $retrySettings
]);
This is done in order to be consistent across other RPC calls which use GAX's retrySettings and to be consistent across other products which mostly use the RetrySettings from GAX already.
Only the maxRetries parameter is supported for now and not the other options in the RetrySettings.
Removed deprecated classes
The following deprecated classes are now removed completely. Use the specified alternatives.
Google\Cloud\Bigtable\V2\Gapic\BigtableGapicClient, useGoogle\Cloud\Bigtable\V2\Client\BigtableClientinstead.Google\Cloud\Bigtable\V2\BigtableClient, useGoogle\Cloud\Bigtable\V2\Client\BigtableClientinstead.Google\Cloud\Bigtable\Admin\V2\Gapic\BigtableInstanceAdminGapicClient, useGoogle\Cloud\Bigtable\Admin\V2\Client\BigtableInstanceAdminClientinstead.Google\Cloud\Bigtable\Admin\V2\Gapic\BigtableTableAdminGapicClient, useGoogle\Cloud\Bigtable\Admin\V2\Client\BigtableTableAdminClientinstead.Google\Cloud\Bigtable\V2\MutateRowsRequest_Entry, useGoogle\Cloud\Bigtable\V2\MutateRowsRequest\Entryinstead.Google\Cloud\Bigtable\V2\MutateRowsResponse_Entry, useGoogle\Cloud\Bigtable\V2\MutateRowsResponse\Entryinstead.Google\Cloud\Bigtable\V2\Mutation_DeleteFromFamily, useGoogle\Cloud\Bigtable\V2\Mutation\DeleteFromFamilyinstead.Google\Cloud\Bigtable\V2\Mutation_DeleteFromColumn, useGoogle\Cloud\Bigtable\V2\Mutation\DeleteFromColumninstead.Google\Cloud\Bigtable\V2\Mutation_DeleteFromRow, useGoogle\Cloud\Bigtable\V2\Mutation\DeleteFromRowinstead.Google\Cloud\Bigtable\V2\Mutation_SetCell, useGoogle\Cloud\Bigtable\V2\Mutation\SetCellinstead.Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_CloseStream, use Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\CloseStream`` instead.Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_DataChange_Type, useGoogle\Cloud\Bigtable\V2\ReadChangeStreamResponse\DataChange\Typeinstead.Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_DataChange, useGoogle\Cloud\Bigtable\V2\ReadChangeStreamResponse\DataChangeinstead.Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_Heartbeat, useGoogle\Cloud\Bigtable\V2\ReadChangeStreamResponse\Heartbeatinstead.Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_MutationChunk_ChunkInfo, useGoogle\Cloud\Bigtable\V2\ReadChangeStreamResponse\MutationChunk\ChunkInfoinstead.Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_MutationChunk, useGoogle\Cloud\Bigtable\V2\ReadChangeStreamResponse\MutationChunkinstead.Google\Cloud\Bigtable\V2\ReadRowsRequest_RequestStatsView, useGoogle\Cloud\Bigtable\V2\ReadRowsRequest\RequestStatsViewinstead.Google\Cloud\Bigtable\V2\RowFilter_Chain, useGoogle\Cloud\Bigtable\V2\RowFilter\Chaininstead.Google\Cloud\Bigtable\V2\RowFilter_Condition, useGoogle\Cloud\Bigtable\V2\RowFilter\Conditioninstead.Google\Cloud\Bigtable\V2\RowFilter_Interleave, useGoogle\Cloud\Bigtable\V2\RowFilter\Interleaveinstead.Google\Cloud\Bigtable\V2\ReadRowsResponse_CellChunk, useGoogle\Cloud\Bigtable\V2\ReadRowsResponse\CellChunkinstead.Google\Cloud\Bigtable\Admin\V2\AppProfile_MultiClusterRoutingUseAny, useGoogle\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAnyinstead.Google\Cloud\Bigtable\Admin\V2\AppProfile_SingleClusterRouting, useGoogle\Cloud\Bigtable\Admin\V2\AppProfile\SingleClusterRoutinginstead.Google\Cloud\Bigtable\Admin\V2\Backup_State, useGoogle\Cloud\Bigtable\Admin\V2\Backup\Stateinstead.Google\Cloud\Bigtable\Admin\V2\Cluster_ClusterAutoscalingConfig, useGoogle\Cloud\Bigtable\Admin\V2\Cluster\ClusterAutoscalingConfiginstead.Google\Cloud\Bigtable\Admin\V2\Cluster_ClusterConfig, useGoogle\Cloud\Bigtable\Admin\V2\Cluster\ClusterConfiginstead.Google\Cloud\Bigtable\Admin\V2\Cluster_EncryptionConfig, useGoogle\Cloud\Bigtable\Admin\V2\Cluster\EncryptionConfiginstead.Google\Cloud\Bigtable\Admin\V2\Cluster_State, useGoogle\Cloud\Bigtable\Admin\V2\Cluster\Stateinstead.Google\Cloud\Bigtable\Admin\V2\CreateClusterMetadata_TableProgress, useGoogle\Cloud\Bigtable\Admin\V2\CreateClusterMetadata\TableProgressinstead.Google\Cloud\Bigtable\Admin\V2\CreateClusterMetadata_TableProgress_State, useGoogle\Cloud\Bigtable\Admin\V2\CreateClusterMetadata\TableProgress\Stateinstead.Google\Cloud\Bigtable\Admin\V2\CreateTableRequest_Split, useGoogle\Cloud\Bigtable\Admin\V2\CreateTableRequest\Splitinstead.Google\Cloud\Bigtable\Admin\V2\EncryptionInfo_EncryptionType, useGoogle\Cloud\Bigtable\Admin\V2\EncryptionInfo\EncryptionTypeinstead.Google\Cloud\Bigtable\Admin\V2\GcRule_Intersection, useGoogle\Cloud\Bigtable\Admin\V2\GcRule\Intersectioninstead.Google\Cloud\Bigtable\Admin\V2\GcRule_Union, useGoogle\Cloud\Bigtable\Admin\V2\GcRule\Unioninstead.Google\Cloud\Bigtable\Admin\V2\Instance_State, useGoogle\Cloud\Bigtable\Admin\V2\Instance\Stateinstead.Google\Cloud\Bigtable\Admin\V2\Instance_Type, useGoogle\Cloud\Bigtable\Admin\V2\Instance\Typeinstead.Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest_Modification, useGoogle\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest\Modificationinstead.Google\Cloud\Bigtable\Admin\V2\Snapshot_State, useGoogle\Cloud\Bigtable\Admin\V2\Snapshot\Stateinstead.Google\Cloud\Bigtable\Admin\V2\Table_ClusterState, useGoogle\Cloud\Bigtable\Admin\V2\Table\ClusterStateinstead.Google\Cloud\Bigtable\Admin\V2\Table_ClusterState_ReplicationState, useGoogle\Cloud\Bigtable\Admin\V2\Table\ClusterState\ReplicationStateinstead.Google\Cloud\Bigtable\Admin\V2\Table_TimestampGranularity, useGoogle\Cloud\Bigtable\Admin\V2\Table\TimestampGranularityinstead.Google\Cloud\Bigtable\Admin\V2\Table_View, useGoogle\Cloud\Bigtable\Admin\V2\Table\Viewinstead.