Class NettyP2PBlobTransferManager
- java.lang.Object
-
- com.linkedin.davinci.blobtransfer.NettyP2PBlobTransferManager
-
- All Implemented Interfaces:
BlobTransferManager<java.lang.Void>
,P2PBlobTransferManager<java.lang.Void>
,java.lang.AutoCloseable
public class NettyP2PBlobTransferManager extends java.lang.Object implements P2PBlobTransferManager<java.lang.Void>
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
Fields Modifier and Type Field Description protected AggVersionedBlobTransferStats
aggVersionedBlobTransferStats
protected NettyFileTransferClient
nettyClient
protected BlobFinder
peerFinder
-
Constructor Summary
Constructors Constructor Description NettyP2PBlobTransferManager(P2PBlobTransferService blobTransferService, NettyFileTransferClient nettyClient, BlobFinder peerFinder, java.lang.String baseDir, AggVersionedBlobTransferStats aggVersionedBlobTransferStats)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the blob transfer manager and related resourcesjava.util.concurrent.CompletionStage<java.io.InputStream>
get(java.lang.String storeName, int version, int partition)
Get the blobs for the given storeName and partitionAggVersionedBlobTransferStats
getAggVersionedBlobTransferStats()
Get the blob transfer statsvoid
start()
Start the blob transfer manager and related resources-
Methods 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 Detail
-
nettyClient
protected final NettyFileTransferClient nettyClient
-
aggVersionedBlobTransferStats
protected final AggVersionedBlobTransferStats aggVersionedBlobTransferStats
-
peerFinder
protected final BlobFinder peerFinder
-
-
Constructor Detail
-
NettyP2PBlobTransferManager
public NettyP2PBlobTransferManager(P2PBlobTransferService blobTransferService, NettyFileTransferClient nettyClient, BlobFinder peerFinder, java.lang.String baseDir, AggVersionedBlobTransferStats aggVersionedBlobTransferStats)
-
-
Method Detail
-
start
public void start() throws java.lang.Exception
Description copied from interface:BlobTransferManager
Start the blob transfer manager and related resources- Specified by:
start
in interfaceBlobTransferManager<java.lang.Void>
- Throws:
java.lang.Exception
-
get
public java.util.concurrent.CompletionStage<java.io.InputStream> get(java.lang.String storeName, int version, int partition) throws VenicePeersNotFoundException
Description copied from interface:BlobTransferManager
Get the blobs for the given storeName and partition- Specified by:
get
in interfaceBlobTransferManager<java.lang.Void>
- 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
public void close() throws java.lang.Exception
Description copied from interface:BlobTransferManager
Close the blob transfer manager and related resources- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceBlobTransferManager<java.lang.Void>
- Throws:
java.lang.Exception
-
getAggVersionedBlobTransferStats
public AggVersionedBlobTransferStats getAggVersionedBlobTransferStats()
Get the blob transfer stats- Specified by:
getAggVersionedBlobTransferStats
in interfaceBlobTransferManager<java.lang.Void>
- Returns:
- the blob transfer stats
-
-