-
Notifications
You must be signed in to change notification settings - Fork 455
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
Created LoadFilesTest #5355
Created LoadFilesTest #5355
Conversation
server/manager/src/test/java/org/apache/accumulo/manager/tableOps/bulkVer2/LoadFilesTest.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.
Tested locally, seems to work fine.
I recommended adding a entry to the load plan to try and load a tablet file out of sequential order to see if that messed anything up.
server/manager/src/main/java/org/apache/accumulo/manager/tableOps/bulkVer2/LoadFiles.java
Show resolved
Hide resolved
server/manager/src/main/java/org/apache/accumulo/manager/tableOps/bulkVer2/LoadFiles.java
Outdated
Show resolved
Hide resolved
assertEquals(3, tablets.size()); | ||
assertEquals(tm.get(0), tablets.get(0)); | ||
assertEquals(tm.get(1), tablets.get(1)); | ||
assertEquals(tm.get(2), tablets.get(2)); |
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.
Could use subList to shorten this check
assertEquals(3, tablets.size()); | |
assertEquals(tm.get(0), tablets.get(0)); | |
assertEquals(tm.get(1), tablets.get(1)); | |
assertEquals(tm.get(2), tablets.get(2)); | |
assertEquals(tm.subList(0,3), tablets); |
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.
While this is less lines of code, it's not as easy to identify where the issue is on a test failure.
assertEquals(3, tablets.size()); | ||
assertEquals(tm.get(tm.size() - 3), tablets.get(tablets.size() - 3)); | ||
assertEquals(tm.get(tm.size() - 2), tablets.get(tablets.size() - 2)); | ||
assertEquals(tm.get(tm.size() - 1), tablets.get(tablets.size() - 1)); |
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.
Could also use subList here
assertEquals(3, tablets.size()); | |
assertEquals(tm.get(tm.size() - 3), tablets.get(tablets.size() - 3)); | |
assertEquals(tm.get(tm.size() - 2), tablets.get(tablets.size() - 2)); | |
assertEquals(tm.get(tm.size() - 1), tablets.get(tablets.size() - 1)); | |
assertEquals(tm.subList(tm.size()-3, tm.size()), tablets); |
server/manager/src/test/java/org/apache/accumulo/manager/tableOps/bulkVer2/LoadFilesTest.java
Outdated
Show resolved
Hide resolved
server/manager/src/test/java/org/apache/accumulo/manager/tableOps/bulkVer2/LoadFilesTest.java
Outdated
Show resolved
Hide resolved
server/manager/src/test/java/org/apache/accumulo/manager/tableOps/bulkVer2/LoadFilesTest.java
Outdated
Show resolved
Hide resolved
server/manager/src/test/java/org/apache/accumulo/manager/tableOps/bulkVer2/LoadFilesTest.java
Outdated
Show resolved
Hide resolved
assertEquals(5, extents.size()); | ||
assertTrue(extents.contains(nke(null, "a"))); | ||
assertTrue(extents.contains(nke("a", "b"))); | ||
assertTrue(extents.contains(nke("b", "c"))); | ||
assertTrue(extents.contains(nke("l", "m"))); | ||
assertTrue(extents.contains(nke("m", "n"))); |
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.
Could shorten using Set.of
assertEquals(5, extents.size()); | |
assertTrue(extents.contains(nke(null, "a"))); | |
assertTrue(extents.contains(nke("a", "b"))); | |
assertTrue(extents.contains(nke("b", "c"))); | |
assertTrue(extents.contains(nke("l", "m"))); | |
assertTrue(extents.contains(nke("m", "n"))); | |
assertEquals(Set.of(nke(null, "a"), nke("a", "b"), nke("b", "c"),nke("l", "m"),nke("m", "n")), extents); |
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.
While this is less lines of code, it's not as easy to identify where the issue is on a test failure.
loadRanges.put(nke("l", "n"), "f1 f2 f4 f5"); | ||
loadRanges.put(nke("n", "r"), "f2 f4"); | ||
loadRanges.put(nke("r", "w"), "f2 f5"); | ||
loadRanges.put(nke("w", null), "f2 f6"); |
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 load mapping covers all data in the table w/ no gaps. Need to test that case. Additionally it would be nice to test other load mappings w/ gaps and not starting ending at -inf or +inf.
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.
In b217cfe I added another test that uses non-contiguous ranges on a subset of the tables tablets.
When merging apache#5355 to main the FILES column ended up not being fetched for the tablet metadata because the Loader.pauseLimit variable had not been set. This variable was set in the call to Loader.start, which happens after the TabletsMetadata is configured
When merging #5355 to main the FILES column ended up not being fetched for the tablet metadata because the Loader.pauseLimit variable had not been set. This variable was set in the call to Loader.start, which happens after the TabletsMetadata is configured
No description provided.