public ClusterClient( Configuration flinkConfig, HighAvailabilityServices highAvailabilityServices, boolean sharedHaServices, ActorSystemLoader actorSystemLoader) { this.flinkConfig = Preconditions.checkNotNull(flinkConfig); this.compiler = new Optimizer(new DataStatistics(), new DefaultCostEstimator(), flinkConfig); this.timeout = AkkaUtils.getClientTimeout(flinkConfig); this.lookupTimeout = AkkaUtils.getLookupTimeout(flinkConfig); this.actorSystemLoader = Preconditions.checkNotNull(actorSystemLoader); this.highAvailabilityServices = Preconditions.checkNotNull(highAvailabilityServices); this.sharedHaServices = sharedHaServices; }
/** * Creates a instance that submits the programs to the JobManager defined in the * configuration. This method will try to resolve the JobManager hostname and throw an exception * if that is not possible. * * @param flinkConfig The config used to obtain the job-manager's address, and used to configure the optimizer. * @param highAvailabilityServices HighAvailabilityServices to use for leader retrieval * @param sharedHaServices true if the HighAvailabilityServices are shared and must not be shut down */ public ClusterClient( Configuration flinkConfig, HighAvailabilityServices highAvailabilityServices, boolean sharedHaServices) { this.flinkConfig = Preconditions.checkNotNull(flinkConfig); this.compiler = new Optimizer(new DataStatistics(), new DefaultCostEstimator(), flinkConfig); this.timeout = AkkaUtils.getClientTimeout(flinkConfig); this.lookupTimeout = AkkaUtils.getLookupTimeout(flinkConfig); this.actorSystemLoader = new LazyActorSystemLoader( highAvailabilityServices, Time.milliseconds(lookupTimeout.toMillis()), flinkConfig, log); this.highAvailabilityServices = Preconditions.checkNotNull(highAvailabilityServices); this.sharedHaServices = sharedHaServices; }
/** * Creates a AbstractFrameworkMaster actor. * * @param flinkConfig The Flink configuration object. */ protected FlinkResourceManager( int numInitialTaskManagers, Configuration flinkConfig, LeaderRetrievalService leaderRetriever) { this.config = requireNonNull(flinkConfig); this.leaderRetriever = requireNonNull(leaderRetriever); this.startedWorkers = new HashMap<>(); FiniteDuration lt; try { lt = AkkaUtils.getLookupTimeout(config); } catch (Exception e) { lt = new FiniteDuration( Duration.apply(ConfigConstants.DEFAULT_AKKA_LOOKUP_TIMEOUT).toMillis(), TimeUnit.MILLISECONDS); } this.messageTimeout = lt; this.designatedPoolSize = numInitialTaskManagers; this.infoMessageListeners = new HashSet<>(); }
private ActorGateway getJobManager() throws JobRetrievalException { try { return LeaderRetrievalUtils.retrieveLeaderGateway( highAvailabilityServices.getJobManagerLeaderRetriever(HighAvailabilityServices.DEFAULT_JOB_ID), actorSystem, AkkaUtils.getLookupTimeout(configuration)); } catch (Exception e) { throw new JobRetrievalException(jobID, "Couldn't retrieve leading JobManager.", e); } } }
private ActorGateway getJobManager() throws JobRetrievalException { try { return LeaderRetrievalUtils.retrieveLeaderGateway( highAvailabilityServices.getJobManagerLeaderRetriever(HighAvailabilityServices.DEFAULT_JOB_ID), actorSystem, AkkaUtils.getLookupTimeout(configuration)); } catch (Exception e) { throw new JobRetrievalException(jobID, "Couldn't retrieve leading JobManager.", e); } } }
/** * Creates a AbstractFrameworkMaster actor. * * @param flinkConfig The Flink configuration object. */ protected FlinkResourceManager( int numInitialTaskManagers, Configuration flinkConfig, LeaderRetrievalService leaderRetriever) { this.config = requireNonNull(flinkConfig); this.leaderRetriever = requireNonNull(leaderRetriever); this.startedWorkers = new HashMap<>(); FiniteDuration lt; try { lt = AkkaUtils.getLookupTimeout(config); } catch (Exception e) { lt = new FiniteDuration( Duration.apply(AkkaOptions.LOOKUP_TIMEOUT.defaultValue()).toMillis(), TimeUnit.MILLISECONDS); } this.messageTimeout = lt; this.designatedPoolSize = numInitialTaskManagers; this.infoMessageListeners = new HashSet<>(); }
/** * Creates a AbstractFrameworkMaster actor. * * @param flinkConfig The Flink configuration object. */ protected FlinkResourceManager( int numInitialTaskManagers, Configuration flinkConfig, LeaderRetrievalService leaderRetriever) { this.config = requireNonNull(flinkConfig); this.leaderRetriever = requireNonNull(leaderRetriever); this.startedWorkers = new HashMap<>(); FiniteDuration lt; try { lt = AkkaUtils.getLookupTimeout(config); } catch (Exception e) { lt = new FiniteDuration( Duration.apply(AkkaOptions.LOOKUP_TIMEOUT.defaultValue()).toMillis(), TimeUnit.MILLISECONDS); } this.messageTimeout = lt; this.designatedPoolSize = numInitialTaskManagers; this.infoMessageListeners = new HashSet<>(); }
private ActorGateway getJobManager() throws JobRetrievalException { try { return LeaderRetrievalUtils.retrieveLeaderGateway( highAvailabilityServices.getJobManagerLeaderRetriever(HighAvailabilityServices.DEFAULT_JOB_ID), actorSystem, AkkaUtils.getLookupTimeout(configuration)); } catch (Exception e) { throw new JobRetrievalException(jobID, "Couldn't retrieve leading JobManager.", e); } } }
private ActorGateway getJobManager() throws JobRetrievalException { try { return LeaderRetrievalUtils.retrieveLeaderGateway( highAvailabilityServices.getJobManagerLeaderRetriever(HighAvailabilityServices.DEFAULT_JOB_ID), actorSystem, AkkaUtils.getLookupTimeout(configuration)); } catch (Exception e) { throw new JobRetrievalException(jobID, "Couldn't retrieve leading JobManager.", e); } } }
/** * Creates a AbstractFrameworkMaster actor. * * @param flinkConfig The Flink configuration object. */ protected FlinkResourceManager( int numInitialTaskManagers, Configuration flinkConfig, LeaderRetrievalService leaderRetriever) { this.config = requireNonNull(flinkConfig); this.leaderRetriever = requireNonNull(leaderRetriever); this.startedWorkers = new HashMap<>(); FiniteDuration lt; try { lt = AkkaUtils.getLookupTimeout(config); } catch (Exception e) { lt = new FiniteDuration( Duration.apply(AkkaOptions.LOOKUP_TIMEOUT.defaultValue()).toMillis(), TimeUnit.MILLISECONDS); } this.messageTimeout = lt; this.designatedPoolSize = numInitialTaskManagers; this.infoMessageListeners = new HashSet<>(); }
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)); }
LOG.info("Using configured hostname/address for TaskManager: {}.", taskManagerHostname); } else { Time lookupTimeout = Time.milliseconds(AkkaUtils.getLookupTimeout(configuration).toMillis());
LOG.info("Using configured hostname/address for TaskManager: {}.", taskManagerHostname); } else { Time lookupTimeout = Time.milliseconds(AkkaUtils.getLookupTimeout(configuration).toMillis());
LOG.info("Using configured hostname/address for TaskManager: {}.", taskManagerHostname); } else { Time lookupTimeout = Time.milliseconds(AkkaUtils.getLookupTimeout(configuration).toMillis());
LOG.info("Using configured hostname/address for TaskManager: {}.", taskManagerHostname); } else { Time lookupTimeout = Time.milliseconds(AkkaUtils.getLookupTimeout(configuration).toMillis());
public ClusterClient( Configuration flinkConfig, HighAvailabilityServices highAvailabilityServices, boolean sharedHaServices, ActorSystemLoader actorSystemLoader) { this.flinkConfig = Preconditions.checkNotNull(flinkConfig); this.compiler = new Optimizer(new DataStatistics(), new DefaultCostEstimator(), flinkConfig); this.timeout = AkkaUtils.getClientTimeout(flinkConfig); this.lookupTimeout = AkkaUtils.getLookupTimeout(flinkConfig); this.actorSystemLoader = Preconditions.checkNotNull(actorSystemLoader); this.highAvailabilityServices = Preconditions.checkNotNull(highAvailabilityServices); this.sharedHaServices = sharedHaServices; }
/** * Creates a instance that submits the programs to the JobManager defined in the * configuration. This method will try to resolve the JobManager hostname and throw an exception * if that is not possible. * * @param flinkConfig The config used to obtain the job-manager's address, and used to configure the optimizer. * @param highAvailabilityServices HighAvailabilityServices to use for leader retrieval */ public ClusterClient(Configuration flinkConfig, HighAvailabilityServices highAvailabilityServices) { this.flinkConfig = Preconditions.checkNotNull(flinkConfig); this.compiler = new Optimizer(new DataStatistics(), new DefaultCostEstimator(), flinkConfig); this.timeout = AkkaUtils.getClientTimeout(flinkConfig); this.lookupTimeout = AkkaUtils.getLookupTimeout(flinkConfig); this.actorSystemLoader = new LazyActorSystemLoader( highAvailabilityServices, Time.milliseconds(lookupTimeout.toMillis()), flinkConfig, LOG); this.highAvailabilityServices = Preconditions.checkNotNull(highAvailabilityServices); }
/** * Creates a instance that submits the programs to the JobManager defined in the * configuration. This method will try to resolve the JobManager hostname and throw an exception * if that is not possible. * * @param flinkConfig The config used to obtain the job-manager's address, and used to configure the optimizer. * @param highAvailabilityServices HighAvailabilityServices to use for leader retrieval * @param sharedHaServices true if the HighAvailabilityServices are shared and must not be shut down */ public ClusterClient(Configuration flinkConfig, HighAvailabilityServices highAvailabilityServices, boolean sharedHaServices) { this.flinkConfig = Preconditions.checkNotNull(flinkConfig); this.compiler = new Optimizer(new DataStatistics(), new DefaultCostEstimator(), flinkConfig); this.timeout = AkkaUtils.getClientTimeout(flinkConfig); this.lookupTimeout = AkkaUtils.getLookupTimeout(flinkConfig); this.actorSystemLoader = new LazyActorSystemLoader( highAvailabilityServices, Time.milliseconds(lookupTimeout.toMillis()), flinkConfig, log); this.highAvailabilityServices = Preconditions.checkNotNull(highAvailabilityServices); this.sharedHaServices = sharedHaServices; }
/** * Creates a instance that submits the programs to the JobManager defined in the * configuration. This method will try to resolve the JobManager hostname and throw an exception * if that is not possible. * * @param flinkConfig The config used to obtain the job-manager's address, and used to configure the optimizer. * @param highAvailabilityServices HighAvailabilityServices to use for leader retrieval * @param sharedHaServices true if the HighAvailabilityServices are shared and must not be shut down */ public ClusterClient( Configuration flinkConfig, HighAvailabilityServices highAvailabilityServices, boolean sharedHaServices) { this.flinkConfig = Preconditions.checkNotNull(flinkConfig); this.compiler = new Optimizer(new DataStatistics(), new DefaultCostEstimator(), flinkConfig); this.timeout = AkkaUtils.getClientTimeout(flinkConfig); this.lookupTimeout = AkkaUtils.getLookupTimeout(flinkConfig); this.actorSystemLoader = new LazyActorSystemLoader( highAvailabilityServices, Time.milliseconds(lookupTimeout.toMillis()), flinkConfig, log); this.highAvailabilityServices = Preconditions.checkNotNull(highAvailabilityServices); this.sharedHaServices = sharedHaServices; }