@InterfaceAudience.Private public class MetaCache extends Object
Constructor and Description |
---|
MetaCache() |
Modifier and Type | Method and Description |
---|---|
void |
cacheLocation(TableName tableName,
RegionLocations locations)
Put a newly discovered HRegionLocation into the cache.
|
void |
cacheLocation(TableName tableName,
ServerName source,
HRegionLocation location)
Put a newly discovered HRegionLocation into the cache.
|
void |
clearCache()
Delete all cached entries.
|
void |
clearCache(HRegionInfo hri)
Deletes the cached location of the region if necessary, based on some error from source.
|
void |
clearCache(HRegionLocation location) |
void |
clearCache(ServerName serverName)
Delete all cached entries of a server.
|
void |
clearCache(TableName tableName)
Delete all cached entries of a table.
|
void |
clearCache(TableName tableName,
byte[] row)
Delete a cached location, no matter what it is.
|
void |
clearCache(TableName tableName,
byte[] row,
int replicaId)
Delete a cached location, no matter what it is.
|
void |
clearCache(TableName tableName,
byte[] row,
ServerName serverName)
Delete a cached location for a table, row and server
|
RegionLocations |
getCachedLocation(TableName tableName,
byte[] row)
Search the cache for a location that fits our table and row key.
|
int |
getNumberOfCachedRegionLocations(TableName tableName)
Return the number of cached region for a table.
|
boolean |
isRegionCached(TableName tableName,
byte[] row)
Check the region cache to see whether a region is cached yet or not.
|
public RegionLocations getCachedLocation(TableName tableName, byte[] row)
tableName
- row
- public void cacheLocation(TableName tableName, ServerName source, HRegionLocation location)
tableName
- The table name.source
- the source of the new locationlocation
- the new locationpublic void cacheLocation(TableName tableName, RegionLocations locations)
tableName
- The table name.locations
- the new locationspublic boolean isRegionCached(TableName tableName, byte[] row)
tableName
- tableNamerow
- rowpublic int getNumberOfCachedRegionLocations(TableName tableName)
public void clearCache()
public void clearCache(ServerName serverName)
public void clearCache(TableName tableName)
public void clearCache(TableName tableName, byte[] row, int replicaId)
tableName
- tableNamerow
- public void clearCache(TableName tableName, byte[] row)
tableName
- tableNamerow
- public void clearCache(TableName tableName, byte[] row, ServerName serverName)
public void clearCache(HRegionInfo hri)
hri
- The region in question.public void clearCache(HRegionLocation location)