Skip to content

Commit

Permalink
upgrade java-storage (#1001)
Browse files Browse the repository at this point in the history
  • Loading branch information
singhravidutt authored May 20, 2023
1 parent ed9a51e commit 33dc155
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions cloudbuild/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ steps:
- 'VCS_COMMIT_ID=$COMMIT_SHA'
- 'VCS_TAG=$TAG_NAME'
- 'CI_BUILD_ID=$BUILD_ID'
- 'GCS_TEST_DIRECT_PATH_PREFERRED=false'

# Tests take on average 25 minutes to run
timeout: 2400s
Expand Down
2 changes: 2 additions & 0 deletions gcs/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@

1. Upgrade Hadoop to 3.3.5.

1. Upgrade java-storage to 2.22.2

### 2.2.2 - 2021-06-25

1. Support footer prefetch in gRPC read channel.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public static Configuration getTestConfig() {
"fs.gs.auth.service.account.json.keyfile", testConf.getServiceAccountJsonKeyFile());
}

config.setBoolean("fs.gs.grpc.directpath.enable", testConf.isDirectPathPreferred());

return config;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public abstract class TestConfiguration {
public static final String GCS_TEST_PROJECT_ID = "GCS_TEST_PROJECT_ID";
public static final String GCS_TEST_JSON_KEYFILE = "GCS_TEST_JSON_KEYFILE";

public static final String GCS_TEST_DIRECT_PATH_PREFERRED = "GCS_TEST_DIRECT_PATH_PREFERRED";

/** Environment-based test configuration. */
public static class EnvironmentBasedTestConfiguration extends TestConfiguration {
@Override
Expand All @@ -32,6 +34,16 @@ public String getProjectId() {
public String getServiceAccountJsonKeyFile() {
return System.getenv(GCS_TEST_JSON_KEYFILE);
}

@Override
public boolean isDirectPathPreferred() {
String envVar = System.getenv(GCS_TEST_DIRECT_PATH_PREFERRED);
// if env variable is not configured default behaviour is to attempt directPath
if (envVar == null) {
return true;
}
return Boolean.parseBoolean(envVar);
}
}

public static TestConfiguration getInstance() {
Expand All @@ -45,4 +57,6 @@ private static class LazyHolder {
public abstract String getProjectId();

public abstract String getServiceAccountJsonKeyFile();

public abstract boolean isDirectPathPreferred();
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public void before() throws Exception {
GoogleCloudStorageOptions.builder()
.setAppName(GoogleCloudStorageTestHelper.APP_NAME)
.setProjectId(projectId)
.setDirectPathPreferred(TestConfiguration.getInstance().isDirectPathPreferred())
.setWriteChannelOptions(
AsyncWriteChannelOptions.builder()
.setUploadChunkSize(64 * 1024 * 1024)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public static Credentials getCredentials() throws IOException {
public static GoogleCloudStorageOptions.Builder getStandardOptionBuilder() {
return GoogleCloudStorageOptions.builder()
.setAppName(GoogleCloudStorageTestHelper.APP_NAME)
.setDirectPathPreferred(TestConfiguration.getInstance().isDirectPathPreferred())
.setProjectId(checkNotNull(TestConfiguration.getInstance().getProjectId()));
}

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@
<google.auth.version>1.14.0</google.auth.version>
<google.auto-value.version>1.10.1</google.auto-value.version>
<google.cloud-core.verion>2.9.0</google.cloud-core.verion>
<google.cloud-storage.bom.version>2.22.1</google.cloud-storage.bom.version>
<google.cloud-storage.bom.version>2.22.2</google.cloud-storage.bom.version>
<google.error-prone.version>2.16</google.error-prone.version>
<google.flogger.version>0.7.4</google.flogger.version>
<google.gax.version>2.20.1</google.gax.version>
<google.gax.version>2.27.0</google.gax.version>
<google.gson.version>2.10</google.gson.version>
<google.guava.version>31.1-jre</google.guava.version>
<google.http-client.version>1.42.3</google.http-client.version>
Expand Down
2 changes: 0 additions & 2 deletions tools/run_integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,5 @@ fi
export GCS_TEST_JSON_KEYFILE
export HDFS_ROOT=file:///tmp
export RUN_INTEGRATION_TESTS=true
# Env variable to enable direct path over gRPC
export GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS=true

./mvnw -B -e -T1C -Pintegration-test clean verify "${@:3}"

0 comments on commit 33dc155

Please sign in to comment.