Class NettyFileTransferClient
java.lang.Object
com.linkedin.davinci.blobtransfer.client.NettyFileTransferClient
-
Constructor Summary
ConstructorsConstructorDescriptionNettyFileTransferClient(int serverPort, String baseDir, StorageMetadataService storageMetadataService, int peersConnectivityFreshnessInSeconds, int blobReceiveTimeoutInMin, int blobReceiveReaderIdleTimeInSeconds, io.netty.handler.traffic.GlobalChannelTrafficShapingHandler globalChannelTrafficShapingHandler, Optional<SSLFactory> sslFactory, Supplier<VeniceNotifier> notifierSupplier) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()get(String host, String storeName, int version, int partition, BlobTransferUtils.BlobTransferTableFormat requestedTableFormat) getConnectableHosts(HashSet<String> discoveredHosts, String storeName, int version, int partition) A method to get the connectable hosts for the given store, version, and partition This method is only used for checking connectivity to the hosts.voidpurgeStaleConnectivityRecords(VeniceConcurrentHashMap<String, Long> hostsToTimestamp) Check the freshness of the connectivity records and purge the stale records
-
Constructor Details
-
NettyFileTransferClient
public NettyFileTransferClient(int serverPort, String baseDir, StorageMetadataService storageMetadataService, int peersConnectivityFreshnessInSeconds, int blobReceiveTimeoutInMin, int blobReceiveReaderIdleTimeInSeconds, io.netty.handler.traffic.GlobalChannelTrafficShapingHandler globalChannelTrafficShapingHandler, Optional<SSLFactory> sslFactory, Supplier<VeniceNotifier> notifierSupplier)
-
-
Method Details
-
getConnectableHosts
public Set<String> getConnectableHosts(HashSet<String> discoveredHosts, String storeName, int version, int partition) A method to get the connectable hosts for the given store, version, and partition This method is only used for checking connectivity to the hosts. Channel is closed after checking.- Parameters:
discoveredHosts- the list of discovered hosts for the store, version, and partition, but not necessarily connectablestoreName- the store nameversion- the versionpartition- the partition- Returns:
- the list of connectable hosts
-
purgeStaleConnectivityRecords
Check the freshness of the connectivity records and purge the stale records- Parameters:
hostsToTimestamp- the map of hosts to the timestamp of the last connection attempt
-
get
public CompletionStage<InputStream> get(String host, String storeName, int version, int partition, BlobTransferUtils.BlobTransferTableFormat requestedTableFormat) -
close
public void close()
-