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;
}
}
}
}
Aggregations