Class FanOutOneBlockAsyncDFSOutputHelper
java.lang.Object
org.apache.hadoop.hbase.io.asyncfs.FanOutOneBlockAsyncDFSOutputHelper
Helper class for implementing
FanOutOneBlockAsyncDFSOutput
.-
Nested Class Summary
Modifier and TypeClassDescription(package private) static final class
private static interface
private static interface
private static interface
static class
Exception other than RemoteException thrown when calling create on namenode -
Field Summary
Modifier and TypeFieldDescriptionprivate static final org.apache.hbase.thirdparty.io.netty.buffer.ByteBufAllocator
static final String
static final int
private static final FanOutOneBlockAsyncDFSOutputHelper.DFSClientAdaptor
private static final FanOutOneBlockAsyncDFSOutputHelper.FileCreator
static final long
private static final FanOutOneBlockAsyncDFSOutputHelper.LeaseManager
private static final org.slf4j.Logger
static final int
private static final org.apache.hadoop.fs.CreateFlag
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) static void
beginFileLease
(org.apache.hadoop.hdfs.DFSClient client, long inodeId) (package private) static void
completeFile
(org.apache.hadoop.hdfs.DFSClient client, org.apache.hadoop.hdfs.protocol.ClientProtocol namenode, String src, String clientName, org.apache.hadoop.hdfs.protocol.ExtendedBlock block, long fileId) private static List<org.apache.hbase.thirdparty.io.netty.util.concurrent.Future<org.apache.hbase.thirdparty.io.netty.channel.Channel>>
connectToDataNodes
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hdfs.DFSClient client, String clientName, org.apache.hadoop.hdfs.protocol.LocatedBlock locatedBlock, long maxBytesRcvd, long latestGS, org.apache.hadoop.hdfs.protocol.datatransfer.BlockConstructionStage stage, org.apache.hadoop.util.DataChecksum summer, org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroup eventLoopGroup, Class<? extends org.apache.hbase.thirdparty.io.netty.channel.Channel> channelClass) (package private) static org.apache.hadoop.util.DataChecksum
createChecksum
(org.apache.hadoop.hdfs.DFSClient client) private static FanOutOneBlockAsyncDFSOutputHelper.DFSClientAdaptor
private static FanOutOneBlockAsyncDFSOutputHelper.FileCreator
private static FanOutOneBlockAsyncDFSOutputHelper.FileCreator
private static FanOutOneBlockAsyncDFSOutputHelper.FileCreator
private static FanOutOneBlockAsyncDFSOutputHelper.FileCreator
private static FanOutOneBlockAsyncDFSOutputHelper.LeaseManager
private static FanOutOneBlockAsyncDFSOutput
createOutput
(org.apache.hadoop.hdfs.DistributedFileSystem dfs, String src, boolean overwrite, boolean createParent, short replication, long blockSize, org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroup eventLoopGroup, Class<? extends org.apache.hbase.thirdparty.io.netty.channel.Channel> channelClass, StreamSlowMonitor monitor, boolean noLocalWrite) static FanOutOneBlockAsyncDFSOutput
createOutput
(org.apache.hadoop.hdfs.DistributedFileSystem dfs, org.apache.hadoop.fs.Path f, boolean overwrite, boolean createParent, short replication, long blockSize, org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroup eventLoopGroup, Class<? extends org.apache.hbase.thirdparty.io.netty.channel.Channel> channelClass, StreamSlowMonitor monitor, boolean noLocalWrite) Create aFanOutOneBlockAsyncDFSOutput
.(package private) static void
endFileLease
(org.apache.hadoop.hdfs.DFSClient client, long inodeId) private static org.apache.hadoop.io.EnumSetWritable<org.apache.hadoop.fs.CreateFlag>
getCreateFlags
(boolean overwrite, boolean noLocalWrite) (package private) static org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.Status
getStatus
(org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.PipelineAckProto ack) private static void
initialize
(org.apache.hadoop.conf.Configuration conf, org.apache.hbase.thirdparty.io.netty.channel.Channel channel, org.apache.hadoop.hdfs.protocol.DatanodeInfo dnInfo, org.apache.hadoop.fs.StorageType storageType, org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.OpWriteBlockProto.Builder writeBlockProtoBuilder, int timeoutMs, org.apache.hadoop.hdfs.DFSClient client, org.apache.hadoop.security.token.Token<org.apache.hadoop.hdfs.security.token.block.BlockTokenIdentifier> accessToken, org.apache.hbase.thirdparty.io.netty.util.concurrent.Promise<org.apache.hbase.thirdparty.io.netty.channel.Channel> promise) private static org.apache.hadoop.fs.CreateFlag
private static void
processWriteBlockResponse
(org.apache.hbase.thirdparty.io.netty.channel.Channel channel, org.apache.hadoop.hdfs.protocol.DatanodeInfo dnInfo, org.apache.hbase.thirdparty.io.netty.util.concurrent.Promise<org.apache.hbase.thirdparty.io.netty.channel.Channel> promise, int timeoutMs) private static void
requestWriteBlock
(org.apache.hbase.thirdparty.io.netty.channel.Channel channel, org.apache.hadoop.fs.StorageType storageType, org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.OpWriteBlockProto.Builder writeBlockProtoBuilder) static boolean
shouldRetryCreate
(org.apache.hadoop.ipc.RemoteException e) (package private) static void
sleepIgnoreInterrupt
(int retry)
-
Field Details
-
LOG
-
ASYNC_DFS_OUTPUT_CREATE_MAX_RETRIES
- See Also:
-
DEFAULT_ASYNC_DFS_OUTPUT_CREATE_MAX_RETRIES
- See Also:
-
ALLOC
-
HEART_BEAT_SEQNO
- See Also:
-
READ_TIMEOUT
- See Also:
-
LEASE_MANAGER
-
DFS_CLIENT_ADAPTOR
-
FILE_CREATOR
-
SHOULD_REPLICATE_FLAG
-
-
Constructor Details
-
FanOutOneBlockAsyncDFSOutputHelper
private FanOutOneBlockAsyncDFSOutputHelper()
-
-
Method Details
-
createDFSClientAdaptor
private static FanOutOneBlockAsyncDFSOutputHelper.DFSClientAdaptor createDFSClientAdaptor() throws NoSuchMethodException- Throws:
NoSuchMethodException
-
createLeaseManager
private static FanOutOneBlockAsyncDFSOutputHelper.LeaseManager createLeaseManager() throws NoSuchMethodException- Throws:
NoSuchMethodException
-
createFileCreator3_3
private static FanOutOneBlockAsyncDFSOutputHelper.FileCreator createFileCreator3_3() throws NoSuchMethodException- Throws:
NoSuchMethodException
-
createFileCreator3
private static FanOutOneBlockAsyncDFSOutputHelper.FileCreator createFileCreator3() throws NoSuchMethodException- Throws:
NoSuchMethodException
-
createFileCreator2
private static FanOutOneBlockAsyncDFSOutputHelper.FileCreator createFileCreator2() throws NoSuchMethodException- Throws:
NoSuchMethodException
-
createFileCreator
private static FanOutOneBlockAsyncDFSOutputHelper.FileCreator createFileCreator() throws NoSuchMethodException- Throws:
NoSuchMethodException
-
loadShouldReplicateFlag
-
beginFileLease
-
endFileLease
-
createChecksum
-
getStatus
static org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.Status getStatus(org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.PipelineAckProto ack) -
processWriteBlockResponse
private static void processWriteBlockResponse(org.apache.hbase.thirdparty.io.netty.channel.Channel channel, org.apache.hadoop.hdfs.protocol.DatanodeInfo dnInfo, org.apache.hbase.thirdparty.io.netty.util.concurrent.Promise<org.apache.hbase.thirdparty.io.netty.channel.Channel> promise, int timeoutMs) -
requestWriteBlock
private static void requestWriteBlock(org.apache.hbase.thirdparty.io.netty.channel.Channel channel, org.apache.hadoop.fs.StorageType storageType, org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.OpWriteBlockProto.Builder writeBlockProtoBuilder) throws IOException - Throws:
IOException
-
initialize
private static void initialize(org.apache.hadoop.conf.Configuration conf, org.apache.hbase.thirdparty.io.netty.channel.Channel channel, org.apache.hadoop.hdfs.protocol.DatanodeInfo dnInfo, org.apache.hadoop.fs.StorageType storageType, org.apache.hadoop.hdfs.protocol.proto.DataTransferProtos.OpWriteBlockProto.Builder writeBlockProtoBuilder, int timeoutMs, org.apache.hadoop.hdfs.DFSClient client, org.apache.hadoop.security.token.Token<org.apache.hadoop.hdfs.security.token.block.BlockTokenIdentifier> accessToken, org.apache.hbase.thirdparty.io.netty.util.concurrent.Promise<org.apache.hbase.thirdparty.io.netty.channel.Channel> promise) throws IOException - Throws:
IOException
-
connectToDataNodes
private static List<org.apache.hbase.thirdparty.io.netty.util.concurrent.Future<org.apache.hbase.thirdparty.io.netty.channel.Channel>> connectToDataNodes(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hdfs.DFSClient client, String clientName, org.apache.hadoop.hdfs.protocol.LocatedBlock locatedBlock, long maxBytesRcvd, long latestGS, org.apache.hadoop.hdfs.protocol.datatransfer.BlockConstructionStage stage, org.apache.hadoop.util.DataChecksum summer, org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroup eventLoopGroup, Class<? extends org.apache.hbase.thirdparty.io.netty.channel.Channel> channelClass) -
getCreateFlags
private static org.apache.hadoop.io.EnumSetWritable<org.apache.hadoop.fs.CreateFlag> getCreateFlags(boolean overwrite, boolean noLocalWrite) -
createOutput
private static FanOutOneBlockAsyncDFSOutput createOutput(org.apache.hadoop.hdfs.DistributedFileSystem dfs, String src, boolean overwrite, boolean createParent, short replication, long blockSize, org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroup eventLoopGroup, Class<? extends org.apache.hbase.thirdparty.io.netty.channel.Channel> channelClass, StreamSlowMonitor monitor, boolean noLocalWrite) throws IOException - Throws:
IOException
-
createOutput
public static FanOutOneBlockAsyncDFSOutput createOutput(org.apache.hadoop.hdfs.DistributedFileSystem dfs, org.apache.hadoop.fs.Path f, boolean overwrite, boolean createParent, short replication, long blockSize, org.apache.hbase.thirdparty.io.netty.channel.EventLoopGroup eventLoopGroup, Class<? extends org.apache.hbase.thirdparty.io.netty.channel.Channel> channelClass, StreamSlowMonitor monitor, boolean noLocalWrite) throws IOException Create aFanOutOneBlockAsyncDFSOutput
. The method maybe blocked so do not call it inside anEventLoop
.- Throws:
IOException
-
shouldRetryCreate
-
completeFile
static void completeFile(org.apache.hadoop.hdfs.DFSClient client, org.apache.hadoop.hdfs.protocol.ClientProtocol namenode, String src, String clientName, org.apache.hadoop.hdfs.protocol.ExtendedBlock block, long fileId) -
sleepIgnoreInterrupt
-