public static Scheduler initializeHDFSScheduler(ICCServiceContext serviceCtx) throws HyracksDataException { ICCContext ccContext = serviceCtx.getCCContext(); Scheduler scheduler = null; try { scheduler = new Scheduler(ccContext.getClusterControllerInfo().getClientNetAddress(), ccContext.getClusterControllerInfo().getClientNetPort()); } catch (HyracksException e) { throw new RuntimeDataException(ErrorCode.UTIL_HDFS_UTILS_CANNOT_OBTAIN_HDFS_SCHEDULER); } return scheduler; }
private CcConnection getPendingNodeRegistration(NodeParameters nodeParameters) { CcConnection ccConnection = pendingRegistrations.remove(nodeParameters.getRegistrationId()); if (ccConnection == null) { throw new IllegalStateException("Unknown pending node registration " + nodeParameters.getRegistrationId() + " for " + nodeParameters.getClusterControllerInfo().getCcId()); } return ccConnection; }
int slashIndex = jar.lastIndexOf('/'); String fileName = jar.substring(slashIndex + 1); String url = "http://" + ccHost + ":" + ccInfo.getWebPort() + "/applications/" + deploymentId.toString() + "&" + fileName; HttpPut put = new HttpPut(url);
@Override public void start() throws Exception { LOGGER.log(Level.INFO, "Starting ClusterControllerService: " + this); serverCtx = new ServerContext(ServerContext.ServerType.CLUSTER_CONTROLLER, new File(ccConfig.getRootDir())); IIPCI ccIPCI = new ClusterControllerIPCI(this); clusterIPC = new IPCSystem(new InetSocketAddress(ccConfig.getClusterListenPort()), networkSecurityManager.getSocketChannelFactory(), ccIPCI, new CCNCFunctions.SerializerDeserializer()); IIPCI ciIPCI = new ClientInterfaceIPCI(this, jobIdFactory); clientIPC = new IPCSystem(new InetSocketAddress(ccConfig.getClientListenAddress(), ccConfig.getClientListenPort()), networkSecurityManager.getSocketChannelFactory(), ciIPCI, new JavaSerializationBasedPayloadSerializerDeserializer()); webServer = new WebServer(this, ccConfig.getConsoleListenPort()); clusterIPC.start(); clientIPC.start(); webServer.start(); info = new ClusterControllerInfo(ccId, ccConfig.getClientPublicAddress(), ccConfig.getClientPublicPort(), ccConfig.getConsolePublicPort()); timer.schedule(sweeper, 0, ccConfig.getDeadNodeSweepThreshold()); jobLog.open(); startApplication(); resultDirectoryService.init(executor); workQueue.start(); connectNCs(); LOGGER.log(Level.INFO, "Started ClusterControllerService"); notifyApplication(); }
@Override public IHyracksClientConnection getHcc() throws HyracksDataException { if (hcc == null || !hcc.isConnected()) { synchronized (this) { if (hcc == null || !hcc.isConnected()) { try { NodeControllerService ncSrv = (NodeControllerService) ncServiceContext.getControllerService(); // TODO(mblow): multicc CcId primaryCcId = ncSrv.getPrimaryCcId(); ClusterControllerInfo ccInfo = ncSrv.getNodeParameters(primaryCcId).getClusterControllerInfo(); hcc = new HyracksConnection(ccInfo.getClientNetAddress(), ccInfo.getClientNetPort(), ncSrv.getNetworkSecurityManager().getSocketChannelFactory()); } catch (Exception e) { throw HyracksDataException.create(e); } } } } return hcc; }
public CcId getCcId() { return getNodeParameters().getClusterControllerInfo().getCcId(); }
String strIP = ccServiceCtx.getCCContext().getClusterControllerInfo().getClientNetAddress(); int port = ccServiceCtx.getCCContext().getClusterControllerInfo().getClientNetPort(); hcc = new HyracksConnection(strIP, port, ccServiceCtx.getControllerService().getNetworkSecurityManager().getSocketChannelFactory());