import static java.util.Objects.requireNonNull;
import com.google.common.collect.Collections2;
+import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import java.util.HashMap;
import java.util.Map;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
import org.opendaylight.controller.cluster.datastore.persisted.FrontendClientMetadata;
import org.opendaylight.controller.cluster.datastore.persisted.FrontendShardDataTreeSnapshotMetadata;
+import org.opendaylight.controller.cluster.datastore.utils.ImmutableUnsignedLongSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
ensureClient(txId.getHistoryId().getClientId()).onTransactionPurged(txId);
}
+ @Override
+ void onTransactionsSkipped(final LocalHistoryIdentifier historyId, final ImmutableUnsignedLongSet txIds) {
+ ensureClient(historyId.getClientId()).onTransactionsSkipped(historyId, txIds);
+ }
+
/**
* Transform frontend metadata into an active leader state map.
*
final FrontendIdentifier frontendId = clientId.getFrontendId();
final FrontendClientMetadataBuilder client = clients.get(frontendId);
if (client == null) {
- // When we havent seen the client before, we still need to disable tracking for him since this only gets
+ // When we have not seen the client before, we still need to disable tracking for him since this only gets
// triggered once.
LOG.debug("{}: disableTracking {} does not match any client, pre-disabling client.", shardName, clientId);
clients.put(frontendId, new FrontendClientMetadataBuilder.Disabled(shardName, clientId));
verify(clients.replace(frontendId, client, new FrontendClientMetadataBuilder.Disabled(shardName, clientId)));
}
+
+ ImmutableSet<ClientIdentifier> getClients() {
+ return clients.values().stream()
+ .map(FrontendClientMetadataBuilder::getIdentifier)
+ .collect(ImmutableSet.toImmutableSet());
+ }
}