this.conf = TezUtils.createConfFromUserPayload(taskSchedulerContext.getInitialUserPayload()); } catch (IOException e) { throw new TezUncheckedException( "Failed to parse user payload for " + LlapTaskSchedulerService.class.getSimpleName(), e);
@Override protected void startRpcServer() { Configuration conf = getConf(); try { JobTokenSecretManager jobTokenSecretManager = new JobTokenSecretManager(); jobTokenSecretManager.addTokenForJob(tokenIdentifier, sessionToken); int numHandlers = HiveConf.getIntVar(conf, ConfVars.LLAP_TASK_COMMUNICATOR_LISTENER_THREAD_COUNT); server = new RPC.Builder(conf) .setProtocol(LlapTaskUmbilicalProtocol.class) .setBindAddress("0.0.0.0") .setPort(0) .setInstance(umbilical) .setNumHandlers(numHandlers) .setSecretManager(jobTokenSecretManager).build(); if (conf.getBoolean(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION, false)) { server.refreshServiceAcl(conf, new LlapUmbilicalPolicyProvider()); } server.start(); this.address = NetUtils.getConnectAddress(server); this.amHost = LlapUtil.getAmHostNameFromAddress(address, conf); LOG.info("Started LlapUmbilical: " + umbilical.getClass().getName() + " at address: " + address + " with numHandlers=" + numHandlers + " using the host name " + amHost); } catch (IOException e) { throw new TezUncheckedException(e); } }
private static EntityDescriptorProto convertToProto( EntityDescriptor<?> descriptor) { EntityDescriptorProto.Builder builder = EntityDescriptorProto .newBuilder(); builder.setClassName(descriptor.getClassName()); UserPayload userPayload = descriptor.getUserPayload(); if (userPayload != null) { UserPayloadProto.Builder payloadBuilder = UserPayloadProto.newBuilder(); if (userPayload.hasPayload()) { payloadBuilder.setUserPayload(ByteString.copyFrom(userPayload.getPayload())); payloadBuilder.setVersion(userPayload.getVersion()); } builder.setUserPayload(payloadBuilder.build()); } if (descriptor.getHistoryText() != null) { try { builder.setHistoryText(TezCommonUtils.compressByteArrayToByteString( descriptor.getHistoryText().getBytes("UTF-8"))); } catch (IOException e) { throw new TezUncheckedException(e); } } return builder.build(); }
public Resource getMaxContainerCapability() { if (!initialized) { throw new TezUncheckedException("ClusterInfo not initialized yet"); } return maxContainerCapability; }
public static TaskFailureType failureTypeFromProto(TaskFailureTypeProto proto) { switch (proto) { case FT_NON_FATAL: return TaskFailureType.NON_FATAL; case FT_FATAL: return TaskFailureType.FATAL; default: throw new TezUncheckedException("Unknown FailureTypeProto: " + proto); } }
public static TaskFailureTypeProto failureTypeToProto(TaskFailureType taskFailureType) { switch (taskFailureType) { case NON_FATAL: return TaskFailureTypeProto.FT_NON_FATAL; case FATAL: return TaskFailureTypeProto.FT_FATAL; default: throw new TezUncheckedException("Unknown FailureType: " + taskFailureType); } }
private GroupInputEdge(VertexGroup inputVertexGroup, Vertex outputVertex, EdgeProperty edgeProperty, InputDescriptor mergedInput) { this.inputVertexGroup = inputVertexGroup; this.outputVertex = outputVertex; this.edgeProperty = edgeProperty; if (mergedInput == null) { throw new TezUncheckedException( "Merged input must be specified when using GroupInputEdge"); } this.mergedInput = mergedInput; }
public static DAGProtos.StatusGetOptsProto convertStatusGetOptsToProto( StatusGetOpts statusGetOpts) { switch (statusGetOpts) { case GET_COUNTERS: return DAGProtos.StatusGetOptsProto.GET_COUNTERS; } throw new TezUncheckedException("Could not convert StatusGetOpts to" + " proto"); }
public static StatusGetOpts convertStatusGetOptsFromProto( DAGProtos.StatusGetOptsProto proto) { switch (proto) { case GET_COUNTERS: return StatusGetOpts.GET_COUNTERS; } throw new TezUncheckedException("Could not convert to StatusGetOpts from" + " proto"); }
protected void onVertexStartedCheck() { if(bipartiteSources == 0) { throw new TezUncheckedException("At least 1 bipartite source should exist"); } }
private void checkAndThrowIfDone() { if (isComplete()) { throw new TezUncheckedException("Cannot invoke context methods after reporting done"); } if (pluginFailed.get()) { throw new TezUncheckedException("Cannot invoke context methods after throwing an exception"); } }
@Override protected void startRpcServer() { try { this.address = new InetSocketAddress(InetAddress.getLocalHost(), 0); } catch (UnknownHostException e) { throw new TezUncheckedException(e); } if (LOG.isDebugEnabled()) { LOG.debug("Not starting TaskAttemptListener RPC in LocalMode"); } } }
public void setSourceVertex(Vertex sourceVertex) { if (this.sourceVertex != null && this.sourceVertex != sourceVertex) { throw new TezUncheckedException("Source vertex exists: " + sourceVertex.getLogIdentifier()); } this.sourceVertex = sourceVertex; }
private AbstractLogicalIOProcessor createProcessor( String processorClassName, ProcessorContext processorContext) throws TezException { Processor processor = ReflectionUtils.createClazzInstance(processorClassName, new Class[]{ProcessorContext.class}, new Object[]{processorContext}); if (!(processor instanceof AbstractLogicalIOProcessor)) { throw new TezUncheckedException(processor.getClass().getName() + " is not a sub-type of AbstractLogicalIOProcessor." + " Only AbstractLogicalIOProcessor sub-types supported by LogicalIOProcessorRuntimeTask."); } return (AbstractLogicalIOProcessor) processor; }
public static String convertToDAGPlan(URL resource) { Path p; try { p = ConverterUtils.getPathFromYarnURL(resource); } catch (URISyntaxException e) { throw new TezUncheckedException("Unable to translate resource: " + resource + " to Path"); } String urlString = p.toString(); return urlString; }
public void setDestinationVertex(Vertex destinationVertex) { if (this.destinationVertex != null && this.destinationVertex != destinationVertex) { throw new TezUncheckedException("Destination vertex exists: " + destinationVertex.getLogIdentifier()); } this.destinationVertex = destinationVertex; }
@Override public void launchContainer(ContainerLaunchRequest launchRequest) { try { eventQueue.put(new ContainerOp(ContainerOp.OPType.LAUNCH_REQUEST, launchRequest)); } catch (InterruptedException e) { throw new TezUncheckedException(e); } }
@Override public void stopContainer(ContainerStopRequest stopRequest) { try { eventQueue.put(new ContainerOp(ContainerOp.OPType.STOP_REQUEST, stopRequest)); } catch (InterruptedException e) { throw new TezUncheckedException(e); } }
public void addSplit(InputSplit split) { wrappedSplits.add(split); try { length += split.getLength(); } catch (Exception e) { throw new TezUncheckedException(e); } }
@Override public void launchContainer(ContainerLaunchRequest launchRequest) { try { eventQueue.put(new ContainerOp(ContainerOp.OPType.LAUNCH_REQUEST, launchRequest)); } catch (InterruptedException e) { throw new TezUncheckedException(e); } }