本文整理了Java中org.apache.helix.model.Message.getMsgState()
方法的一些代码示例,展示了Message.getMsgState()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getMsgState()
方法的具体详情如下:
包路径:org.apache.helix.model.Message
类名称:Message
方法名:getMsgState
[英]Get the current state of the message
[中]获取消息的当前状态
代码示例来源:origin: org.apache.helix/helix-core
/**
* Instantiate a message
* @param record a ZNRecord corresponding to a message
*/
public Message(ZNRecord record) {
super(record);
if (getMsgState() == null) {
setMsgState(MessageState.NEW);
}
if (getCreateTimeStamp() == 0) {
_record.setLongField(Attributes.CREATE_TIMESTAMP.toString(), new Date().getTime());
}
}
代码示例来源:origin: apache/helix
/**
* Instantiate a message
* @param record a ZNRecord corresponding to a message
*/
public Message(ZNRecord record) {
super(record);
if (getMsgState() == null) {
setMsgState(MessageState.NEW);
}
if (getCreateTimeStamp() == 0) {
_record.setLongField(Attributes.CREATE_TIMESTAMP.toString(), new Date().getTime());
}
}
代码示例来源:origin: apache/helix
/**
* Create a statusupdate that is related to a cluster manager message.
* @param message
* the related cluster manager message
* @param level
* the error level
* @param classInfo
* class info about the class that reports the status update
* @param additionalInfo
* info the additional debug information
*/
public ZNRecord createMessageStatusUpdateRecord(Message message, Level level, Class classInfo,
String additionalInfo) {
ZNRecord result = createEmptyStatusUpdateRecord(getStatusUpdateRecordName(message));
Map<String, String> contentMap = new TreeMap<String, String>();
contentMap.put("Message state",
(message.getMsgState() == null ? "NULL" : message.getMsgState().toString()));
contentMap.put("AdditionalInfo", additionalInfo);
contentMap.put("Class", classInfo.toString());
contentMap.put("MSG_ID", message.getMsgId());
result.setMapField(generateMapFieldId(level, getRecordIdForMessage(message)), contentMap);
return result;
}
代码示例来源:origin: org.apache.helix/helix-core
/**
* Create a statusupdate that is related to a cluster manager message.
* @param message
* the related cluster manager message
* @param level
* the error level
* @param classInfo
* class info about the class that reports the status update
* @param additionalInfo
* info the additional debug information
*/
public ZNRecord createMessageStatusUpdateRecord(Message message, Level level, Class classInfo,
String additionalInfo) {
ZNRecord result = createEmptyStatusUpdateRecord(getStatusUpdateRecordName(message));
Map<String, String> contentMap = new TreeMap<String, String>();
contentMap.put("Message state",
(message.getMsgState() == null ? "NULL" : message.getMsgState().toString()));
contentMap.put("AdditionalInfo", additionalInfo);
contentMap.put("Class", classInfo.toString());
contentMap.put("MSG_ID", message.getMsgId());
result.setMapField(generateMapFieldId(level, getRecordIdForMessage(message)), contentMap);
return result;
}
代码示例来源:origin: apache/helix
@GET
@Path("{instanceName}/messages")
public Response getMessagesOnInstance(@PathParam("clusterId") String clusterId,
@PathParam("instanceName") String instanceName) throws IOException {
HelixDataAccessor accessor = getDataAccssor(clusterId);
ObjectNode root = JsonNodeFactory.instance.objectNode();
root.put(Properties.id.name(), instanceName);
ArrayNode newMessages = root.putArray(InstanceProperties.new_messages.name());
ArrayNode readMessages = root.putArray(InstanceProperties.read_messages.name());
List<String> messages =
accessor.getChildNames(accessor.keyBuilder().messages(instanceName));
if (messages == null || messages.size() == 0) {
return notFound();
}
for (String messageName : messages) {
Message message = accessor.getProperty(accessor.keyBuilder().message(instanceName, messageName));
if (message.getMsgState() == Message.MessageState.NEW) {
newMessages.add(messageName);
}
if (message.getMsgState() == Message.MessageState.READ) {
readMessages.add(messageName);
}
}
root.put(InstanceProperties.total_message_count.name(),
newMessages.size() + readMessages.size());
root.put(InstanceProperties.read_message_count.name(), readMessages.size());
return JSONRepresentation(root);
}
代码示例来源:origin: org.apache.helix/helix-core
if (MessageState.NEW != message.getMsgState()) {
代码示例来源:origin: apache/helix
if (MessageState.NEW != message.getMsgState()) {
代码示例来源:origin: apache/helix
AssertJUnit.assertTrue(factory._handlersCreated == nMsgs1);
AssertJUnit.assertTrue(exceptionMsg.getMsgState() == MessageState.UNPROCESSABLE);
System.out.println("END TestCMTaskExecutor.testCreateHandlerException()");
代码示例来源:origin: apache/helix
if (toState.equals(state) && message.getMsgState() == Message.MessageState.NEW) {
getMessageTarget(message.getResourceName(), message.getPartitionName());
if (message.getMsgState() == Message.MessageState.NEW &&
_messageTaskMap.containsKey(messageTarget)) {
String taskId = _messageTaskMap.get(messageTarget);
内容来源于网络,如有侵权,请联系作者删除!