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

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

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

Node.getPartitionService介绍

暂无

代码示例

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

  1. @Override
  2. public InternalPartitionService getPartitionService() {
  3. return node.getPartitionService();
  4. }

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

  1. @Override
  2. public InternalPartitionService getPartitionService() {
  3. return node.getPartitionService();
  4. }

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

  1. int asyncBackups(int requestedSyncBackups, int requestedAsyncBackups, boolean syncForced) {
  2. if (syncForced || requestedAsyncBackups == 0) {
  3. // if syncForced, then there will never be any async backups (they are forced to become sync)
  4. // if there are no asyncBackups then we are also done.
  5. return 0;
  6. }
  7. InternalPartitionService partitionService = node.getPartitionService();
  8. int maxBackupCount = partitionService.getMaxAllowedBackupCount();
  9. return min(maxBackupCount - requestedSyncBackups, requestedAsyncBackups);
  10. }

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

  1. int syncBackups(int requestedSyncBackups, int requestedAsyncBackups, boolean syncForced) {
  2. if (syncForced) {
  3. // if force sync enabled, then the sum of the backups
  4. requestedSyncBackups += requestedAsyncBackups;
  5. }
  6. InternalPartitionService partitionService = node.getPartitionService();
  7. int maxBackupCount = partitionService.getMaxAllowedBackupCount();
  8. return min(maxBackupCount, requestedSyncBackups);
  9. }

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

  1. int syncBackups(int requestedSyncBackups, int requestedAsyncBackups, boolean syncForced) {
  2. if (syncForced) {
  3. // if force sync enabled, then the sum of the backups
  4. requestedSyncBackups += requestedAsyncBackups;
  5. }
  6. InternalPartitionService partitionService = node.getPartitionService();
  7. int maxBackupCount = partitionService.getMaxAllowedBackupCount();
  8. return min(maxBackupCount, requestedSyncBackups);
  9. }

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

  1. int asyncBackups(int requestedSyncBackups, int requestedAsyncBackups, boolean syncForced) {
  2. if (syncForced || requestedAsyncBackups == 0) {
  3. // if syncForced, then there will never be any async backups (they are forced to become sync)
  4. // if there are no asyncBackups then we are also done.
  5. return 0;
  6. }
  7. InternalPartitionService partitionService = node.getPartitionService();
  8. int maxBackupCount = partitionService.getMaxAllowedBackupCount();
  9. return min(maxBackupCount - requestedSyncBackups, requestedAsyncBackups);
  10. }

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

  1. void sendMembershipEvents(Collection<MemberImpl> currentMembers, Collection<MemberImpl> newMembers) {
  2. Set<Member> eventMembers = new LinkedHashSet<Member>(currentMembers);
  3. if (!newMembers.isEmpty()) {
  4. for (MemberImpl newMember : newMembers) {
  5. // sync calls
  6. node.getPartitionService().memberAdded(newMember);
  7. node.getNodeExtension().onMemberListChange();
  8. // async events
  9. eventMembers.add(newMember);
  10. sendMembershipEventNotifications(newMember, unmodifiableSet(new LinkedHashSet<Member>(eventMembers)), true);
  11. }
  12. }
  13. }

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

  1. private void checkMigrationsAndPartitionStateVersion(ClusterStateChange stateChange, int partitionStateVersion) {
  2. final InternalPartitionService partitionService = node.getPartitionService();
  3. final int thisPartitionStateVersion = partitionService.getPartitionStateVersion();
  4. if (partitionService.hasOnGoingMigrationLocal()) {
  5. throw new IllegalStateException("Still have pending migration tasks, "
  6. + "cannot lock cluster state! New state: " + stateChange
  7. + ", current state: " + getState());
  8. } else if (partitionStateVersion != thisPartitionStateVersion) {
  9. throw new IllegalStateException("Can not lock cluster state! Partition tables have different versions! "
  10. + "Expected version: " + partitionStateVersion + " Current version: " + thisPartitionStateVersion);
  11. }
  12. }

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

  1. private void checkMigrationsAndPartitionStateVersion(ClusterStateChange stateChange, int partitionStateVersion) {
  2. final InternalPartitionService partitionService = node.getPartitionService();
  3. final int thisPartitionStateVersion = partitionService.getPartitionStateVersion();
  4. if (partitionService.hasOnGoingMigrationLocal()) {
  5. throw new IllegalStateException("Still have pending migration tasks, "
  6. + "cannot lock cluster state! New state: " + stateChange
  7. + ", current state: " + getState());
  8. } else if (partitionStateVersion != thisPartitionStateVersion) {
  9. throw new IllegalStateException("Can not lock cluster state! Partition tables have different versions! "
  10. + "Expected version: " + partitionStateVersion + " Current version: " + thisPartitionStateVersion);
  11. }
  12. }

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

  1. private void changeClusterState(ClusterState newState, boolean isTransient) {
  2. int partitionStateVersion = node.getPartitionService().getPartitionStateVersion();
  3. clusterStateManager.changeClusterState(ClusterStateChange.from(newState), membershipManager.getMemberMap(),
  4. partitionStateVersion, isTransient);
  5. }

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

  1. @Override
  2. public void changeClusterVersion(Version version) {
  3. int partitionStateVersion = node.getPartitionService().getPartitionStateVersion();
  4. clusterStateManager.changeClusterState(ClusterStateChange.from(version), membershipManager.getMemberMap(),
  5. partitionStateVersion, false);
  6. }

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

  1. private void changeClusterState(ClusterState newState, boolean isTransient) {
  2. int partitionStateVersion = node.getPartitionService().getPartitionStateVersion();
  3. clusterStateManager.changeClusterState(ClusterStateChange.from(newState), membershipManager.getMemberMap(),
  4. partitionStateVersion, isTransient);
  5. }

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

  1. @Override
  2. public void changeClusterVersion(Version version, TransactionOptions options) {
  3. int partitionStateVersion = node.getPartitionService().getPartitionStateVersion();
  4. clusterStateManager.changeClusterState(ClusterStateChange.from(version), membershipManager.getMemberMap(),
  5. options, partitionStateVersion, false);
  6. }

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

  1. void onMemberRemove(MemberImpl deadMember) {
  2. // sync calls
  3. node.getPartitionService().memberRemoved(deadMember);
  4. nodeEngine.onMemberLeft(deadMember);
  5. node.getNodeExtension().onMemberListChange();
  6. }

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

  1. private void changeClusterState(ClusterState newState, TransactionOptions options, boolean isTransient) {
  2. int partitionStateVersion = node.getPartitionService().getPartitionStateVersion();
  3. clusterStateManager.changeClusterState(ClusterStateChange.from(newState), membershipManager.getMemberMap(),
  4. options, partitionStateVersion, isTransient);
  5. }

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

  1. void onMemberRemove(MemberImpl deadMember) {
  2. // sync calls
  3. node.getPartitionService().memberRemoved(deadMember);
  4. nodeEngine.onMemberLeft(deadMember);
  5. node.getNodeExtension().onMemberListChange();
  6. }

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

  1. private void changeClusterState(ClusterState newState, TransactionOptions options, boolean isTransient) {
  2. int partitionStateVersion = node.getPartitionService().getPartitionStateVersion();
  3. clusterStateManager.changeClusterState(ClusterStateChange.from(newState), membershipManager.getMemberMap(),
  4. options, partitionStateVersion, isTransient);
  5. }

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

  1. @Override
  2. public void changeClusterVersion(Version version, TransactionOptions options) {
  3. int partitionStateVersion = node.getPartitionService().getPartitionStateVersion();
  4. clusterStateManager.changeClusterState(ClusterStateChange.from(version), membershipManager.getMemberMap(),
  5. options, partitionStateVersion, false);
  6. }

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

  1. private void registerCoreServices() {
  2. logger.finest("Registering core services...");
  3. Node node = nodeEngine.getNode();
  4. registerService(ClusterServiceImpl.SERVICE_NAME, node.getClusterService());
  5. registerService(InternalPartitionService.SERVICE_NAME, node.getPartitionService());
  6. registerService(ProxyServiceImpl.SERVICE_NAME, nodeEngine.getProxyService());
  7. registerService(TransactionManagerServiceImpl.SERVICE_NAME, nodeEngine.getTransactionManagerService());
  8. registerService(ClientEngineImpl.SERVICE_NAME, node.clientEngine);
  9. registerService(QuorumServiceImpl.SERVICE_NAME, nodeEngine.getQuorumService());
  10. registerService(WanReplicationService.SERVICE_NAME, nodeEngine.getWanReplicationService());
  11. registerService(EventServiceImpl.SERVICE_NAME, nodeEngine.getEventService());
  12. }

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

  1. private void registerCoreServices() {
  2. logger.finest("Registering core services...");
  3. Node node = nodeEngine.getNode();
  4. registerService(ClusterServiceImpl.SERVICE_NAME, node.getClusterService());
  5. registerService(InternalPartitionService.SERVICE_NAME, node.getPartitionService());
  6. registerService(ProxyServiceImpl.SERVICE_NAME, nodeEngine.getProxyService());
  7. registerService(TransactionManagerServiceImpl.SERVICE_NAME, nodeEngine.getTransactionManagerService());
  8. registerService(ClientEngineImpl.SERVICE_NAME, node.clientEngine);
  9. registerService(QuorumServiceImpl.SERVICE_NAME, nodeEngine.getQuorumService());
  10. registerService(WanReplicationService.SERVICE_NAME, nodeEngine.getWanReplicationService());
  11. registerService(EventServiceImpl.SERVICE_NAME, nodeEngine.getEventService());
  12. }

相关文章