-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HADOOP-18805. S3A prefetch tests to work with small files #5851
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
Conversation
|
This PR build is also failing with likely jenkins env issue https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5851/1/console |
|
jenkins build issue resolved as part of INFRA-24797 |
|
🎊 +1 overall
This message was automatically generated. |
steveloughran
left a comment
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.
I'd also imagined this jira would cover the original large file test, as it has similar issues. we shouldn't need to work with landsat at all.
| S3ATestUtils.removeBaseAndBucketOverrides(conf, PREFETCH_BLOCK_SIZE_KEY); | ||
| conf.setBoolean(PREFETCH_ENABLED_KEY, true); | ||
| conf.setInt(PREFETCH_MAX_BLOCKS_COUNT, Integer.parseInt(maxBlocks)); | ||
| conf.setInt(PREFETCH_BLOCK_SIZE_KEY, S_1K * 10); |
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.
given this is fixed, why have blocksize reread on L115?
proposed: make blocksize constant BLOCK_SIZE, use as appropriate
you mean |
|
removed dependency on landsat for prefetch tests, re-tested the whole suite against |
steveloughran
left a comment
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.
this is good. now we have small filesystems everywhere we can actually skip creating new filesystems in test cases, just use getFileSystem().
this will make the classes even simpler
| S3ATestUtils.removeBaseAndBucketOverrides(conf, PREFETCH_ENABLED_KEY); | ||
| S3ATestUtils.removeBaseAndBucketOverrides(conf, PREFETCH_BLOCK_SIZE_KEY); | ||
| conf.setBoolean(PREFETCH_ENABLED_KEY, true); | ||
| conf.setInt(PREFETCH_BLOCK_SIZE_KEY, BLOCK_SIZE); |
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.
because the size is now being set in this method, the filesystem automatically created/destroyed is already set up for the tests; we can replace openFS() entirely.
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.
done, makes them much simpler
| } | ||
|
|
||
| private void openFS() throws Exception { | ||
| private void openFS(String fileName) throws Exception { |
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.
change to using the existing fs, and using methodPath() to generate a per test case path (no test uses more than one file, does it?)
void createLargeFile() throws IOException {
Configuration conf = getConfiguration();
byte[] data = ContractTestUtils.dataset(S_1K * 72, 'x', 26);
largeFile = methodPath();
FileSystem largeFileFS = getFileSystem();
ContractTestUtils.writeDataset(largeFileFS, largeFile, data, data.length, 16, true);
FileStatus fileStatus = largeFileFS.getFileStatus(largeFile);
largeFileSize = fileStatus.getLen();
numBlocks = calculateNumBlocks(largeFileSize, BLOCK_SIZE);
}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.
no test uses more than one file, does it?
correct, they use only 1 file
| smallFile = path("iTestS3APrefetchingLruEviction"); | ||
| ContractTestUtils.writeDataset(getFileSystem(), smallFile, data, data.length, 16, true); | ||
| blockSize = conf.getInt(PREFETCH_BLOCK_SIZE_KEY, PREFETCH_BLOCK_DEFAULT_SIZE); | ||
| smallFileFS = new S3AFileSystem(); |
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.
can use use getFileSystem() here
|
🎊 +1 overall
This message was automatically generated. |
|
|
|
🎊 +1 overall
This message was automatically generated. |
steveloughran
left a comment
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.
really, really close, just need to move from fields to local vars
| private void createSmallFile() throws Exception { | ||
| byte[] data = ContractTestUtils.dataset(SMALL_FILE_SIZE, 'x', 26); | ||
| smallFile = path("iTestS3APrefetchingLruEviction"); | ||
| smallFile = methodPath(); |
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.
this should be made a local variable; class field removed as well as teardown
| private void createLargeFile() throws Exception { | ||
| byte[] data = ContractTestUtils.dataset(S_1K * 72, 'x', 26); | ||
| largeFile = path(fileName); | ||
| largeFile = methodPath(); |
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.
this should be made a local variable; class field removed as well as teardown
steveloughran
left a comment
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.
ok, sorry, my fault, i annotated the wrong line,
It's the filesystem instances largeFileFS and smallFileFS which should be replaced with local vars -they are both just getFileSystem() references, and there's no need to close them in teardown as the superclass does its work there
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
us-west-2:
|
|
i plan to initiate few more followup sub-task Jira later: a) LRU contents unit testable with some refactor |
steveloughran
left a comment
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.
LGTM
+1
will merge
|
merged to trunk; now I will get to rebase my unbuffer() patch atop it. Can you do the homework of a cherrypick and retest onto branch-3? thanks |
|
sure thing, will create 3.3 backport PR and test it. Thank you for merging the PR! |
Contributed by Viraj Jasani
Jira: HADOOP-18805