Search in sources :

Example 1 with CreateLocalHistoryRequest

use of org.opendaylight.controller.cluster.access.commands.CreateLocalHistoryRequest in project controller by opendaylight.

the class AbstractClientHistory method createHistoryProxy.

/**
 * Create a new history proxy for a given shard.
 *
 * @throws InversibleLockException if the shard is being reconnected
 */
@GuardedBy("lock")
private ProxyHistory createHistoryProxy(final Long shard) {
    final AbstractClientConnection<ShardBackendInfo> connection = client.getConnection(shard);
    final LocalHistoryIdentifier proxyId = new LocalHistoryIdentifier(identifier.getClientId(), identifier.getHistoryId(), shard);
    LOG.debug("Created proxyId {} for history {} shard {}", proxyId, identifier, shard);
    final ProxyHistory ret = createHistoryProxy(proxyId, connection);
    // Request creation of the history, if it is not the single history
    if (ret.getIdentifier().getHistoryId() != 0) {
        connection.sendRequest(new CreateLocalHistoryRequest(ret.getIdentifier(), connection.localActor()), this::createHistoryCallback);
    }
    return ret;
}
Also used : CreateLocalHistoryRequest(org.opendaylight.controller.cluster.access.commands.CreateLocalHistoryRequest) LocalHistoryIdentifier(org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier) GuardedBy(javax.annotation.concurrent.GuardedBy)

Aggregations

GuardedBy (javax.annotation.concurrent.GuardedBy)1 CreateLocalHistoryRequest (org.opendaylight.controller.cluster.access.commands.CreateLocalHistoryRequest)1 LocalHistoryIdentifier (org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier)1