예제 #1
0
파일: Log.java 프로젝트: AbacusHu/OpenDJ
 private void openHeadLogFile() throws ChangelogException {
   final LogFile<K, V> head =
       LogFile.newAppendableLogFile(new File(logPath, HEAD_LOG_FILE_NAME), recordParser);
   final Record<K, V> newestRecord = head.getNewestRecord();
   lastAppendedKey = newestRecord != null ? newestRecord.getKey() : null;
   logFiles.put(recordParser.getMaxKey(), head);
 }
예제 #2
0
파일: Log.java 프로젝트: AbacusHu/OpenDJ
 /**
  * Returns the file name to use for the read-only version of the provided log file.
  *
  * <p>The file name is based on the lowest and highest key in the log file.
  *
  * @return the name to use for the read-only version of the log file
  * @throws ChangelogException If an error occurs.
  */
 private String generateReadOnlyFileName(final LogFile<K, V> logFile) throws ChangelogException {
   final K lowestKey = logFile.getOldestRecord().getKey();
   final K highestKey = logFile.getNewestRecord().getKey();
   return recordParser.encodeKeyToString(lowestKey)
       + LOG_FILE_NAME_SEPARATOR
       + recordParser.encodeKeyToString(highestKey)
       + LOG_FILE_SUFFIX;
 }