keith-turner commented on code in PR #5981:
URL: https://github.com/apache/accumulo/pull/5981#discussion_r2539056523
##########
core/src/test/java/org/apache/accumulo/core/spi/compaction/RatioBasedCompactionPlannerTest.java:
##########
@@ -851,6 +852,43 @@ public void testMaxTableFilesFallback() {
verify(senv);
}
+ /**
+ * Ensures the planner does not drop, modify, or mix up ranges on input
files.
+ */
+ @Test
+ public void testFilesWithRanges() throws Exception {
Review Comment:
When looking into testing compactable file noticed the planner was not being
unit tested with ranges, this is super important to test to make sure the
planner handles ranges correctly.
##########
core/src/main/java/org/apache/accumulo/core/client/admin/compaction/CompactableFile.java:
##########
@@ -48,16 +49,23 @@ public interface CompactableFile {
public long getEstimatedEntries();
+ /**
+ * Create a compactable file object that implements equals and hash code
based on the file uri and
+ * an infinite range.
+ */
static CompactableFile create(URI uri, long estimatedSize, long
estimatedEntries) {
return new CompactableFileImpl(uri, estimatedSize, estimatedEntries);
}
/**
- * Creates a new CompactableFile object that implements this interface.
+ * Creates a new CompactableFile object that implements this interface. The
returned object
+ * implements equals() and hashCode() based only on the file uri and range.
*
+ * @param range must be of the form (startRow, endRow]
* @since 4.0.0
*/
- static CompactableFile create(URI uri, Range range, long estimatedSize, long
estimatedEntries) {
- return new CompactableFileImpl(uri, range, estimatedSize,
estimatedEntries);
+ static CompactableFile create(URI uri, RowRange range, long estimatedSize,
Review Comment:
Switched this to use the new RowRange type.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]