本文整理汇总了Java中org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.PipelineAckProto类的典型用法代码示例。如果您正苦于以下问题:Java PipelineAckProto类的具体用法?Java PipelineAckProto怎么用?Java PipelineAckProto使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PipelineAckProto类属于org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos包,在下文中一共展示了PipelineAckProto类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PipelineAck
import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.PipelineAckProto; //导入依赖的package包/类
/**
* Constructor
* @param seqno sequence number
* @param replies an array of replies
* @param downstreamAckTimeNanos ack RTT in nanoseconds, 0 if no next DN in pipeline
*/
public PipelineAck(long seqno, int[] replies,
long downstreamAckTimeNanos) {
ArrayList<Status> statusList = Lists.newArrayList();
ArrayList<Integer> flagList = Lists.newArrayList();
for (int r : replies) {
statusList.add(StatusFormat.getStatus(r));
flagList.add(r);
}
proto = PipelineAckProto.newBuilder()
.setSeqno(seqno)
.addAllReply(statusList)
.addAllFlag(flagList)
.setDownstreamAckTimeNanos(downstreamAckTimeNanos)
.build();
}
示例2: channelRead0
import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.PipelineAckProto; //导入依赖的package包/类
@Override
protected void channelRead0(ChannelHandlerContext ctx, PipelineAckProto ack) throws Exception {
Status reply = getStatus(ack);
if (reply != Status.SUCCESS) {
failed(ctx.channel(), () -> new IOException("Bad response " + reply + " for block " +
block + " from datanode " + ctx.channel().remoteAddress()));
return;
}
if (PipelineAck.isRestartOOBStatus(reply)) {
failed(ctx.channel(), () -> new IOException("Restart response " + reply + " for block " +
block + " from datanode " + ctx.channel().remoteAddress()));
return;
}
if (ack.getSeqno() == HEART_BEAT_SEQNO) {
return;
}
completed(ctx.channel());
}
示例3: PipelineAck
import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.PipelineAckProto; //导入依赖的package包/类
/**
* Constructor
* @param seqno sequence number
* @param replies an array of replies
* @param downstreamAckTimeNanos ack RTT in nanoseconds, 0 if no next DN in pipeline
*/
public PipelineAck(long seqno, Status[] replies, long downstreamAckTimeNanos) {
proto = PipelineAckProto.newBuilder()
.setSeqno(seqno)
.addAllStatus(Arrays.asList(replies))
.setDownstreamAckTimeNanos(downstreamAckTimeNanos)
.build();
}
示例4: createPipelineAckStatusGetter26
import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.PipelineAckProto; //导入依赖的package包/类
private static PipelineAckStatusGetter createPipelineAckStatusGetter26()
throws NoSuchMethodException {
Method getStatusMethod = PipelineAckProto.class.getMethod("getStatus", int.class);
return new PipelineAckStatusGetter() {
@Override
public Status get(PipelineAckProto ack) {
try {
return (Status) getStatusMethod.invoke(ack, 0);
} catch (IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
}
}
};
}
示例5: setupReceiver
import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.PipelineAckProto; //导入依赖的package包/类
private void setupReceiver(int timeoutMs) {
AckHandler ackHandler = new AckHandler(timeoutMs);
for (Channel ch : datanodeList) {
ch.pipeline().addLast(
new IdleStateHandler(timeoutMs, timeoutMs / 2, 0, TimeUnit.MILLISECONDS),
new ProtobufVarint32FrameDecoder(),
new ProtobufDecoder(PipelineAckProto.getDefaultInstance()), ackHandler);
ch.config().setAutoRead(true);
}
}
示例6: readFields
import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.PipelineAckProto; //导入依赖的package包/类
/**** Writable interface ****/
public void readFields(InputStream in) throws IOException {
proto = PipelineAckProto.parseFrom(vintPrefixed(in));
}
示例7: readFields
import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.PipelineAckProto; //导入依赖的package包/类
/**
* * Writable interface ***
*/
public void readFields(InputStream in) throws IOException {
proto = PipelineAckProto.parseFrom(vintPrefixed(in));
}
示例8: getStatus
import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.PipelineAckProto; //导入依赖的package包/类
static Status getStatus(PipelineAckProto ack) {
return PIPELINE_ACK_STATUS_GETTER.get(ack);
}
示例9: PipelineAck
import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.PipelineAckProto; //导入依赖的package包/类
/**
* Constructor
*
* @param seqno
* sequence number
* @param replies
* an array of replies
* @param downstreamAckTimeNanos
* ack RTT in nanoseconds, 0 if no next DN in pipeline
*/
public PipelineAck(long seqno, Status[] replies,
long downstreamAckTimeNanos) {
proto = PipelineAckProto.newBuilder().setSeqno(seqno)
.addAllStatus(Arrays.asList(replies))
.setDownstreamAckTimeNanos(downstreamAckTimeNanos).build();
}
示例10: get
import org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.PipelineAckProto; //导入依赖的package包/类
Status get(PipelineAckProto ack);