keith-turner commented on code in PR #3447:
URL: https://github.com/apache/accumulo/pull/3447#discussion_r1215007811
##########
server/base/src/main/java/org/apache/accumulo/server/manager/state/TabletManagementScanner.java:
##########
@@ -46,9 +47,11 @@ public class TabletManagementScanner implements
ClosableIterator<TabletManagemen
private final BatchScanner mdScanner;
private final Iterator<Entry<Key,Value>> iter;
private final AtomicBoolean closed = new AtomicBoolean(false);
+ private final ConcurrentLinkedQueue<TabletManagement>
knownTabletModifications;
- TabletManagementScanner(ClientContext context, Range range, CurrentState
state,
- String tableName) {
+ // This constructor is called from TabletStateStore implementations
+ public TabletManagementScanner(ClientContext context, Range range,
CurrentState state,
+ String tableName, ConcurrentLinkedQueue<TabletManagement>
knownTabletModifications) {
Review Comment:
Another comment suggested making clients either add to
knownTabletModifications or call EventCoordinator.event(). With that change
we may be able to separate knownTabletModifications from the metadata scan.
Not sure exactly how to implement it, but wondering if TabletGroupWatcher could
do the following.
* Scan the entire metadata table when EventCoordinator signals or when the
configured time has passed.
* When not doing the above immediately process whatever arrives in
knownTabletModifications, but do no metadata scan.
##########
server/base/src/main/java/org/apache/accumulo/server/manager/state/MetaDataStateStore.java:
##########
@@ -49,7 +52,13 @@ protected MetaDataStateStore(ClientContext context,
CurrentState state, String t
@Override
public ClosableIterator<TabletManagement> iterator() {
- return new TabletManagementScanner(context, TabletsSection.getRange(),
state, targetTableName);
+ return new TabletManagementScanner(context, TabletsSection.getRange(),
state, targetTableName,
+ knownStateChanges);
+ }
+
+ @Override
+ public void knownTabletStateChange(TabletManagement tablet) {
+ this.knownStateChanges.add(tablet);
Review Comment:
We could make knownStateChanges an ArrayBlockingQueue with a fixed size.
When we call this method and knownStateChanges is full we could instead call
EventCoordinator.event().
```java
if(!knownStateChanges.offer(tablet)){
// call EventCoordinator.event() which will trigger a full metadata
table scan
}
```
Then callers of this method could stop calling EventCoordinator.event().
--
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]