beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject [1/2] beam git commit: Only use ASCII 'a' through 'z' for temporary Spanner tables
Date Thu, 29 Jun 2017 15:50:56 GMT
Repository: beam
Updated Branches:
  refs/heads/master 997bf4025 -> 4d41e25d8


Only use ASCII 'a' through 'z' for temporary Spanner tables


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/dbeba09b
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/dbeba09b
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/dbeba09b

Branch: refs/heads/master
Commit: dbeba09b0def871066753d96a2fb354bffe18c04
Parents: 997bf40
Author: Kenneth Knowles <klk@google.com>
Authored: Wed Jun 28 07:12:51 2017 -0700
Committer: Kenneth Knowles <klk@google.com>
Committed: Thu Jun 29 08:48:37 2017 -0700

----------------------------------------------------------------------
 .../org/apache/beam/sdk/io/gcp/spanner/SpannerReadIT.java |  8 +++++---
 .../apache/beam/sdk/io/gcp/spanner/SpannerWriteIT.java    | 10 +++++-----
 2 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/dbeba09b/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/SpannerReadIT.java
----------------------------------------------------------------------
diff --git a/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/SpannerReadIT.java
b/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/SpannerReadIT.java
index f5d7cbd..ca43b40 100644
--- a/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/SpannerReadIT.java
+++ b/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/SpannerReadIT.java
@@ -41,6 +41,7 @@ import org.apache.beam.sdk.transforms.Count;
 import org.apache.beam.sdk.values.PCollection;
 import org.apache.beam.sdk.values.PCollectionView;
 import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.commons.text.RandomStringGenerator;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
@@ -161,9 +162,10 @@ public class SpannerReadIT {
 
   private String generateDatabaseName() {
     String random =
-        RandomStringUtils.randomAlphanumeric(
-            MAX_DB_NAME_LENGTH - 1 - options.getDatabaseIdPrefix().length())
-            .toLowerCase();
+        new RandomStringGenerator.Builder()
+            .withinRange('a', 'z')
+            .build()
+            .generate(MAX_DB_NAME_LENGTH - 1 - options.getDatabaseIdPrefix().length());
     return options.getDatabaseIdPrefix() + "-" + random;
   }
 }

http://git-wip-us.apache.org/repos/asf/beam/blob/dbeba09b/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/SpannerWriteIT.java
----------------------------------------------------------------------
diff --git a/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/SpannerWriteIT.java
b/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/SpannerWriteIT.java
index 33532c9..613756c 100644
--- a/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/SpannerWriteIT.java
+++ b/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/SpannerWriteIT.java
@@ -33,7 +33,6 @@ import com.google.cloud.spanner.SpannerOptions;
 import com.google.cloud.spanner.Statement;
 import com.google.spanner.admin.database.v1.CreateDatabaseMetadata;
 import java.util.Collections;
-
 import org.apache.beam.sdk.io.GenerateSequence;
 import org.apache.beam.sdk.options.Default;
 import org.apache.beam.sdk.options.Description;
@@ -43,7 +42,6 @@ import org.apache.beam.sdk.testing.TestPipelineOptions;
 import org.apache.beam.sdk.transforms.DoFn;
 import org.apache.beam.sdk.transforms.ParDo;
 import org.apache.commons.text.RandomStringGenerator;
-
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
@@ -116,9 +114,11 @@ public class SpannerWriteIT {
   }
 
   private String generateDatabaseName() {
-    String random = new RandomStringGenerator.Builder().build()
-        .generate(MAX_DB_NAME_LENGTH - 1 - options.getDatabaseIdPrefix().length())
-        .toLowerCase();
+    String random =
+        new RandomStringGenerator.Builder()
+            .withinRange('a', 'z')
+            .build()
+            .generate(MAX_DB_NAME_LENGTH - 1 - options.getDatabaseIdPrefix().length());
     return options.getDatabaseIdPrefix() + "-" + random;
   }
 


Mime
View raw message