import org.opendaylight.controller.clustering.it.provider.impl.GetConstantService;
import org.opendaylight.controller.clustering.it.provider.impl.IdIntsDOMDataTreeLIstener;
import org.opendaylight.controller.clustering.it.provider.impl.IdIntsListener;
+import org.opendaylight.controller.clustering.it.provider.impl.PrefixLeaderHandler;
import org.opendaylight.controller.clustering.it.provider.impl.PrefixShardHandler;
import org.opendaylight.controller.clustering.it.provider.impl.ProduceTransactionsHandler;
import org.opendaylight.controller.clustering.it.provider.impl.PublishNotificationsTask;
private final SchemaService schemaService;
private final ClusterSingletonServiceProvider singletonService;
private final DOMRpcProviderService domRpcService;
+ private final PrefixLeaderHandler prefixLeaderHandler;
private final PrefixShardHandler prefixShardHandler;
private final DOMDataTreeChangeService domDataTreeChangeService;
this.domDataBroker = domDataBroker;
this.domDataTreeService = domDataTreeService;
this.distributedShardFactory = distributedShardFactory;
+ this.prefixLeaderHandler = new PrefixLeaderHandler(domDataTreeService, bindingNormalizedNodeSerializer);
domDataTreeChangeService =
(DOMDataTreeChangeService) domDataBroker.getSupportedExtensions().get(DOMDataTreeChangeService.class);
registration = rpcRegistry.addRpcImplementation(OdlMdsalLowlevelControlService.class, this);
- prefixShardHandler = new PrefixShardHandler(distributedShardFactory, bindingNormalizedNodeSerializer);
+ prefixShardHandler = new PrefixShardHandler(distributedShardFactory, domDataTreeService,
+ bindingNormalizedNodeSerializer);
}
@Override
dtclReg = domDataTreeChangeService
.registerDataTreeChangeListener(
new org.opendaylight.controller.md.sal.dom.api.DOMDataTreeIdentifier(
- CONTROLLER_CONFIG, WriteTransactionsHandler.ID_INTS_YID),
+ CONTROLLER_CONFIG, WriteTransactionsHandler.ID_INT_YID),
idIntsListener);
return Futures.immediateFuture(RpcResultBuilder.<Void>success().build());
@Override
public Future<RpcResult<Void>> becomePrefixLeader(final BecomePrefixLeaderInput input) {
- return null;
+ LOG.debug("become-prefix-leader, input: {}", input);
+
+ return prefixLeaderHandler.makeLeaderLocal(input);
}
@Override
ddtlReg =
domDataTreeService.registerListener(idIntsDdtl,
Collections.singleton(new DOMDataTreeIdentifier(LogicalDatastoreType.CONFIGURATION,
- ProduceTransactionsHandler.ID_INTS_YID))
+ ProduceTransactionsHandler.ID_INT_YID))
, true, Collections.emptyList());
} catch (DOMDataTreeLoopException e) {
LOG.error("Failed to register DOMDataTreeListener.", e);
}
final Optional<NormalizedNode<?, ?>> readResult =
- rTx.read(CONTROLLER_CONFIG, WriteTransactionsHandler.ID_INTS_YID).checkedGet();
+ rTx.read(CONTROLLER_CONFIG, WriteTransactionsHandler.ID_INT_YID).checkedGet();
if (!readResult.isPresent()) {
final RpcError error = RpcResultBuilder.newError(
try {
final ListenerRegistration<ReadListener> registration = domDataTreeService.registerListener(readListener,
Collections.singleton(new DOMDataTreeIdentifier(LogicalDatastoreType.CONFIGURATION,
- ProduceTransactionsHandler.ID_INTS_YID))
+ ProduceTransactionsHandler.ID_INT_YID))
, true, Collections.emptyList());
final DataTreeCandidate dataTreeCandidate = readListener.getFirstNotif().get();
RpcResultBuilder.success(new UnsubscribeDdtlOutputBuilder()
.setCopyMatches(idIntsDdtl.checkEqual(lastRead))).build());
-
} catch (final DOMDataTreeLoopException | InterruptedException | ExecutionException e) {
LOG.error("Unable to read data to verify ddtl data.", e);
final RpcError error = RpcResultBuilder.newError(