org.apache.hadoop.hbase.io
Class Reference

java.lang.Object
  extended by org.apache.hadoop.hbase.io.Reference

@InterfaceAudience.Private
public class Reference
extends Object

A reference to the top or bottom half of a store file where 'bottom' is the first half of the file containing the keys that sort lowest and 'top' is the second half of the file with keys that sort greater than those of the bottom half. The file referenced lives under a different region. References are made at region split time.

References work with a special half store file type. References know how to write out the reference format in the file system and are what is juggled when references are mixed in with direct store files. The half store file type is used reading the referred to file.

References to store files located over in some other region look like this in the file system 1278437856009925445.3323223323: i.e. an id followed by hash of the referenced region. Note, a region is itself not splittable if it has instances of store file references. References are cleaned up by compactions.


Constructor Summary
Reference()
          Deprecated. 
 
Method Summary
static Reference createBottomReference(byte[] splitRow)
           
static Reference createTopReference(byte[] splitRow)
           
 org.apache.hadoop.hbase.io.Reference.Range getFileRegion()
           
 byte[] getSplitKey()
           
static boolean isTopFileRegion(org.apache.hadoop.hbase.io.Reference.Range r)
           
static Reference read(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path p)
          Read a Reference from FileSystem.
 void readFields(DataInput in)
          Deprecated. Writables are going away. Use the pb serialization methods instead. Remove in a release after 0.96 goes out. This is here only to migrate old Reference files written with Writables before 0.96.
 String toString()
           
 org.apache.hadoop.fs.Path write(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Reference

@Deprecated
public Reference()
Deprecated. 

Used by serializations.

Method Detail

createTopReference

public static Reference createTopReference(byte[] splitRow)
Parameters:
splitRow -
Returns:
A Reference that points at top half of a an hfile

createBottomReference

public static Reference createBottomReference(byte[] splitRow)
Parameters:
splitRow -
Returns:
A Reference that points at the bottom half of a an hfile

getFileRegion

public org.apache.hadoop.hbase.io.Reference.Range getFileRegion()
Returns:
Range

getSplitKey

public byte[] getSplitKey()
Returns:
splitKey

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

isTopFileRegion

public static boolean isTopFileRegion(org.apache.hadoop.hbase.io.Reference.Range r)

readFields

@Deprecated
public void readFields(DataInput in)
                throws IOException
Deprecated. Writables are going away. Use the pb serialization methods instead. Remove in a release after 0.96 goes out. This is here only to migrate old Reference files written with Writables before 0.96.

Throws:
IOException

write

public org.apache.hadoop.fs.Path write(org.apache.hadoop.fs.FileSystem fs,
                                       org.apache.hadoop.fs.Path p)
                                throws IOException
Throws:
IOException

read

public static Reference read(org.apache.hadoop.fs.FileSystem fs,
                             org.apache.hadoop.fs.Path p)
                      throws IOException
Read a Reference from FileSystem.

Parameters:
fs -
p -
Returns:
New Reference made from passed p
Throws:
IOException


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