public class BlockManagerId
extends Object
implements java.io.Externalizable
The first 2 constructors of this class are made private to ensure that BlockManagerId objects can be created only using the apply method in the companion object. This allows de-duplication of ID objects. Also, constructor parameters are private to ensure that parameters cannot be modified from outside this class.
| Constructor and Description |
|---|
BlockManagerId() |
| Modifier and Type | Method and Description |
|---|---|
static BlockManagerId |
apply(java.io.ObjectInput in) |
static BlockManagerId |
apply(String execId,
String host,
int port,
scala.Option<String> topologyInfo)
Returns a
BlockManagerId for the given configuration. |
static com.google.common.cache.LoadingCache<BlockManagerId,BlockManagerId> |
blockManagerIdCache()
The max cache size is hardcoded to 10000, since the size of a BlockManagerId
object is about 48B, the total memory cost should be below 1MB which is feasible.
|
boolean |
equals(Object that) |
String |
executorId() |
static BlockManagerId |
getCachedBlockManagerId(BlockManagerId id) |
int |
hashCode() |
String |
host() |
String |
hostPort() |
boolean |
isDriver() |
int |
port() |
void |
readExternal(java.io.ObjectInput in) |
scala.Option<String> |
topologyInfo() |
String |
toString() |
void |
writeExternal(java.io.ObjectOutput out) |
public static BlockManagerId apply(String execId, String host, int port, scala.Option<String> topologyInfo)
BlockManagerId for the given configuration.
execId - ID of the executor.host - Host name of the block manager.port - Port of the block manager.topologyInfo - topology information for the blockmanager, if available
This can be network topology information for use while choosing peers
while replicating data blocks. More information available here:
TopologyMapperBlockManagerId.public static BlockManagerId apply(java.io.ObjectInput in)
public static com.google.common.cache.LoadingCache<BlockManagerId,BlockManagerId> blockManagerIdCache()
public static BlockManagerId getCachedBlockManagerId(BlockManagerId id)
public String executorId()
public String hostPort()
public String host()
public int port()
public scala.Option<String> topologyInfo()
public boolean isDriver()
public void writeExternal(java.io.ObjectOutput out)
writeExternal in interface java.io.Externalizablepublic void readExternal(java.io.ObjectInput in)
readExternal in interface java.io.Externalizablepublic String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object that)
equals in class Object