Search in sources :

Example 1 with RecordInstantiationException

use of kieker.common.exception.RecordInstantiationException in project iobserve-analysis by research-iobserve.

the class MultipleConnectionTcpReaderStage method deserializeRecord.

private boolean deserializeRecord(final Connection connection, final int clazzId) throws IOException {
    final String recordClassName = connection.getRegistry().get(clazzId);
    // identify logging timestamp
    if (connection.getBuffer().remaining() < MultipleConnectionTcpReaderStage.LONG_BYTES) {
        return false;
    } else {
        final long loggingTimestamp = connection.getBuffer().getLong();
        // identify record data
        final IRecordFactory<? extends IMonitoringRecord> recordFactory = this.recordFactories.get(recordClassName);
        if (connection.getBuffer().remaining() < recordFactory.getRecordSizeInBytes()) {
            return false;
        } else {
            try {
                final IMonitoringRecord record = recordFactory.create(connection.getValueDeserializer());
                this.recordRewriter.rewrite(connection, record, loggingTimestamp, this.outputPort);
                return true;
            } catch (final RecordInstantiationException ex) {
                super.logger.error("Failed to create: " + recordClassName, ex);
                return false;
            }
        }
    }
}
Also used : IMonitoringRecord(kieker.common.record.IMonitoringRecord) RecordInstantiationException(kieker.common.exception.RecordInstantiationException)

Aggregations

RecordInstantiationException (kieker.common.exception.RecordInstantiationException)1 IMonitoringRecord (kieker.common.record.IMonitoringRecord)1