keith-turner commented on code in PR #2792:
URL: https://github.com/apache/accumulo/pull/2792#discussion_r969621782
##########
server/gc/src/main/java/org/apache/accumulo/gc/GCRun.java:
##########
@@ -462,4 +479,28 @@ public long getErrorsStat() {
public long getCandidatesStat() {
return candidates;
}
+
+ @Override
+ public boolean isRootTable() {
+ return level == DataLevel.ROOT;
+ }
+
+ @Override
+ public boolean isMetadataTable() {
+ return level == DataLevel.METADATA;
+ }
+
+ @Override
+ public Set<TableId> getCandidateTableIDs() {
+ if (isRootTable()) {
+ return Collections.singleton(MetadataTable.ID);
+ } else if (isMetadataTable()) {
Review Comment:
```suggestion
if (level == ROOT) {
return Set.of(RootTable.ID);
} else if(level == METADATA){
return Set.of(MetadataTable.ID);
} else if (level == USER) {
```
##########
server/gc/src/main/java/org/apache/accumulo/gc/GCRun.java:
##########
@@ -462,4 +479,28 @@ public long getErrorsStat() {
public long getCandidatesStat() {
return candidates;
}
+
+ @Override
+ public boolean isRootTable() {
+ return level == DataLevel.ROOT;
+ }
+
+ @Override
+ public boolean isMetadataTable() {
+ return level == DataLevel.METADATA;
+ }
Review Comment:
It would be nice to remove these if possible, seems like they are only used
in test. Could just make test override/implement the method to get table ids.
If it is needed for test I would suggest adding a getDataLevel() method.
```suggestion
```
##########
server/gc/src/main/java/org/apache/accumulo/gc/GCRun.java:
##########
@@ -462,4 +479,28 @@ public long getErrorsStat() {
public long getCandidatesStat() {
return candidates;
}
+
+ @Override
+ public boolean isRootTable() {
+ return level == DataLevel.ROOT;
+ }
+
+ @Override
+ public boolean isMetadataTable() {
+ return level == DataLevel.METADATA;
+ }
+
+ @Override
+ public Set<TableId> getCandidateTableIDs() {
Review Comment:
Using level in the name seems better to me.
```suggestion
/**
* @return the tables id for the current data level
*/
public Set<TableId> getLevelTableIDs() {
```
--
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]