Search in sources :

Example 1 with ShortCircuitShmRequestProto

use of org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.ShortCircuitShmRequestProto in project hadoop by apache.

the class Sender method requestShortCircuitShm.

@Override
public void requestShortCircuitShm(String clientName) throws IOException {
    ShortCircuitShmRequestProto.Builder builder = ShortCircuitShmRequestProto.newBuilder().setClientName(clientName);
    SpanId spanId = Tracer.getCurrentSpanId();
    if (spanId.isValid()) {
        builder.setTraceInfo(DataTransferTraceInfoProto.newBuilder().setTraceId(spanId.getHigh()).setParentId(spanId.getLow()));
    }
    ShortCircuitShmRequestProto proto = builder.build();
    send(out, Op.REQUEST_SHORT_CIRCUIT_SHM, proto);
}
Also used : ShortCircuitShmRequestProto(org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.ShortCircuitShmRequestProto) SpanId(org.apache.htrace.core.SpanId)

Example 2 with ShortCircuitShmRequestProto

use of org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.ShortCircuitShmRequestProto in project hadoop by apache.

the class Receiver method opRequestShortCircuitShm.

/** Receive {@link Op#REQUEST_SHORT_CIRCUIT_SHM} */
private void opRequestShortCircuitShm(DataInputStream in) throws IOException {
    final ShortCircuitShmRequestProto proto = ShortCircuitShmRequestProto.parseFrom(vintPrefixed(in));
    TraceScope traceScope = continueTraceSpan(proto.getTraceInfo(), proto.getClass().getSimpleName());
    try {
        requestShortCircuitShm(proto.getClientName());
    } finally {
        if (traceScope != null)
            traceScope.close();
    }
}
Also used : TraceScope(org.apache.htrace.core.TraceScope) ShortCircuitShmRequestProto(org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.ShortCircuitShmRequestProto)

Aggregations

ShortCircuitShmRequestProto (org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.ShortCircuitShmRequestProto)2 SpanId (org.apache.htrace.core.SpanId)1 TraceScope (org.apache.htrace.core.TraceScope)1