Add ProblemReport section to metadata schema#3321
Conversation
Adds ProblemReport section to the metadata schema to consolidate metadata table prefixes.
ctubbsii
left a comment
There was a problem hiding this comment.
I wonder if some of these APIs have a String equivalent, so we don't have to wrap them all with new Text. That could be another slight improvement that would go nicely along with this change (if they are equivalent).
Removes Text class use in favor of cleaning up method calls.
That's a great idea! I just added the changes to remove the Text wrappers. I also had to modify the Encoding util to support a byte array for full removal of the Hadoop Text wrappers. This change seemed minimal as Encoding was only being used by ProblemReport and its test class and immediately generated a byte array from the Text object. |
Remove commented code that is not used.
ctubbsii
left a comment
There was a problem hiding this comment.
One more minor change to eliminate a new Text, but after that, this change looks ready to merge.
| */ | ||
| public static class ProblemSection { | ||
| private static final Section section = | ||
| new Section(RESERVED_PREFIX + "err_", true, RESERVED_PREFIX + "err`", false); |
There was a problem hiding this comment.
This section definition includes the underscore as a mandatory part of the section. That's the most narrowly scoped definition, and completely fine. However, I'm a bit surprised that the section wasn't defined more widely as everything starting with err, as in something like:
new Section(RESERVED_PREFIX + "err", true, RESERVED_PREFIX + "ers", false);I am not suggesting changing it... just noting the distinction between the narrow section definition and the wider definition.
|
|
||
| if (table == null) { | ||
| scanner.setRange(new Range(new Text("~err_"), false, new Text("~err`"), false)); | ||
| scanner.setRange(ProblemSection.getRange()); |
There was a problem hiding this comment.
One difference is that the new version has the start key inclusive, and the old range has it exclusive. I don't think this matters, since we don't expect any rows to just include the prefix without a tableId after the underscore, so this isn't an important change. I'm just noting it here as a very slight difference in behavior, in case there's a surprise later, and this comment serves to help debug something.
server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java
Outdated
Show resolved
Hide resolved
Removes `new Text()` wrappers to clean up code.
|
Thanks, @ddanielr . This can be merged once CI checks are finished. |
Adds ProblemReport section to the metadata schema to consolidate metadata table prefixes.
This removes hardcoded prefix strings located in various classes.