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;
}
void setLocalDataTree(final Optional<ReadOnlyDataTree> dataTree) {
- this.localShardDataTree = dataTree;
+ localShardDataTree = dataTree;
}
Optional<ReadOnlyDataTree> getLocalShardDataTree() {
}
void setDatastoreContext(final DatastoreContext newDatastoreContext, final ActorRef sender) {
- this.datastoreContext = newDatastoreContext;
+ datastoreContext = newDatastoreContext;
if (actor != null) {
LOG.debug("Sending new DatastoreContext to {}", shardId);
- actor.tell(this.datastoreContext, sender);
+ actor.tell(datastoreContext, sender);
}
}
}
String getSerializedLeaderActor() {
- if (isLeader()) {
- return Serialization.serializedActorPath(getActor());
- } else {
- return addressResolver.resolve(leaderId);
- }
+ return isLeader() ? Serialization.serializedActorPath(getActor()) : addressResolver.resolve(leaderId);
}
void setActorInitialized() {
LOG.debug("Shard {} is initialized", shardId);
- this.actorInitialized = true;
+ actorInitialized = true;
notifyOnShardInitializedCallbacks();
}
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()) {
}
void setRole(final String newRole) {
- this.role = newRole;
+ role = newRole;
notifyOnShardInitializedCallbacks();
}
}
void setFollowerSyncStatus(final boolean syncStatus) {
- this.followerSyncStatus = syncStatus;
+ followerSyncStatus = syncStatus;
}
boolean isInSync() {
- if (RaftState.Follower.name().equals(this.role)) {
+ if (RaftState.Follower.name().equals(role)) {
return followerSyncStatus;
- } else if (RaftState.Leader.name().equals(this.role)) {
+ } else if (RaftState.Leader.name().equals(role)) {
return true;
}
}
boolean setLeaderId(final String newLeaderId) {
- final boolean changed = !Objects.equals(this.leaderId, newLeaderId);
- this.leaderId = newLeaderId;
+ final boolean changed = !Objects.equals(leaderId, newLeaderId);
+ leaderId = newLeaderId;
if (newLeaderId != null) {
- this.leaderAvailable = true;
+ leaderAvailable = true;
}
notifyOnShardInitializedCallbacks();
}
void setActiveMember(final boolean isActiveMember) {
- this.activeMember = isActiveMember;
+ activeMember = isActiveMember;
}
EffectiveModelContext getSchemaContext() {