* @param entryList
* @throws IOException
*/
public synchronized <T extends EntryValue> void update(List<Entry<T>> entryList)
throws IOException {
Chronos c = new Chronos();
// Sort values by position in the array file
T[] values = EntryUtility.sortEntriesToValues(entryList);
if (values == null || values.length == 0) return;
// Obtain maxScn
long maxScn = _arrayHwmScn;
for (Entry<?> e : entryList) {
maxScn = Math.max(e.getMaxScn(), maxScn);
}
// Write hwmScn
_log.info("write hwmScn:" + maxScn);
_writer.writeLong(HWM_SCN_POSITION, maxScn);
_writer.flush();
// Write values
for (T v : values) {
v.updateArrayFile(_writer, getPosition(v.pos));
}
_writer.flush();
// Write lwmScn
_log.info("write lwmScn:" + maxScn);
_writer.writeLong(LWM_SCN_POSITION, maxScn);
_writer.flush();
_arrayLwmScn = maxScn;
_arrayHwmScn = maxScn;
_log.info(entryList.size() + " entries flushed to " +
_file.getAbsolutePath() + " in " + c.getElapsedTime());
}