use of org.apache.helix.NotificationContext in project helix by apache.
the class TestDistControllerStateModel method testOnBecomeLeaderFromStandby.
@Test()
public void testOnBecomeLeaderFromStandby() {
Message message = new Message(MessageType.STATE_TRANSITION, "0");
message.setPartitionName(clusterName);
message.setTgtName("controller_0");
try {
stateModel.onBecomeLeaderFromStandby(message, new NotificationContext(null));
} catch (Exception e) {
LOG.error("Exception becoming leader from standby", e);
}
stateModel.onBecomeStandbyFromLeader(message, new NotificationContext(null));
}
use of org.apache.helix.NotificationContext in project helix by apache.
the class TestDistControllerStateModel method testOnBecomeStandbyFromLeader.
@Test()
public void testOnBecomeStandbyFromLeader() {
Message message = new Message(MessageType.STATE_TRANSITION, "0");
message.setPartitionName(clusterName);
message.setTgtName("controller_0");
stateModel.onBecomeStandbyFromLeader(message, new NotificationContext(null));
}
use of org.apache.helix.NotificationContext in project helix by apache.
the class TestDistControllerStateModel method testRollbackOnError.
@Test()
public void testRollbackOnError() {
Message message = new Message(MessageType.STATE_TRANSITION, "0");
message.setPartitionName(clusterName);
message.setTgtName("controller_0");
try {
stateModel.onBecomeLeaderFromStandby(message, new NotificationContext(null));
} catch (Exception e) {
LOG.error("Exception becoming leader from standby", e);
}
stateModel.rollbackOnError(message, new NotificationContext(null), null);
}
use of org.apache.helix.NotificationContext in project ambry by linkedin.
the class MockHelixManager method triggerRoutingTableNotification.
void triggerRoutingTableNotification() {
NotificationContext notificationContext = new NotificationContext(this);
routingTableProvider.onStateChange(instanceName, Collections.emptyList(), notificationContext);
}
use of org.apache.helix.NotificationContext in project ambry by linkedin.
the class MockHelixManager method addExternalViewChangeListener.
@Override
public void addExternalViewChangeListener(ExternalViewChangeListener externalViewChangeListener) throws Exception {
if (beBadException != null) {
throw beBadException;
}
this.externalViewChangeListener = externalViewChangeListener;
NotificationContext notificationContext = new NotificationContext(this);
notificationContext.setType(NotificationContext.Type.INIT);
this.externalViewChangeListener.onExternalViewChange(Collections.emptyList(), notificationContext);
}
Aggregations