本文整理了Java中org.apache.helix.model.Message.getMsgId()
方法的一些代码示例,展示了Message.getMsgId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getMsgId()
方法的具体详情如下:
包路径:org.apache.helix.model.Message
类名称:Message
方法名:getMsgId
[英]Get the unique identifier of this message
[中]获取此消息的唯一标识符
代码示例来源:origin: org.apache.helix/helix-core
@Override
public void onError(Exception e, ErrorCode code, ErrorType type) {
_logger.error("Message handling pipeline get an exception. MsgId:" + _message.getMsgId(), e);
}
}
代码示例来源:origin: apache/helix
@Override
public void onError(Exception e, ErrorCode code, ErrorType type) {
_logger.error("Message handling pipeline get an exception. MsgId:" + _message.getMsgId(), e);
}
}
代码示例来源:origin: org.apache.helix/helix-core
@Override
public void onError(Exception e, ErrorCode code, ErrorType type) {
_logger.error("Message handling pipeline get an exception. MsgId:" + _message.getMsgId(), e);
}
}
代码示例来源:origin: org.apache.helix/helix-core
@Override
public void onError(Exception e, ErrorCode code, ErrorType type) {
_logger.error("Message handling pipeline get an exception. MsgId:" + _message.getMsgId(), e);
}
}
代码示例来源:origin: apache/helix
@Override
public void onError(Exception e, ErrorCode code, ErrorType type) {
_logger.error("Message handling pipeline get an exception. MsgId:" + _message.getMsgId(), e);
}
}
代码示例来源:origin: org.apache.helix/helix-core
private void removeMessageFromZK(HelixDataAccessor accessor, Message message,
String instanceName) {
if (HelixUtil.removeMessageFromZK(accessor, message, instanceName)) {
LOG.info("Successfully removed message {} from ZK.", message.getMsgId());
} else {
LOG.warn("Failed to remove message {} from ZK.", message.getMsgId());
}
}
代码示例来源:origin: org.apache.helix/helix-core
@Override
public void onTimeOut() {
_logger.info("Scheduler msg timeout " + _originalMessage.getMsgId() + " timout with "
+ _timeout + " Ms");
_statusUpdateUtil.logError(_originalMessage, SchedulerAsyncCallback.class, "Task timeout",
_manager);
addSummary(_resultSummaryMap, _originalMessage, _manager, true);
}
代码示例来源:origin: apache/helix
@Override
public void onReplyMessage(Message message) {
// TODO Auto-generated method stub
_repliedMessageId.add(message.getMsgId());
}
代码示例来源:origin: apache/helix
@Override
public void onTimeOut() {
_logger.info("Scheduler msg timeout " + _originalMessage.getMsgId() + " timout with "
+ _timeout + " Ms");
_statusUpdateUtil.logError(_originalMessage, SchedulerAsyncCallback.class, "Task timeout",
_manager);
addSummary(_resultSummaryMap, _originalMessage, _manager, true);
}
代码示例来源:origin: org.apache.helix/helix-core
private List<Message> generateMessagesForController(Message message) {
List<Message> messages = new ArrayList<Message>();
String id = (message.getMsgId() == null) ? UUID.randomUUID().toString() : message.getMsgId();
Message newMessage = new Message(message.getRecord(), id);
newMessage.setMsgId(id);
newMessage.setSrcName(_manager.getInstanceName());
newMessage.setTgtName(InstanceType.CONTROLLER.name());
messages.add(newMessage);
return messages;
}
代码示例来源:origin: org.apache.helix/helix-core
private String getStatusUpdateKey(Message message) {
if (message.getMsgType().equalsIgnoreCase(MessageType.STATE_TRANSITION.name())) {
return message.getPartitionName();
}
return message.getMsgId();
}
代码示例来源:origin: org.apache.helix/helix-core
@Override
public void run() {
Message message = _task.getMessage();
// NotificationContext context = _task.getNotificationContext();
// System.out.println("msg: " + message.getMsgId() + " timeouot.");
LOG.warn("Message time out, canceling. id:" + message.getMsgId() + " timeout : "
+ message.getExecutionTimeout());
_task.onTimeout();
_executor.cancelTask(_task);
}
代码示例来源:origin: org.apache.helix/helix-core
public void updateLatency(Message message) {
long latency = System.currentTimeMillis() - message.getCreateTimeStamp();
_logger.info(String.format("The latency of message %s is %d ms", message.getMsgId(), latency));
_totalMessageCount.updateValue(_totalMessageCount.getValue() + 1);
_totalMessageLatency.updateValue(_totalMessageLatency.getValue() + latency);
_messageLatencyGauge.updateValue(latency);
}
代码示例来源:origin: apache/helix
String getStatusUpdateRecordName(Message message) {
if (message.getMsgType().equalsIgnoreCase(MessageType.STATE_TRANSITION.name())) {
return message.getTgtSessionId() + "__" + message.getResourceName();
}
return message.getMsgId();
}
代码示例来源:origin: apache/helix
@Override
public boolean createControllerMessage(Message message) {
return _baseDataAccessor.create(PropertyPathBuilder.controllerMessage(_clusterName,
message.getMsgId()),
message.getRecord(), AccessOption.PERSISTENT);
}
代码示例来源:origin: apache/helix
@Override
public void run() {
Message message = _task.getMessage();
// NotificationContext context = _task.getNotificationContext();
// System.out.println("msg: " + message.getMsgId() + " timeouot.");
LOG.warn("Message time out, canceling. id:" + message.getMsgId() + " timeout : "
+ message.getExecutionTimeout());
_task.onTimeout();
_executor.cancelTask(_task);
}
代码示例来源:origin: org.apache.helix/helix-core
@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);
}
代码示例来源:origin: org.apache.helix/helix-core
@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);
}
代码示例来源:origin: org.apache.helix/helix-core
@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);
}
代码示例来源:origin: apache/helix
@Override
public HelixTaskResult handleMessage() throws InterruptedException {
HelixTaskResult result = new HelixTaskResult();
result.setSuccess(true);
Thread.sleep(1000);
System.out.println("TestMessagingHandler " + _message.getMsgId());
_processedMsgIds.add(_message.getRecord().getSimpleField("TestMessagingPara"));
result.getTaskResultMap().put("ReplyMessage", "TestReplyMessage");
return result;
}
内容来源于网络,如有侵权,请联系作者删除!