org.apache.hadoop.hbase.io.hfile
Class BlockCacheColumnFamilySummary

java.lang.Object
  extended by org.apache.hadoop.hbase.io.hfile.BlockCacheColumnFamilySummary
All Implemented Interfaces:
Comparable<BlockCacheColumnFamilySummary>, org.apache.hadoop.io.Writable

public class BlockCacheColumnFamilySummary
extends Object
implements org.apache.hadoop.io.Writable, Comparable<BlockCacheColumnFamilySummary>

BlockCacheColumnFamilySummary represents a summary of the blockCache usage at Table/ColumnFamily granularity.

As ColumnFamilies are owned by Tables, a summary by ColumnFamily implies that the owning Table is included in the summarization.


Constructor Summary
BlockCacheColumnFamilySummary()
          Default constructor for Writable
BlockCacheColumnFamilySummary(String table, String columnFamily)
           
 
Method Summary
 int compareTo(BlockCacheColumnFamilySummary o)
           
static BlockCacheColumnFamilySummary create(BlockCacheColumnFamilySummary e)
          Creates a new BlockCacheSummaryEntry
static BlockCacheColumnFamilySummary createFromStoreFilePath(org.apache.hadoop.fs.Path path)
          Construct a BlockCacheSummaryEntry from a full StoreFile Path

The path is expected to be in the format of...
 boolean equals(Object obj)
           
 int getBlocks()
           
 String getColumnFamily()
           
 long getHeapSize()
           
 String getTable()
           
 int hashCode()
           
 void incrementBlocks()
          Increments the number of blocks in the cache for this entry
 void incrementHeapSize(long heapSize)
           
 void readFields(DataInput in)
           
 void setBlocks(int blocks)
           
 void setColumnFamily(String columnFamily)
           
 void setHeapSize(long heapSize)
           
 void setTable(String table)
           
 String toString()
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BlockCacheColumnFamilySummary

public BlockCacheColumnFamilySummary()
Default constructor for Writable


BlockCacheColumnFamilySummary

public BlockCacheColumnFamilySummary(String table,
                                     String columnFamily)
Parameters:
table - table
columnFamily - columnFamily
Method Detail

getTable

public String getTable()
Returns:
table

setTable

public void setTable(String table)
Parameters:
table - (table that owns the cached block)

getColumnFamily

public String getColumnFamily()
Returns:
columnFamily

setColumnFamily

public void setColumnFamily(String columnFamily)
Parameters:
columnFamily - (columnFamily that owns the cached block)

getBlocks

public int getBlocks()
Returns:
blocks in the cache

setBlocks

public void setBlocks(int blocks)
Parameters:
blocks - in the cache

getHeapSize

public long getHeapSize()
Returns:
heapSize in the cache

incrementBlocks

public void incrementBlocks()
Increments the number of blocks in the cache for this entry


incrementHeapSize

public void incrementHeapSize(long heapSize)
Parameters:
heapSize - to increment

setHeapSize

public void setHeapSize(long heapSize)
Parameters:
heapSize - (total heapSize for the table/CF)

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

toString

public String toString()
Overrides:
toString in class Object

createFromStoreFilePath

public static BlockCacheColumnFamilySummary createFromStoreFilePath(org.apache.hadoop.fs.Path path)
Construct a BlockCacheSummaryEntry from a full StoreFile Path

The path is expected to be in the format of...
 hdfs://localhost:51169/user/userid/-ROOT-/70236052/info/3944417774205889744
 
... where:
'-ROOT-' = Table
'70236052' = Region
'info' = ColumnFamily
'3944417774205889744' = StoreFile

Parameters:
path - (full StoreFile Path)
Returns:
BlockCacheSummaryEntry

compareTo

public int compareTo(BlockCacheColumnFamilySummary o)
Specified by:
compareTo in interface Comparable<BlockCacheColumnFamilySummary>

create

public static BlockCacheColumnFamilySummary create(BlockCacheColumnFamilySummary e)
Creates a new BlockCacheSummaryEntry

Parameters:
e - BlockCacheSummaryEntry
Returns:
new BlockCacheSummaryEntry


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.