Commit 2d68952 1 parent d7b0954 commit 2d68952 Copy full SHA for 2d68952
File tree 1 file changed +8
-8
lines changed
core/src/main/java/org/apache/accumulo/core/metadata/schema
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -565,31 +565,31 @@ public static void validate(TabletMetadata tm) {
565
565
throw new IllegalStateException ("TabletMetadata cannot be null" );
566
566
}
567
567
568
+ Collection <StoredTabletFile > files = tm .getFiles ();
569
+ if (files == null || files .isEmpty ()) {
570
+ return ;
571
+ }
572
+
568
573
Text prevEndRowText = tm .getPrevEndRow ();
569
574
Text endRowText = tm .getEndRow ();
570
575
571
576
// Allow validation even if prevEndRow is missing, as long as endRowText exists
572
577
Key prevEndRowKey = (prevEndRowText != null ) ? new Key (prevEndRowText ) : null ;
573
578
Key endRowKey = (endRowText != null ) ? new Key (endRowText ) : null ;
574
579
575
- Collection <StoredTabletFile > files = tm .getFiles ();
576
- if (files == null || files .isEmpty ()) {
577
- return ;
578
- }
579
-
580
580
for (StoredTabletFile file : files ) {
581
581
if (!isFileRangeValid (file , prevEndRowKey , endRowKey )) {
582
582
throw new IllegalStateException ("File range " + file .getRange ()
583
- + " is inconsistent with tablet range [" + prevEndRowText + ", " + endRowText + "]" );
583
+ + " does not overlap with tablet range [" + prevEndRowText + ", " + endRowText + "]" );
584
584
}
585
585
}
586
586
}
587
587
588
588
private static boolean isFileRangeValid (StoredTabletFile file , Key prevEndRowKey , Key endRowKey ) {
589
589
Range fileRange = file .getRange ();
590
590
591
- if (fileRange == null ) {
592
- return false ;
591
+ if (file . hasRange () ) {
592
+ return true ;
593
593
}
594
594
595
595
Key fileStartKey = fileRange .getStartKey ();
You can’t perform that action at this time.
0 commit comments