Top Inners Fields Constructors Methods
org.HdrHistogram

public Class HistogramLogScanner

extends Object
implements Closeable
Class Inheritance
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable
Imports
java.io.*, java.nio.ByteBuffer, java.util.Locale, .Scanner, java.util.zip.DataFormatException

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
public static interface
HistogramLogScanner.EventHandler

Handles log events, return true to stop processing.

private static class

Field Summary

Modifier and TypeField and Description
private final HistogramLogScanner.LazyHistogramReader
protected final Scanner

Constructor Summary

AccessConstructor and Description
public
HistogramLogScanner(final String
The name of the file to read from
inputFileName
)

Constructs a new HistogramLogReader that produces intervals read from the specified file name.

public
HistogramLogScanner(final InputStream
The InputStream to read from
inputStream
)

Constructs a new HistogramLogReader that produces intervals read from the specified InputStream.

public
HistogramLogScanner(final File
The File to read from
inputFile
)

Constructs a new HistogramLogReader that produces intervals read from the specified file.

private

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Close underlying scanner.
public boolean

Returns:

true if additional intervals may exist in the log
hasNextLine
()

Indicates whether or not additional intervals may exist in the log

private void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lazyReaderback to summary
private final HistogramLogScanner.LazyHistogramReader lazyReader
scannerback to summary
protected final Scanner scanner

Constructor Detail

HistogramLogScannerback to summary
public HistogramLogScanner(final String inputFileName) throws FileNotFoundException

Constructs a new HistogramLogReader that produces intervals read from the specified file name.

Parameters
inputFileName:String

The name of the file to read from

Exceptions
FileNotFoundException:
when unable to find inputFileName
HistogramLogScannerback to summary
public HistogramLogScanner(final InputStream inputStream)

Constructs a new HistogramLogReader that produces intervals read from the specified InputStream. Note that log readers constructed through this constructor do not assume ownership of stream and will not close it on close().

Parameters
inputStream:InputStream

The InputStream to read from

HistogramLogScannerback to summary
public HistogramLogScanner(final File inputFile) throws FileNotFoundException

Constructs a new HistogramLogReader that produces intervals read from the specified file.

Parameters
inputFile:File

The File to read from

Exceptions
FileNotFoundException:
when unable to find inputFile
HistogramLogScannerback to summary
private HistogramLogScanner(Scanner scanner)

Method Detail

closeback to summary
public void close()

Implements java.io.Closeable.close.

Close underlying scanner.

Annotations
@Override
hasNextLineback to summary
public boolean hasNextLine()

Indicates whether or not additional intervals may exist in the log

Returns:boolean

true if additional intervals may exist in the log

initScannerback to summary
private void initScanner()
processback to summary
public void process(HistogramLogScanner.EventHandler handler)
org.HdrHistogram back to summary

public Interface HistogramLogScanner.EncodableHistogramSupplier

Known Direct Implementers
org.HdrHistogram.HistogramLogScanner.LazyHistogramReader

Method Summary

Modifier and TypeMethod and Description
public EncodableHistogram
read()

Method Detail

readback to summary
public EncodableHistogram read() throws DataFormatException
org.HdrHistogram back to summary

public Interface HistogramLogScanner.EventHandler


Handles log events, return true to stop processing.

Method Summary

Modifier and TypeMethod and Description
public boolean
onBaseTime(double secondsSinceEpoch)

public boolean
onComment(String comment)

public boolean
public boolean

Returns:

true to stop processing, false to continue.
onHistogram
(String
histogram tag or null if none exist
tag
,
double
logged timestamp
timestamp
,
double
logged interval length
length
,
HistogramLogScanner.EncodableHistogramSupplier
to be called if the histogram needs to be deserialized, given the tag/timestamp etc.
lazyReader
)

A lazy reader is provided to allow fast skipping of bulk of work where tag or timestamp are to be used as a basis for filtering the EncodableHistogram anyway.

public boolean
onStartTime(double secondsSinceEpoch)

Method Detail

onBaseTimeback to summary
public boolean onBaseTime(double secondsSinceEpoch)
onCommentback to summary
public boolean onComment(String comment)
onExceptionback to summary
public boolean onException(Throwable t)
onHistogramback to summary
public boolean onHistogram(String tag, double timestamp, double length, HistogramLogScanner.EncodableHistogramSupplier lazyReader)

A lazy reader is provided to allow fast skipping of bulk of work where tag or timestamp are to be used as a basis for filtering the EncodableHistogram anyway. The reader is to be called only once.

Parameters
tag:String

histogram tag or null if none exist

timestamp:double

logged timestamp

length:double

logged interval length

lazyReader:HistogramLogScanner.EncodableHistogramSupplier

to be called if the histogram needs to be deserialized, given the tag/timestamp etc.

Returns:boolean

true to stop processing, false to continue.

onStartTimeback to summary
public boolean onStartTime(double secondsSinceEpoch)
org.HdrHistogram back to summary

private Class HistogramLogScanner.LazyHistogramReader

extends Object
implements EncodableHistogramSupplier
Class Inheritance
All Implemented Interfaces
org.HdrHistogram.HistogramLogScanner.EncodableHistogramSupplier

Field Summary

Modifier and TypeField and Description
private boolean
private final Scanner

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
public EncodableHistogram
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

gotItback to summary
private boolean gotIt
scannerback to summary
private final Scanner scanner

Constructor Detail

LazyHistogramReaderback to summary
private LazyHistogramReader(Scanner scanner)

Method Detail

allowGetback to summary
private void allowGet()
readback to summary
public EncodableHistogram read() throws DataFormatException

Implements org.HdrHistogram.HistogramLogScanner.EncodableHistogramSupplier.read.

Annotations
@Override