+ public final SettableFuture<Empty> readinessFuture() {
+ return readinessFuture;
+ }
+
+ @Override
+ public final Registration registerProxyListener(final YangInstanceIdentifier shardLookup,
+ final YangInstanceIdentifier insideShard, final DOMDataTreeChangeListener delegate) {
+ requireNonNull(shardLookup, "shardLookup should not be null");
+ requireNonNull(insideShard, "insideShard should not be null");
+ requireNonNull(delegate, "delegate should not be null");
+
+ final var shardName = actorUtils.getShardStrategyFactory().getStrategy(shardLookup).findShard(shardLookup);
+ LOG.debug("Registering tree listener: {} for tree: {} shard: {}, path inside shard: {}", delegate, shardLookup,
+ shardName, insideShard);
+
+ return DataTreeChangeListenerProxy.of(actorUtils, new DOMDataTreeChangeListener() {
+ @Override
+ public void onDataTreeChanged(final List<DataTreeCandidate> changes) {
+ delegate.onDataTreeChanged(changes);
+ }
+
+ @Override
+ public void onInitialData() {
+ delegate.onInitialData();
+ }
+ }, insideShard, true, shardName);
+ }
+
+ private Duration initialSettleTime() {
+ final DatastoreContext context = actorUtils.getDatastoreContext();
+ final int multiplier = context.getInitialSettleTimeoutMultiplier();
+ return multiplier == 0 ? Duration.Inf() : context.getShardLeaderElectionTimeout().duration().$times(multiplier);