Class NettyP2PBlobTransferManager
java.lang.Object
com.linkedin.davinci.blobtransfer.NettyP2PBlobTransferManager
- All Implemented Interfaces:
BlobTransferManager<Void>
,P2PBlobTransferManager<Void>
,AutoCloseable
Netty based P2P blob transfer manager implementation.
Upon start, it starts the blob transfer service and the client, so it can receive requests from peers to serve
blobs and in the meanwhile, it can make requests to other peers to fetch blobs.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final AggVersionedBlobTransferStats
protected final NettyFileTransferClient
protected final BlobFinder
-
Constructor Summary
ConstructorDescriptionNettyP2PBlobTransferManager
(P2PBlobTransferService blobTransferService, NettyFileTransferClient nettyClient, BlobFinder peerFinder, String baseDir, AggVersionedBlobTransferStats aggVersionedBlobTransferStats) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the blob transfer manager and related resourcesget
(String storeName, int version, int partition, BlobTransferUtils.BlobTransferTableFormat tableFormat) Get the blobs for the given storeName and partitionGet the blob transfer statsvoid
start()
Start the blob transfer manager and related resourcesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.linkedin.davinci.blobtransfer.P2PBlobTransferManager
put
-
Field Details
-
nettyClient
-
aggVersionedBlobTransferStats
-
peerFinder
-
-
Constructor Details
-
NettyP2PBlobTransferManager
public NettyP2PBlobTransferManager(P2PBlobTransferService blobTransferService, NettyFileTransferClient nettyClient, BlobFinder peerFinder, String baseDir, AggVersionedBlobTransferStats aggVersionedBlobTransferStats)
-
-
Method Details
-
start
Description copied from interface:BlobTransferManager
Start the blob transfer manager and related resources- Specified by:
start
in interfaceBlobTransferManager<Void>
- Throws:
Exception
-
get
public CompletionStage<InputStream> get(String storeName, int version, int partition, BlobTransferUtils.BlobTransferTableFormat tableFormat) throws VenicePeersNotFoundException Description copied from interface:BlobTransferManager
Get the blobs for the given storeName and partition- Specified by:
get
in interfaceBlobTransferManager<Void>
tableFormat
- the table format defined in config (PLAIN_TABLE or BLOCK_BASED_TABLE).- Returns:
- the InputStream of the blob. The return type is experimental and may change in the future.
- Throws:
VenicePeersNotFoundException
- when the peers are not found for the requested blob. Other exceptions may be thrown, but it's wrapped inside the CompletionStage.
-
close
Description copied from interface:BlobTransferManager
Close the blob transfer manager and related resources- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceBlobTransferManager<Void>
- Throws:
Exception
-
getAggVersionedBlobTransferStats
Get the blob transfer stats- Specified by:
getAggVersionedBlobTransferStats
in interfaceBlobTransferManager<Void>
- Returns:
- the blob transfer stats
-