-
Notifications
You must be signed in to change notification settings - Fork 44
Add GCP Objectstore SDK instead of JClouds #1723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
LMCROSSITXSADEPLOY-3313
7b20da8
to
ac576b8
Compare
<dependency> | ||
<groupId>com.google.cloud</groupId> | ||
<artifactId>google-cloud-nio</artifactId> | ||
<scope>compile</scope> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compile is default, is it needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without it I can't build the project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's strange, might the dependency be already added or have other scope, maybe transitive?
multiapps-controller-persistence/src/main/java/module-info.java
Outdated
Show resolved
Hide resolved
...va/org/cloudfoundry/multiapps/controller/persistence/services/GcpObjectStoreFileStorage.java
Outdated
Show resolved
Hide resolved
...rg/cloudfoundry/multiapps/controller/persistence/services/GcpObjectStoreFileStorageTest.java
Outdated
Show resolved
Hide resolved
...va/org/cloudfoundry/multiapps/controller/persistence/services/GcpObjectStoreFileStorage.java
Outdated
Show resolved
Hide resolved
...va/org/cloudfoundry/multiapps/controller/persistence/services/GcpObjectStoreFileStorage.java
Outdated
Show resolved
Hide resolved
|
||
public class ObjectStoreUtil { | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(ObjectStoreUtil.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the log value of these classes was DEBUG:
org.cloudfoundry.multiapps.controller.persistence.services.ObjectStoreFileStorage: DEBUG
consider adding it in manifest + product cf hcp
...rg/cloudfoundry/multiapps/controller/persistence/services/GcpObjectStoreFileStorageTest.java
Outdated
Show resolved
Hide resolved
...y/multiapps/controller/web/configuration/bean/factory/ObjectStoreFileStorageFactoryBean.java
Outdated
Show resolved
Hide resolved
|
try { | ||
storage.createFrom(blobInfo, content); | ||
return; | ||
} catch (IOException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about the other StorageException that gcp throws?
public <T> T processArchiveEntryContent(FileContentToProcess fileContentToProcess, FileContentProcessor<T> fileContentProcessor) | ||
throws FileStorageException { | ||
FileEntry fileEntry = ObjectStoreUtil.createFileEntry(fileContentToProcess.getSpaceGuid(), fileContentToProcess.getGuid()); | ||
InputStream res = getBlobPayloadWithOffset(fileEntry, fileContentToProcess.getStartOffset(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why called res?
return processContent(fileContentProcessor, res); | ||
} | ||
|
||
private <T> T processContent(FileContentProcessor<T> fileContentProcessor, InputStream res) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename res
to something related to stream
public Storage createObjectStoreStorage(Map<String, Object> credentials) { | ||
return StorageOptions.newBuilder() | ||
.setCredentials(getGcpCredentialsSupplier(credentials)) | ||
.build() | ||
.getService(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StorageOptions and GCP provider has a built in retry strategy.
We can utilize it and remove the custom retry strategies? I mean we can move Storage creation in the GCP client and in the info creator only to provide the necessary credentials. We're binding this class with gcp classes now.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StorageOptions.newBuilder()
.setCredentials(getGcpCredentialsSupplier(credentials))
.setRetrySettings()
.build()
.getService();
No description provided.