Package org.apache.hadoop.hdfs
Class PeerCache
java.lang.Object
org.apache.hadoop.hdfs.PeerCache
A cache of input stream sockets to Data Node.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget(DatanodeID dnId, boolean isDomain) Get a cached peer connected to the given DataNode.voidput(DatanodeID dnId, Peer peer) Give an unused socket to the cache.intsize()
-
Constructor Details
-
PeerCache
public PeerCache(int c, long e)
-
-
Method Details
-
get
Get a cached peer connected to the given DataNode.- Parameters:
dnId- The DataNode to get a Peer for.isDomain- Whether to retrieve a DomainPeer or not.- Returns:
- An open Peer connected to the DN, or null if none was found.
-
put
Give an unused socket to the cache. -
size
public int size()
-