本文整理了Java中org.apache.helix.model.Message.getToState()
方法的一些代码示例,展示了Message.getToState()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getToState()
方法的具体详情如下:
包路径:org.apache.helix.model.Message
类名称:Message
方法名:getToState
[英]Get the "to state" for transition-related messages
[中]获取与转换相关的消息的“to state”
代码示例来源:origin: apache/helix
private boolean isCancelingSameStateTransition(Message stateTranstionMessage,
Message cancellationMessage) {
return stateTranstionMessage.getFromState().equalsIgnoreCase(cancellationMessage.getFromState())
&& stateTranstionMessage.getToState().equalsIgnoreCase(cancellationMessage.getToState());
}
代码示例来源:origin: org.apache.helix/helix-core
public void onBecomeOfflineFromSlave(Message message, NotificationContext context) {
System.out.println(_instanceName + " transitioning from " + message.getFromState() + " to "
+ message.getToState() + " for " + partitionName);
sleep();
}
代码示例来源:origin: apache/helix
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();
}
}
代码示例来源:origin: org.apache.helix/helix-core
public void onBecomeSlaveFromMaster(Message message, NotificationContext context) {
System.out.println(_instanceName + " transitioning from " + message.getFromState() + " to "
+ message.getToState() + " for " + partitionName);
sleep();
}
代码示例来源:origin: org.apache.helix/helix-core
public void onBecomeMasterFromSlave(Message message, NotificationContext context) {
System.out.println(_instanceName + " transitioning from " + message.getFromState() + " to "
+ message.getToState() + " for " + partitionName);
sleep();
}
代码示例来源:origin: apache/helix
public void onBecomeSlaveFromOffline(Message message, NotificationContext context) {
System.out.println(_instanceName + " transitioning from " + message.getFromState() + " to "
+ message.getToState() + " for " + partitionName);
sleep();
}
代码示例来源:origin: apache/helix
public void onBecomeSlaveFromMaster(Message message, NotificationContext context) {
System.out.println(_instanceName + " transitioning from " + message.getFromState() + " to "
+ message.getToState() + " for " + partitionName);
sleep();
}
代码示例来源:origin: apache/helix
@Transition(from = "SLAVE", to = "OFFLINE")
public void onBecomeOfflineFromSlave(Message message, NotificationContext context) {
replicator.stop();
LOG.info(_serverId + " transitioning from " + message.getFromState() + " to "
+ message.getToState() + " for " + _partition);
}
代码示例来源:origin: apache/helix
public void onBecomeStandbyFromOffline(Message message, NotificationContext context) {
System.out.println("LeaderStandbyStateModel.onBecomeStandbyFromOffline():" + _instanceName
+ " transitioning from " + message.getFromState() + " to " + message.getToState()
+ " for " + message.getResourceName() + " " + message.getPartitionName());
sleep();
}
代码示例来源:origin: apache/helix
public void onBecomeStandbyFromLeader(Message message, NotificationContext context) {
System.out.println("LeaderStandbyStateModel.onBecomeStandbyFromLeader():" + _instanceName
+ " transitioning from " + message.getFromState() + " to " + message.getToState()
+ " for " + message.getResourceName() + " " + message.getPartitionName());
sleep();
}
代码示例来源:origin: apache/helix
public void onBecomeOfflineFromOnline(Message message, NotificationContext context) {
System.out.println(
"OnlineOfflineStateModelFactory.onBecomeOfflineFromOnline():" + _instanceName
+ " transitioning from " + message.getFromState() + " to " + message.getToState()
+ " for " + message.getResourceName() + " " + message.getPartitionName());
sleep();
}
代码示例来源:origin: org.apache.helix/helix-core
public void onBecomeStandbyFromOffline(Message message, NotificationContext context) {
System.out.println("LeaderStandbyStateModel.onBecomeStandbyFromOffline():" + _instanceName
+ " transitioning from " + message.getFromState() + " to " + message.getToState()
+ " for " + message.getResourceName() + " " + message.getPartitionName());
sleep();
}
代码示例来源:origin: org.apache.helix/helix-core
public void onBecomeOnlineFromOffline(Message message, NotificationContext context) {
System.out.println(
"OnlineOfflineStateModelFactory.onBecomeOnlineFromOffline():" + _instanceName
+ " transitioning from " + message.getFromState() + " to " + message.getToState()
+ " for " + message.getResourceName() + " " + message.getPartitionName());
sleep();
}
代码示例来源:origin: org.apache.helix/helix-core
public void onBecomeDroppedFromOffline(Message message, NotificationContext context) {
System.out.println(
"OnlineOfflineStateModelFactory.onBecomeDroppedFromOffline():" + _instanceName
+ " transitioning from " + message.getFromState() + " to " + message.getToState()
+ " for " + message.getResourceName() + " " + message.getPartitionName());
sleep();
}
代码示例来源:origin: apache/helix
public void onBecomeOfflineFromStandby(Message message, NotificationContext context) {
System.out.println("LeaderStandbyStateModel.onBecomeOfflineFromStandby():" + _instanceName
+ " transitioning from " + message.getFromState() + " to " + message.getToState()
+ " for " + message.getResourceName() + " " + message.getPartitionName());
sleep();
}
代码示例来源:origin: org.apache.helix/helix-core
public void onBecomeStandbyFromLeader(Message message, NotificationContext context) {
System.out.println("LeaderStandbyStateModel.onBecomeStandbyFromLeader():" + _instanceName
+ " transitioning from " + message.getFromState() + " to " + message.getToState()
+ " for " + message.getResourceName() + " " + message.getPartitionName());
sleep();
}
代码示例来源:origin: org.apache.helix/helix-core
public void onBecomeOfflineFromOnline(Message message, NotificationContext context) {
System.out.println(
"OnlineOfflineStateModelFactory.onBecomeOfflineFromOnline():" + _instanceName
+ " transitioning from " + message.getFromState() + " to " + message.getToState()
+ " for " + message.getResourceName() + " " + message.getPartitionName());
sleep();
}
代码示例来源:origin: org.apache.helix/helix-core
void disablePartition() {
String instanceName = _manager.getInstanceName();
String resourceName = _message.getResourceName();
String partitionName = _message.getPartitionName();
String clusterName = _manager.getClusterName();
HelixAdmin admin = _manager.getClusterManagmentTool();
admin.enablePartition(false, clusterName, instanceName, resourceName,
Arrays.asList(partitionName));
logger.info("error in transit from ERROR to " + _message.getToState() + " for partition: "
+ partitionName + ". disable it on " + instanceName);
}
代码示例来源:origin: apache/helix
@Override
public void doTransition(Message message, NotificationContext context) {
// System.err.println("doReset() invoked");
super.doTransition(message, context);
String fromState = message.getFromState();
String toState = message.getToState();
if (fromState.equals("ERROR") && toState.equals("OFFLINE")) {
_errToOfflineInvoked++;
}
}
代码示例来源:origin: apache/helix
@Transition(to = "*", from = "*")
public void generalTransitionHandle(Message message, NotificationContext context)
throws InterruptedException {
LOG.info(String
.format("Resource %s partition %s becomes %s from %s", message.getResourceName(),
message.getPartitionName(), message.getToState(), message.getFromState()));
if (_transition != null) {
_transition.doTransition(message, context);
}
}
内容来源于网络,如有侵权,请联系作者删除!