当前位置: 首页>>代码示例>>Java>>正文


Java Message.getMsgType方法代码示例

本文整理汇总了Java中org.apache.helix.model.Message.getMsgType方法的典型用法代码示例。如果您正苦于以下问题:Java Message.getMsgType方法的具体用法?Java Message.getMsgType怎么用?Java Message.getMsgType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.helix.model.Message的用法示例。


在下文中一共展示了Message.getMsgType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onBecomeCompletedFromOffline

import org.apache.helix.model.Message; //导入方法依赖的package包/类
@Transition(to = "COMPLETED", from = "OFFLINE")
public void onBecomeCompletedFromOffline(Message message, NotificationContext context)
    throws InterruptedException {
  logger.info(_partitionKey + " onBecomeCompletedFromOffline");

  // Construct the inner task message from the mapfields of scheduledTaskQueue resource group
  Map<String, String> messageInfo =
      message.getRecord().getMapField(Message.Attributes.INNER_MESSAGE.toString());
  ZNRecord record = new ZNRecord(_partitionKey);
  record.getSimpleFields().putAll(messageInfo);
  Message taskMessage = new Message(record);
  if (logger.isDebugEnabled()) {
    logger.debug(taskMessage.getRecord().getSimpleFields().toString());
  }
  MessageHandler handler =
      _executor.createMessageHandler(taskMessage, new NotificationContext(null));
  if (handler == null) {
    throw new HelixException("Task message " + taskMessage.getMsgType()
        + " handler not found, task id " + _partitionKey);
  }
  // Invoke the internal handler to complete the task
  handler.handleMessage();
  logger.info(_partitionKey + " onBecomeCompletedFromOffline completed");
}
 
开发者ID:apache,项目名称:helix,代码行数:25,代码来源:ScheduledTaskStateModel.java

示例2: createHandler

import org.apache.helix.model.Message; //导入方法依赖的package包/类
@Override
public MessageHandler createHandler(Message message, NotificationContext context) {
  String type = message.getMsgType();

  if (!type.equals(getMessageType())) {
    throw new HelixException("Unexpected msg type for message " + message.getMsgId() + " type:"
        + message.getMsgType());
  }

  return new DefaultControllerMessageHandler(message, context);
}
 
开发者ID:apache,项目名称:helix,代码行数:12,代码来源:DefaultControllerMessageHandlerFactory.java

示例3: createHandler

import org.apache.helix.model.Message; //导入方法依赖的package包/类
@Override
public MessageHandler createHandler(Message message, NotificationContext context) {
  String type = message.getMsgType();

  if (!type.equals(getMessageType())) {
    throw new HelixException("Unexpected msg type for message " + message.getMsgId() + " type:"
        + message.getMsgType());
  }

  return new DefaultParticipantErrorMessageHandler(message, context, _manager);
}
 
开发者ID:apache,项目名称:helix,代码行数:12,代码来源:DefaultParticipantErrorMessageHandlerFactory.java

示例4: createHandler

import org.apache.helix.model.Message; //导入方法依赖的package包/类
@Override
public MessageHandler createHandler(Message message, NotificationContext context) {
  String type = message.getMsgType();

  if (!type.equals(getMessageType())) {
    throw new HelixException("Unexpected msg type for message " + message.getMsgId() + " type:"
        + message.getMsgType());
  }

  return new DefaultSchedulerMessageHandler(message, context, _manager);
}
 
开发者ID:apache,项目名称:helix,代码行数:12,代码来源:DefaultSchedulerMessageHandlerFactory.java

示例5: getRecordIdForMessage

import org.apache.helix.model.Message; //导入方法依赖的package包/类
private String getRecordIdForMessage(Message message) {
  if (message.getMsgType().equals(MessageType.STATE_TRANSITION)) {
    return message.getPartitionName() + " Trans:" + message.getFromState().charAt(0) + "->"
        + message.getToState().charAt(0) + "  " + UUID.randomUUID().toString();
  } else {
    return message.getMsgType() + " " + UUID.randomUUID().toString();
  }
}
 
开发者ID:apache,项目名称:helix,代码行数:9,代码来源:StatusUpdateUtil.java

示例6: getStatusUpdateSubPath

import org.apache.helix.model.Message; //导入方法依赖的package包/类
/**
 * Generate the sub-path under STATUSUPDATE or ERROR path for a status update
 */
String getStatusUpdateSubPath(Message message) {
  if (message.getMsgType().equalsIgnoreCase(MessageType.STATE_TRANSITION.name())) {
    return message.getResourceName();
  }
  return message.getMsgType();
}
 
开发者ID:apache,项目名称:helix,代码行数:10,代码来源:StatusUpdateUtil.java


注:本文中的org.apache.helix.model.Message.getMsgType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。