use of org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.NotTezEvent in project hive by apache.
the class NotTezEventHelper method createSignableNotTezEvent.
public static Signable createSignableNotTezEvent(InputDataInformationEvent event, String vertexName, String destInputName) {
final NotTezEvent.Builder builder = NotTezEvent.newBuilder().setInputEventProtoBytes(ProtoConverters.convertRootInputDataInformationEventToProto(event).toByteString()).setVertexName(vertexName).setDestInputName(destInputName);
return new Signable() {
@Override
public void setSignInfo(int masterKeyId) {
builder.setKeyId(masterKeyId);
}
@Override
public byte[] serialize() throws IOException {
NotTezEvent nte = builder.build();
ByteArrayOutputStream baos = new ByteArrayOutputStream(nte.getSerializedSize());
nte.writeTo(baos);
return baos.toByteArray();
}
};
}
use of org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.NotTezEvent in project hive by apache.
the class ContainerRunnerImpl method extractInitialEvent.
private TezEvent extractInitialEvent(SubmitWorkRequestProto request, LlapTokenInfo tokenInfo) throws InvalidProtocolBufferException {
if (!request.hasInitialEventBytes())
return null;
ByteString initialEventByteString = request.getInitialEventBytes();
byte[] initialEventBytes = initialEventByteString.toByteArray();
NotTezEvent initialEvent = NotTezEvent.parseFrom(initialEventBytes);
if (tokenInfo.isSigningRequired) {
if (!request.hasInitialEventSignature()) {
logSecurityErrorRarely(tokenInfo.userName);
throw new SecurityException("Unsigned initial event is not allowed");
}
byte[] signatureBytes = request.getInitialEventSignature().toByteArray();
try {
signer.checkSignature(initialEventBytes, signatureBytes, initialEvent.getKeyId());
} catch (SecurityException ex) {
logSecurityErrorRarely(tokenInfo.userName);
throw ex;
}
}
return NotTezEventHelper.toTezEvent(initialEvent);
}
use of org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.NotTezEvent in project hive by apache.
the class NotTezEventHelper method toTezEvent.
public static TezEvent toTezEvent(NotTezEvent nte) throws InvalidProtocolBufferException {
EventMetaData sourceMetaData = new EventMetaData(EventMetaData.EventProducerConsumerType.INPUT, nte.getVertexName(), "NULL_VERTEX", null);
EventMetaData destMetaData = new EventMetaData(EventMetaData.EventProducerConsumerType.INPUT, nte.getVertexName(), nte.getDestInputName(), null);
InputDataInformationEvent event = ProtoConverters.convertRootInputDataInformationEventFromProto(RootInputDataInformationEventProto.parseFrom(nte.getInputEventProtoBytes()));
TezEvent tezEvent = new TezEvent(event, sourceMetaData, System.currentTimeMillis());
tezEvent.setDestinationInfo(destMetaData);
return tezEvent;
}
Aggregations