@ChannelHandler.Sharable public final class BlockTransfer extends io.netty.channel.SimpleChannelInboundHandler<BlockStream>
BlockManagerWorker
.Modifier and Type | Method and Description |
---|---|
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx) |
protected void |
channelRead0(io.netty.channel.ChannelHandlerContext ctx,
BlockStream stream) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
BlockInputStream |
initiatePull(String executorId,
boolean encodePartialBlock,
DataStoreProperty.Value blockStoreValue,
String blockId,
String runtimeEdgeId,
KeyRange keyRange)
Initiate a pull-based block transfer.
|
BlockOutputStream |
initiatePush(String executorId,
boolean encodePartialBlock,
String blockId,
String runtimeEdgeId,
KeyRange keyRange)
Initiate a push-based block transfer.
|
acceptInboundMessage, channelRead
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
public BlockInputStream initiatePull(String executorId, boolean encodePartialBlock, DataStoreProperty.Value blockStoreValue, String blockId, String runtimeEdgeId, KeyRange keyRange)
executorId
- the id of the source executorencodePartialBlock
- whether the sender should start encoding even though the whole block
has not been written yetblockStoreValue
- the block storeblockId
- the id of the block to transferruntimeEdgeId
- the runtime edge idkeyRange
- the key rangeBlockInputStream
from which the received data can be readpublic BlockOutputStream initiatePush(String executorId, boolean encodePartialBlock, String blockId, String runtimeEdgeId, KeyRange keyRange)
executorId
- the id of the destination executorencodePartialBlock
- whether to start encoding even though the whole block has not been written yetblockId
- the id of the block to transferruntimeEdgeId
- the runtime edge idkeyRange
- the key rangeBlockOutputStream
to which data can be writtenprotected void channelRead0(io.netty.channel.ChannelHandlerContext ctx, BlockStream stream)
channelRead0
in class io.netty.channel.SimpleChannelInboundHandler<BlockStream>
public void channelActive(io.netty.channel.ChannelHandlerContext ctx)
channelActive
in interface io.netty.channel.ChannelInboundHandler
channelActive
in class io.netty.channel.ChannelInboundHandlerAdapter
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
channelInactive
in interface io.netty.channel.ChannelInboundHandler
channelInactive
in class io.netty.channel.ChannelInboundHandlerAdapter
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in interface io.netty.channel.ChannelInboundHandler
exceptionCaught
in class io.netty.channel.ChannelInboundHandlerAdapter
Copyright © 2018. All rights reserved.