private boolean publishCurrentTask() { boolean isClientRunnable = currentTask instanceof MessageTask; return getPartitionId() != AD_HOC_PARTITION_ID && (currentTask == null || isClientRunnable); }
private boolean publishCurrentTask() { boolean isClientRunnable = currentTask instanceof MessageTask; return getPartitionId() != AD_HOC_PARTITION_ID && (currentTask == null || isClientRunnable); }
private void ensureNoPartitionProblems(Operation op) { int partitionId = op.getPartitionId(); if (partitionId < 0) { return; } if (partitionId != getPartitionId()) { throw new IllegalStateException("wrong partition, expected: " + getPartitionId() + " but found:" + partitionId); } if (internalPartition == null) { internalPartition = nodeEngine.getPartitionService().getPartition(partitionId); } if (!isAllowedToRetryDuringMigration(op) && internalPartition.isMigrating()) { throw new PartitionMigratingException(thisAddress, partitionId, op.getClass().getName(), op.getServiceName()); } Address owner = internalPartition.getReplicaAddress(op.getReplicaIndex()); if (op.validatesTarget() && !thisAddress.equals(owner)) { throw new WrongTargetException(thisAddress, owner, partitionId, op.getReplicaIndex(), op.getClass().getName(), op.getServiceName()); } }
private void ensureNoPartitionProblems(Operation op) { int partitionId = op.getPartitionId(); if (partitionId < 0) { return; } if (partitionId != getPartitionId()) { throw new IllegalStateException("wrong partition, expected: " + getPartitionId() + " but found:" + partitionId); } if (internalPartition == null) { internalPartition = nodeEngine.getPartitionService().getPartition(partitionId); } if (!isAllowedToRetryDuringMigration(op) && internalPartition.isMigrating()) { throw new PartitionMigratingException(thisAddress, partitionId, op.getClass().getName(), op.getServiceName()); } PartitionReplica owner = internalPartition.getReplica(op.getReplicaIndex()); if (op.validatesTarget() && (owner == null || !owner.isIdentical(node.getLocalMember()))) { Member target = owner != null ? node.getClusterService().getMember(owner.address(), owner.uuid()) : null; throw new WrongTargetException(node.getLocalMember(), target, partitionId, op.getReplicaIndex(), op.getClass().getName(), op.getServiceName()); } }