@Nonnull @Override public List<Job> getJobs() { Address masterAddress = nodeEngine.getMasterAddress(); Future<Set<Long>> future = nodeEngine .getOperationService() .createInvocationBuilder(JetService.SERVICE_NAME, new GetJobIdsOperation(), masterAddress) .invoke(); try { return future.get() .stream() .map(jobId -> new JobProxy((NodeEngineImpl) nodeEngine, jobId)) .collect(toList()); } catch (Throwable t) { throw rethrow(t); } }
private void verifyMasterOnMigrationDestination() { NodeEngine nodeEngine = getNodeEngine(); Address masterAddress = nodeEngine.getMasterAddress(); if (!masterAddress.equals(migrationInfo.getMaster())) { throw new IllegalStateException("Migration initiator is not master node! => " + toString()); } }
@Override public void beforeRun() throws Exception { if (beforeStateCompleted) { return; } NodeEngine nodeEngine = getNodeEngine(); final Member localMember = nodeEngine.getLocalMember(); if (!localMember.getUuid().equals(expectedMemberUuid)) { throw new IllegalStateException("This " + localMember + " is promotion commit destination but most probably it's restarted " + "and not the expected target."); } Address masterAddress = nodeEngine.getMasterAddress(); Address callerAddress = getCallerAddress(); if (!callerAddress.equals(masterAddress)) { throw new IllegalStateException("Caller is not master node! Caller: " + callerAddress + ", Master: " + masterAddress); } }
@Override public void beforeRun() throws Exception { if (beforeStateCompleted) { return; } NodeEngine nodeEngine = getNodeEngine(); final Member localMember = nodeEngine.getLocalMember(); if (!localMember.getUuid().equals(expectedMemberUuid)) { throw new IllegalStateException("This " + localMember + " is promotion commit destination but most probably it's restarted " + "and not the expected target."); } Address masterAddress = nodeEngine.getMasterAddress(); Address callerAddress = getCallerAddress(); if (!callerAddress.equals(masterAddress)) { throw new IllegalStateException("Caller is not master node! Caller: " + callerAddress + ", Master: " + masterAddress); } }
@Override public List<Long> getJobIdsByName(String name) { Address masterAddress = nodeEngine.getMasterAddress(); Future<List<Long>> future = nodeEngine .getOperationService() .createInvocationBuilder(JetService.SERVICE_NAME, new GetJobIdsByNameOperation(name), masterAddress) .invoke(); try { return future.get(); } catch (Throwable t) { throw rethrow(t); } }
/** Verifies that the local master is equal to the migration master. */ private void verifyMasterOnMigrationSource() { NodeEngine nodeEngine = getNodeEngine(); Address masterAddress = nodeEngine.getMasterAddress(); if (!migrationInfo.getMaster().equals(masterAddress)) { throw new IllegalStateException("Migration initiator is not master node! => " + toString()); } if (!masterAddress.equals(getCallerAddress())) { throw new IllegalStateException("Caller is not master node! => " + toString()); } }
/** Verifies that the local master is equal to the migration master. */ final void verifyMaster() { NodeEngine nodeEngine = getNodeEngine(); Address masterAddress = nodeEngine.getMasterAddress(); if (!migrationInfo.getMaster().equals(masterAddress)) { throw new IllegalStateException("Migration initiator is not master node! => " + toString()); } if (getMigrationParticipantType() == MigrationParticipant.SOURCE && !masterAddress.equals(getCallerAddress())) { throw new IllegalStateException("Caller is not master node! => " + toString()); } }
@Override public void run() { Address caller = getCallerAddress(); NodeEngine nodeEngine = getNodeEngine(); Address master = nodeEngine.getMasterAddress(); if (!caller.equals(master)) { String msg = caller + " requested our partition table but it's not our known master. " + "Master: " + master; getLogger().warning(msg); throw new IllegalStateException(msg); } InternalPartitionServiceImpl service = getService(); partitionState = service.createPartitionStateInternal(); }
@Override public void run() { Address caller = getCallerAddress(); NodeEngine nodeEngine = getNodeEngine(); Address master = nodeEngine.getMasterAddress(); if (!caller.equals(master)) { String msg = caller + " requested our partition table but it's not our known master. " + "Master: " + master; getLogger().warning(msg); throw new IllegalStateException(msg); } InternalPartitionServiceImpl service = getService(); partitionState = service.createPartitionStateInternal(); }
@Override public void run() { ILogger logger = getLogger(); JetService service = getService(); Address callerAddress = getCallerAddress(); logger.fine("Completing execution " + idToString(executionId) + " from caller " + callerAddress + ", error=" + error); Address masterAddress = getNodeEngine().getMasterAddress(); if (!callerAddress.equals(masterAddress)) { throw new IllegalStateException("Caller " + callerAddress + " cannot complete execution " + idToString(executionId) + " because it is not master. Master is: " + masterAddress); } service.getJobExecutionService().completeExecution(executionId, error); }