Package org.apache.helix.api.id

Examples of org.apache.helix.api.id.MessageId


    for (String instanceName : liveinstanceMap.keySet()) {
      String sessionid = liveinstanceMap.get(instanceName).getTypedSessionId().stringify();
      for (String partition : ev.getPartitionSet()) {
        if (ev.getStateMap(partition).containsKey(instanceName)) {
          MessageId uuid = MessageId.from(UUID.randomUUID().toString());
          Message message = new Message(MessageType.STATE_TRANSITION, uuid);
          boolean rand = new Random().nextInt(10) > 5;
          if (ev.getStateMap(partition).get(instanceName).equals("MASTER")) {
            message.setSrcName(manager.getInstanceName());
            message.setTgtName(instanceName);
View Full Code Here


  private Message createMessage(HelixManager manager, ResourceId resourceId,
      PartitionId partitionId, ParticipantId participantId, State currentState, State nextState,
      SessionId participantSessionId, StateModelDefId stateModelDefId,
      StateModelFactoryId stateModelFactoryId, int bucketSize) {
    MessageId uuid = MessageId.from(UUID.randomUUID().toString());
    Message message = new Message(MessageType.STATE_TRANSITION, uuid);
    message.setSrcName(manager.getInstanceName());
    message.setTgtName(participantId.stringify());
    message.setMsgState(MessageState.NEW);
    message.setPartitionId(partitionId);
View Full Code Here

public class TestHelixTaskExecutor {

  @Test()
  public void testCMTaskExecutor() throws Exception {
    System.out.println("START TestCMTaskExecutor");
    MessageId msgId = MessageId.from("TestMessageId");
    Message message = new Message(MessageType.TASK_REPLY, msgId);

    message.setMessageId(msgId);
    message.setSrcName("cm-instance-0");
    message.setTgtName("cm-instance-1");
View Full Code Here

    post(zkServer, message, clusterName, instanceName);
  }

  public void postTestMessage(String zkServer, String clusterName, String instanceName) {
    String msgSrc = "cm-instance-0";
    MessageId msgId = MessageId.from("TestMessageId-2");

    Message message = new Message(MessageType.STATE_TRANSITION, msgId);
    message.setMessageId(msgId);
    message.setSrcName(msgSrc);
    message.setTgtName(instanceName);
View Full Code Here

    TestMessagingHandlerFactory factory = new TestMessagingHandlerFactory();
    _participants[1].getMessagingService().registerMessageHandlerFactory(factory.getMessageType(),
        factory);

    MessageId msgId = MessageId.from(new UUID(123, 456).toString());
    Message msg = new Message(factory.getMessageType(), msgId);
    msg.setMessageId(msgId);
    msg.setSrcName(hostSrc);
    msg.setTgtSessionId(SessionId.from("*"));
    msg.setMsgState(MessageState.NEW);
View Full Code Here

        factory);

    _participants[0].getMessagingService().registerMessageHandlerFactory(factory.getMessageType(),
        factory);

    MessageId msgId = MessageId.from(new UUID(123, 456).toString());
    Message msg = new Message(factory.getMessageType(), msgId);
    msg.setMessageId(msgId);
    msg.setSrcName(hostSrc);

    msg.setTgtSessionId(SessionId.from("*"));
 
View Full Code Here

    TestMessagingHandlerFactory factory = new TestMessagingHandlerFactory();
    _participants[1].getMessagingService().registerMessageHandlerFactory(factory.getMessageType(),
        factory);

    MessageId msgId = MessageId.from(new UUID(123, 456).toString());
    Message msg = new Message(factory.getMessageType(), msgId);
    msg.setMessageId(msgId);
    msg.setSrcName(hostSrc);

    msg.setTgtSessionId(SessionId.from("*"));
 
View Full Code Here

      String hostDest = "localhost_" + (START_PORT + i);
      _participants[0].getMessagingService().registerMessageHandlerFactory(
          factory.getMessageType(), factory);

    }
    MessageId msgId = MessageId.from(new UUID(123, 456).toString());
    Message msg = new Message(new TestMessagingHandlerFactory().getMessageType(), msgId);
    msg.setMessageId(msgId);
    msg.setSrcName(hostSrc);

    msg.setTgtSessionId(SessionId.from("*"));
 
View Full Code Here

      String hostDest = "localhost_" + (START_PORT + i);
      _participants[i].getMessagingService().registerMessageHandlerFactory(
          factory.getMessageType(), factory);

    }
    MessageId msgId = MessageId.from(new UUID(123, 456).toString());
    Message msg = new Message(new TestMessagingHandlerFactory().getMessageType(), msgId);
    msg.setMessageId(msgId);
    msg.setSrcName(hostSrc);

    msg.setTgtSessionId(SessionId.from("*"));
 
View Full Code Here

      String hostDest = "localhost_" + (START_PORT + i);
      _participants[i].getMessagingService().registerMessageHandlerFactory(
          factory.getMessageType(), factory);

    }
    MessageId msgId = MessageId.from(new UUID(123, 456).toString());
    Message msg = new Message(MessageType.CONTROLLER_MSG, msgId);
    msg.setMessageId(msgId);
    msg.setSrcName(hostSrc);

    msg.setTgtSessionId(SessionId.from("*"));
 
View Full Code Here

TOP

Related Classes of org.apache.helix.api.id.MessageId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.