-
Notifications
You must be signed in to change notification settings - Fork 522
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
HDDS-12348. Reuse TestDataUtil.createKey
method
#7971
Conversation
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.
Thanks @chiacyu for the patch.
private void createKey(OzoneBucket ozoneBucket, String key, int length, | ||
byte[] input) | ||
private void createAndAssertKey(OzoneBucket ozoneBucket, String key, int length, | ||
byte[] input) |
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.
nit: Please do not format method signature like this. Whenever visibility / return type / method name / other modifiers are changed, we would have to reindent parameters.
...-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStoreWithFSO.java
Outdated
Show resolved
Hide resolved
...-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStoreWithFSO.java
Outdated
Show resolved
Hide resolved
ozoneOutputStream.write(input, 0, 10); | ||
ozoneOutputStream.close(); | ||
|
||
createKey(ozoneBucket, key, new String(input, UTF_8)); |
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.
Sorry I haven't noticed that we write byte[]
but createKey
accepts String
.
Instead of wrapping in new String
in each call (here and the other test classes), let's create a new version of createKey
in TestDataUtil
that accepts byte[]
.
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestBucketOwner.java
Outdated
Show resolved
Hide resolved
...-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStoreWithFSO.java
Outdated
Show resolved
Hide resolved
...-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStoreWithFSO.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeys.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeysWithFSO.java
Outdated
Show resolved
Hide resolved
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.
Thanks @chiacyu for updating the patch. I think it's almost good to go.
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestDataUtil.java
Outdated
Show resolved
Hide resolved
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.
Thanks @chiacyu for updating the patch, LGTM, pending CI.
What changes were proposed in this pull request?
The
TestDataUtil.createKey
can be reused in many places to reduce the code redundancy, please take a look, thanks!What is the link to the Apache JIRA
HDDS-12348
How was this patch tested?
It can test by CI.