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 SummaryConstructors
- 
Method SummaryModifier 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- 
BlockManagerIdpublic BlockManagerId()
 
- 
- 
Method Details- 
applypublic 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
- 
blockManagerIdCachepublic 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
- 
portpublic int port()
- 
topologyInfo
- 
isDriverpublic boolean isDriver()
- 
writeExternal- Specified by:
- writeExternalin interface- Externalizable
 
- 
readExternal- Specified by:
- readExternalin interface- Externalizable
 
- 
toString
- 
hashCodepublic int hashCode()
- 
equals
 
-