scala.Option<Object> portOption = AkkaUtils.getAddress(getContext().system()).port(); int actorSystemPort = portOption.isDefined() ? (int) portOption.get() : -1;
final int akkaPort = (Integer) AkkaUtils.getAddress(actorSystem).port().get();
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; }
public LeaderConnectionInfo(String address, UUID leaderSessionID) throws FlinkException { this.address = address; this.leaderSessionID = leaderSessionID; final Address akkaAddress; // this only works as long as the address is Akka based try { akkaAddress = AkkaUtils.getAddressFromAkkaURL(address); } catch (MalformedURLException e) { throw new FlinkException("Could not extract the hostname from the given address \'" + address + "\'.", e); } if (akkaAddress.host().isDefined()) { hostname = akkaAddress.host().get(); } else { hostname = "localhost"; } if (akkaAddress.port().isDefined()) { port = (int) akkaAddress.port().get(); } else { port = -1; } }
public LeaderConnectionInfo(String address, UUID leaderSessionID) throws FlinkException { this.address = address; this.leaderSessionID = leaderSessionID; final Address akkaAddress; // this only works as long as the address is Akka based try { akkaAddress = AkkaUtils.getAddressFromAkkaURL(address); } catch (MalformedURLException e) { throw new FlinkException("Could not extract the hostname from the given address \'" + address + "\'.", e); } if (akkaAddress.host().isDefined()) { hostname = akkaAddress.host().get(); } else { hostname = "localhost"; } if (akkaAddress.port().isDefined()) { port = (int) akkaAddress.port().get(); } else { port = -1; } }
public LeaderConnectionInfo(String address, UUID leaderSessionID) throws FlinkException { this.address = address; this.leaderSessionID = leaderSessionID; final Address akkaAddress; // this only works as long as the address is Akka based try { akkaAddress = AkkaUtils.getAddressFromAkkaURL(address); } catch (MalformedURLException e) { throw new FlinkException("Could not extract the hostname from the given address \'" + address + "\'.", e); } if (akkaAddress.host().isDefined()) { hostname = akkaAddress.host().get(); } else { hostname = "localhost"; } if (akkaAddress.port().isDefined()) { port = (int) akkaAddress.port().get(); } else { port = -1; } }
public AkkaRpcService(final ActorSystem actorSystem, final Time timeout) { this.actorSystem = checkNotNull(actorSystem, "actor system"); this.timeout = checkNotNull(timeout, "timeout"); if (actorSystem.settings().config().hasPath(MAXIMUM_FRAME_SIZE_PATH)) { maximumFramesize = actorSystem.settings().config().getBytes(MAXIMUM_FRAME_SIZE_PATH); } else { // only local communication maximumFramesize = Long.MAX_VALUE; } Address actorSystemAddress = AkkaUtils.getAddress(actorSystem); if (actorSystemAddress.host().isDefined()) { address = actorSystemAddress.host().get(); } else { address = ""; } if (actorSystemAddress.port().isDefined()) { port = (Integer) actorSystemAddress.port().get(); } else { port = -1; } internalScheduledExecutor = new ActorSystemScheduledExecutorAdapter(actorSystem); terminationFuture = new CompletableFuture<>(); stopped = false; }
public AkkaRpcService(final ActorSystem actorSystem, final Time timeout) { this.actorSystem = checkNotNull(actorSystem, "actor system"); this.timeout = checkNotNull(timeout, "timeout"); if (actorSystem.settings().config().hasPath(MAXIMUM_FRAME_SIZE_PATH)) { maximumFramesize = actorSystem.settings().config().getBytes(MAXIMUM_FRAME_SIZE_PATH); } else { // only local communication maximumFramesize = Long.MAX_VALUE; } Address actorSystemAddress = AkkaUtils.getAddress(actorSystem); if (actorSystemAddress.host().isDefined()) { address = actorSystemAddress.host().get(); } else { address = ""; } if (actorSystemAddress.port().isDefined()) { port = (Integer) actorSystemAddress.port().get(); } else { port = -1; } internalScheduledExecutor = new ActorSystemScheduledExecutorAdapter(actorSystem); terminationFuture = new CompletableFuture<>(); stopped = false; }
public AkkaRpcService(final ActorSystem actorSystem, final Time timeout) { this.actorSystem = checkNotNull(actorSystem, "actor system"); this.timeout = checkNotNull(timeout, "timeout"); if (actorSystem.settings().config().hasPath(MAXIMUM_FRAME_SIZE_PATH)) { maximumFramesize = actorSystem.settings().config().getBytes(MAXIMUM_FRAME_SIZE_PATH); } else { // only local communication maximumFramesize = Long.MAX_VALUE; } Address actorSystemAddress = AkkaUtils.getAddress(actorSystem); if (actorSystemAddress.host().isDefined()) { address = actorSystemAddress.host().get(); } else { address = ""; } if (actorSystemAddress.port().isDefined()) { port = (Integer) actorSystemAddress.port().get(); } else { port = -1; } internalScheduledExecutor = new ActorSystemScheduledExecutorAdapter(actorSystem); terminationFuture = new CompletableFuture<>(); stopped = false; }
public ActorContext(ActorSystem actorSystem, ActorRef shardManager, ClusterWrapper clusterWrapper, Configuration configuration, DatastoreContext datastoreContext, PrimaryShardInfoFutureCache primaryShardInfoCache) { this.actorSystem = actorSystem; this.shardManager = shardManager; this.clusterWrapper = clusterWrapper; this.configuration = configuration; this.datastoreContext = datastoreContext; this.dispatchers = new Dispatchers(actorSystem.dispatchers()); this.primaryShardInfoCache = primaryShardInfoCache; this.shardStrategyFactory = new ShardStrategyFactory(configuration); setCachedProperties(); Address selfAddress = clusterWrapper.getSelfAddress(); if (selfAddress != null && !selfAddress.host().isEmpty()) { selfAddressHostPort = selfAddress.host().get() + ":" + selfAddress.port().get(); } else { selfAddressHostPort = null; } }
config.setString(ConfigConstants.JOB_MANAGER_IPC_PORT_KEY, address.port().get().toString());
scala.Option<Object> portOption = AkkaUtils.getAddress(getContext().system()).port(); int actorSystemPort = portOption.isDefined() ? (int) portOption.get() : -1;
scala.Option<Object> portOption = AkkaUtils.getAddress(getContext().system()).port(); int actorSystemPort = portOption.isDefined() ? (int) portOption.get() : -1;
final int akkaPort = (Integer) AkkaUtils.getAddress(actorSystem).port().get();
final int akkaPort = (Integer) AkkaUtils.getAddress(actorSystem).port().get();