-
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
added validate method into TabletMetadata #5340
base: 3.1
Are you sure you want to change the base?
Conversation
core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.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.
These changes seem good, it would be nice to add some unit test to TabletMetadataTest
@@ -558,6 +559,26 @@ private static Optional<TServerInstance> checkServer(ClientContext context, Stri | |||
.map(address -> new TServerInstance(address, stat.getEphemeralOwner())); | |||
} | |||
|
|||
public static void validate(TabletMetadata tm) { | |||
if (!tm.fetchedCols.contains(ColumnType.FILES) || !tm.sawPrevEndRow) { |
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.
If we fetched files, may not see any files for a tablet can avoid some work by checking if the set is empty. The sawPrevEndRow
is more for error checking. If we fetched the PREV_ROW then its always expeced that it will be seen, so can check if it was fetched. Other code will throw an error if prev row was fetched and not seen.
if (!tm.fetchedCols.contains(ColumnType.FILES) || !tm.sawPrevEndRow) { | |
if (files.isEmpty() || !tm.fetchedCols.contains(ColumnType.PREV_ROW)) { |
closes issue #5242
Created a Validate method inside Tablet Metadata to check overlap of files and tablet ranges.