org.apache.hadoop.hbase.replication.regionserver
Class ReplicationHLogReaderManager

java.lang.Object
  extended by org.apache.hadoop.hbase.replication.regionserver.ReplicationHLogReaderManager

@InterfaceAudience.Private
public class ReplicationHLogReaderManager
extends Object

Wrapper class around HLog to help manage the implementation details such as compression.


Constructor Summary
ReplicationHLogReaderManager(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf)
          Creates the helper but doesn't open any file Use setInitialPosition after using the constructor if some content needs to be skipped
 
Method Summary
 void closeReader()
          Close the current reader
 long getPosition()
          Get the position that we stopped reading at
 HLog.Reader openReader(org.apache.hadoop.fs.Path path)
          Opens the file at the current position
 HLog.Entry readNextAndSetPosition()
          Get the next entry, returned and also added in the array
 void seek()
          Advance the reader to the current position
 void setPosition(long pos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplicationHLogReaderManager

public ReplicationHLogReaderManager(org.apache.hadoop.fs.FileSystem fs,
                                    org.apache.hadoop.conf.Configuration conf)
Creates the helper but doesn't open any file Use setInitialPosition after using the constructor if some content needs to be skipped

Parameters:
fs -
conf -
Method Detail

openReader

public HLog.Reader openReader(org.apache.hadoop.fs.Path path)
                       throws IOException
Opens the file at the current position

Parameters:
path -
Returns:
an HLog reader.
Throws:
IOException

readNextAndSetPosition

public HLog.Entry readNextAndSetPosition()
                                  throws IOException
Get the next entry, returned and also added in the array

Returns:
a new entry or null
Throws:
IOException

seek

public void seek()
          throws IOException
Advance the reader to the current position

Throws:
IOException

getPosition

public long getPosition()
Get the position that we stopped reading at

Returns:
current position, cannot be negative

setPosition

public void setPosition(long pos)

closeReader

public void closeReader()
                 throws IOException
Close the current reader

Throws:
IOException


Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.