private boolean isReplicaAvailable(Address replicaAddress, int backupCount) { return !(replicaAddress == null && partitionService.getMaxAllowedBackupCount() >= backupCount); }
private boolean isReplicaAvailable(Address replicaAddress, int backupCount) { return !(replicaAddress == null && partitionService.getMaxAllowedBackupCount() >= backupCount); }
/** * Waits partition table update to get replica address if current replica address is null. */ private Address waitForReplicaAddress(int replica, IPartition partition, int backupCount) { int tryCount = RETRY_COUNT; Address replicaAddress = null; while (replicaAddress == null && partitionService.getMaxAllowedBackupCount() >= backupCount && tryCount-- > 0) { sleep(); replicaAddress = partition.getReplicaAddress(replica); } return replicaAddress; }
/** * Waits partition table update to get replica address if current replica address is null. */ private Address waitForReplicaAddress(int replica, IPartition partition, int backupCount) { int tryCount = RETRY_COUNT; Address replicaAddress = null; while (replicaAddress == null && partitionService.getMaxAllowedBackupCount() >= backupCount && tryCount-- > 0) { sleep(); replicaAddress = partition.getReplicaAddress(replica); } return replicaAddress; }
private Address getReplicaAddress(IPartition partition, int backupCount, int replicaIndex) { Address replicaAddress = partition.getReplicaAddress(replicaIndex); int tryCount = REPLICA_ADDRESS_TRY_COUNT; int maxAllowedBackupCount = min(backupCount, nodeEngine.getPartitionService().getMaxAllowedBackupCount()); while (maxAllowedBackupCount > replicaIndex && replicaAddress == null && tryCount-- > 0) { try { Thread.sleep(REPLICA_ADDRESS_SLEEP_WAIT_MILLIS); } catch (InterruptedException e) { currentThread().interrupt(); throw ExceptionUtil.rethrow(e); } replicaAddress = partition.getReplicaAddress(replicaIndex); } return replicaAddress; }
private Address getReplicaAddress(IPartition partition, int backupCount, int replicaIndex) { Address replicaAddress = partition.getReplicaAddress(replicaIndex); int tryCount = REPLICA_ADDRESS_TRY_COUNT; int maxAllowedBackupCount = min(backupCount, nodeEngine.getPartitionService().getMaxAllowedBackupCount()); while (maxAllowedBackupCount > replicaIndex && replicaAddress == null && tryCount-- > 0) { try { Thread.sleep(REPLICA_ADDRESS_SLEEP_WAIT_MILLIS); } catch (InterruptedException e) { currentThread().interrupt(); throw ExceptionUtil.rethrow(e); } replicaAddress = partition.getReplicaAddress(replicaIndex); } return replicaAddress; }