Repository navigation
Refactored JCloud Tiered Storage - #2865
david-streamlio wants to merge 12 commits into
Conversation
|
rerun integration tests |
|
@david-streamlio Seems the integration tests also need taking care of. |
ivankelly
left a comment
There was a problem hiding this comment.
Got about 25% through before time ran out. Lots of unrelated changes that should be in a their own cleanup patch, but i guess it's ok this time. Will come back to it later.
| import java.io.IOException; | ||
| import java.io.InputStream; | ||
|
|
||
| /** |
There was a problem hiding this comment.
This change, along with several others you have flagged as "unrelated" are actually changes made to conform with the check style rules defined in the pulsar/buildtools/src/main/resources/pulsar/checkstyle.xml file.
Before I commit my changes I run "mvn -Pcontrib-check clean install" , which flags any check style violations.
There was a problem hiding this comment.
I'm not saying these changes are wrong. But they're in the wrong PR. This PR is 1500+ lines long. There are substantive code changes in it and stuff that normally could be waved through with a quick glance. But given that there are some real changes, all 1500 lines of change must be looked at carefully.
| import java.io.IOException; | ||
| import java.io.InputStream; | ||
|
|
||
| /** |
There was a problem hiding this comment.
I'm not saying these changes are wrong. But they're in the wrong PR. This PR is 1500+ lines long. There are substantive code changes in it and stuff that normally could be waved through with a quick glance. But given that there are some real changes, all 1500 lines of change must be looked at carefully.
|
rerun integration tests |
ivankelly
left a comment
There was a problem hiding this comment.
This still looks like it's breaking BC in a lot of places, which I guess is why integration are failing.
This reverts commit 807e2fd.
ivankelly
left a comment
There was a problem hiding this comment.
Better, though you don't need to expose the map, since you can mock the passed in config. Mocking the config would allow you to assign writeBlobStore in the constructor also.
Regarding the integration tests, I don't think they will ever pass with the current change due to the config changes, but am happy to be proven wrong on this. They seems to be generally passing on master.
|
After making changes to the integration test property names, the only failures we are seeing in the integration tests are related to Kafka and JDBC ------- Starting test [TestClass name=class org.apache.pulsar.tests.integration.functions.PulsarFunctionsThreadTest].pulsar-test-suite([])------- ------- Starting test [TestClass name=class org.apache.pulsar.tests.integration.functions.PulsarFunctionsThreadTest].pulsar-test-suite([])------- |
This is a BC break. A configuration which works with 2.1 or 2.2 will not work with this code. And even if I were willing to accept a BC break like this, |
|
I can fix the BC issue, but we need to decide on what the future property names will be. My only requests are that we don't use a vendor specific prefix, like "s3Bucket" nor have every permutation of "provider/property", e.g. "GCSBucket", "S3Bucket", "AzureBucket", "rackspace-cloudfiles-us-bucket", "Backblaze-B2-Bucket", etc. As it will make documentation an absolute nightmare. |
|
There will likely have to be some vendor specific things, as they don't have 100% compatible features. How about something like: I don't think this adds a much of a documentation burden. We have a core set that work for everyone, and can be documented once. The vendor specific stuff gets documented in their own section. In broker.conf they only need to be added once. |
ivankelly
left a comment
There was a problem hiding this comment.
New conf looks good. Some small comments.
| brokerContainer.withEnv("managedLedgerOffloadDriver", "s3"); | ||
| brokerContainer.withEnv("bucket", "pulsar-integtest"); | ||
| brokerContainer.withEnv("endpoint", "http://" + S3Container.NAME + ":9090"); | ||
| brokerContainer.withEnv("s3ManagedLedgerOffloadBucket", "pulsar-integtest"); |
There was a problem hiding this comment.
It would be good to test both the BC version and the variants.
Maybe ```
if (i++ % 2) {
// use BC variant
} else {
// use new variant
}
Kinda messy though.
There was a problem hiding this comment.
This brings up two questions:
- Should I just create a second class for the BC tests, e.g. PulsarTieredStorageBCTestSuite?
- How are the following properties being propagated to the JCloud provider? I didn't see any place in the code (old or new) that does this, which has me concerned that I might have missed something.
brokerContainer.withEnv("managedLedgerMaxEntriesPerLedger", String.valueOf(ENTRIES_PER_LEDGER));
brokerContainer.withEnv("managedLedgerMinLedgerRolloverTimeMinutes", "0");
There was a problem hiding this comment.
PulsarTieredStorageTestSuite is a base class used by TestS3Offload. So adding a new TestSuite class would be kinda messy. I'm happy enough to keep it as it is now. When you add azure, I assume there'll be some tests that use the new values.
These values get passed as environment values to the docker containers which run the tests. The docker containers go through each environment variable, sees if it matches a field in the configuration file (like broker.conf), and if so updates that field.
|
rerun integration tests |
|
rerun java8 tests |
|
run java8 tests |
1 similar comment
|
run java8 tests |
|
run integration tests |
1 similar comment
|
run integration tests |
|
run integration tests @david-streamlio FYI. |
|
Hi, when is this going to be available? This is a much needed change for us! |
|
@david-streamlio do you have time to rebase this pull request? or shall we pick it up? /cc @jiazhai |
|
Sijie
I was waiting for approval on the PR
…On Fri, Feb 7, 2020, 4:47 PM Sijie Guo ***@***.***> wrote:
@david-streamlio <https://github.com/david-streamlio> do you have time to
rebase this pull request? or shall we pick it up? /cc @jiazhai
<https://github.com/jiazhai>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2865?email_source=notifications&email_token=AIOS2EPXHFWOKR5CCGUD27TRBX6KLA5CNFSM4F7WVQK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELFDJQI#issuecomment-583677121>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIOS2ENFL46KMV2XQW7EGK3RBX6KLANCNFSM4F7WVQKQ>
.
|
|
@david-streamlio I thought this pull request was approved a while ago by Jia, Ivan and me. |
|
I thought so too but then it was held back due to failing tests that were
unrelated to the code in the PR
Let me know what is required to move forward and I will do what I can to
get this merged
…On Fri, Feb 7, 2020, 5:07 PM Sijie Guo ***@***.***> wrote:
@david-streamlio <https://github.com/david-streamlio> I thought this pull
request was approved a while ago by Jia, Ivan and me.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2865?email_source=notifications&email_token=AIOS2ELHB3ZSGOAJ26TL6RTRBYAUVA5CNFSM4F7WVQK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELFD76Q#issuecomment-583679994>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIOS2EOC3VLX3GZX3PAX7H3RBYAUVANCNFSM4F7WVQKQ>
.
|
|
Thanks! We are in dire need of this and Azure blob loader PR-2615. I'm hoping we will move that too once this moves? |
|
I have opened #6335 as a replacement for this, as it is now based of the 2.6.0 branch. Should we close this one? |
|
Close this pull request since #6335 is open to replace it. |
Motivation In order to facilitate the support of additional JClouds-supported providers, we first needed to clean up the existing code, as there were a lot of if/then/else constructs throughout the code that were based on the assumption that we either supported AWS S3 or Google Cloud Storage. I didn't want to keep adding else if's to these code blocks for every new provider we add, so I decided to refactor the code to make it a bit cleaner Modifications in addition to being home for most of the aforementioned if/then/else blocks, the BlobStoreManagedLedgerOffloader class had multiple responsibilities in addition to providing an implementation for the LedgerOffloader interface. My goal was to simplify this class such that its only responsibility was to implement the LedgerOffloader interface. The other major change was the addition of the JCloudBlobStoreProvider enum, which implements 3 interfaces that allow for it to handle the provider specific logic for things such as acquiring the credentials, validating the configuration, and creating a provider-specific instance of BlobStore. Result After this change, we will be able to easily add support for additional JClouds-supported providers by simply adding new elements to the JCloudBlobStoreProvider Enums since the other logic has been isolated and is not vendor specific. See #2865 for more details * Refactored JCloud Tiered Storage * Refactored JCloud Tiered Storage * Added missing import statements * Refactored JCloud Tiered Storage * Refactored JCloud Tiered Storage * Added missing import statements * Refactored JCloud Tiered Storage * Refactored JCloud Tiered Storage * Added missing import statements * fix test * add test logs * fix logs * fix test * fix * fix * fix broker log * fix configuration * fix * fix * fix * fix get BlobStore * repair test presto query tiered storage data * fix test * fix test * fix test TestPrestoQueryTieredStorage * fix * fix Co-authored-by: Sijie Guo <[email protected]> Co-authored-by: gaoran10 <[email protected]> Co-authored-by: xiaolong.ran <[email protected]>
Motivation In order to facilitate the support of additional JClouds-supported providers, we first needed to clean up the existing code, as there were a lot of if/then/else constructs throughout the code that were based on the assumption that we either supported AWS S3 or Google Cloud Storage. I didn't want to keep adding else if's to these code blocks for every new provider we add, so I decided to refactor the code to make it a bit cleaner Modifications in addition to being home for most of the aforementioned if/then/else blocks, the BlobStoreManagedLedgerOffloader class had multiple responsibilities in addition to providing an implementation for the LedgerOffloader interface. My goal was to simplify this class such that its only responsibility was to implement the LedgerOffloader interface. The other major change was the addition of the JCloudBlobStoreProvider enum, which implements 3 interfaces that allow for it to handle the provider specific logic for things such as acquiring the credentials, validating the configuration, and creating a provider-specific instance of BlobStore. Result After this change, we will be able to easily add support for additional JClouds-supported providers by simply adding new elements to the JCloudBlobStoreProvider Enums since the other logic has been isolated and is not vendor specific. See #2865 for more details * Refactored JCloud Tiered Storage * Refactored JCloud Tiered Storage * Added missing import statements * Refactored JCloud Tiered Storage * Refactored JCloud Tiered Storage * Added missing import statements * Refactored JCloud Tiered Storage * Refactored JCloud Tiered Storage * Added missing import statements * fix test * add test logs * fix logs * fix test * fix * fix * fix broker log * fix configuration * fix * fix * fix * fix get BlobStore * repair test presto query tiered storage data * fix test * fix test * fix test TestPrestoQueryTieredStorage * fix * fix Co-authored-by: Sijie Guo <[email protected]> Co-authored-by: gaoran10 <[email protected]> Co-authored-by: xiaolong.ran <[email protected]> (cherry picked from commit d3a5233)
Motivation In order to facilitate the support of additional JClouds-supported providers, we first needed to clean up the existing code, as there were a lot of if/then/else constructs throughout the code that were based on the assumption that we either supported AWS S3 or Google Cloud Storage. I didn't want to keep adding else if's to these code blocks for every new provider we add, so I decided to refactor the code to make it a bit cleaner Modifications in addition to being home for most of the aforementioned if/then/else blocks, the BlobStoreManagedLedgerOffloader class had multiple responsibilities in addition to providing an implementation for the LedgerOffloader interface. My goal was to simplify this class such that its only responsibility was to implement the LedgerOffloader interface. The other major change was the addition of the JCloudBlobStoreProvider enum, which implements 3 interfaces that allow for it to handle the provider specific logic for things such as acquiring the credentials, validating the configuration, and creating a provider-specific instance of BlobStore. Result After this change, we will be able to easily add support for additional JClouds-supported providers by simply adding new elements to the JCloudBlobStoreProvider Enums since the other logic has been isolated and is not vendor specific. See apache#2865 for more details * Refactored JCloud Tiered Storage * Refactored JCloud Tiered Storage * Added missing import statements * Refactored JCloud Tiered Storage * Refactored JCloud Tiered Storage * Added missing import statements * Refactored JCloud Tiered Storage * Refactored JCloud Tiered Storage * Added missing import statements * fix test * add test logs * fix logs * fix test * fix * fix * fix broker log * fix configuration * fix * fix * fix * fix get BlobStore * repair test presto query tiered storage data * fix test * fix test * fix test TestPrestoQueryTieredStorage * fix * fix Co-authored-by: Sijie Guo <[email protected]> Co-authored-by: gaoran10 <[email protected]> Co-authored-by: xiaolong.ran <[email protected]>
Motivation In order to facilitate the support of additional JClouds-supported providers, we first needed to clean up the existing code, as there were a lot of if/then/else constructs throughout the code that were based on the assumption that we either supported AWS S3 or Google Cloud Storage. I didn't want to keep adding else if's to these code blocks for every new provider we add, so I decided to refactor the code to make it a bit cleaner Modifications in addition to being home for most of the aforementioned if/then/else blocks, the BlobStoreManagedLedgerOffloader class had multiple responsibilities in addition to providing an implementation for the LedgerOffloader interface. My goal was to simplify this class such that its only responsibility was to implement the LedgerOffloader interface. The other major change was the addition of the JCloudBlobStoreProvider enum, which implements 3 interfaces that allow for it to handle the provider specific logic for things such as acquiring the credentials, validating the configuration, and creating a provider-specific instance of BlobStore. Result After this change, we will be able to easily add support for additional JClouds-supported providers by simply adding new elements to the JCloudBlobStoreProvider Enums since the other logic has been isolated and is not vendor specific. See apache#2865 for more details * Refactored JCloud Tiered Storage * Refactored JCloud Tiered Storage * Added missing import statements * Refactored JCloud Tiered Storage * Refactored JCloud Tiered Storage * Added missing import statements * Refactored JCloud Tiered Storage * Refactored JCloud Tiered Storage * Added missing import statements * fix test * add test logs * fix logs * fix test * fix * fix * fix broker log * fix configuration * fix * fix * fix * fix get BlobStore * repair test presto query tiered storage data * fix test * fix test * fix test TestPrestoQueryTieredStorage * fix * fix Co-authored-by: Sijie Guo <[email protected]> Co-authored-by: gaoran10 <[email protected]> Co-authored-by: xiaolong.ran <[email protected]>
Motivation
In order to facilitate the support of additional JClouds-supported providers, we first needed to clean up the existing code, as there were a lot of if/then/else constructs throughout the code that were based on the assumption that we either supported AWS S3 or Google Cloud Storage. I didn't want to keep adding else if's to these code blocks for every new provider we add, so I decided to refactor the code to make it a bit cleaner
Modifications
in addition to being home for most of the aforementioned if/then/else blocks, the BlobStoreManagedLedgerOffloader class had multiple responsibilities in addition to providing an implementation for the LedgerOffloader interface. My goal was to simplify this class such that its only responsibility was to implement the LedgerOffloader interface.
The other major change was the addition of the JCloudBlobStoreProvider enum, which implements 3 interfaces that allow for it to handle the provider specific logic for things such as acquiring the credentials, validating the configuration, and creating a provider-specific instance of BlobStore.
Result
After this change, we will be able to easily add support for additional JClouds-supported providers by simply adding new elements to the JCloudBlobStoreProvider Enums since the other logic has been isolated and is not vendor specific.