Modifier and Type | Field and Description |
---|---|
protected boolean |
closed |
protected java.util.Map<java.lang.String,java.lang.Object> |
record
The table of value to store.
|
protected java.util.List<java.lang.String> |
schema
The statistics schema
|
Constructor and Description |
---|
AbstractLogger(java.lang.String[] schema)
Creates a new logger providing a schema
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Saves cached records on media and closes the logger.
|
protected abstract void |
doClose()
Closes the logger.
|
protected abstract void |
doSave()
Saves cached records on media
|
protected void |
finalize() |
java.lang.Object |
get(java.lang.String key)
Retrieves a statistics from the current record.
|
java.util.Iterator<java.lang.String> |
getFields()
Returns the list of schema fields
|
java.lang.String[] |
getSchema()
Returns the logging schema
|
boolean |
isRecordComplete()
Returns true if the record is complete
|
void |
log()
Logs a current record by storing it and making the record empty.
|
void |
put(java.lang.String key,
java.lang.Object value)
Puts a value into the current record.
|
void |
save()
Saves cached records on media.
|
protected abstract void |
store()
Stores the current record.
|
protected java.util.List<java.lang.String> schema
protected java.util.Map<java.lang.String,java.lang.Object> record
protected boolean closed
public AbstractLogger(java.lang.String[] schema)
schema
- - the logging schemapublic java.lang.String[] getSchema()
public java.util.Iterator<java.lang.String> getFields()
public final void put(java.lang.String key, java.lang.Object value)
key
- - the statistics namevalue
- - the statistics valuepublic final java.lang.Object get(java.lang.String key)
key
- - the statistics namepublic boolean isRecordComplete()
public final void log()
public void save()
public void close()
protected abstract void store()
protected abstract void doSave()
protected abstract void doClose()
protected void finalize()
finalize
in class java.lang.Object