mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-09-23 06:05:46 +00:00
part of fix for HER-1627 incorrect source tag in crawl.log (of persist-loaded crawl)
* EnhancedEnvironment.java
in getClassCatalog(), when read-only env, insist on read-only catalog
* PersistLoadProcessor.java
remove existing curi members from prior to prevent clobbering source
* PersistProcessor.java
set historyDbConfig read-only, set je.log.faultReadSize for
compatability with BDBModule.setup()
This commit is contained in:
@@ -59,6 +59,7 @@ public class EnhancedEnvironment extends Environment {
|
||||
if(classCatalog == null) {
|
||||
DatabaseConfig dbConfig = new DatabaseConfig();
|
||||
dbConfig.setAllowCreate(true);
|
||||
dbConfig.setReadOnly(this.getConfig().getReadOnly());
|
||||
try {
|
||||
classCatalogDB = openDatabase(null, "classCatalog", dbConfig);
|
||||
classCatalog = new StoredClassCatalog(classCatalogDB);
|
||||
|
||||
@@ -74,6 +74,7 @@ public class PersistLoadProcessor extends PersistOnlineProcessor {
|
||||
(Map<String,Object>) store.get(pkey);
|
||||
if(prior!=null) {
|
||||
// merge in keys
|
||||
prior.keySet().removeAll(curi.getData().keySet());
|
||||
curi.getData().putAll(prior);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ import com.sleepycat.bind.tuple.StringBinding;
|
||||
import com.sleepycat.collections.StoredIterator;
|
||||
import com.sleepycat.collections.StoredSortedMap;
|
||||
import com.sleepycat.je.Database;
|
||||
import com.sleepycat.je.DatabaseConfig;
|
||||
import com.sleepycat.je.DatabaseException;
|
||||
import com.sleepycat.je.EnvironmentConfig;
|
||||
|
||||
@@ -142,8 +143,10 @@ public abstract class PersistProcessor extends Processor {
|
||||
// open the source env history DB, copying entries to target env
|
||||
EnhancedEnvironment sourceEnv = setupEnvironment(sourceDir, true);
|
||||
StoredClassCatalog sourceClassCatalog = sourceEnv.getClassCatalog();
|
||||
DatabaseConfig historyDbConfig = HISTORY_DB_CONFIG.toDatabaseConfig();
|
||||
historyDbConfig.setReadOnly(true);
|
||||
Database sourceHistoryDB = sourceEnv.openDatabase(
|
||||
null, URI_HISTORY_DBNAME, HISTORY_DB_CONFIG.toDatabaseConfig());
|
||||
null, URI_HISTORY_DBNAME, historyDbConfig);
|
||||
StoredSortedMap<String,Map> sourceHistoryMap = new StoredSortedMap<String,Map>(sourceHistoryDB,
|
||||
new StringBinding(), new SerialBinding<Map>(sourceClassCatalog,
|
||||
Map.class), true);
|
||||
@@ -351,6 +354,7 @@ public abstract class PersistProcessor extends Processor {
|
||||
EnvironmentConfig envConfig = new EnvironmentConfig();
|
||||
envConfig.setAllowCreate(true);
|
||||
envConfig.setReadOnly(readOnly);
|
||||
envConfig.setConfigParam("je.log.faultReadSize", "6144");
|
||||
return new EnhancedEnvironment(env, envConfig);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user