com.hazelcast.core.Member.localMember()方法的使用及代码示例

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

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

Member.localMember介绍

[英]Returns true if this member is the local member.
[中]如果此成员是本地成员,则返回true。

代码示例

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

@Test
public void doTest() {
  logger.info( "do test" );
  Hazelcast.addInstanceListener( this );
  ITopic<Object> topic = Hazelcast.getTopic( "default" );
  topic.addMessageListener( this );
  topic.publish( "my-message-object" );
  Collection<Instance> instances = Hazelcast.getInstances();
  for ( Instance instance : instances ) {
    logger.info( "ID: [" + instance.getId() + "] Type: [" + instance.getInstanceType() + "]" );
  }
  Set<Member> setMembers = Hazelcast.getCluster().getMembers();
  for ( Member member : setMembers ) {
    logger.info( "isLocalMember " + member.localMember() );
    logger.info( "member.inetsocketaddress " + member.getInetSocketAddress() );
  }
}

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

@Override
  public boolean select(Member member) {
    return member.localMember();
  }
};

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

@Override
  public boolean select(Member member) {
    return !member.localMember();
  }
};

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

@Override
  public boolean select(Member member) {
    return member.localMember();
  }
};

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

@Override
  public boolean select(Member member) {
    return !member.localMember();
  }
};

代码示例来源:origin: org.neo4j/neo4j-core-edge

private static boolean canBeBootstrapped( Set<Member> coreMembers )
{
  Iterator<Member> iterator = coreMembers.iterator();
  return iterator.hasNext() && iterator.next().localMember();
}

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

protected boolean isAlivePerIcmp(Member member) {
    if (!pingFDEnabled || member.localMember()) {
      return true;
    }

    return pingFailureDetector.isAlive(member);
  }
}

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

protected boolean isAlivePerIcmp(Member member) {
    if (!pingFDEnabled || member.localMember()) {
      return true;
    }

    return pingFailureDetector.isAlive(member);
  }
}

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

private boolean isCandidateMember(Member member) {
  if (member.localMember()) {
    return true;
  }
  if (!memberFilter.accept(member)) {
    return true;
  }
  return false;
}

代码示例来源:origin: jclawson/hazeltask

public HazeltaskTopology(String topologyName, Member localMember) {
  this.readyMembers = new CopyOnWriteArrayListSet<Member>();
  this.localMember = localMember;
  this.topologyName = topologyName;
  if(!localMember.localMember()) {
    throw new IllegalArgumentException(localMember+" is not the local member");
  }
}

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

private boolean isCandidateMember(Member member) {
  if (member.localMember()) {
    return true;
  }
  if (!memberFilter.accept(member)) {
    return true;
  }
  return false;
}

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

private static boolean isFirstMember(Node node) {
  Iterator<Member> iterator = node.getClusterService().getMembers().iterator();
  return (iterator.hasNext() && iterator.next().localMember());
}

代码示例来源:origin: org.wso2.carbon.event-processing/org.wso2.carbon.event.processor.core

@Override
  public void entryUpdated(EntryEvent entryEvent) {
    if (!entryEvent.getMember().localMember()) {
      stormStatusMonitor.hazelcastListenerCallback();
    }
  }
}

代码示例来源:origin: org.wso2.carbon.event-processing/org.wso2.carbon.event.processor.core

@Override
public void entryAdded(EntryEvent entryEvent) {
  if (!entryEvent.getMember().localMember()) {
    stormStatusMonitor.hazelcastListenerCallback();
  }
}

代码示例来源:origin: com.jtbdevelopment.core-games/games-hazelcast

@Override
 public void onMessage(final Message<ClusterMessage> message) {
  if (message != null && !message.getPublishingMember().localMember()) {
   ClusterMessage clusterMessage = message.getMessageObject();
   if (clusterMessage != null) {
    receiveClusterMessage(clusterMessage);
   }

  }

 }
}

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

public void onMessage(final Message<Object> message) {
    if (!message.getPublishingMember().localMember()) {
      maybeInvalidate(message.getMessageObject());
    }
  }
};

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

private void destroyCacheOnAllMembers(String name, String callerUuid) {
  NodeEngine nodeEngine = getNodeEngine();
  OperationService operationService = nodeEngine.getOperationService();
  Collection<Member> members = nodeEngine.getClusterService().getMembers();
  for (Member member : members) {
    if (!member.localMember() && !member.getUuid().equals(callerUuid)) {
      CacheDestroyOperation op = new CacheDestroyOperation(name, true);
      operationService.invokeOnTarget(ICacheService.SERVICE_NAME, op, member.getAddress());
    }
  }
}

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

private void destroyCacheOnAllMembers(String name, String callerUuid) {
  NodeEngine nodeEngine = getNodeEngine();
  OperationService operationService = nodeEngine.getOperationService();
  Collection<Member> members = nodeEngine.getClusterService().getMembers();
  for (Member member : members) {
    if (!member.localMember() && !member.getUuid().equals(callerUuid)) {
      CacheDestroyOperation op = new CacheDestroyOperation(name, true);
      operationService.invokeOnTarget(ICacheService.SERVICE_NAME, op, member.getAddress());
    }
  }
}

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

private void updateCacheListenerConfigOnOtherNodes(CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration,
                          boolean isRegister) {
  OperationService operationService = getNodeEngine().getOperationService();
  Collection<Member> members = getNodeEngine().getClusterService().getMembers();
  for (Member member : members) {
    if (!member.localMember()) {
      Operation op = new CacheListenerRegistrationOperation(getDistributedObjectName(), cacheEntryListenerConfiguration,
          isRegister);
      operationService.invokeOnTarget(CacheService.SERVICE_NAME, op, member.getAddress());
    }
  }
}

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

private void updateCacheListenerConfigOnOtherNodes(CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration,
                          boolean isRegister) {
  OperationService operationService = getNodeEngine().getOperationService();
  Collection<Member> members = getNodeEngine().getClusterService().getMembers();
  for (Member member : members) {
    if (!member.localMember()) {
      Operation op = new CacheListenerRegistrationOperation(getDistributedObjectName(), cacheEntryListenerConfiguration,
          isRegister);
      operationService.invokeOnTarget(CacheService.SERVICE_NAME, op, member.getAddress());
    }
  }
}

相关文章