Search in sources :

Example 1 with TextValueDeserializer

use of kieker.common.record.io.TextValueDeserializer in project iobserve-analysis by research-iobserve.

the class DatFileToRecordStage method createRecord.

private void createRecord(final ClassNameRegistry classNameRegistry) throws MappingException, MonitoringRecordException, UnknownRecordTypeException {
    this.charBuffer.flip();
    final char lead = this.charBuffer.get();
    if (lead == '$') {
        final TextValueDeserializer deserializer = TextValueDeserializer.create(this.charBuffer);
        final int id = deserializer.getInt();
        final String classname = classNameRegistry.get(id);
        if (classname == null) {
            throw new MappingException("Missing classname mapping for record type id " + "'" + id + "'");
        }
        final long loggingTimestamp = deserializer.getLong();
        final IRecordFactory<? extends IMonitoringRecord> recordFactory = this.recordFactories.get(classname);
        final IMonitoringRecord event = recordFactory.create(deserializer);
        event.setLoggingTimestamp(loggingTimestamp);
        this.outputPort.send(event);
        this.charBuffer.clear();
    }
}
Also used : IMonitoringRecord(kieker.common.record.IMonitoringRecord) TextValueDeserializer(kieker.common.record.io.TextValueDeserializer) MappingException(teetime.stage.util.MappingException)

Aggregations

IMonitoringRecord (kieker.common.record.IMonitoringRecord)1 TextValueDeserializer (kieker.common.record.io.TextValueDeserializer)1 MappingException (teetime.stage.util.MappingException)1