Class StatisticsEditsVisitor
java.lang.Object
org.apache.hadoop.hdfs.tools.offlineEditsViewer.StatisticsEditsVisitor
- All Implemented Interfaces:
OfflineEditsVisitor
@Private
@Unstable
public class StatisticsEditsVisitor
extends Object
implements OfflineEditsVisitor
StatisticsEditsVisitor implements text version of EditsVisitor
that aggregates counts of op codes processed
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a processor that writes to the file named and may or may not also output to the screen, as specified. -
Method Summary
Modifier and TypeMethodDescriptionvoidClose the visitorGet statisticsGet the statistics in string format, suitable for printingvoidstart(int version) Start the visitorvoidvisitOp(FSEditLogOp op) Begin visiting an element that encloses another element, such as the beginning of the list of blocks that comprise a file.
-
Constructor Details
-
StatisticsEditsVisitor
Create a processor that writes to the file named and may or may not also output to the screen, as specified.- Parameters:
out- Name of file to write output to- Throws:
IOException
-
-
Method Details
-
start
Start the visitor- Specified by:
startin interfaceOfflineEditsVisitor- Parameters:
version- Edit log version- Throws:
IOException
-
close
Close the visitor- Specified by:
closein interfaceOfflineEditsVisitor- Parameters:
error- If the visitor was closed because of an unrecoverable error in the input stream, this is the exception.- Throws:
IOException
-
visitOp
Description copied from interface:OfflineEditsVisitorBegin visiting an element that encloses another element, such as the beginning of the list of blocks that comprise a file.- Specified by:
visitOpin interfaceOfflineEditsVisitor- Parameters:
op- Token being visited- Throws:
IOException
-
getStatistics
Get statistics- Returns:
- statistics, map of counts per opCode
-
getStatisticsString
Get the statistics in string format, suitable for printing- Returns:
- statistics in in string format, suitable for printing
-