class TransportClientFactory extends Closeable
Factory for creating TransportClients by using createClient.
The factory maintains a connection pool to other hosts and should return the same TransportClient for the same remote host. It also shares a single worker thread pool for all TransportClients.
TransportClients will be reused whenever possible. Prior to completing the creation of a new
TransportClient, all given TransportClientBootstraps will be run.
- Alphabetic
- By Inheritance
- TransportClientFactory
- Closeable
- AutoCloseable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new TransportClientFactory(context: TransportContext, clientBootstraps: List[TransportClientBootstrap])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
close(): Unit
Close all connections in the connection pool, and shutdown the worker thread pool.
Close all connections in the connection pool, and shutdown the worker thread pool.
- Definition Classes
- TransportClientFactory → Closeable → AutoCloseable
- Annotations
- @Override()
- def createClient(remoteHost: String, remotePort: Int): TransportClient
-
def
createClient(remoteHost: String, remotePort: Int, fastFail: Boolean): TransportClient
Create a
TransportClientconnecting to the given remote host / port.Create a
TransportClientconnecting to the given remote host / port.We maintain an array of clients (size determined by spark.shuffle.io.numConnectionsPerPeer) and randomly picks one to use. If no client was previously created in the randomly selected spot, this function creates a new client and places it there.
If the fastFail parameter is true, fail immediately when the last attempt to the same address failed within the fast fail time window (95 percent of the io wait retry timeout). The assumption is the caller will handle retrying.
Prior to the creation of a new TransportClient, we will execute all
TransportClientBootstraps that are registered with this factory.This blocks until a connection is successfully established and fully bootstrapped.
Concurrency: This method is safe to call from multiple threads.
- remoteHost
remote address host
- remotePort
remote address port
- fastFail
whether this call should fail immediately when the last attempt to the same address failed with in the last fast fail time window.
-
def
createUnmanagedClient(remoteHost: String, remotePort: Int): TransportClient
Create a completely new
TransportClientto the given remote host / port.Create a completely new
TransportClientto the given remote host / port. This connection is not pooled.As with
int), this method is blocking. -
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def getAllMetrics(): MetricSet
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()