Esempio n. 1
0
 /**
  * Populates a given StoredSortedMap (history map) from an old environment db or a persist log. If
  * a map is not provided, only logs the entries that would have been populated.
  *
  * @param sourceFile source of old entries: can be a path to an existing environment db or persist
  *     log
  * @param historyMap map to populate (or null for a dry run)
  * @return number of records
  * @throws DatabaseException
  * @throws IOException
  */
 public static int copyPersistSourceToHistoryMap(
     File sourceFile, StoredSortedMap<String, Map> historyMap)
     throws DatabaseException, IOException {
   // delegate depending on the source
   if (sourceFile.isDirectory()) {
     return copyPersistEnv(sourceFile, historyMap);
   } else {
     BufferedReader persistLogReader = ArchiveUtils.getBufferedReader(sourceFile);
     return populatePersistEnvFromLog(persistLogReader, historyMap);
   }
 }
Esempio n. 2
0
 /**
  * Populates a given StoredSortedMap (history map) from an old persist log. If a map is not
  * provided, only logs the entries that would have been populated.
  *
  * @param sourceUrl url of source persist log
  * @param historyMap map to populate (or null for a dry run)
  * @return number of records
  * @throws DatabaseException
  * @throws IOException
  */
 public static int copyPersistSourceToHistoryMap(
     URL sourceUrl, StoredSortedMap<String, Map> historyMap)
     throws DatabaseException, IOException {
   BufferedReader persistLogReader = ArchiveUtils.getBufferedReader(sourceUrl);
   return populatePersistEnvFromLog(persistLogReader, historyMap);
 }