import akka.actor.ActorRef;
import akka.actor.Props;
import akka.serialization.Serialization;
-import com.google.common.base.Preconditions;
+import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import java.util.HashSet;
import java.util.Iterator;
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.DataTree;
+import org.opendaylight.yangtools.yang.data.api.schema.tree.ReadOnlyDataTree;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private final AtomicShardContextProvider schemaContextProvider = new AtomicShardContextProvider();
private ActorRef actor;
- private Optional<DataTree> localShardDataTree;
+ private Optional<ReadOnlyDataTree> localShardDataTree;
private boolean leaderAvailable = false;
// flag that determines if the actor is ready for business
return shardId;
}
- void setLocalDataTree(final Optional<DataTree> dataTree) {
+ void setLocalDataTree(final Optional<ReadOnlyDataTree> dataTree) {
this.localShardDataTree = dataTree;
}
- Optional<DataTree> getLocalShardDataTree() {
+ Optional<ReadOnlyDataTree> getLocalShardDataTree() {
return localShardDataTree;
}
}
void setSchemaContext(final SchemaContext schemaContext) {
- schemaContextProvider.set(Preconditions.checkNotNull(schemaContext));
+ schemaContextProvider.set(requireNonNull(schemaContext));
+ }
+
+ @VisibleForTesting
+ Shard.AbstractBuilder<?, ?> getBuilder() {
+ return builder;
}
@Override