Search in sources :

Example 6 with FrontendIdentifier

use of org.opendaylight.controller.cluster.access.concepts.FrontendIdentifier in project controller by opendaylight.

the class FrontendMetadata method doApplySnapshot.

@Override
void doApplySnapshot(final FrontendShardDataTreeSnapshotMetadata snapshot) {
    LOG.debug("{}: applying snapshot {} over clients {}", shardName, snapshot, clients);
    clients.clear();
    for (FrontendClientMetadata m : snapshot.getClients()) {
        LOG.debug("{}: applying metadata {}", shardName, m);
        final FrontendClientMetadataBuilder b = new FrontendClientMetadataBuilder(shardName, m);
        final FrontendIdentifier client = m.getIdentifier().getFrontendId();
        LOG.debug("{}: client {} updated to {}", shardName, client, b);
        clients.put(client, b);
    }
}
Also used : FrontendClientMetadata(org.opendaylight.controller.cluster.datastore.persisted.FrontendClientMetadata) FrontendIdentifier(org.opendaylight.controller.cluster.access.concepts.FrontendIdentifier)

Example 7 with FrontendIdentifier

use of org.opendaylight.controller.cluster.access.concepts.FrontendIdentifier in project controller by opendaylight.

the class SimpleDataStoreClientActor method props.

public static Props props(@Nonnull final MemberName memberName, @Nonnull final String storeName, final ActorContext ctx, final String shardName) {
    final String name = "datastore-" + storeName;
    final FrontendIdentifier frontendId = FrontendIdentifier.create(memberName, FrontendType.forName(name));
    return Props.create(SimpleDataStoreClientActor.class, () -> new SimpleDataStoreClientActor(frontendId, ctx, shardName));
}
Also used : FrontendIdentifier(org.opendaylight.controller.cluster.access.concepts.FrontendIdentifier)

Example 8 with FrontendIdentifier

use of org.opendaylight.controller.cluster.access.concepts.FrontendIdentifier in project controller by opendaylight.

the class ClientBackedTransactionChainTest method setUp.

@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    final FrontendIdentifier frontendId = FrontendIdentifier.create(MemberName.forName("member"), FrontendType.forName("frontend"));
    final ClientIdentifier clientId = ClientIdentifier.create(frontendId, 0);
    final LocalHistoryIdentifier historyId = new LocalHistoryIdentifier(clientId, 0);
    final TransactionIdentifier transactionId = new TransactionIdentifier(historyId, 0);
    Mockito.when(history.getIdentifier()).thenReturn(historyId);
    Mockito.when(transaction.getIdentifier()).thenReturn(transactionId);
    Mockito.when(snapshot.getIdentifier()).thenReturn(transactionId);
    Mockito.when(history.takeSnapshot()).thenReturn(snapshot);
    Mockito.when(history.createTransaction()).thenReturn(transaction);
    chain = new ClientBackedTransactionChain(history, false);
}
Also used : ClientIdentifier(org.opendaylight.controller.cluster.access.concepts.ClientIdentifier) TransactionIdentifier(org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier) LocalHistoryIdentifier(org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier) FrontendIdentifier(org.opendaylight.controller.cluster.access.concepts.FrontendIdentifier) Before(org.junit.Before)

Example 9 with FrontendIdentifier

use of org.opendaylight.controller.cluster.access.concepts.FrontendIdentifier in project controller by opendaylight.

the class DistributedDataStoreClientActor method props.

public static Props props(@Nonnull final MemberName memberName, @Nonnull final String storeName, final ActorContext ctx) {
    final String name = "datastore-" + storeName;
    final FrontendIdentifier frontendId = FrontendIdentifier.create(memberName, FrontendType.forName(name));
    return Props.create(DistributedDataStoreClientActor.class, () -> new DistributedDataStoreClientActor(frontendId, ctx));
}
Also used : FrontendIdentifier(org.opendaylight.controller.cluster.access.concepts.FrontendIdentifier)

Aggregations

FrontendIdentifier (org.opendaylight.controller.cluster.access.concepts.FrontendIdentifier)9 ClientIdentifier (org.opendaylight.controller.cluster.access.concepts.ClientIdentifier)5 Before (org.junit.Before)2 LocalHistoryIdentifier (org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier)2 SelectedSnapshot (akka.persistence.SelectedSnapshot)1 SnapshotMetadata (akka.persistence.SnapshotMetadata)1 UnsignedLong (com.google.common.primitives.UnsignedLong)1 Test (org.junit.Test)1 FrontendType (org.opendaylight.controller.cluster.access.concepts.FrontendType)1 TransactionIdentifier (org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier)1 FrontendClientMetadata (org.opendaylight.controller.cluster.datastore.persisted.FrontendClientMetadata)1