use of org.apache.hadoop.hive.ql.exec.tez.TezContext in project hive by apache.
the class MapredContext method init.
public static MapredContext init(boolean isMap, JobConf jobConf) {
MapredContext context = HiveConf.getVar(jobConf, ConfVars.HIVE_EXECUTION_ENGINE).equals("tez") ? new TezContext(isMap, jobConf) : new MapredContext(isMap, jobConf);
contexts.set(context);
if (logger.isDebugEnabled()) {
logger.debug("MapredContext initialized.");
}
return context;
}
use of org.apache.hadoop.hive.ql.exec.tez.TezContext in project hive by apache.
the class AppMasterEventOperator method closeOp.
@Override
public void closeOp(boolean abort) throws HiveException {
if (!abort) {
TezContext context = (TezContext) TezContext.get();
String vertexName = getConf().getVertexName();
String inputName = getConf().getInputName();
byte[] payload = null;
if (hasReachedMaxSize) {
initDataBuffer(true);
}
payload = new byte[buffer.getLength()];
System.arraycopy(buffer.getData(), 0, payload, 0, buffer.getLength());
Event event = InputInitializerEvent.create(vertexName, inputName, ByteBuffer.wrap(payload, 0, payload.length));
if (isLogInfoEnabled) {
LOG.info("Sending Tez event to vertex = " + vertexName + ", input = " + inputName + ". Payload size = " + payload.length);
}
context.getTezProcessorContext().sendEvents(Collections.singletonList(event));
}
}
Aggregations