Package org.apache.spark.storage
Class BlockManagerId
Object
org.apache.spark.storage.BlockManagerId
- All Implemented Interfaces:
 Externalizable,Serializable
:: DeveloperApi ::
 This class represent a unique identifier for a BlockManager.
 
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.
- See Also:
 
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic BlockManagerIdapply(ObjectInput in) static BlockManagerIdReturns aBlockManagerIdfor the given configuration.static com.google.common.cache.LoadingCache<BlockManagerId,BlockManagerId> 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.booleanstatic BlockManagerIdinthashCode()host()hostPort()booleanisDriver()intport()voidscala.Option<String>toString()void 
- 
Constructor Details
- 
BlockManagerId
public BlockManagerId() 
 - 
 - 
Method Details
- 
apply
public static BlockManagerId apply(String execId, String host, int port, scala.Option<String> topologyInfo) Returns aBlockManagerIdfor the given configuration.- Parameters:
 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:TopologyMapper- Returns:
 - A new 
BlockManagerId. 
 - 
apply
 - 
blockManagerIdCache
public 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.- Returns:
 - (undocumented)
 
 - 
getCachedBlockManagerId
 - 
executorId
 - 
hostPort
 - 
host
 - 
port
public int port() - 
topologyInfo
 - 
isDriver
public boolean isDriver() - 
writeExternal
- Specified by:
 writeExternalin interfaceExternalizable
 - 
readExternal
- Specified by:
 readExternalin interfaceExternalizable
 - 
toString
 - 
hashCode
public int hashCode() - 
equals
 
 -