constraints.put("CONSTRAINT_VALUE", "1");
constraints.put("INSTANCE", ".*");
admin.addMessageConstraint(clusterName, "constraint1", constraints);
final ZKHelixDataAccessor accessor =
new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_gZkClient));
// make sure we never see more than 1 state transition message for each participant
final AtomicBoolean success = new AtomicBoolean(true);
for (int i = 0; i < 5; i++)
{
String instanceName = "localhost_" + (12918 + i);
String msgPath =
PropertyPathConfig.getPath(PropertyType.MESSAGES, clusterName, instanceName);
_gZkClient.subscribeChildChanges(msgPath, new IZkChildListener()
{
@Override
public void handleChildChange(String parentPath, List<String> currentChilds) throws Exception
{
if (currentChilds != null && currentChilds.size() > 1)
{
List<ZNRecord> records = accessor.getBaseDataAccessor().getChildren(parentPath, null, 0);
int transitionMsgCount = 0;
for (ZNRecord record : records)
{
Message msg = new Message(record);
if(msg.getMsgType().equals(Message.MessageType.STATE_TRANSITION.toString()))