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

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

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

Member.isLiteMember介绍

[英]Returns true if this member is a lite member.
[中]如果此成员是lite成员,则返回true。

代码示例

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

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

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

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

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

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

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

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

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

private void writeObject(ObjectOutputStream out) throws IOException {
  out.defaultWriteObject();
  Address address = member.getAddress();
  String host = address.getHost();
  int port = address.getPort();
  out.writeUTF(member.getUuid());
  out.writeUTF(host);
  out.writeInt(port);
  out.writeBoolean(member.isLiteMember());
  out.writeObject(member.getVersion());
}

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

private void writeObject(ObjectOutputStream out) throws IOException {
  out.defaultWriteObject();
  Address address = member.getAddress();
  String host = address.getHost();
  int port = address.getPort();
  out.writeUTF(member.getUuid());
  out.writeUTF(host);
  out.writeInt(port);
  out.writeBoolean(member.isLiteMember());
  out.writeObject(member.getVersion());
}

代码示例来源:origin: dsukhoroslov/bagri

public static boolean hasStorageMembers(HazelcastInstance hzInstance) {
  for (Member member: hzInstance.getCluster().getMembers()) {
    if (!member.isLiteMember()) {
      return true;
    }
  }
  return false;
}

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

@Override
public void destroyDistributedObject(String objectName) {
  if (nodeEngine.getLocalMember().isLiteMember()) {
    return;
  }
  for (int i = 0; i < nodeEngine.getPartitionService().getPartitionCount(); i++) {
    partitionContainers[i].destroy(objectName);
  }
  quorumConfigCache.remove(objectName);
}

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

public boolean removeEventListener(String mapName, String registrationId) {
  if (nodeEngine.getLocalMember().isLiteMember()) {
    throw new ReplicatedMapCantBeCreatedOnLiteMemberException(nodeEngine.getThisAddress());
  }
  if (registrationId == null) {
    throw new IllegalArgumentException("registrationId cannot be null");
  }
  return eventService.deregisterListener(SERVICE_NAME, mapName, registrationId);
}

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

public static void encode(Member member, ClientMessage clientMessage) {
  AddressCodec.encode(member.getAddress(), clientMessage);
  clientMessage.set(member.getUuid());
  clientMessage.set(member.isLiteMember());
  Map<String, Object> attributes = new HashMap<String, Object>(member.getAttributes());
  clientMessage.set(attributes.size());
  for (Map.Entry<String, Object> entry : attributes.entrySet()) {
    clientMessage.set(entry.getKey());
    Object value = entry.getValue();
    clientMessage.set(value.toString());
  }
}

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

@Override
public void destroyDistributedObject(String objectName) {
  if (nodeEngine.getLocalMember().isLiteMember()) {
    return;
  }
  for (int i = 0; i < nodeEngine.getPartitionService().getPartitionCount(); i++) {
    partitionContainers[i].destroy(objectName);
  }
  quorumConfigCache.remove(objectName);
}

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

public boolean removeEventListener(String mapName, String registrationId) {
  if (nodeEngine.getLocalMember().isLiteMember()) {
    throw new ReplicatedMapCantBeCreatedOnLiteMemberException(nodeEngine.getThisAddress());
  }
  if (registrationId == null) {
    throw new IllegalArgumentException("registrationId cannot be null");
  }
  return eventService.deregisterListener(SERVICE_NAME, mapName, registrationId);
}

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

public static void encode(Member member, ClientMessage clientMessage) {
  AddressCodec.encode(member.getAddress(), clientMessage);
  clientMessage.set(member.getUuid());
  clientMessage.set(member.isLiteMember());
  Map<String, Object> attributes = new HashMap<String, Object>(member.getAttributes());
  clientMessage.set(attributes.size());
  for (Map.Entry<String, Object> entry : attributes.entrySet()) {
    clientMessage.set(entry.getKey());
    Object value = entry.getValue();
    clientMessage.set(value.toString());
  }
}

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

public static void encode(Member member, ClientMessage clientMessage) {
  AddressCodec.encode(member.getAddress(), clientMessage);
  clientMessage.set(member.getUuid());
  clientMessage.set(member.isLiteMember());
  Map<String, Object> attributes = new HashMap<String, Object>(member.getAttributes());
  clientMessage.set(attributes.size());
  for (Map.Entry<String, Object> entry : attributes.entrySet()) {
    clientMessage.set(entry.getKey());
    Object value = entry.getValue();
    clientMessage.set(value.toString());
  }
}

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

/**
 * Schedules a {@link CRDTMigrationTask} with a delay of {@code delaySeconds}
 * seconds.
 */
void scheduleMigrationTask(long delaySeconds) {
  if (nodeEngine.getLocalMember().isLiteMember()) {
    return;
  }
  nodeEngine.getExecutionService().schedule(CRDT_REPLICATION_MIGRATION_EXECUTOR,
      new CRDTMigrationTask(nodeEngine, this), delaySeconds, TimeUnit.SECONDS);
}

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

/**
 * Schedules a {@link CRDTMigrationTask} with a delay of {@code delaySeconds}
 * seconds.
 */
void scheduleMigrationTask(long delaySeconds) {
  if (nodeEngine.getLocalMember().isLiteMember()) {
    return;
  }
  nodeEngine.getExecutionService().schedule(CRDT_REPLICATION_MIGRATION_EXECUTOR,
      new CRDTMigrationTask(nodeEngine, this), delaySeconds, TimeUnit.SECONDS);
}

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

public String addEventListener(EventListener entryListener, EventFilter eventFilter, String mapName) {
  if (nodeEngine.getLocalMember().isLiteMember()) {
    throw new ReplicatedMapCantBeCreatedOnLiteMemberException(nodeEngine.getThisAddress());
  }
  EventRegistration registration = eventService.registerLocalListener(SERVICE_NAME, mapName, eventFilter,
      entryListener);
  return registration.getId();
}

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

public String addEventListener(EventListener entryListener, EventFilter eventFilter, String mapName) {
  if (nodeEngine.getLocalMember().isLiteMember()) {
    throw new ReplicatedMapCantBeCreatedOnLiteMemberException(nodeEngine.getThisAddress());
  }
  EventRegistration registration = eventService.registerLocalListener(SERVICE_NAME, mapName, eventFilter,
      entryListener);
  return registration.getId();
}

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

public ReplicatedRecordStore getReplicatedRecordStore(String name, boolean create, int partitionId) {
  if (nodeEngine.getLocalMember().isLiteMember()) {
    throw new ReplicatedMapCantBeCreatedOnLiteMemberException(nodeEngine.getThisAddress());
  }
  PartitionContainer partitionContainer = partitionContainers[partitionId];
  if (create) {
    return partitionContainer.getOrCreateRecordStore(name);
  }
  return partitionContainer.getRecordStore(name);
}

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

public ReplicatedRecordStore getReplicatedRecordStore(String name, boolean create, int partitionId) {
  if (nodeEngine.getLocalMember().isLiteMember()) {
    throw new ReplicatedMapCantBeCreatedOnLiteMemberException(nodeEngine.getThisAddress());
  }
  PartitionContainer partitionContainer = partitionContainers[partitionId];
  if (create) {
    return partitionContainer.getOrCreateRecordStore(name);
  }
  return partitionContainer.getRecordStore(name);
}

相关文章