Skip to content

Commit 69db70f

Browse files
authored
chore: [Storage] update turbo copy and filenames (GoogleCloudPlatform#1601)
Updated turbo replication samples and tests
1 parent 87b0a94 commit 69db70f

File tree

5 files changed

+21
-19
lines changed

5 files changed

+21
-19
lines changed

storage/src/create_bucket_turbo_replication.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
use Google\Cloud\Storage\StorageClient;
2828

2929
/**
30-
* Create a Cloud Storage Bucket with Turbo Replication set to `ASYNC_TURBO`.
30+
* Create a Cloud Storage bucket with the recovery point objective (RPO) set to `ASYNC_TURBO`.
3131
* The bucket must be a dual-region bucket for this setting to take effect.
3232
*
3333
* @param string $bucketName The name of your Cloud Storage bucket.
@@ -49,7 +49,7 @@ function create_bucket_turbo_replication($bucketName, $location = 'nam4')
4949
'location' => $location,
5050
'rpo' => $rpo
5151
]);
52-
printf('Bucket with Turbo Replication set to \'ASYNC_TURBO\' created: %s' . PHP_EOL, $bucket->name());
52+
printf('Bucket with recovery point objective (RPO) set to \'ASYNC_TURBO\' created: %s' . PHP_EOL, $bucket->name());
5353
}
5454
# [END storage_create_bucket_turbo_replication]
5555

storage/src/get_turbo_replication_status.php renamed to storage/src/get_rpo.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
use Google\Cloud\Storage\StorageClient;
2828

2929
/**
30-
* Get the bucket's Turbo Replication(rpo) setting.
30+
* Get the bucket's recovery point objective (RPO) setting.
3131
*
3232
* @param string $bucketName the name of your Cloud Storage bucket.
3333
*/
34-
function get_turbo_replication_status($bucketName)
34+
function get_rpo($bucketName)
3535
{
3636
// $bucketName = 'my-bucket';
3737

storage/src/set_turbo_replication_async_turbo.php renamed to storage/src/set_rpo_async_turbo.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
*
3333
* @param string $bucketName the name of your Cloud Storage bucket.
3434
*/
35-
function set_turbo_replication_async_turbo($bucketName)
35+
function set_rpo_async_turbo($bucketName)
3636
{
3737
// $bucketName = 'my-bucket';
3838

@@ -45,7 +45,7 @@ function set_turbo_replication_async_turbo($bucketName)
4545
]);
4646

4747
printf(
48-
'Turbo Replication has been set to ASYNC_TURBO for %s.' . PHP_EOL,
48+
'The replication behavior or recovery point objective (RPO) has been set to ASYNC_TURBO for %s.' . PHP_EOL,
4949
$bucketName
5050
);
5151
}

storage/src/set_turbo_replication_default.php renamed to storage/src/set_rpo_default.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
use Google\Cloud\Storage\StorageClient;
2828

2929
/**
30-
* Set the bucket's Turbo Replication(rpo) setting to `DEFAULT`.
30+
* Set the bucket's replication behavior or recovery point objective (RPO) to `DEFAULT`.
3131
*
3232
* @param string $bucketName the name of your Cloud Storage bucket.
3333
*/
34-
function set_turbo_replication_default($bucketName)
34+
function set_rpo_default($bucketName)
3535
{
3636
// $bucketName = 'my-bucket';
3737

@@ -46,7 +46,7 @@ function set_turbo_replication_default($bucketName)
4646
]);
4747

4848
printf(
49-
'Turbo Replication has been set to DEFAULT for %s.' . PHP_EOL,
49+
'The replication behavior or recovery point objective (RPO) has been set to DEFAULT for %s.' . PHP_EOL,
5050
$bucketName
5151
);
5252
}

storage/test/TurboReplicationTest.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
use PHPUnit\Framework\TestCase;
2323

2424
/**
25-
* Unit tests for Turbo Replication(RPO)
25+
* Unit tests to manage a bucket's recovery point objective (RPO). An RPO value set to `DEFAULT`
26+
* indicates the default replication behavior is applied to the bucket.
27+
* An RPO value set to `ASYNC_TURBO` indicates turbo replication is applied to the bucket.
2628
*/
2729
class TurboReplicationTest extends TestCase
2830
{
@@ -52,7 +54,7 @@ public function testCreateBucketWithTurboReplication()
5254

5355
$this->assertStringContainsString(
5456
sprintf(
55-
'Bucket with Turbo Replication set to \'ASYNC_TURBO\' created: %s',
57+
'Bucket with recovery point objective (RPO) set to \'ASYNC_TURBO\' created: %s',
5658
self::$bucketName
5759
),
5860
$output
@@ -63,9 +65,9 @@ public function testCreateBucketWithTurboReplication()
6365
}
6466

6567
/** @depends testCreateBucketWithTurboReplication */
66-
public function testGetTurboReplicationStatus()
68+
public function testGetRpo()
6769
{
68-
$output = self::runFunctionSnippet('get_turbo_replication_status', [
70+
$output = self::runFunctionSnippet('get_rpo', [
6971
self::$bucketName,
7072
]);
7173

@@ -79,15 +81,15 @@ public function testGetTurboReplicationStatus()
7981
}
8082

8183
/** @depends testCreateBucketWithTurboReplication */
82-
public function testSetTurboReplicationStatusDefault()
84+
public function testSetRpoDefault()
8385
{
84-
$output = self::runFunctionSnippet('set_turbo_replication_default', [
86+
$output = self::runFunctionSnippet('set_rpo_default', [
8587
self::$bucketName,
8688
]);
8789

8890
$this->assertEquals(
8991
sprintf(
90-
'Turbo Replication has been set to DEFAULT for %s.' . PHP_EOL,
92+
'The replication behavior or recovery point objective (RPO) has been set to DEFAULT for %s.' . PHP_EOL,
9193
self::$bucketName
9294
),
9395
$output
@@ -98,15 +100,15 @@ public function testSetTurboReplicationStatusDefault()
98100
}
99101

100102
/** @depends testCreateBucketWithTurboReplication */
101-
public function testSetTurboReplicationStatusAsyncTurbo()
103+
public function testSetRpoAsyncTurbo()
102104
{
103-
$output = self::runFunctionSnippet('set_turbo_replication_async_turbo', [
105+
$output = self::runFunctionSnippet('set_rpo_async_turbo', [
104106
self::$bucketName,
105107
]);
106108

107109
$this->assertEquals(
108110
sprintf(
109-
'Turbo Replication has been set to ASYNC_TURBO for %s.' . PHP_EOL,
111+
'The replication behavior or recovery point objective (RPO) has been set to ASYNC_TURBO for %s.' . PHP_EOL,
110112
self::$bucketName
111113
),
112114
$output

0 commit comments

Comments
 (0)