use of org.opendaylight.controller.cluster.databroker.actors.dds.ClientSnapshot in project controller by opendaylight.
the class PrefixedShardConfigWriter method checkDefaultIsPresent.
boolean checkDefaultIsPresent() {
final NodeIdentifierWithPredicates pag = new NodeIdentifierWithPredicates(ClusterUtils.SHARD_LIST_QNAME, ClusterUtils.SHARD_PREFIX_QNAME, YangInstanceIdentifier.EMPTY);
final YangInstanceIdentifier defaultId = ClusterUtils.SHARD_LIST_PATH.node(pag);
final ClientSnapshot snapshot = history.takeSnapshot();
try {
return snapshot.exists(defaultId).checkedGet();
} catch (final ReadFailedException e) {
LOG.error("Presence check of default shard in configuration failed.", e);
return false;
} finally {
snapshot.abort();
}
}
Aggregations