Skip to content

Conversation

Yavor16
Copy link
Contributor

@Yavor16 Yavor16 commented Oct 15, 2025

No description provided.

<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-nio</artifactId>
<scope>compile</scope>
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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?


public class ObjectStoreUtil {

private static final Logger LOGGER = LoggerFactory.getLogger(ObjectStoreUtil.class);
Copy link
Contributor

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

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
61.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

try {
storage.createFrom(blobInfo, content);
return;
} catch (IOException e) {
Copy link
Contributor

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(),
Copy link
Contributor

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)
Copy link
Contributor

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

Comment on lines +111 to +116
public Storage createObjectStoreStorage(Map<String, Object> credentials) {
return StorageOptions.newBuilder()
.setCredentials(getGcpCredentialsSupplier(credentials))
.build()
.getService();
}
Copy link
Contributor

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?

Copy link
Contributor

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();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants