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

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

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

Member.getVersion介绍

[英]Returns the Hazelcast codebase version of this member; this may or may not be different from the version reported by Cluster#getClusterVersion(), for example when a node with a different codebase version is added to an existing cluster. See the documentation for Cluster#getClusterVersion() for a more thorough discussion of Cluster and Member / Node version.
[中]返回此成员的Hazelcast代码库版本;这可能与Cluster#getClusterVersion()报告的版本不同,也可能不不同,例如,将具有不同代码库版本的节点添加到现有集群时。有关集群和成员/节点版本的更详细讨论,请参阅集群#getClusterVersion()的文档。

代码示例

代码示例来源: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: 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: org.ligoj.bootstrap/bootstrap-business

private CacheNode newCacheNode(Member member) {
  final CacheNode node = new CacheNode();
  node.setAddress(Objects.toString(member.getAddress()));
  node.setId(member.getUuid());
  node.setVersion(Objects.toString(member.getVersion()));
  return node;
}

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

@Override
protected boolean requiresExplicitServiceName() {
  // RU_COMPAT_3_10
  Member member = getNodeEngine().getClusterService().getMember(target);
  if (member == null) {
    return false;
  }
  Version memberVersion = member.getVersion().asVersion();
  return memberVersion.isLessThan(Versions.V3_11);
}

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

@Override
protected boolean requiresExplicitServiceName() {
  // RU_COMPAT_3_10
  Member member = getNodeEngine().getClusterService().getMember(target);
  if (member == null) {
    return false;
  }
  Version memberVersion = member.getVersion().asVersion();
  return memberVersion.isLessThan(Versions.V3_11);
}

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

@Override
protected boolean requiresExplicitServiceName() {
  // RU_COMPAT_3_10
  Member member = getNodeEngine().getClusterService().getMember(target);
  if (member == null) {
    return false;
  }
  Version memberVersion = member.getVersion().asVersion();
  return memberVersion.isLessThan(Versions.V3_11);
}

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

@Override
protected boolean requiresExplicitServiceName() {
  // RU_COMPAT_3_10
  Member member = getNodeEngine().getClusterService().getMember(target);
  if (member == null) {
    return false;
  }
  Version memberVersion = member.getVersion().asVersion();
  return memberVersion.isLessThan(Versions.V3_11);
}

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

@Override
  public Boolean apply(Integer partitionId, Integer replicaIndex) {
    IBiFunction<Integer, Integer, Boolean> filter
        = CacheClearExpiredRecordsTask.super.newBackupExpiryOpFilter();
    if (!filter.apply(partitionId, replicaIndex)) {
      return false;
    }
    // Previous versions did not remove expired entries until they are
    // touched. Old members behave the same whereas newer members still
    // benefit from periodic removal of expired entries.
    //
    // RU_COMPAT_3_10
    IPartition partition = partitionService.getPartition(partitionId);
    Address replicaAddress = partition.getReplicaAddress(replicaIndex);
    Member member = nodeEngine.getClusterService().getMember(replicaAddress);
    if (member == null) {
      return false;
    }
    return member.getVersion().asVersion().isGreaterOrEqual(Versions.V3_11);
  }
};

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

@Override
  public Boolean apply(Integer partitionId, Integer replicaIndex) {
    IBiFunction<Integer, Integer, Boolean> filter
        = CacheClearExpiredRecordsTask.super.newBackupExpiryOpFilter();
    if (!filter.apply(partitionId, replicaIndex)) {
      return false;
    }
    // Previous versions did not remove expired entries until they are
    // touched. Old members behave the same whereas newer members still
    // benefit from periodic removal of expired entries.
    //
    // RU_COMPAT_3_10
    IPartition partition = partitionService.getPartition(partitionId);
    Address replicaAddress = partition.getReplicaAddress(replicaIndex);
    Member member = nodeEngine.getClusterService().getMember(replicaAddress);
    if (member == null) {
      return false;
    }
    return member.getVersion().asVersion().isGreaterOrEqual(Versions.V3_11);
  }
};

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

private boolean mustWriteIndexInfos(Version clusterVersion) {
  // 3.10 OS always writes mapIndexInfos
  // 3.10 EE on cluster version 3.10 must write index info
  if (!getBuildInfo().isEnterprise() || clusterVersion.isGreaterOrEqual(V3_10)) {
    return true;
  }
  ClusterService clusterService = operation.getNodeEngine().getClusterService();
  Member targetMember = clusterService.getMember(target);
  // When cluster version is 3.9, only write mapIndexInfo if target member is 3.9 EE. Reasoning:
  // 3.9 EE expects to read mapIndexInfos when object data input comes with 3.9+ version. This is
  // the case when the object stream originates from a versioned 3.10 member.
  return targetMember.getVersion().asVersion().isEqualTo(V3_9) && clusterVersion.isEqualTo(V3_9);
}

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

private boolean mustWriteIndexInfos(Version clusterVersion) {
    // Do not write index info when OS or cluster version is 3.10+
    if (!getBuildInfo().isEnterprise() || clusterVersion.isGreaterOrEqual(V3_10)) {
      return false;
    }

    // 3.9 EE reads index definitions when object input version is UNKNOWN or <= 3.8
    // --> it expects to read map index definitions from other 3.9 members but not from
    // an input coming from 3.10 EE (as it will have version 3.9) --> do not send when target member is 3.9
    // --> when target member is 3.10, do send index info so it behaves like 3.9-only cluster
    ClusterService clusterService = getNodeEngine().getClusterService();
    Member targetMember = clusterService.getMember(target);
    return targetMember.getVersion().asVersion().isEqualTo(V3_10) && clusterVersion.isEqualTo(V3_9);
  }
}

相关文章