use of org.apache.tez.runtime.api.impl.GroupInputSpec in project hive by apache.
the class Converters method constructSignableVertexSpec.
public static SignableVertexSpec.Builder constructSignableVertexSpec(TaskSpec taskSpec, QueryIdentifierProto queryIdentifierProto, String tokenIdentifier, String user, String hiveQueryIdString) {
TezTaskAttemptID tId = taskSpec.getTaskAttemptID();
SignableVertexSpec.Builder builder = SignableVertexSpec.newBuilder();
builder.setQueryIdentifier(queryIdentifierProto);
builder.setHiveQueryId(hiveQueryIdString);
builder.setVertexIndex(tId.getTaskID().getVertexID().getId());
builder.setDagName(taskSpec.getDAGName());
builder.setVertexName(taskSpec.getVertexName());
builder.setVertexParallelism(taskSpec.getVertexParallelism());
builder.setTokenIdentifier(tokenIdentifier);
builder.setUser(user);
if (taskSpec.getProcessorDescriptor() != null) {
builder.setProcessorDescriptor(convertToProto(taskSpec.getProcessorDescriptor()));
}
if (taskSpec.getInputs() != null && !taskSpec.getInputs().isEmpty()) {
for (InputSpec inputSpec : taskSpec.getInputs()) {
builder.addInputSpecs(convertInputSpecToProto(inputSpec));
}
}
if (taskSpec.getOutputs() != null && !taskSpec.getOutputs().isEmpty()) {
for (OutputSpec outputSpec : taskSpec.getOutputs()) {
builder.addOutputSpecs(convertOutputSpecToProto(outputSpec));
}
}
if (taskSpec.getGroupInputs() != null && !taskSpec.getGroupInputs().isEmpty()) {
for (GroupInputSpec groupInputSpec : taskSpec.getGroupInputs()) {
builder.addGroupedInputSpecs(convertGroupInputSpecToProto(groupInputSpec));
}
}
return builder;
}
use of org.apache.tez.runtime.api.impl.GroupInputSpec in project hive by apache.
the class Converters method getTaskSpecfromProto.
public static TaskSpec getTaskSpecfromProto(SignableVertexSpec vectorProto, int fragmentNum, int attemptNum, TezTaskAttemptID attemptId) {
TezTaskAttemptID taskAttemptID = attemptId != null ? attemptId : createTaskAttemptId(vectorProto.getQueryIdentifier(), vectorProto.getVertexIndex(), fragmentNum, attemptNum);
ProcessorDescriptor processorDescriptor = null;
if (vectorProto.hasProcessorDescriptor()) {
processorDescriptor = convertProcessorDescriptorFromProto(vectorProto.getProcessorDescriptor());
}
List<InputSpec> inputSpecList = new ArrayList<InputSpec>(vectorProto.getInputSpecsCount());
if (vectorProto.getInputSpecsCount() > 0) {
for (IOSpecProto inputSpecProto : vectorProto.getInputSpecsList()) {
inputSpecList.add(getInputSpecFromProto(inputSpecProto));
}
}
List<OutputSpec> outputSpecList = new ArrayList<OutputSpec>(vectorProto.getOutputSpecsCount());
if (vectorProto.getOutputSpecsCount() > 0) {
for (IOSpecProto outputSpecProto : vectorProto.getOutputSpecsList()) {
outputSpecList.add(getOutputSpecFromProto(outputSpecProto));
}
}
List<GroupInputSpec> groupInputSpecs = new ArrayList<GroupInputSpec>(vectorProto.getGroupedInputSpecsCount());
if (vectorProto.getGroupedInputSpecsCount() > 0) {
for (GroupInputSpecProto groupInputSpecProto : vectorProto.getGroupedInputSpecsList()) {
groupInputSpecs.add(getGroupInputSpecFromProto(groupInputSpecProto));
}
}
TaskSpec taskSpec = new TaskSpec(taskAttemptID, vectorProto.getDagName(), vectorProto.getVertexName(), vectorProto.getVertexParallelism(), processorDescriptor, inputSpecList, outputSpecList, groupInputSpecs);
return taskSpec;
}
Aggregations