protected ExtendedManagementProtocol getJobManagerConnection(CommandLine line) throws IOException { InetSocketAddress jobManagerAddress = getJobManagerAddress(line); if (jobManagerAddress == null) { return null; } String address = jobManagerAddress.getAddress().getHostAddress(); int port = jobManagerAddress.getPort(); return RPC.getProxy(ExtendedManagementProtocol.class, new InetSocketAddress(address, port), NetUtils.getSocketFactory()); }
protected ExtendedManagementProtocol getJobManagerConnection(CommandLine line) throws IOException { InetSocketAddress jobManagerAddress = getJobManagerAddress(line); if (jobManagerAddress == null) { return null; } String address = jobManagerAddress.getAddress().getHostAddress(); int port = jobManagerAddress.getPort(); return RPC.getProxy(ExtendedManagementProtocol.class, new InetSocketAddress(address, port), NetUtils.getSocketFactory()); }
/** * Sets up a connection to the JobManager. * * @return Connection to the JobManager. * @throws IOException */ private ExtendedManagementProtocol getJMConnection() throws IOException { String jmHost = config.getString(ConfigConstants.JOB_MANAGER_IPC_ADDRESS_KEY, null); String jmPort = config.getString(ConfigConstants.JOB_MANAGER_IPC_PORT_KEY, null); return RPC.getProxy(ExtendedManagementProtocol.class, new InetSocketAddress(jmHost, Integer.parseInt(jmPort)), NetUtils.getSocketFactory()); }
/** * Sets up a connection to the JobManager. * * @return Connection to the JobManager. * @throws IOException */ private ExtendedManagementProtocol getJMConnection() throws IOException { String jmHost = config.getString(ConfigConstants.JOB_MANAGER_IPC_ADDRESS_KEY, null); String jmPort = config.getString(ConfigConstants.JOB_MANAGER_IPC_PORT_KEY, null); return RPC.getProxy(ExtendedManagementProtocol.class, new InetSocketAddress(jmHost, Integer.parseInt(jmPort)), NetUtils.getSocketFactory()); }
/** * Constructs a new job client object and instantiates a local * RPC proxy for the {@link JobSubmissionProtocol}. * * @param jobGraph * the job graph to run * @param configuration * configuration object which can include special configuration settings for the job client * @param jobManagerAddress * IP/Port of the jobmanager (not taken from provided configuration object). * @throws IOException * thrown on error while initializing the RPC connection to the job manager */ public JobClient(final JobGraph jobGraph, final Configuration configuration, final InetSocketAddress jobManagerAddress) throws IOException { this.jobSubmitClient = RPC.getProxy(JobManagementProtocol.class, jobManagerAddress, NetUtils.getSocketFactory()); this.jobGraph = jobGraph; this.configuration = configuration; this.jobCleanUp = new JobCleanUp(this); }
/** * Constructs a new job client object and instantiates a local * RPC proxy for the {@link JobSubmissionProtocol}. * * @param jobGraph * the job graph to run * @param configuration * configuration object which can include special configuration settings for the job client * @param jobManagerAddress * IP/Port of the jobmanager (not taken from provided configuration object). * @throws IOException * thrown on error while initializing the RPC connection to the job manager */ public JobClient(final JobGraph jobGraph, final Configuration configuration, final InetSocketAddress jobManagerAddress) throws IOException { this.jobSubmitClient = RPC.getProxy(JobManagementProtocol.class, jobManagerAddress, NetUtils.getSocketFactory()); this.jobGraph = jobGraph; this.configuration = configuration; this.jobCleanUp = new JobCleanUp(this); }
@Override public void run() { ExtendedManagementProtocol jobManagerConnection = null; try { jobManagerConnection = RPC.getProxy(ExtendedManagementProtocol.class, this.jobManagerAddress, NetUtils.getSocketFactory()); this.instances = jobManagerConnection.getMapOfAvailableInstanceTypes(); if (this.instances == null) { throw new IOException("Returned instance map was <null>"); } } catch (Throwable t) { this.error = t; } finally { // first of all, signal completion synchronized (this.lock) { this.lock.notifyAll(); } if (jobManagerConnection != null) { try { RPC.stopProxy(jobManagerConnection); } catch (Throwable t) { LOG.error("Could not cleanly shut down connection from compiler to job manager,", t); } } jobManagerConnection = null; } } }
@Override public void run() { ExtendedManagementProtocol jobManagerConnection = null; try { jobManagerConnection = RPC.getProxy(ExtendedManagementProtocol.class, this.jobManagerAddress, NetUtils.getSocketFactory()); this.instances = jobManagerConnection.getMapOfAvailableInstanceTypes(); if (this.instances == null) { throw new IOException("Returned instance map was <null>"); } } catch (Throwable t) { this.error = t; } finally { // first of all, signal completion synchronized (this.lock) { this.lock.notifyAll(); } if (jobManagerConnection != null) { try { RPC.stopProxy(jobManagerConnection); } catch (Throwable t) { LOG.error("Could not cleanly shut down connection from compiler to job manager,", t); } } jobManagerConnection = null; } } }
/** * Constructs a new job client object and instantiates a local * RPC proxy for the {@link JobSubmissionProtocol}. * * @param jobGraph * the job graph to run * @param configuration * configuration object which can include special configuration settings for the job client * @throws IOException * thrown on error while initializing the RPC connection to the job manager */ public JobClient(final JobGraph jobGraph, final Configuration configuration) throws IOException { final String address = configuration.getString(ConfigConstants.JOB_MANAGER_IPC_ADDRESS_KEY, null); final int port = configuration.getInteger(ConfigConstants.JOB_MANAGER_IPC_PORT_KEY, ConfigConstants.DEFAULT_JOB_MANAGER_IPC_PORT); final InetSocketAddress inetaddr = new InetSocketAddress(address, port); this.jobSubmitClient = RPC.getProxy(JobManagementProtocol.class, inetaddr, NetUtils.getSocketFactory()); this.accumulatorProtocolProxy = RPC.getProxy(AccumulatorProtocol.class, inetaddr, NetUtils.getSocketFactory()); this.jobGraph = jobGraph; this.configuration = configuration; this.jobCleanUp = new JobCleanUp(this); }
/** * Constructs a new job client object and instantiates a local * RPC proxy for the {@link JobSubmissionProtocol}. * * @param jobGraph * the job graph to run * @param configuration * configuration object which can include special configuration settings for the job client * @throws IOException * thrown on error while initializing the RPC connection to the job manager */ public JobClient(final JobGraph jobGraph, final Configuration configuration) throws IOException { final String address = configuration.getString(ConfigConstants.JOB_MANAGER_IPC_ADDRESS_KEY, null); final int port = configuration.getInteger(ConfigConstants.JOB_MANAGER_IPC_PORT_KEY, ConfigConstants.DEFAULT_JOB_MANAGER_IPC_PORT); final InetSocketAddress inetaddr = new InetSocketAddress(address, port); this.jobSubmitClient = RPC.getProxy(JobManagementProtocol.class, inetaddr, NetUtils.getSocketFactory()); this.accumulatorProtocolProxy = RPC.getProxy(AccumulatorProtocol.class, inetaddr, NetUtils.getSocketFactory()); this.jobGraph = jobGraph; this.configuration = configuration; this.jobCleanUp = new JobCleanUp(this); }
/** * Creates or returns the RPC stub object for the instance's task manager. * * @return the RPC stub object for the instance's task manager * @throws IOException * thrown if the RPC stub object for the task manager cannot be created */ private TaskOperationProtocol getTaskManagerProxy() throws IOException { if (this.taskManager == null) { this.taskManager = RPC.getProxy(TaskOperationProtocol.class, new InetSocketAddress(getInstanceConnectionInfo().address(), getInstanceConnectionInfo().ipcPort()), NetUtils.getSocketFactory()); } return this.taskManager; }
/** * Creates or returns the RPC stub object for the instance's task manager. * * @return the RPC stub object for the instance's task manager * @throws IOException * thrown if the RPC stub object for the task manager cannot be created */ private TaskOperationProtocol getTaskManagerProxy() throws IOException { if (this.taskManager == null) { this.taskManager = RPC.getProxy(TaskOperationProtocol.class, new InetSocketAddress(getInstanceConnectionInfo().address(), getInstanceConnectionInfo().ipcPort()), NetUtils.getSocketFactory()); } return this.taskManager; }
try { jobManagerProfilerTmp = (ProfilerImplProtocol) RPC.getProxy(ProfilerImplProtocol.class, profilingAddress, NetUtils.getSocketFactory()); } catch (IOException e) { throw new ProfilingException(StringUtils.stringifyException(e));
try { jobManagerProfilerTmp = (ProfilerImplProtocol) RPC.getProxy(ProfilerImplProtocol.class, profilingAddress, NetUtils.getSocketFactory()); } catch (IOException e) { throw new ProfilingException(StringUtils.stringifyException(e));
this.jobManager = RPC.getProxy(JobManagerProtocol.class, jobManagerAddress, NetUtils.getSocketFactory()); } catch (IOException e) { LOG.fatal("Could not connect to the JobManager: " + e.getMessage(), e); this.globalInputSplitProvider = RPC.getProxy(InputSplitProviderProtocol.class, jobManagerAddress, NetUtils.getSocketFactory()); } catch (IOException e) { LOG.fatal(e.getMessage(), e); this.lookupService = RPC.getProxy(ChannelLookupProtocol.class, jobManagerAddress, NetUtils.getSocketFactory()); } catch (IOException e) { LOG.fatal(e.getMessage(), e); this.accumulatorProtocolProxy = RPC.getProxy(AccumulatorProtocol.class, jobManagerAddress, NetUtils.getSocketFactory()); } catch (IOException e) { LOG.fatal("Failed to initialize accumulator protocol: " + e.getMessage(), e);
this.jobManager = RPC.getProxy(JobManagerProtocol.class, jobManagerAddress, NetUtils.getSocketFactory()); } catch (IOException e) { LOG.fatal("Could not connect to the JobManager: " + e.getMessage(), e); this.globalInputSplitProvider = RPC.getProxy(InputSplitProviderProtocol.class, jobManagerAddress, NetUtils.getSocketFactory()); } catch (IOException e) { LOG.fatal(e.getMessage(), e); this.lookupService = RPC.getProxy(ChannelLookupProtocol.class, jobManagerAddress, NetUtils.getSocketFactory()); } catch (IOException e) { LOG.fatal(e.getMessage(), e); this.accumulatorProtocolProxy = RPC.getProxy(AccumulatorProtocol.class, jobManagerAddress, NetUtils.getSocketFactory()); } catch (IOException e) { LOG.fatal("Failed to initialize accumulator protocol: " + e.getMessage(), e);