org.apache.helix.model.Message.getToState()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(174)

本文整理了Java中org.apache.helix.model.Message.getToState()方法的一些代码示例,展示了Message.getToState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getToState()方法的具体详情如下:
包路径:org.apache.helix.model.Message
类名称:Message
方法名:getToState

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);
 }
}

相关文章