public ActorSystem get() throws FlinkException { if (!isLoaded()) {
/** * Creates a new ActorSystem or returns an existing one. * @return ActorSystem * @throws Exception if the ActorSystem could not be created */ public ActorSystem get() throws FlinkException { if (!isLoaded()) { // start actor system LOG.info("Starting client actor system."); final InetAddress ownHostname; try { ownHostname = LeaderRetrievalUtils.findConnectingAddress( highAvailabilityServices.getJobManagerLeaderRetriever(HighAvailabilityServices.DEFAULT_JOB_ID), timeout); } catch (LeaderRetrievalException lre) { throw new FlinkException("Could not find out our own hostname by connecting to the " + "leading JobManager. Please make sure that the Flink cluster has been started.", lre); } try { actorSystem = AkkaUtils.createActorSystem( configuration, Option.apply(new Tuple2<String, Object>(ownHostname.getCanonicalHostName(), 0))); } catch (Exception e) { throw new FlinkException("Could not start the ActorSystem lazily.", e); } } return actorSystem; }
public ActorSystem get() throws FlinkException { if (!isLoaded()) {
/** * Creates a new ActorSystem or returns an existing one. * @return ActorSystem * @throws Exception if the ActorSystem could not be created */ public ActorSystem get() throws FlinkException { if (!isLoaded()) { // start actor system log.info("Starting client actor system."); final InetAddress ownHostname; try { ownHostname = LeaderRetrievalUtils.findConnectingAddress( highAvailabilityServices.getJobManagerLeaderRetriever(HighAvailabilityServices.DEFAULT_JOB_ID), timeout); } catch (LeaderRetrievalException lre) { throw new FlinkException("Could not find out our own hostname by connecting to the " + "leading JobManager. Please make sure that the Flink cluster has been started.", lre); } try { actorSystem = BootstrapTools.startActorSystem( configuration, ownHostname.getCanonicalHostName(), 0, log); } catch (Exception e) { throw new FlinkException("Could not start the ActorSystem lazily.", e); } } return actorSystem; }
public void shutdown() { if (isLoaded()) { actorSystem.shutdown(); actorSystem.awaitTermination(); actorSystem = null; } }
public void shutdown() { if (isLoaded()) { actorSystem.shutdown(); actorSystem.awaitTermination(); actorSystem = null; } }
@Override public void close() throws Exception { if (isLoaded()) { actorSystem.terminate(); Await.ready(actorSystem.whenTerminated(), Duration.Inf()); actorSystem = null; } }
@Override public void close() throws Exception { if (isLoaded()) { actorSystem.terminate(); Await.ready(actorSystem.whenTerminated(), Duration.Inf()); actorSystem = null; } }