keith-turner commented on code in PR #3409:
URL: https://github.com/apache/accumulo/pull/3409#discussion_r1202524520
##########
server/base/src/main/java/org/apache/accumulo/server/manager/state/ZooTabletStateStore.java:
##########
@@ -42,16 +39,14 @@ class ZooTabletStateStore extends AbstractTabletStateStore
implements TabletStat
private static final Logger log =
LoggerFactory.getLogger(ZooTabletStateStore.class);
private final Ample ample;
- private final ClientContext context;
ZooTabletStateStore(ClientContext context) {
super(context);
- this.context = context;
this.ample = context.getAmple();
}
@Override
- public ClosableIterator<TabletLocationState> iterator() {
+ public ClosableIterator<ManagerTabletInfo> iterator() {
Review Comment:
In the past this method could always return a tablet location state even if
there was nothing to do. Now I think it should only return something if there
is work to do. Also thinking it should somehow call the code in
ManagerTabletInfoIterator. This does not compile, but I worked up the
following as a proof of concept of what I was thinking.
```java
@Override
public ClosableIterator<ManagerTabletInfo> iterator() {
List<ManagerTabletInfo> mtis = List.of();
TabletMetadata tabletMetadata = ample.readTablet(RootTable.EXTENT,
ReadConsistency.EVENTUAL);
Set<ManagementAction> reasons = new HashSet<>();
if(ManagerTabletInfoIterator.sendToManager(tabletMetadata, reasons)){
mtis = List.of(new ManagerTabletInfo(reasons, tabletMetadata));
}
var iterator = mtis.iterator();
return new ClosableIterator<>() {
@Override
public boolean hasNext() {
return iterator.hasNext();
}
@Override
public ManagerTabletInfo next() {
return iterator.next();
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
@Override
public void close() {}
};
}
```
--
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]