|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.regionserver.Store
public class Store
A Store holds a column family in a Region. Its a memstore and a set of zero or more StoreFiles, which stretch backwards over time.
There's no reason to consider append-logging at this level; all logging and locking is handled at the HRegion level. Store just provides services to manage sets of StoreFiles. One of the most important of those services is compaction services where files are aggregated once they pass a configurable threshold.
The only thing having to do with logs that Store needs to deal with is the reconstructionLog. This is a segment of an HRegion's log that might NOT be present upon startup. If the param is NULL, there's nothing to do. If the param is non-NULL, we need to process the log to reconstruct a TreeMap that might not have been written to disk before the process died.
It's assumed that after this constructor returns, the reconstructionLog file will be deleted (by whoever has instantiated the Store).
Locking and transactions are handled at a higher level. This API should not be called directly but by an HRegion manager.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.HConstants |
---|
HConstants.Modify |
Field Summary | |
---|---|
static long |
DEEP_OVERHEAD
|
static long |
FIXED_OVERHEAD
|
protected MemStore |
memstore
Comparator that looks at columns and compares their family portions. |
protected long |
ttl
|
Constructor Summary | |
---|---|
protected |
Store(org.apache.hadoop.fs.Path basedir,
HRegion region,
HColumnDescriptor family,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path reconstructionLog,
HBaseConfiguration conf,
org.apache.hadoop.util.Progressable reporter)
Constructor |
Method Summary | |
---|---|
protected long |
add(KeyValue kv)
Adds a value to the memstore |
protected long |
delete(KeyValue kv)
Adds a value to the memstore |
void |
get(Get get,
NavigableSet<byte[]> columns,
List<KeyValue> result)
Retrieve results from this store given the specified Get parameters. |
int |
getNumberOfstorefiles()
|
protected KeyValueScanner |
getScanner(Scan scan,
NavigableSet<byte[]> targetCols)
Return a scanner for both the memstore and the HStore files |
long |
getSize()
|
static org.apache.hadoop.fs.Path |
getStoreHomedir(org.apache.hadoop.fs.Path tabledir,
int encodedName,
byte[] family)
|
boolean |
hasTooManyStoreFiles()
See if there's too much store files in this store |
long |
heapSize()
|
String |
toString()
|
long |
updateColumnValue(byte[] row,
byte[] f,
byte[] qualifier,
long newValue)
Increments the value for the given row/family/qualifier |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final MemStore memstore
protected long ttl
public static final long FIXED_OVERHEAD
public static final long DEEP_OVERHEAD
Constructor Detail |
---|
protected Store(org.apache.hadoop.fs.Path basedir, HRegion region, HColumnDescriptor family, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path reconstructionLog, HBaseConfiguration conf, org.apache.hadoop.util.Progressable reporter) throws IOException
basedir
- qualified path under which the region directory lives;
generally the table subdirectoryregion
- family
- HColumnDescriptor for this columnfs
- file system objectreconstructionLog
- existing log file to apply if anyconf
- configuration objectreporter
- Call on a period so hosting server can report we're
making progress to master -- otherwise master might think region deploy
failed. Can be null.
IOException
Method Detail |
---|
public static org.apache.hadoop.fs.Path getStoreHomedir(org.apache.hadoop.fs.Path tabledir, int encodedName, byte[] family)
tabledir
- encodedName
- Encoded region name.family
-
protected long add(KeyValue kv)
kv
-
protected long delete(KeyValue kv)
kv
-
public int getNumberOfstorefiles()
public long getSize()
protected KeyValueScanner getScanner(Scan scan, NavigableSet<byte[]> targetCols)
public String toString()
toString
in class Object
public void get(Get get, NavigableSet<byte[]> columns, List<KeyValue> result) throws IOException
get
- Get operationcolumns
- List of columns to match, can be empty (not null)result
- List to add results to
IOException
public long updateColumnValue(byte[] row, byte[] f, byte[] qualifier, long newValue) throws IOException
row
- f
- qualifier
- newValue
- the new value to set into memstore
IOException
public boolean hasTooManyStoreFiles()
public long heapSize()
heapSize
in interface HeapSize
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |