-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Should Blobs and Buckets be stateless or keep a reference to a StorageService ? #55
Comments
I think that this is nice but consider it in the level of a syntactic sugar. I don't think an extra reference to Storage service would be a problem. Two more things to consider are:
|
I am taking over on this. This is perfectly doable for
I would personally prefer solution 1. |
I also think that Bucket should return (functional) Blob. Another option would be remove the constrain that Now the question is how do we create storageService upon de-serialization of that implementation I think it is reasonable to ask If we do so, we could technically even make the functional What do you think? |
I am not sure I would want functional classes as Blob, Bucket or XXX Service to be serializable. I think having serializable BlobInfo and BucketInfo is good as the classes are semantically containers or metadata. But for XXX Service, Blob and Bucker I struggle to find reasons for making them serializable. |
Yes, we don't have to make or declare them as serializable, the other approach was to transform them on the fly and remove the requirement of having T serializable. Any opinion on that? |
(Sorry, closed by mistake) |
Yes, it would still need to make It is actually very common to have a serialize container but not to force its elements compile time |
Oh I see! |
I don't see a problem with that, but I don't think it is a must in this case. |
No it's ok then. I prefer having a getFactory method in XXX Service rather then passing the factory to Blob and Bucket. I'll work on a PR that does this before moving back Blob and Bucket. |
Coming back to this after some thinking. PS: sorry for being a bit annoying on this but I feel like we should close this issue for good :) |
@mziccard I think that is a fine plan. We may later not need BlobListResult but you should not be blocked by it. |
Fixed by #171 |
* chore: update dependencies for regapic * add more dependencies and trigger comment * update goldens * fix indentation * remove duplicate gax-httpjson dependency * remove duplicated dependencies Source-Link: googleapis/synthtool@fa54eb2 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:1ec28a46062b19135b11178ceee60231e5f5a92dab454e23ae0aab72cd875906
Source-Link: googleapis/synthtool@7a220e2 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:6d4e3a15c62cfdcb823d60e16da7521e7c6fc00eba07c8ff12e4de9924a57d28
…0.3.0 (#55) * chore(deps): update dependency com.google.cloud:google-cloud-run to v0.3.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ## [0.3.1](googleapis/java-video-stitcher@v0.3.0...v0.3.1) (2022-07-13) ### Bug Fixes * enable longpaths support for windows test ([#1485](https://github.com/googleapis/java-video-stitcher/issues/1485)) ([#54](googleapis/java-video-stitcher#54)) ([9665282](googleapis/java-video-stitcher@9665282)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
…onfig to v1.5.3 (#55) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `1.5.1` -> `1.5.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.3/compatibility-slim/1.5.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.3/confidence-slim/1.5.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>googleapis/java-shared-config</summary> ### [`v1.5.3`](https://togithub.com/googleapis/java-shared-config/blob/HEAD/CHANGELOG.md#​153-httpsgithubcomgoogleapisjava-shared-configcomparev152v153-2022-07-27) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v1.5.2...v1.5.3) ##### Dependencies - update dependency org.junit.vintage:junit-vintage-engine to v5.9.0 ([#​497](https://togithub.com/googleapis/java-shared-config/issues/497)) ([1fc6ab4](https://togithub.com/googleapis/java-shared-config/commit/1fc6ab445624cd4f9c8b161d109f346a9e5ed09a)) - Update doclet to latest version 1.6.0 ([38fb7c3](https://togithub.com/googleapis/java-shared-config/commit/38fb7c3957fb6c9b2da10f9e463cc93a8b80a3a4)) ### [`v1.5.2`](https://togithub.com/googleapis/java-shared-config/blob/HEAD/CHANGELOG.md#​152-httpsgithubcomgoogleapisjava-shared-configcomparev151v152-2022-07-25) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v1.5.1...v1.5.2) ##### Dependencies - update dependency com.puppycrawl.tools:checkstyle to v10 ([#​435](https://togithub.com/googleapis/java-shared-config/issues/435)) ([bfc8ce1](https://togithub.com/googleapis/java-shared-config/commit/bfc8ce1deca6292147d002d3afe22a09840aa5d6)) - update dependency org.graalvm.buildtools:junit-platform-native to v0.9.13 ([#​488](https://togithub.com/googleapis/java-shared-config/issues/488)) ([39b91ee](https://togithub.com/googleapis/java-shared-config/commit/39b91ee1283f0a5fbbe63e8bfd1ec97ab4ab377e)) - update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.13 ([#​489](https://togithub.com/googleapis/java-shared-config/issues/489)) ([cc3bcfa](https://togithub.com/googleapis/java-shared-config/commit/cc3bcfa2d6717441a8d5b5048fa78c2cf7aabf2b)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bare-metal-solution). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMzUuMSIsInVwZGF0ZWRJblZlciI6IjMyLjEzNS4xIn0=-->
…i-cloud to v0.2.3 (#55) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-gke-multi-cloud](https://togithub.com/googleapis/java-gke-multi-cloud) | `0.2.2` -> `0.2.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-gke-multi-cloud/0.2.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-gke-multi-cloud/0.2.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-gke-multi-cloud/0.2.3/compatibility-slim/0.2.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-gke-multi-cloud/0.2.3/confidence-slim/0.2.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-gke-multi-cloud). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xOTQuMyIsInVwZGF0ZWRJblZlciI6IjMyLjE5NC4zIn0=-->
…1575) (#55) Source-Link: googleapis/synthtool@2e9ac19 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:8175681a918181d306d9c370d3262f16b4c724cc73d74111b7d42fc985ca7f93
🤖 I have created a release *beep* *boop* --- ## [0.2.3](https://togithub.com/googleapis/java-dataform/compare/v0.2.2...v0.2.3) (2022-10-03) ### Dependencies * Update dependency click to v8.1.3 ([#42](https://togithub.com/googleapis/java-dataform/issues/42)) ([b1c8e02](https://togithub.com/googleapis/java-dataform/commit/b1c8e02cd4cf529bb65e0cc774856e55bde8d205)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.4 ([#57](https://togithub.com/googleapis/java-dataform/issues/57)) ([9784644](https://togithub.com/googleapis/java-dataform/commit/978464492b63b0529e8545fdcbdb23f0f0ad100f)) * Update dependency google-api-core to v2.10.1 ([#43](https://togithub.com/googleapis/java-dataform/issues/43)) ([d871cda](https://togithub.com/googleapis/java-dataform/commit/d871cda2d17c0f05e4da8c7cfd28a90867bd8a71)) * Update dependency google-auth to v2.12.0 ([#44](https://togithub.com/googleapis/java-dataform/issues/44)) ([712cbdb](https://togithub.com/googleapis/java-dataform/commit/712cbdbd8e9ee2dd1e2003f594bb47ea686580fb)) * Update dependency google-cloud-storage to v2.5.0 ([#45](https://togithub.com/googleapis/java-dataform/issues/45)) ([23085e2](https://togithub.com/googleapis/java-dataform/commit/23085e2dd32797ab299a56a74af9eaf68212b278)) * Update dependency google-crc32c to v1.5.0 ([#46](https://togithub.com/googleapis/java-dataform/issues/46)) ([afbdac2](https://togithub.com/googleapis/java-dataform/commit/afbdac28c8059fb853f18f73d057e70fdc4e7cae)) * Update dependency importlib-metadata to v4.12.0 ([#47](https://togithub.com/googleapis/java-dataform/issues/47)) ([526c297](https://togithub.com/googleapis/java-dataform/commit/526c297655024e02323857b4a87c588cc3e3e99f)) * Update dependency jeepney to v0.8.0 ([#48](https://togithub.com/googleapis/java-dataform/issues/48)) ([fa287dd](https://togithub.com/googleapis/java-dataform/commit/fa287dd7b7a3509b014cccf43cb1d2d38bc14f62)) * Update dependency markupsafe to v2.1.1 ([#49](https://togithub.com/googleapis/java-dataform/issues/49)) ([9c10205](https://togithub.com/googleapis/java-dataform/commit/9c1020586eff34b1df7d39d47d9ce02245e8f2d8)) * Update dependency protobuf to v3.20.2 ([#50](https://togithub.com/googleapis/java-dataform/issues/50)) ([3d756c7](https://togithub.com/googleapis/java-dataform/commit/3d756c77e2e25f918843e1b3ea99164d3ac44190)) * Update dependency pyjwt to v2.5.0 ([#51](https://togithub.com/googleapis/java-dataform/issues/51)) ([d39606e](https://togithub.com/googleapis/java-dataform/commit/d39606ee46a941ebea245dbc6a8f857fe32b2f19)) * Update dependency requests to v2.28.1 ([#52](https://togithub.com/googleapis/java-dataform/issues/52)) ([c46d8a6](https://togithub.com/googleapis/java-dataform/commit/c46d8a62a77558a2ab57b3b6e5303c7930a5e1d6)) * Update dependency typing-extensions to v4.3.0 ([#53](https://togithub.com/googleapis/java-dataform/issues/53)) ([33f7a3d](https://togithub.com/googleapis/java-dataform/commit/33f7a3d971f056fa5b074b77fc1a16a97d0b491b)) * Update dependency zipp to v3.8.1 ([#54](https://togithub.com/googleapis/java-dataform/issues/54)) ([518a68d](https://togithub.com/googleapis/java-dataform/commit/518a68d1932da0a2a1d1ca8de689536f559f2999)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [0.3.1](https://togithub.com/googleapis/java-apigee-registry/compare/v0.3.0...v0.3.1) (2022-10-03) ### Bug Fixes * Additional error codes added to service configuration for retry ([#39](https://togithub.com/googleapis/java-apigee-registry/issues/39)) ([55a9b41](https://togithub.com/googleapis/java-apigee-registry/commit/55a9b417cf04575d2070ad026e5648a494fe076a)) ### Dependencies * Update dependency certifi to v2022.9.24 ([#48](https://togithub.com/googleapis/java-apigee-registry/issues/48)) ([1c6ae70](https://togithub.com/googleapis/java-apigee-registry/commit/1c6ae70cb9ff9e7e98d83ce472ae5526d08f9a35)) * Update dependency charset-normalizer to v2.1.1 ([#53](https://togithub.com/googleapis/java-apigee-registry/issues/53)) ([2130079](https://togithub.com/googleapis/java-apigee-registry/commit/21300793a908ed41c535813ee15ec94b5f5ef018)) * Update dependency click to v8.1.3 ([#54](https://togithub.com/googleapis/java-apigee-registry/issues/54)) ([cf3458b](https://togithub.com/googleapis/java-apigee-registry/commit/cf3458bd2972f3db75c8cbf834be0b383d9e74a0)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#42](https://togithub.com/googleapis/java-apigee-registry/issues/42)) ([38cb4f9](https://togithub.com/googleapis/java-apigee-registry/commit/38cb4f9932c3d6cb4c36d3f61922fd613409607f)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 ([#44](https://togithub.com/googleapis/java-apigee-registry/issues/44)) ([ddaed09](https://togithub.com/googleapis/java-apigee-registry/commit/ddaed0964ae57cd7b799b9acf7b202595af4c781)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.4 ([#65](https://togithub.com/googleapis/java-apigee-registry/issues/65)) ([882e36b](https://togithub.com/googleapis/java-apigee-registry/commit/882e36b2d21ff601f569aa79dfe840cd41bf0438)) * Update dependency gcp-releasetool to v1.8.8 ([#49](https://togithub.com/googleapis/java-apigee-registry/issues/49)) ([3a927a3](https://togithub.com/googleapis/java-apigee-registry/commit/3a927a3df5a8cf5cfff79faede5387291a3d443e)) * Update dependency google-api-core to v2.10.1 ([#55](https://togithub.com/googleapis/java-apigee-registry/issues/55)) ([f841a07](https://togithub.com/googleapis/java-apigee-registry/commit/f841a07c0b1c2fa585f7e665208d6a6b7843c75c)) * Update dependency google-auth to v2.11.1 ([#50](https://togithub.com/googleapis/java-apigee-registry/issues/50)) ([7b450cb](https://togithub.com/googleapis/java-apigee-registry/commit/7b450cbeadc08b8dc26fbd4738ce47788a5cf330)) * Update dependency google-cloud-core to v2.3.2 ([#51](https://togithub.com/googleapis/java-apigee-registry/issues/51)) ([b7f1110](https://togithub.com/googleapis/java-apigee-registry/commit/b7f111014416ff76fa787085d0d0bc9ab47f9af6)) * Update dependency google-cloud-storage to v2.5.0 ([#56](https://togithub.com/googleapis/java-apigee-registry/issues/56)) ([f3799d3](https://togithub.com/googleapis/java-apigee-registry/commit/f3799d3d2d754ec89c784655d835ecaed4df3406)) * Update dependency google-crc32c to v1.5.0 ([#57](https://togithub.com/googleapis/java-apigee-registry/issues/57)) ([b978c7d](https://togithub.com/googleapis/java-apigee-registry/commit/b978c7d2bed23554998a9f0f047e7211ff37f906)) * Update dependency googleapis-common-protos to v1.56.4 ([#52](https://togithub.com/googleapis/java-apigee-registry/issues/52)) ([9e069f1](https://togithub.com/googleapis/java-apigee-registry/commit/9e069f1d96c78fdaedbf57a95d05ada18d57ea0f)) * Update dependency importlib-metadata to v4.12.0 ([#58](https://togithub.com/googleapis/java-apigee-registry/issues/58)) ([370bd1e](https://togithub.com/googleapis/java-apigee-registry/commit/370bd1eba82d820fe7156c276ee5e4a5cbf3f9e0)) * Update dependency jeepney to v0.8.0 ([#59](https://togithub.com/googleapis/java-apigee-registry/issues/59)) ([7a63034](https://togithub.com/googleapis/java-apigee-registry/commit/7a63034a2a194feed6dc7e8215c5063ad1454072)) * Update dependency jinja2 to v3.1.2 ([#60](https://togithub.com/googleapis/java-apigee-registry/issues/60)) ([4fe2b85](https://togithub.com/googleapis/java-apigee-registry/commit/4fe2b853af3c39d2c46efbdc5027cc34945a736c)) * Update dependency keyring to v23.9.3 ([#61](https://togithub.com/googleapis/java-apigee-registry/issues/61)) ([c8cf1c2](https://togithub.com/googleapis/java-apigee-registry/commit/c8cf1c29cab75b18ab67e372bf3d50b36a4b57e9)) * Update dependency markupsafe to v2.1.1 ([#62](https://togithub.com/googleapis/java-apigee-registry/issues/62)) ([98036ae](https://togithub.com/googleapis/java-apigee-registry/commit/98036ae98fa56eba73cccb88a2af726d20fb2a1d)) * Update dependency protobuf to v3.20.2 ([#63](https://togithub.com/googleapis/java-apigee-registry/issues/63)) ([aa9f0e7](https://togithub.com/googleapis/java-apigee-registry/commit/aa9f0e7cad3940fa02cd69c3b3c3e8c2938e0c1b)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Right now, it looks like our
Blob
andBucket
objects are stateless, in that they don't keep a reference to aStorageService
object. What this means is, given we have the following:The only way to interact with these objects is by keeping a reference to the
StorageService
:There's no way to do:
The purpose of this issue is to discuss whether or not these objects should hold a reference to the
StorageService
which would make things likeblob.getReadChannel()
orblob.delete()
possible rather than always callingstorage.getReadChannel(blob)
andstorage.delete(blob)
.The benefits of this are friendlier-looking code (IMO at least....). The downsides are (I think) serialization becomes a bit more confusing, and what does it mean to send one "
StorageService
-aware"Blob
into anotherStorageService
method, ie:I have no idea what the right answer is, but wanted to open the floor for discussion.
/cc @aozarov @jboynes
The text was updated successfully, but these errors were encountered: