Package krati.util

Examples of krati.util.Chronos


   * @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());
  }
View Full Code Here

TOP

Related Classes of krati.util.Chronos

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.