import org.opendaylight.controller.cluster.datastore.DatastoreContext.Builder;
import org.opendaylight.controller.cluster.datastore.DistributedDataStore;
import org.opendaylight.controller.cluster.datastore.IntegrationTestKit;
-import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
+import org.opendaylight.controller.cluster.datastore.utils.ActorUtils;
import org.opendaylight.controller.cluster.datastore.utils.ClusterUtils;
import org.opendaylight.controller.cluster.dom.api.CDSDataTreeProducer;
import org.opendaylight.controller.cluster.dom.api.CDSShardAccess;
import org.opendaylight.controller.cluster.raft.utils.InMemoryJournal;
import org.opendaylight.controller.cluster.raft.utils.InMemorySnapshotStore;
-import org.opendaylight.controller.cluster.sharding.DistributedShardFactory.DistributedShardRegistration;
import org.opendaylight.controller.md.cluster.datastore.model.SchemaContextHelper;
import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@Deprecated(forRemoval = true)
public class DistributedShardedDOMDataTreeTest extends AbstractTest {
private static final Logger LOG = LoggerFactory.getLogger(DistributedShardedDOMDataTreeRemotingTest.class);
initEmptyDatastores();
final DOMDataTreeIdentifier configRoot =
- new DOMDataTreeIdentifier(LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.EMPTY);
+ new DOMDataTreeIdentifier(LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.empty());
final DOMDataTreeProducer producer = leaderShardFactory.createProducer(Collections.singleton(configRoot));
final DOMDataTreeCursorAwareTransaction tx = producer.createTransaction(true);
final DOMDataTreeWriteCursor cursor =
tx.createCursor(new DOMDataTreeIdentifier(
- LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.EMPTY));
+ LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.empty()));
Assert.assertNotNull(cursor);
final ContainerNode test =
leaderShardFactory.createDistributedShard(TEST_ID, Lists.newArrayList(AbstractTest.MEMBER_NAME)),
DistributedShardedDOMDataTree.SHARD_FUTURE_TIMEOUT_DURATION);
- leaderTestKit.waitUntilLeader(leaderDistributedDataStore.getActorContext(),
+ leaderTestKit.waitUntilLeader(leaderDistributedDataStore.getActorUtils(),
ClusterUtils.getCleanShardName(TEST_ID.getRootIdentifier()));
final DOMDataTreeProducer producer = leaderShardFactory.createProducer(Collections.singleton(TEST_ID));
final String shardName = ClusterUtils.getCleanShardName(TEST_ID.getRootIdentifier());
LOG.debug("Creating distributed datastore client for shard {}", shardName);
- final ActorContext actorContext = leaderDistributedDataStore.getActorContext();
+ final ActorUtils actorUtils = leaderDistributedDataStore.getActorUtils();
final Props distributedDataStoreClientProps =
- SimpleDataStoreClientActor.props(actorContext.getCurrentMemberName(),
- "Shard-" + shardName, actorContext, shardName);
+ SimpleDataStoreClientActor.props(actorUtils.getCurrentMemberName(), "Shard-" + shardName, actorUtils,
+ shardName);
final ActorRef clientActor = leaderSystem.actorOf(distributedDataStoreClientProps);
final DataStoreClient distributedDataStoreClient = SimpleDataStoreClientActor
final ClientLocalHistory localHistory = distributedDataStoreClient.createLocalHistory();
final ClientTransaction tx2 = localHistory.createTransaction();
- final FluentFuture<Optional<NormalizedNode<?, ?>>> read = tx2.read(YangInstanceIdentifier.EMPTY);
+ final FluentFuture<Optional<NormalizedNode<?, ?>>> read = tx2.read(YangInstanceIdentifier.empty());
final Optional<NormalizedNode<?, ?>> optional = read.get();
tx2.abort();
leaderShardFactory.createDistributedShard(TEST_ID, Lists.newArrayList(AbstractTest.MEMBER_NAME)),
DistributedShardedDOMDataTree.SHARD_FUTURE_TIMEOUT_DURATION);
- leaderTestKit.waitUntilLeader(leaderDistributedDataStore.getActorContext(),
+ leaderTestKit.waitUntilLeader(leaderDistributedDataStore.getActorUtils(),
ClusterUtils.getCleanShardName(TEST_ID.getRootIdentifier()));
LOG.warn("Got after waiting for nonleader");
- final ActorRef leaderShardManager = leaderDistributedDataStore.getActorContext().getShardManager();
+ final ActorRef leaderShardManager = leaderDistributedDataStore.getActorUtils().getShardManager();
- leaderTestKit.waitUntilLeader(leaderDistributedDataStore.getActorContext(),
+ leaderTestKit.waitUntilLeader(leaderDistributedDataStore.getActorUtils(),
ClusterUtils.getCleanShardName(TestModel.TEST_PATH));
final YangInstanceIdentifier oid1 = getOuterListIdFor(0);
leaderShardFactory.createDistributedShard(outerListPath, Lists.newArrayList(AbstractTest.MEMBER_NAME)),
DistributedShardedDOMDataTree.SHARD_FUTURE_TIMEOUT_DURATION);
- leaderTestKit.waitUntilLeader(leaderDistributedDataStore.getActorContext(),
+ leaderTestKit.waitUntilLeader(leaderDistributedDataStore.getActorUtils(),
ClusterUtils.getCleanShardName(outerListPath.getRootIdentifier()));
final DOMDataTreeProducer shardProducer = leaderShardFactory.createProducer(
}
final DOMDataTreeIdentifier rootId =
- new DOMDataTreeIdentifier(LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.EMPTY);
+ new DOMDataTreeIdentifier(LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.empty());
final DOMDataTreeProducer producer = leaderShardFactory.createProducer(Collections.singletonList(
rootId));
TEST_ID, Lists.newArrayList(AbstractTest.MEMBER_NAME)),
DistributedShardedDOMDataTree.SHARD_FUTURE_TIMEOUT_DURATION);
- leaderTestKit.waitUntilLeader(leaderDistributedDataStore.getActorContext(),
+ leaderTestKit.waitUntilLeader(leaderDistributedDataStore.getActorUtils(),
ClusterUtils.getCleanShardName(TestModel.TEST_PATH));
- assertNotNull(findLocalShard(leaderDistributedDataStore.getActorContext(),
+ assertNotNull(findLocalShard(leaderDistributedDataStore.getActorUtils(),
ClusterUtils.getCleanShardName(TestModel.TEST_PATH)));
waitOnAsyncTask(reg1.close(), DistributedShardedDOMDataTree.SHARD_FUTURE_TIMEOUT_DURATION);
- waitUntilShardIsDown(leaderDistributedDataStore.getActorContext(),
+ waitUntilShardIsDown(leaderDistributedDataStore.getActorUtils(),
ClusterUtils.getCleanShardName(TestModel.TEST_PATH));
}
}
TEST_ID, Lists.newArrayList(AbstractTest.MEMBER_NAME)),
DistributedShardedDOMDataTree.SHARD_FUTURE_TIMEOUT_DURATION);
- leaderTestKit.waitUntilLeader(leaderDistributedDataStore.getActorContext(),
+ leaderTestKit.waitUntilLeader(leaderDistributedDataStore.getActorUtils(),
ClusterUtils.getCleanShardName(TestModel.TEST_PATH));
- assertNotNull(findLocalShard(leaderDistributedDataStore.getActorContext(),
+ assertNotNull(findLocalShard(leaderDistributedDataStore.getActorUtils(),
ClusterUtils.getCleanShardName(TestModel.TEST_PATH)));
final DOMDataTreeIdentifier configRoot =
- new DOMDataTreeIdentifier(LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.EMPTY);
+ new DOMDataTreeIdentifier(LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.empty());
final DOMDataTreeProducer producer = leaderShardFactory.createProducer(Collections.singleton(configRoot));
assertTrue(producer instanceof CDSDataTreeProducer);
final Collection<MapEntryNode> ret = new ArrayList<>();
for (int i = 0; i < amount; i++) {
ret.add(ImmutableNodes.mapEntryBuilder()
- .withNodeIdentifier(new NodeIdentifierWithPredicates(TestModel.OUTER_LIST_QNAME,
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(TestModel.OUTER_LIST_QNAME,
QName.create(TestModel.OUTER_LIST_QNAME, "id"), i))
.withChild(ImmutableNodes
.leafNode(QName.create(TestModel.OUTER_LIST_QNAME, "id"), i))
final Collection<MapEntryNode> ret = new ArrayList<>();
for (int i = 0; i < amount; i++) {
ret.add(ImmutableNodes.mapEntryBuilder()
- .withNodeIdentifier(new NodeIdentifierWithPredicates(TestModel.INNER_LIST_QNAME,
+ .withNodeIdentifier(NodeIdentifierWithPredicates.of(TestModel.INNER_LIST_QNAME,
QName.create(TestModel.INNER_LIST_QNAME, "name"), Integer.toString(i)))
.withChild(ImmutableNodes
.leafNode(QName.create(TestModel.INNER_LIST_QNAME, "value"), valuePrefix + "-" + i))
}
private static YangInstanceIdentifier getOuterListIdFor(final int id) {
- return TestModel.OUTER_LIST_PATH.node(new NodeIdentifierWithPredicates(
+ return TestModel.OUTER_LIST_PATH.node(NodeIdentifierWithPredicates.of(
TestModel.OUTER_LIST_QNAME, QName.create(TestModel.OUTER_LIST_QNAME, "id"), id));
}
}