LOG.info("Slow KahaDB access: Journal read took: "+(end-start)+" ms");
}
}
DataByteArrayInputStream is = new DataByteArrayInputStream(data);
byte readByte = is.readByte();
KahaEntryType type = KahaEntryType.valueOf(readByte);
if( type == null ) {
try {
is.close();
} catch (IOException e) {}
throw new IOException("Could not load journal record. Invalid location: "+location);
}
JournalCommand<?> message = (JournalCommand<?>)type.createMessage();
message.mergeFramed(is);
return message;
}