GoogleTraceReaderAbstract

abstract class GoogleTraceReaderAbstract<T> extends TraceReaderBase

An abstract class for creating Google Cluster Trace readers.

Author:

Manoel Campos da Silva Filho

Parameters:
  • <T> – the type of objects that will be created for each line read from the trace file

Fields

COL_SEPARATOR

static final String COL_SEPARATOR

VAL_SEPARATOR

static final String VAL_SEPARATOR

Constructors

GoogleTraceReaderAbstract

GoogleTraceReaderAbstract(String filePath, InputStream reader)

Methods

addAvailableObject

final boolean addAvailableObject(T object)

Adds an object T to the list of available objects.

Parameters:
  • object – the object T to add
Returns:

true if the object was added, false otherwise

See also: .availableObjects

formatPercentValue

String formatPercentValue(double percent)

postProcess

protected abstract void postProcess()

Executes any post-process after the trace file was totally parsed.

preProcess

protected abstract void preProcess()

Executes any pre-process before starting to read the trace file, such as checking if required attributes were set.

process

public Set<T> process()

Process the trace file creating a Set of objects described in the file.

It returns the Set of created objects that were available at timestamp 0 inside the trace file.

Returns:the Set of created objects that were available at timestamp 0 inside the trace file.

processParsedLine

final boolean processParsedLine(String[] parsedLineArray)

Process the parsed line according to the event type.

Parameters:
  • parsedLineArray – an array containing the field values from the last parsed trace line.
Returns:

true if the parsed line was processed, false otherwise

processParsedLineInternal

protected abstract boolean processParsedLineInternal()

Process the last parsed trace line.

Returns:true if the parsed line was processed, false otherwise

See also: .processParsedLine(String[]), .getLastParsedLineArray()