org.apache.spark.storage
Class BlockManagerId

Object
  extended by org.apache.spark.storage.BlockManagerId
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class BlockManagerId
extends Object
implements java.io.Externalizable

:: DeveloperApi :: This class represent an unique identifier for a BlockManager.

The first 2 constructors of this class is 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:
Serialized Form

Method Summary
static BlockManagerId apply(java.io.ObjectInput in)
           
static BlockManagerId apply(String execId, String host, int port)
          Returns a BlockManagerId for the given configuration.
static java.util.concurrent.ConcurrentHashMap<BlockManagerId,BlockManagerId> blockManagerIdCache()
           
 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)
           
 String toString()
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

apply

public static BlockManagerId apply(String execId,
                                   String host,
                                   int port)
Returns a BlockManagerId for the given configuration.

Parameters:
execId - ID of the executor.
host - Host name of the block manager.
port - Port of the block manager.
Returns:
A new BlockManagerId.

apply

public static BlockManagerId apply(java.io.ObjectInput in)

blockManagerIdCache

public static java.util.concurrent.ConcurrentHashMap<BlockManagerId,BlockManagerId> blockManagerIdCache()

getCachedBlockManagerId

public static BlockManagerId getCachedBlockManagerId(BlockManagerId id)

executorId

public String executorId()

hostPort

public String hostPort()

host

public String host()

port

public int port()

isDriver

public boolean isDriver()

writeExternal

public void writeExternal(java.io.ObjectOutput out)
Specified by:
writeExternal in interface java.io.Externalizable

readExternal

public void readExternal(java.io.ObjectInput in)
Specified by:
readExternal in interface java.io.Externalizable

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object that)
Overrides:
equals in class Object