Skip to content

Commit

Permalink
Merge b924108 into d560de8
Browse files Browse the repository at this point in the history
  • Loading branch information
rtitle committed Jul 3, 2019
2 parents d560de8 + b924108 commit 3a48e6a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ Latest SBT dependency: `"org.broadinstitute.dsde.workbench" %% "workbench-metric

Contains utility functions for talking to Google APIs and DAOs for Google PubSub, Google Directory, Google IAM, and Google BigQuery.

Latest SBT dependency: `"org.broadinstitute.dsde.workbench" %% "workbench-google" % "0.19-2aaa9b5"`
Latest SBT dependency: `"org.broadinstitute.dsde.workbench" %% "workbench-google" % "0.19-TRAVIS-REPLACE-ME"`

To depend on the `MockGoogle*` classes, additionally depend on:

`"org.broadinstitute.dsde.workbench" %% "workbench-google" % "0.19-2aaa9b5" % "test" classifier "tests"`
`"org.broadinstitute.dsde.workbench" %% "workbench-google" % "0.19-TRAVIS-REPLACE-ME" % "test" classifier "tests"`

[Changelog](google/CHANGELOG.md)

Expand Down
2 changes: 1 addition & 1 deletion google/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file documents changes to the `workbench-google` library, including notes o

## 0.19

SBT dependency: `"org.broadinstitute.dsde.workbench" %% "workbench-google" % "0.19-2aaa9b5"`
SBT dependency: `"org.broadinstitute.dsde.workbench" %% "workbench-google" % "0.19-TRAVIS-REPLACE-ME"`

- Moved `org.broadinstitute.dsde.workbench.google.GoogleKmsService` to `org.broadinstitute.dsde.workbench.google2.GoogleKmsService`
- Add `getProjectLabels` to `GoogleProjectDAO`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,19 @@ class HttpGoogleStorageDAO(appName: String,

private def storeObject(bucketName: GcsBucketName, objectName: GcsObjectName, content: AbstractInputStreamContent): Future[Unit] = {
val storageObject = new StorageObject().setName(objectName.value)
val inserter = storage.objects().insert(bucketName.value, storageObject, content)
inserter.getMediaHttpUploader.setDirectUploadEnabled(true)

retryWhen500orGoogleError(() => {
val inserter = storage.objects().insert(bucketName.value, storageObject, content)
inserter.getMediaHttpUploader.setDirectUploadEnabled(true)

executeGoogleRequest(inserter)
})
}

override def getObject(bucketName: GcsBucketName, objectName: GcsObjectName): Future[Option[ByteArrayOutputStream]] = {
val getter = storage.objects().get(bucketName.value, objectName.value)
getter.getMediaHttpDownloader.setDirectDownloadEnabled(true)

retryWhen500orGoogleError(() => {
try {
val getter = storage.objects().get(bucketName.value, objectName.value)
getter.getMediaHttpDownloader.setDirectDownloadEnabled(true)
val objectBytes = new ByteArrayOutputStream()
getter.executeMediaAndDownloadTo(objectBytes)
executeGoogleRequest(getter)
Expand Down

0 comments on commit 3a48e6a

Please sign in to comment.