com.hazelcast.instance.Node.isRunning()方法的使用及代码示例

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

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

Node.isRunning介绍

[英]Indicates that node is not shutting down or it has not already shut down
[中]指示节点未关闭或尚未关闭

代码示例

代码示例来源:origin: hazelcast/hazelcast-jet

  1. @Override
  2. public boolean isRunning() {
  3. //no synchronization needed since getState() is atomic.
  4. return instance.node.isRunning();
  5. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. @Override
  2. public boolean isRunning() {
  3. //no synchronization needed since getState() is atomic.
  4. return instance.node.isRunning();
  5. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. @Override
  2. public boolean isRunning() {
  3. return node.isRunning();
  4. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. @Override
  2. public boolean isRunning() {
  3. return node.isRunning();
  4. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. private <V> V waitOnFuture(Future<V> future) {
  2. try {
  3. return future.get();
  4. } catch (Throwable t) {
  5. if (!node.isRunning()) {
  6. future.cancel(true);
  7. throw new HazelcastInstanceNotActiveException();
  8. } else {
  9. throw ExceptionUtil.rethrow(t);
  10. }
  11. }
  12. }
  13. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. private <V> V waitOnFuture(Future<V> future) {
  2. try {
  3. return future.get();
  4. } catch (Throwable t) {
  5. if (!node.isRunning()) {
  6. future.cancel(true);
  7. throw new HazelcastInstanceNotActiveException();
  8. } else {
  9. throw ExceptionUtil.rethrow(t);
  10. }
  11. }
  12. }
  13. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. private boolean isJoined() {
  2. return node.isRunning() && node.getClusterService().isJoined();
  3. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. protected final boolean shouldRetry() {
  2. return node.isRunning() && !clusterService.isJoined() && !shouldResetHotRestartData();
  3. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. private boolean isJoined() {
  2. return node.isRunning() && node.getClusterService().isJoined();
  3. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. protected final boolean shouldRetry() {
  2. return node.isRunning() && !clusterService.isJoined() && !isMemberExcludedFromHotRestart();
  3. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. private boolean ensureNodeIsReady() {
  2. if (clusterService.isJoined() && node.isRunning()) {
  3. return true;
  4. }
  5. if (logger.isFineEnabled()) {
  6. logger.fine("Node is not ready to process join request...");
  7. }
  8. return false;
  9. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. private boolean ensureNodeIsReady() {
  2. if (clusterService.isJoined() && node.isRunning()) {
  3. return true;
  4. }
  5. if (logger.isFineEnabled()) {
  6. logger.fine("Node is not ready to process join request...");
  7. }
  8. return false;
  9. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. private void handleHealthReady(HttpGetCommand command) {
  2. Node node = textCommandService.getNode();
  3. if (node.isRunning()
  4. && node.getNodeExtension().isStartCompleted()) {
  5. command.setResponse(RES_200_WITH_NO_CONTENT);
  6. } else {
  7. command.setResponse(RES_503);
  8. }
  9. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. @Override
  2. public void onMessage(Object msg) {
  3. if (!isValidJoinMessage(msg)) {
  4. logDroppedMessage(msg);
  5. return;
  6. }
  7. JoinMessage joinMessage = (JoinMessage) msg;
  8. if (node.isRunning() && node.getClusterService().isJoined()) {
  9. handleActiveAndJoined(joinMessage);
  10. } else {
  11. handleNotActiveOrNotJoined(joinMessage);
  12. }
  13. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. @Override
  2. public void onMessage(Object msg) {
  3. if (!isValidJoinMessage(msg)) {
  4. logDroppedMessage(msg);
  5. return;
  6. }
  7. JoinMessage joinMessage = (JoinMessage) msg;
  8. if (node.isRunning() && node.getClusterService().isJoined()) {
  9. handleActiveAndJoined(joinMessage);
  10. } else {
  11. handleNotActiveOrNotJoined(joinMessage);
  12. }
  13. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. /** Sends a {@link ShutdownResponseOperation} to the {@code address} or takes a shortcut if shutdown is local. */
  2. private void sendShutdownOperation(Address address) {
  3. if (node.getThisAddress().equals(address)) {
  4. assert !node.isRunning() : "Node state: " + node.getState();
  5. partitionService.onShutdownResponse();
  6. } else {
  7. nodeEngine.getOperationService().send(new ShutdownResponseOperation(), address);
  8. }
  9. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. @Override
  2. public void run() {
  3. if (!node.isRunning() || !node.getNodeExtension().isStartCompleted()
  4. || !partitionService.areMigrationTasksAllowed()) {
  5. return;
  6. }
  7. nodeEngine.getOperationService().executeOnPartitions(new PartitionAntiEntropyTaskFactory(), getLocalPartitions());
  8. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. /** Sends a {@link ShutdownResponseOperation} to the {@code address} or takes a shortcut if shutdown is local. */
  2. private void sendShutdownOperation(Address address) {
  3. if (node.getThisAddress().equals(address)) {
  4. assert !node.isRunning() : "Node state: " + node.getState();
  5. partitionService.onShutdownResponse();
  6. } else {
  7. nodeEngine.getOperationService().send(new ShutdownResponseOperation(), address);
  8. }
  9. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. @Override
  2. public void run() {
  3. if (!node.isRunning() || !node.getNodeExtension().isStartCompleted()
  4. || !partitionService.isMigrationAllowed()) {
  5. return;
  6. }
  7. nodeEngine.getOperationService().executeOnPartitions(new PartitionAntiEntropyTaskFactory(), getLocalPartitions());
  8. }

代码示例来源:origin: hazelcast/hazelcast-jet

  1. private boolean shouldRun() {
  2. ClusterServiceImpl clusterService = node.getClusterService();
  3. if (!clusterService.isJoined()) {
  4. return false;
  5. }
  6. if (!clusterService.isMaster()) {
  7. return false;
  8. }
  9. if (!node.isRunning()) {
  10. return false;
  11. }
  12. final ClusterJoinManager clusterJoinManager = clusterService.getClusterJoinManager();
  13. if (clusterJoinManager.isJoinInProgress()) {
  14. return false;
  15. }
  16. final ClusterState clusterState = clusterService.getClusterState();
  17. return clusterState.isJoinAllowed();
  18. }

相关文章