ActorSystem as = AkkaUtils.createActorSystem( new Configuration(), new Some<scala.Tuple2<String, Object>>(new scala.Tuple2<String, Object>(addr.getHostAddress(), port)));
@Before public void setUp() throws Exception { ExecutionEnvironment env = ExecutionEnvironment.createLocalEnvironment(); env.generateSequence(1, 1000).output(new DiscardingOutputFormat<Long>()); Plan plan = env.createProgramPlan(); JobWithJars jobWithJars = new JobWithJars(plan, Collections.<URL>emptyList(), Collections.<URL>emptyList()); program = mock(PackagedProgram.class); when(program.getPlanWithJars()).thenReturn(jobWithJars); final int freePort = NetUtils.getAvailablePort(); config = new Configuration(); config.setString(JobManagerOptions.ADDRESS, "localhost"); config.setInteger(JobManagerOptions.PORT, freePort); config.setString(AkkaOptions.ASK_TIMEOUT, AkkaOptions.ASK_TIMEOUT.defaultValue()); try { scala.Tuple2<String, Object> address = new scala.Tuple2<String, Object>("localhost", freePort); jobManagerSystem = AkkaUtils.createActorSystem(config, new scala.Some<scala.Tuple2<String, Object>>(address)); } catch (Exception e) { e.printStackTrace(); fail("Setup of test actor system failed."); } }
testActorSystem = AkkaUtils.createActorSystem(new Configuration(), new Some<>(new Tuple2<String, Object>("localhost", 0))); taskManagerSystem = AkkaUtils.createActorSystem( config, Option.apply(new Tuple2<String, Object>("localhost", 0))); TaskManager.startTaskManagerComponentsAndActor(
ActorSystem actorSystem = AkkaUtils.createActorSystem(akkaConfig);
ActorSystem actorSystem = AkkaUtils.createActorSystem(akkaConfig);
/** * Factory method to instantiate the RPC service. * * @param configuration * The configuration of the mini cluster * @param askTimeout * The default RPC timeout for asynchronous "ask" requests. * @param remoteEnabled * True, if the RPC service should be reachable from other (remote) RPC services. * @param bindAddress * The address to bind the RPC service to. Only relevant when "remoteEnabled" is true. * * @return The instantiated RPC service */ protected RpcService createRpcService( Configuration configuration, Time askTimeout, boolean remoteEnabled, String bindAddress) { ActorSystem actorSystem; if (remoteEnabled) { actorSystem = AkkaUtils.createActorSystem(configuration, bindAddress, 0); } else { actorSystem = AkkaUtils.createLocalActorSystem(configuration); } return new AkkaRpcService(actorSystem, askTimeout); }
ActorSystem actorSystem = AkkaUtils.createActorSystem(actorSystemName, akkaConfig);
ActorSystem actorSystem = AkkaUtils.createActorSystem(actorSystemName, akkaConfig);
public static ActorSystem startJobClientActorSystem(Configuration config) throws IOException { LOG.info("Starting JobClient actor system"); Option<Tuple2<String, Object>> remoting = new Some<>(new Tuple2<String, Object>("", 0)); // start a remote actor system to listen on an arbitrary port ActorSystem system = AkkaUtils.createActorSystem(config, remoting); Address address = system.provider().getDefaultAddress(); String hostAddress = address.host().isDefined() ? NetUtils.ipAddressToUrlString(InetAddress.getByName(address.host().get())) : "(unknown)"; int port = address.port().isDefined() ? ((Integer) address.port().get()) : -1; LOG.info("Started JobClient actor system at " + hostAddress + ':' + port); return system; }
actorSystem = AkkaUtils.createActorSystem(akkaConfig); } catch (Throwable t) { if (t instanceof ChannelException) {
private ActorRef getJobManager() throws IOException { final Configuration configuration = GlobalConfiguration.loadConfiguration(); ActorSystem actorSystem; try { final scala.Tuple2<String, Object> systemEndpoint = new scala.Tuple2<String, Object>("", 0); actorSystem = AkkaUtils.createActorSystem(configuration, new Some<scala.Tuple2<String, Object>>( systemEndpoint)); } catch (final Exception e) { throw new RuntimeException("Could not start actor system to communicate with JobManager", e); } final String jobManagerAkkaUrl = AkkaRpcServiceUtils.getRpcUrl( jobManagerHost, jobManagerPort, JobMaster.JOB_MANAGER_NAME, AddressResolution.TRY_ADDRESS_RESOLUTION, configuration); return AkkaUtils.getActorRef(jobManagerAkkaUrl, actorSystem, AkkaUtils.getLookupTimeout(configuration)); }
public ActorGateway getJobManagerGateway() throws Exception { ActorSystem actorSystem; scala.Tuple2<String, Object> systemEndpoint = new scala.Tuple2<>("", 0); try { actorSystem = AkkaUtils.createActorSystem( config, new Some<>(systemEndpoint)); } catch (Exception e) { throw new IOException("Could not start actor system to communicate with JobManager", e); } //LeaderRetrievalService lrs = LeaderRetrievalUtils.createLeaderRetrievalService(config); LeaderRetrievalService lrs = HighAvailabilityServicesUtils.createHighAvailabilityServices( config, Executors.directExecutor(), HighAvailabilityServicesUtils.AddressResolution.TRY_ADDRESS_RESOLUTION).getJobManagerLeaderRetriever (HighAvailabilityServices.DEFAULT_JOB_ID); return LeaderRetrievalUtils.retrieveLeaderGateway(lrs, actorSystem, lookupTimeout); }
actorSystem = AkkaUtils.createActorSystem(akkaConfig); } catch (Throwable t) { if (t instanceof ChannelException) {
/** * Factory method to instantiate the RPC service. * * @param configuration * The configuration of the mini cluster * @param askTimeout * The default RPC timeout for asynchronous "ask" requests. * @param remoteEnabled * True, if the RPC service should be reachable from other (remote) RPC services. * @param bindAddress * The address to bind the RPC service to. Only relevant when "remoteEnabled" is true. * * @return The instantiated RPC service */ protected RpcService createRpcService( Configuration configuration, Time askTimeout, boolean remoteEnabled, String bindAddress) { final Config akkaConfig; if (remoteEnabled) { akkaConfig = AkkaUtils.getAkkaConfig(configuration, bindAddress, 0); } else { akkaConfig = AkkaUtils.getAkkaConfig(configuration); } final Config effectiveAkkaConfig = AkkaUtils.testDispatcherConfig().withFallback(akkaConfig); final ActorSystem actorSystem = AkkaUtils.createActorSystem(effectiveAkkaConfig); return new AkkaRpcService(actorSystem, askTimeout); }
/** * 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; }
/** * Factory method to instantiate the RPC service. * * @param configuration * The configuration of the mini cluster * @param askTimeout * The default RPC timeout for asynchronous "ask" requests. * @param remoteEnabled * True, if the RPC service should be reachable from other (remote) RPC services. * @param bindAddress * The address to bind the RPC service to. Only relevant when "remoteEnabled" is true. * * @return The instantiated RPC service */ protected RpcService createRpcService( Configuration configuration, Time askTimeout, boolean remoteEnabled, String bindAddress) { final Config akkaConfig; if (remoteEnabled) { akkaConfig = AkkaUtils.getAkkaConfig(configuration, bindAddress, 0); } else { akkaConfig = AkkaUtils.getAkkaConfig(configuration); } final Config effectiveAkkaConfig = AkkaUtils.testDispatcherConfig().withFallback(akkaConfig); final ActorSystem actorSystem = AkkaUtils.createActorSystem(effectiveAkkaConfig); return new AkkaRpcService(actorSystem, askTimeout); }
/** * Factory method to instantiate the RPC service. * * @param configuration * The configuration of the mini cluster * @param askTimeout * The default RPC timeout for asynchronous "ask" requests. * @param remoteEnabled * True, if the RPC service should be reachable from other (remote) RPC services. * @param bindAddress * The address to bind the RPC service to. Only relevant when "remoteEnabled" is true. * * @return The instantiated RPC service */ protected RpcService createRpcService( Configuration configuration, Time askTimeout, boolean remoteEnabled, String bindAddress) { final Config akkaConfig; if (remoteEnabled) { akkaConfig = AkkaUtils.getAkkaConfig(configuration, bindAddress, 0); } else { akkaConfig = AkkaUtils.getAkkaConfig(configuration); } final Config effectiveAkkaConfig = AkkaUtils.testDispatcherConfig().withFallback(akkaConfig); final ActorSystem actorSystem = AkkaUtils.createActorSystem(effectiveAkkaConfig); return new AkkaRpcService(actorSystem, askTimeout); }
this.actorSystem = AkkaUtils.createActorSystem(config, remoting);