private void onRuntimeError(final Throwable throwable) { // SHUTDOWN YARN try { this.reefEventHandlers.close(); this.resourceManager.unregisterApplicationMaster( FinalApplicationStatus.FAILED, throwable.getMessage(), this.trackingUrl); } catch (final Exception e) { LOG.log(Level.WARNING, "Error shutting down YARN application", e); } finally { this.resourceManager.stop(); } final ReefServiceProtos.RuntimeErrorProto runtimeError = ReefServiceProtos.RuntimeErrorProto.newBuilder() .setName(RUNTIME_NAME) .setMessage(throwable.getMessage()) .setException(ByteString.copyFrom(new ObjectSerializableCodec<>().encode(throwable))) .build(); this.reefEventHandlers.onRuntimeStatus( RuntimeStatusEventImpl.newBuilder() .setState(State.FAILED) .setName(RUNTIME_NAME) .setError(runtimeError) .build()); } }
/** * RM Callback: RM requests application shutdown. */ @Override public void onShutdownRequest() { this.reefEventHandlers.onRuntimeStatus(RuntimeStatusEventImpl.newBuilder() .setName(RUNTIME_NAME).setState(State.DONE).build()); this.driverStatusManager.onError(new Exception("Shutdown requested by YARN.")); }
private void onRuntimeError(final Throwable throwable) { this.mesosMaster.stop(); try { this.schedulerDriverEStage.close(); } catch (final Exception e) { throw new RuntimeException(e); } final RuntimeStatusEventImpl.Builder runtimeStatusBuilder = RuntimeStatusEventImpl.newBuilder() .setState(State.FAILED) .setName(RUNTIME_NAME); final Encoder<Throwable> codec = new ObjectSerializableCodec<>(); runtimeStatusBuilder.setError(ReefServiceProtos.RuntimeErrorProto.newBuilder() .setName(RUNTIME_NAME) .setMessage(throwable.getMessage()) .setException(ByteString.copyFrom(codec.encode(throwable))) .build()); this.reefEventHandlers.onRuntimeStatus(runtimeStatusBuilder.build()); }
private void sendRuntimeStatus() { final RuntimeStatusEventImpl.Builder builder = RuntimeStatusEventImpl.newBuilder() .setName("LOCAL") .setState(State.RUNNING) .setOutstandingContainerRequests(this.requestQueue.getNumberOfOutstandingRequests()); for (final String containerAllocation : this.theContainers.getAllocatedContainerIDs()) { builder.addContainerAllocation(containerAllocation); } final RuntimeStatusEvent msg = builder.build(); LOG.log(Level.INFO, "Allocated: {0}, Outstanding requests: {1}", new Object[]{msg.getContainerAllocationList().size(), msg.getOutstandingContainerRequests()}); this.runtimeStatusHandlerEventHandler.onNext(msg); } }
/** * Update the driver with my current status. */ private void updateRuntimeStatus() { final RuntimeStatusEventImpl.Builder builder = RuntimeStatusEventImpl.newBuilder() .setName(RUNTIME_NAME) .setState(State.RUNNING) .setOutstandingContainerRequests(this.containerRequestCounter.get()); for (final String allocatedContainerId : this.containers.getContainerIds()) { builder.addContainerAllocation(allocatedContainerId); } this.reefEventHandlers.onRuntimeStatus(builder.build()); }
private synchronized void updateRuntimeStatus() { final RuntimeStatusEventImpl.Builder builder = RuntimeStatusEventImpl.newBuilder() .setName(RUNTIME_NAME) .setState(State.RUNNING) .setOutstandingContainerRequests(this.outstandingRequestCounter); for (final String executorId : this.executors.getExecutorIds()) { builder.addContainerAllocation(executorId); } this.reefEventHandlers.onRuntimeStatus(builder.build()); }