Skip to content

Commit 8d96188

Browse files
authored
Merge pull request #69 from thatsafunnyname/patch-8
Show in the cloud examples how to use bucket other than with prefix "rockset."
2 parents 1aa53e9 + bfa8b7f commit 8d96188

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

cloud/examples/clone_example.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Status CloneDB(const std::string& clone_name, const std::string& src_bucket,
6565
std::string persistent_cache = "";
6666

6767
// create a bucket name for debugging purposes
68-
const std::string bucketName = "rockset." + kBucketSuffix;
68+
const std::string bucketName = cloud_env->get()->GetSrcBucketName();
6969

7070
// open clone
7171
DBCloud* db;
@@ -102,9 +102,14 @@ int main() {
102102
char* user = getenv("USER");
103103
kBucketSuffix.append(user);
104104

105+
const std::string bucketPrefix = "rockset.";
105106
// create a bucket name for debugging purposes
106-
const std::string bucketName = "rockset." + kBucketSuffix;
107+
const std::string bucketName = bucketPrefix + kBucketSuffix;
107108

109+
// Needed if using bucket prefix other than the default "rockset."
110+
cloud_env_options.src_bucket.SetBucketName(kBucketSuffix,bucketPrefix);
111+
cloud_env_options.dest_bucket.SetBucketName(kBucketSuffix,bucketPrefix);
112+
108113
// Create a new AWS cloud env Status
109114
CloudEnv* cenv;
110115
Status s =

cloud/examples/cloud_dump.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@ int main() {
4242
char* user = getenv("USER");
4343
kBucketSuffix.append(user);
4444

45+
// "rockset." is the default bucket prefix
46+
const std::string bucketPrefix = "rockset.";
47+
cloud_env_options.src_bucket.SetBucketName(kBucketSuffix,bucketPrefix);
48+
cloud_env_options.dest_bucket.SetBucketName(kBucketSuffix,bucketPrefix);
49+
4550
// create a bucket name for debugging purposes
46-
const std::string bucketName = "rockset." + kBucketSuffix;
51+
const std::string bucketName = bucketPrefix + kBucketSuffix;
4752

4853
// Create a new AWS cloud env Status
4954
CloudEnv* cenv;

cloud/examples/cloud_durable_example.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,14 @@ int main() {
4545
char* user = getenv("USER");
4646
kBucketSuffix.append(user);
4747

48-
// create a bucket name for debugging purposes
49-
const std::string bucketName = "rockset." + kBucketSuffix;
48+
// "rockset." is the default bucket prefix
49+
const std::string bucketPrefix = "rockset.";
50+
cloud_env_options.src_bucket.SetBucketName(kBucketSuffix,bucketPrefix);
51+
cloud_env_options.dest_bucket.SetBucketName(kBucketSuffix,bucketPrefix);
5052

53+
// create a bucket name for debugging purposes
54+
const std::string bucketName = bucketPrefix + kBucketSuffix;
55+
5156
// Create a new AWS cloud env Status
5257
CloudEnv* cenv;
5358
Status s =

0 commit comments

Comments
 (0)