org.apache.hadoop.hbase.regionserver.wal
Class MetricsWAL

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.wal.MetricsWAL
All Implemented Interfaces:
WALActionsListener

@InterfaceAudience.Private
public class MetricsWAL
extends Object
implements WALActionsListener

Class used to push numbers about the WAL into the metrics subsystem. This will take a single function call and turn it into multiple manipulations of the hadoop metrics system.


Constructor Summary
MetricsWAL()
           
 
Method Summary
 void finishAppend(long time, long size)
           
 void finishSync(long time)
           
 void logCloseRequested()
          The WAL is about to close.
 void logRollRequested(boolean underReplicated)
          A request was made that the WAL be rolled.
 void postLogArchive(org.apache.hadoop.fs.Path oldPath, org.apache.hadoop.fs.Path newPath)
          The WAL has been archived.
 void postLogRoll(org.apache.hadoop.fs.Path oldPath, org.apache.hadoop.fs.Path newPath)
          The WAL has been rolled.
 void preLogArchive(org.apache.hadoop.fs.Path oldPath, org.apache.hadoop.fs.Path newPath)
          The WAL is going to be archived.
 void preLogRoll(org.apache.hadoop.fs.Path oldPath, org.apache.hadoop.fs.Path newPath)
          The WAL is going to be rolled.
 void visitLogEntryBeforeWrite(HRegionInfo info, HLogKey logKey, WALEdit logEdit)
          Called before each write.
 void visitLogEntryBeforeWrite(HTableDescriptor htd, HLogKey logKey, WALEdit logEdit)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetricsWAL

public MetricsWAL()
Method Detail

finishSync

public void finishSync(long time)

finishAppend

public void finishAppend(long time,
                         long size)

logRollRequested

public void logRollRequested(boolean underReplicated)
Description copied from interface: WALActionsListener
A request was made that the WAL be rolled.

Specified by:
logRollRequested in interface WALActionsListener
Parameters:
underReplicated - roll requested because of too few replicas if true

preLogRoll

public void preLogRoll(org.apache.hadoop.fs.Path oldPath,
                       org.apache.hadoop.fs.Path newPath)
                throws IOException
Description copied from interface: WALActionsListener
The WAL is going to be rolled. The oldPath can be null if this is the first log file from the regionserver.

Specified by:
preLogRoll in interface WALActionsListener
Parameters:
oldPath - the path to the old hlog
newPath - the path to the new hlog
Throws:
IOException

postLogRoll

public void postLogRoll(org.apache.hadoop.fs.Path oldPath,
                        org.apache.hadoop.fs.Path newPath)
                 throws IOException
Description copied from interface: WALActionsListener
The WAL has been rolled. The oldPath can be null if this is the first log file from the regionserver.

Specified by:
postLogRoll in interface WALActionsListener
Parameters:
oldPath - the path to the old hlog
newPath - the path to the new hlog
Throws:
IOException

preLogArchive

public void preLogArchive(org.apache.hadoop.fs.Path oldPath,
                          org.apache.hadoop.fs.Path newPath)
                   throws IOException
Description copied from interface: WALActionsListener
The WAL is going to be archived.

Specified by:
preLogArchive in interface WALActionsListener
Parameters:
oldPath - the path to the old hlog
newPath - the path to the new hlog
Throws:
IOException

postLogArchive

public void postLogArchive(org.apache.hadoop.fs.Path oldPath,
                           org.apache.hadoop.fs.Path newPath)
                    throws IOException
Description copied from interface: WALActionsListener
The WAL has been archived.

Specified by:
postLogArchive in interface WALActionsListener
Parameters:
oldPath - the path to the old hlog
newPath - the path to the new hlog
Throws:
IOException

logCloseRequested

public void logCloseRequested()
Description copied from interface: WALActionsListener
The WAL is about to close.

Specified by:
logCloseRequested in interface WALActionsListener

visitLogEntryBeforeWrite

public void visitLogEntryBeforeWrite(HRegionInfo info,
                                     HLogKey logKey,
                                     WALEdit logEdit)
Description copied from interface: WALActionsListener
Called before each write.

Specified by:
visitLogEntryBeforeWrite in interface WALActionsListener

visitLogEntryBeforeWrite

public void visitLogEntryBeforeWrite(HTableDescriptor htd,
                                     HLogKey logKey,
                                     WALEdit logEdit)
Specified by:
visitLogEntryBeforeWrite in interface WALActionsListener


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