import org.opendaylight.controller.cluster.datastore.shardmanager.ShardManager.OnShardInitialized;
import org.opendaylight.controller.cluster.datastore.shardmanager.ShardManager.OnShardReady;
import org.opendaylight.controller.cluster.raft.RaftState;
-import org.opendaylight.yangtools.yang.data.api.schema.tree.ReadOnlyDataTree;
+import org.opendaylight.yangtools.yang.data.tree.api.ReadOnlyDataTree;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Props newProps() {
Props props = requireNonNull(builder).id(shardId).peerAddresses(initialPeerAddresses)
- .datastoreContext(datastoreContext).schemaContextProvider(schemaContextProvider).props();
+ .datastoreContext(datastoreContext).schemaContextProvider(schemaContextProvider::modelContext).props();
builder = null;
return props;
}
return shardId;
}
- void setLocalDataTree(final Optional<ReadOnlyDataTree> dataTree) {
- localShardDataTree = dataTree;
+ void setLocalDataTree(final ReadOnlyDataTree dataTree) {
+ localShardDataTree = Optional.ofNullable(dataTree);
}
Optional<ReadOnlyDataTree> getLocalShardDataTree() {
return;
}
- boolean ready = isShardReadyWithLeaderId();
-
- LOG.debug("Shard {} is {} - notifying {} OnShardInitialized callbacks", shardId,
- ready ? "ready" : "initialized", onShardInitializedSet.size());
+ final boolean ready = isShardReadyWithLeaderId();
+ final String readyStr = ready ? "ready" : "initialized";
+ LOG.debug("Shard {} is {} - notifying {} OnShardInitialized callbacks", shardId, readyStr,
+ onShardInitializedSet.size());
Iterator<OnShardInitialized> iter = onShardInitializedSet.iterator();
while (iter.hasNext()) {
}
EffectiveModelContext getSchemaContext() {
- return schemaContextProvider.getEffectiveModelContext();
+ return schemaContextProvider.modelContext();
}
void setSchemaContext(final EffectiveModelContext schemaContext) {