Search in sources :

Example 1 with OpRequestShortCircuitAccessProto

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

the class Receiver method opRequestShortCircuitFds.

/** Receive {@link Op#REQUEST_SHORT_CIRCUIT_FDS} */
private void opRequestShortCircuitFds(DataInputStream in) throws IOException {
    final OpRequestShortCircuitAccessProto proto = OpRequestShortCircuitAccessProto.parseFrom(vintPrefixed(in));
    SlotId slotId = (proto.hasSlotId()) ? PBHelperClient.convert(proto.getSlotId()) : null;
    TraceScope traceScope = continueTraceSpan(proto.getHeader(), proto.getClass().getSimpleName());
    try {
        requestShortCircuitFds(PBHelperClient.convert(proto.getHeader().getBlock()), PBHelperClient.convert(proto.getHeader().getToken()), slotId, proto.getMaxVersion(), proto.getSupportsReceiptVerification());
    } finally {
        if (traceScope != null)
            traceScope.close();
    }
}
Also used : SlotId(org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm.SlotId) TraceScope(org.apache.htrace.core.TraceScope) OpRequestShortCircuitAccessProto(org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.OpRequestShortCircuitAccessProto)

Example 2 with OpRequestShortCircuitAccessProto

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

the class Sender method requestShortCircuitFds.

@Override
public void requestShortCircuitFds(final ExtendedBlock blk, final Token<BlockTokenIdentifier> blockToken, SlotId slotId, int maxVersion, boolean supportsReceiptVerification) throws IOException {
    OpRequestShortCircuitAccessProto.Builder builder = OpRequestShortCircuitAccessProto.newBuilder().setHeader(DataTransferProtoUtil.buildBaseHeader(blk, blockToken)).setMaxVersion(maxVersion);
    if (slotId != null) {
        builder.setSlotId(PBHelperClient.convert(slotId));
    }
    builder.setSupportsReceiptVerification(supportsReceiptVerification);
    OpRequestShortCircuitAccessProto proto = builder.build();
    send(out, Op.REQUEST_SHORT_CIRCUIT_FDS, proto);
}
Also used : OpRequestShortCircuitAccessProto(org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.OpRequestShortCircuitAccessProto)

Aggregations

OpRequestShortCircuitAccessProto (org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.OpRequestShortCircuitAccessProto)2 SlotId (org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm.SlotId)1 TraceScope (org.apache.htrace.core.TraceScope)1