commit a03dad001c3d281bc82feb02a4f117c5a1371b04 Author: Karsten Loesing karsten.loesing@gmx.net Date: Wed Nov 7 12:51:11 2012 -0500
Take out now unused config options. --- config.template | 19 +---- .../db/bridgedescs/SanitizedBridgesWriter.java | 5 +- .../BridgePoolAssignmentsProcessor.java | 4 +- .../ernie/db/exitlists/ExitListDownloader.java | 4 +- .../torproject/ernie/db/main/Configuration.java | 84 +------------------- .../ernie/db/relaydescs/ArchiveWriter.java | 4 +- .../ernie/db/torperf/TorperfDownloader.java | 4 +- 7 files changed, 8 insertions(+), 116 deletions(-)
diff --git a/config.template b/config.template index ecb2e3b..1b84775 100644 --- a/config.template +++ b/config.template @@ -55,24 +55,15 @@ ## Compress relay descriptors downloads by adding .z to the URLs #CompressRelayDescriptorDownloads 0 # -## Write directory archives to disk -#WriteDirectoryArchives 0 -# ## Relative path to directory to write directory archives to #DirectoryArchivesOutputDirectory out/relay-descriptors/ # # ######## Bridge descriptors ######## # -## Import bridge snapshots from disk, if available -#ImportBridgeSnapshots 0 -# ## Relative path to directory to import bridge descriptor snapshots from #BridgeSnapshotsDirectory in/bridge-descriptors/ # -## Write sanitized bridges to disk -#WriteSanitizedBridges 0 -# ## Replace IP addresses in sanitized bridge descriptors with 10.x.y.z ## where x.y.z = H(IP address | bridge identity | secret)[:3], so that we ## can learn about IP address changes. @@ -88,10 +79,6 @@ # ######## Bridge pool assignments ######## # -## Process bridge pool assignment files by sanitizing bridge fingerprints -## and sorting sanitized files into subdirectories -#ProcessBridgePoolAssignments 0 -# ## Relative path to directory to read bridge pool assignment files from #AssignmentsDirectory in/bridge-pool-assignments/ # @@ -102,15 +89,11 @@ # ######## Exit lists ######## # -## Download exit list and store it to disk -#DownloadExitList 0 +## (No options available) # # ######## Torperf downloader ######## # -## Download and merge Torperf .data and .extradata files -#ProcessTorperfFiles 0 -# ## Relative path to the directory to store Torperf files in #TorperfOutputDirectory out/torperf/ # diff --git a/src/org/torproject/ernie/db/bridgedescs/SanitizedBridgesWriter.java b/src/org/torproject/ernie/db/bridgedescs/SanitizedBridgesWriter.java index 0c4e76a..f0b5208 100644 --- a/src/org/torproject/ernie/db/bridgedescs/SanitizedBridgesWriter.java +++ b/src/org/torproject/ernie/db/bridgedescs/SanitizedBridgesWriter.java @@ -68,10 +68,7 @@ public class SanitizedBridgesWriter extends Thread { }
// Sanitize bridge descriptors - if (config.getImportBridgeSnapshots() && - config.getWriteSanitizedBridges()) { - new SanitizedBridgesWriter(config).run(); - } + new SanitizedBridgesWriter(config).run();
// Remove lock file lf.releaseLock(); diff --git a/src/org/torproject/ernie/db/bridgepools/BridgePoolAssignmentsProcessor.java b/src/org/torproject/ernie/db/bridgepools/BridgePoolAssignmentsProcessor.java index ac45787..77cfd7a 100644 --- a/src/org/torproject/ernie/db/bridgepools/BridgePoolAssignmentsProcessor.java +++ b/src/org/torproject/ernie/db/bridgepools/BridgePoolAssignmentsProcessor.java @@ -52,9 +52,7 @@ public class BridgePoolAssignmentsProcessor extends Thread { }
// Process bridge pool assignments - if (config.getProcessBridgePoolAssignments()) { - new BridgePoolAssignmentsProcessor(config).run(); - } + new BridgePoolAssignmentsProcessor(config).run();
// Remove lock file lf.releaseLock(); diff --git a/src/org/torproject/ernie/db/exitlists/ExitListDownloader.java b/src/org/torproject/ernie/db/exitlists/ExitListDownloader.java index 825de65..1bb9f69 100644 --- a/src/org/torproject/ernie/db/exitlists/ExitListDownloader.java +++ b/src/org/torproject/ernie/db/exitlists/ExitListDownloader.java @@ -51,9 +51,7 @@ public class ExitListDownloader extends Thread { }
// Download exit list and store it to disk - if (config.getDownloadExitList()) { - new ExitListDownloader(config).run(); - } + new ExitListDownloader(config).run();
// Remove lock file lf.releaseLock(); diff --git a/src/org/torproject/ernie/db/main/Configuration.java b/src/org/torproject/ernie/db/main/Configuration.java index 7ac8d52..7b5e53d 100644 --- a/src/org/torproject/ernie/db/main/Configuration.java +++ b/src/org/torproject/ernie/db/main/Configuration.java @@ -22,7 +22,6 @@ import java.util.logging.Logger; * configuration. */ public class Configuration { - private boolean writeDirectoryArchives = false; private String directoryArchivesOutputDirectory = "out/relay-descriptors/"; private boolean importCachedRelayDescriptors = false; @@ -33,12 +32,10 @@ public class Configuration { private String directoryArchivesDirectory = "in/relay-descriptors/archives/"; private boolean keepDirectoryArchiveImportHistory = false; - private boolean writeSanitizedBridges = false; private boolean replaceIPAddressesWithHashes = false; private long limitBridgeDescriptorMappings = -1L; private String sanitizedBridgesWriteDirectory = "out/bridge-descriptors/"; - private boolean importBridgeSnapshots = false; private String bridgeSnapshotsDirectory = "in/bridge-descriptors/"; private boolean downloadRelayDescriptors = false; private List<String> downloadFromDirectoryAuthorities = Arrays.asList(( @@ -62,12 +59,9 @@ public class Configuration { private boolean downloadAllServerDescriptors = false; private boolean downloadAllExtraInfoDescriptors = false; private boolean compressRelayDescriptorDownloads; - private boolean downloadExitList = false; - private boolean processBridgePoolAssignments = false; private String assignmentsDirectory = "in/bridge-pool-assignments/"; private String sanitizedAssignmentsDirectory = "out/bridge-pool-assignments/"; - private boolean processTorperfFiles = false; private String torperfOutputDirectory = "out/torperf/"; private SortedMap<String, String> torperfSources = null; private List<String> torperfFiles = null; @@ -94,9 +88,6 @@ public class Configuration { while ((line = br.readLine()) != null) { if (line.startsWith("#") || line.length() < 1) { continue; - } else if (line.startsWith("WriteDirectoryArchives")) { - this.writeDirectoryArchives = Integer.parseInt( - line.split(" ")[1]) != 0; } else if (line.startsWith("DirectoryArchivesOutputDirectory")) { this.directoryArchivesOutputDirectory = line.split(" ")[1]; } else if (line.startsWith("ImportCachedRelayDescriptors")) { @@ -116,9 +107,6 @@ public class Configuration { } else if (line.startsWith("KeepDirectoryArchiveImportHistory")) { this.keepDirectoryArchiveImportHistory = Integer.parseInt( line.split(" ")[1]) != 0; - } else if (line.startsWith("WriteSanitizedBridges")) { - this.writeSanitizedBridges = Integer.parseInt( - line.split(" ")[1]) != 0; } else if (line.startsWith("ReplaceIPAddressesWithHashes")) { this.replaceIPAddressesWithHashes = Integer.parseInt( line.split(" ")[1]) != 0; @@ -127,9 +115,6 @@ public class Configuration { line.split(" ")[1]); } else if (line.startsWith("SanitizedBridgesWriteDirectory")) { this.sanitizedBridgesWriteDirectory = line.split(" ")[1]; - } else if (line.startsWith("ImportBridgeSnapshots")) { - this.importBridgeSnapshots = Integer.parseInt( - line.split(" ")[1]) != 0; } else if (line.startsWith("BridgeSnapshotsDirectory")) { this.bridgeSnapshotsDirectory = line.split(" ")[1]; } else if (line.startsWith("DownloadRelayDescriptors")) { @@ -175,19 +160,10 @@ public class Configuration { } else if (line.startsWith("CompressRelayDescriptorDownloads")) { this.compressRelayDescriptorDownloads = Integer.parseInt( line.split(" ")[1]) != 0; - } else if (line.startsWith("DownloadExitList")) { - this.downloadExitList = Integer.parseInt( - line.split(" ")[1]) != 0; - } else if (line.startsWith("ProcessBridgePoolAssignments")) { - this.processBridgePoolAssignments = Integer.parseInt( - line.split(" ")[1]) != 0; } else if (line.startsWith("AssignmentsDirectory")) { this.assignmentsDirectory = line.split(" ")[1]; } else if (line.startsWith("SanitizedAssignmentsDirectory")) { this.sanitizedAssignmentsDirectory = line.split(" ")[1]; - } else if (line.startsWith("ProcessTorperfFiles")) { - this.processTorperfFiles = Integer.parseInt(line.split(" ")[1]) - != 0; } else if (line.startsWith("TorperfOutputDirectory")) { this.torperfOutputDirectory = line.split(" ")[1]; } else if (line.startsWith("TorperfSource")) { @@ -234,47 +210,6 @@ public class Configuration { + "file! Exiting!", e); System.exit(1); } - - /** Make some checks if configuration is valid. */ - if (!this.importCachedRelayDescriptors && - !this.importDirectoryArchives && !this.downloadRelayDescriptors && - !this.importBridgeSnapshots && - !this.downloadExitList && !this.processBridgePoolAssignments && - !this.writeDirectoryArchives && !this.writeSanitizedBridges && - !this.processTorperfFiles) { - logger.warning("We have not been configured to read data from any " - + "data source or write data to any data sink. You need to " - + "edit your config file (" + configFile.getAbsolutePath() - + ") and provide at least one data source and one data sink. " - + "Refer to the manual for more information."); - } - if ((this.importCachedRelayDescriptors || - this.importDirectoryArchives || this.downloadRelayDescriptors) && - !this.writeDirectoryArchives) { - logger.warning("We are configured to import/download relay " - + "descriptors, but we don't have a single data sink to write " - + "relay descriptors to."); - } - if (!(this.importCachedRelayDescriptors || - this.importDirectoryArchives || this.downloadRelayDescriptors) && - this.writeDirectoryArchives) { - logger.warning("We are configured to write relay descriptor to at " - + "least one data sink, but we don't have a single data source " - + "containing relay descriptors."); - } - if (this.importBridgeSnapshots && !this.writeSanitizedBridges) { - logger.warning("We are configured to import/download bridge " - + "descriptors, but we don't have a single data sink to write " - + "bridge descriptors to."); - } - if (!this.importBridgeSnapshots && this.writeSanitizedBridges) { - logger.warning("We are configured to write bridge descriptor to at " - + "least one data sink, but we don't have a single data source " - + "containing bridge descriptors."); - } - } - public boolean getWriteDirectoryArchives() { - return this.writeDirectoryArchives; } public String getDirectoryArchivesOutputDirectory() { return this.directoryArchivesOutputDirectory; @@ -294,9 +229,6 @@ public class Configuration { public boolean getKeepDirectoryArchiveImportHistory() { return this.keepDirectoryArchiveImportHistory; } - public boolean getWriteSanitizedBridges() { - return this.writeSanitizedBridges; - } public boolean getReplaceIPAddressesWithHashes() { return this.replaceIPAddressesWithHashes; } @@ -306,9 +238,6 @@ public class Configuration { public String getSanitizedBridgesWriteDirectory() { return this.sanitizedBridgesWriteDirectory; } - public boolean getImportBridgeSnapshots() { - return this.importBridgeSnapshots; - } public String getBridgeSnapshotsDirectory() { return this.bridgeSnapshotsDirectory; } @@ -342,20 +271,11 @@ public class Configuration { public boolean getCompressRelayDescriptorDownloads() { return this.compressRelayDescriptorDownloads; } - public boolean getDownloadExitList() { - return this.downloadExitList; - } - public boolean getProcessBridgePoolAssignments() { - return processBridgePoolAssignments; - } public String getAssignmentsDirectory() { - return assignmentsDirectory; + return this.assignmentsDirectory; } public String getSanitizedAssignmentsDirectory() { - return sanitizedAssignmentsDirectory; - } - public boolean getProcessTorperfFiles() { - return this.processTorperfFiles; + return this.sanitizedAssignmentsDirectory; } public String getTorperfOutputDirectory() { return this.torperfOutputDirectory; diff --git a/src/org/torproject/ernie/db/relaydescs/ArchiveWriter.java b/src/org/torproject/ernie/db/relaydescs/ArchiveWriter.java index 1ffb0cb..1b4f774 100644 --- a/src/org/torproject/ernie/db/relaydescs/ArchiveWriter.java +++ b/src/org/torproject/ernie/db/relaydescs/ArchiveWriter.java @@ -55,9 +55,7 @@ public class ArchiveWriter extends Thread { }
// Import/download relay descriptors from the various sources - if (config.getWriteDirectoryArchives()) { - new ArchiveWriter(config).run(); - } + new ArchiveWriter(config).run();
// Remove lock file lf.releaseLock(); diff --git a/src/org/torproject/ernie/db/torperf/TorperfDownloader.java b/src/org/torproject/ernie/db/torperf/TorperfDownloader.java index 13d5846..20549f3 100644 --- a/src/org/torproject/ernie/db/torperf/TorperfDownloader.java +++ b/src/org/torproject/ernie/db/torperf/TorperfDownloader.java @@ -50,9 +50,7 @@ public class TorperfDownloader extends Thread { }
// Process Torperf files - if (config.getProcessTorperfFiles()) { - new TorperfDownloader(config).run(); - } + new TorperfDownloader(config).run();
// Remove lock file lf.releaseLock();
tor-commits@lists.torproject.org