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

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

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

Message.getFromState介绍

[英]Get the "from-state" for transition-related messages
[中]获取与转换相关的消息的“来自状态”

代码示例

代码示例来源:origin: apache/helix

  1. private boolean isCancelingSameStateTransition(Message stateTranstionMessage,
  2. Message cancellationMessage) {
  3. return stateTranstionMessage.getFromState().equalsIgnoreCase(cancellationMessage.getFromState())
  4. && stateTranstionMessage.getToState().equalsIgnoreCase(cancellationMessage.getToState());
  5. }

代码示例来源:origin: org.apache.helix/helix-core

  1. private boolean isCancelingSameStateTransition(Message stateTranstionMessage,
  2. Message cancellationMessage) {
  3. return stateTranstionMessage.getFromState().equalsIgnoreCase(cancellationMessage.getFromState())
  4. && stateTranstionMessage.getToState().equalsIgnoreCase(cancellationMessage.getToState());
  5. }

代码示例来源:origin: org.apache.helix/helix-core

  1. public void onBecomeOfflineFromSlave(Message message, NotificationContext context) {
  2. System.out.println(_instanceName + " transitioning from " + message.getFromState() + " to "
  3. + message.getToState() + " for " + partitionName);
  4. sleep();
  5. }

代码示例来源:origin: apache/helix

  1. private String getRecordIdForMessage(Message message) {
  2. if (message.getMsgType().equals(MessageType.STATE_TRANSITION)) {
  3. return message.getPartitionName() + " Trans:" + message.getFromState().charAt(0) + "->"
  4. + message.getToState().charAt(0) + " " + UUID.randomUUID().toString();
  5. } else {
  6. return message.getMsgType() + " " + UUID.randomUUID().toString();
  7. }
  8. }

代码示例来源:origin: org.apache.helix/helix-core

  1. public void onBecomeSlaveFromMaster(Message message, NotificationContext context) {
  2. System.out.println(_instanceName + " transitioning from " + message.getFromState() + " to "
  3. + message.getToState() + " for " + partitionName);
  4. sleep();
  5. }

代码示例来源:origin: org.apache.helix/helix-core

  1. public void onBecomeMasterFromSlave(Message message, NotificationContext context) {
  2. System.out.println(_instanceName + " transitioning from " + message.getFromState() + " to "
  3. + message.getToState() + " for " + partitionName);
  4. sleep();
  5. }

代码示例来源:origin: apache/helix

  1. public void onBecomeSlaveFromOffline(Message message, NotificationContext context) {
  2. System.out.println(_instanceName + " transitioning from " + message.getFromState() + " to "
  3. + message.getToState() + " for " + partitionName);
  4. sleep();
  5. }

代码示例来源:origin: apache/helix

  1. public void onBecomeSlaveFromMaster(Message message, NotificationContext context) {
  2. System.out.println(_instanceName + " transitioning from " + message.getFromState() + " to "
  3. + message.getToState() + " for " + partitionName);
  4. sleep();
  5. }

代码示例来源:origin: apache/helix

  1. @Transition(from = "SLAVE", to = "OFFLINE")
  2. public void onBecomeOfflineFromSlave(Message message, NotificationContext context) {
  3. replicator.stop();
  4. LOG.info(_serverId + " transitioning from " + message.getFromState() + " to "
  5. + message.getToState() + " for " + _partition);
  6. }

代码示例来源:origin: apache/helix

  1. public void onBecomeStandbyFromOffline(Message message, NotificationContext context) {
  2. System.out.println("LeaderStandbyStateModel.onBecomeStandbyFromOffline():" + _instanceName
  3. + " transitioning from " + message.getFromState() + " to " + message.getToState()
  4. + " for " + message.getResourceName() + " " + message.getPartitionName());
  5. sleep();
  6. }

代码示例来源:origin: apache/helix

  1. public void onBecomeStandbyFromLeader(Message message, NotificationContext context) {
  2. System.out.println("LeaderStandbyStateModel.onBecomeStandbyFromLeader():" + _instanceName
  3. + " transitioning from " + message.getFromState() + " to " + message.getToState()
  4. + " for " + message.getResourceName() + " " + message.getPartitionName());
  5. sleep();
  6. }

代码示例来源:origin: apache/helix

  1. public void onBecomeOfflineFromOnline(Message message, NotificationContext context) {
  2. System.out.println(
  3. "OnlineOfflineStateModelFactory.onBecomeOfflineFromOnline():" + _instanceName
  4. + " transitioning from " + message.getFromState() + " to " + message.getToState()
  5. + " for " + message.getResourceName() + " " + message.getPartitionName());
  6. sleep();
  7. }

代码示例来源:origin: org.apache.helix/helix-core

  1. public void onBecomeStandbyFromOffline(Message message, NotificationContext context) {
  2. System.out.println("LeaderStandbyStateModel.onBecomeStandbyFromOffline():" + _instanceName
  3. + " transitioning from " + message.getFromState() + " to " + message.getToState()
  4. + " for " + message.getResourceName() + " " + message.getPartitionName());
  5. sleep();
  6. }

代码示例来源:origin: org.apache.helix/helix-core

  1. public void onBecomeOnlineFromOffline(Message message, NotificationContext context) {
  2. System.out.println(
  3. "OnlineOfflineStateModelFactory.onBecomeOnlineFromOffline():" + _instanceName
  4. + " transitioning from " + message.getFromState() + " to " + message.getToState()
  5. + " for " + message.getResourceName() + " " + message.getPartitionName());
  6. sleep();
  7. }

代码示例来源:origin: org.apache.helix/helix-core

  1. public void onBecomeDroppedFromOffline(Message message, NotificationContext context) {
  2. System.out.println(
  3. "OnlineOfflineStateModelFactory.onBecomeDroppedFromOffline():" + _instanceName
  4. + " transitioning from " + message.getFromState() + " to " + message.getToState()
  5. + " for " + message.getResourceName() + " " + message.getPartitionName());
  6. sleep();
  7. }

代码示例来源:origin: apache/helix

  1. public void onBecomeOfflineFromStandby(Message message, NotificationContext context) {
  2. System.out.println("LeaderStandbyStateModel.onBecomeOfflineFromStandby():" + _instanceName
  3. + " transitioning from " + message.getFromState() + " to " + message.getToState()
  4. + " for " + message.getResourceName() + " " + message.getPartitionName());
  5. sleep();
  6. }

代码示例来源:origin: org.apache.helix/helix-core

  1. public void onBecomeStandbyFromLeader(Message message, NotificationContext context) {
  2. System.out.println("LeaderStandbyStateModel.onBecomeStandbyFromLeader():" + _instanceName
  3. + " transitioning from " + message.getFromState() + " to " + message.getToState()
  4. + " for " + message.getResourceName() + " " + message.getPartitionName());
  5. sleep();
  6. }

代码示例来源:origin: org.apache.helix/helix-core

  1. public void onBecomeOfflineFromOnline(Message message, NotificationContext context) {
  2. System.out.println(
  3. "OnlineOfflineStateModelFactory.onBecomeOfflineFromOnline():" + _instanceName
  4. + " transitioning from " + message.getFromState() + " to " + message.getToState()
  5. + " for " + message.getResourceName() + " " + message.getPartitionName());
  6. sleep();
  7. }

代码示例来源:origin: apache/helix

  1. @Override
  2. public void doTransition(Message message, NotificationContext context) {
  3. // System.err.println("doReset() invoked");
  4. super.doTransition(message, context);
  5. String fromState = message.getFromState();
  6. String toState = message.getToState();
  7. if (fromState.equals("ERROR") && toState.equals("OFFLINE")) {
  8. _errToOfflineInvoked++;
  9. }
  10. }

代码示例来源:origin: apache/helix

  1. @Transition(to = "*", from = "*")
  2. public void generalTransitionHandle(Message message, NotificationContext context)
  3. throws InterruptedException {
  4. LOG.info(String
  5. .format("Resource %s partition %s becomes %s from %s", message.getResourceName(),
  6. message.getPartitionName(), message.getToState(), message.getFromState()));
  7. if (_transition != null) {
  8. _transition.doTransition(message, context);
  9. }
  10. }

相关文章