[tor-commits] [collector/master] Finishes task-20162: removed six configuration properties:

karsten at torproject.org karsten at torproject.org
Thu Oct 20 15:31:34 UTC 2016


commit 8bb7de37ad100b7517b3810dd021a9e301d16bdc
Author: iwakeh <iwakeh at torproject.org>
Date:   Tue Oct 18 15:59:07 2016 +0200

    Finishes task-20162: removed six configuration properties:
    
    DownloadCurrentConsensus,
    DownloadCurrentMicrodescConsensus,
    DownloadCurrentVotes,
    DownloadMissingServerDescriptors,
    DownloadMissingExtraInfoDescriptors,
    and DownloadMissingMicrodescriptors
    
    Each was replaced by hard-coded 'true'.
---
 CHANGELOG.md                                       |  2 ++
 .../java/org/torproject/collector/conf/Key.java    |  6 ------
 .../collector/relaydescs/ArchiveWriter.java        |  8 ++------
 src/main/resources/collector.properties            | 22 ----------------------
 .../collector/conf/ConfigurationTest.java          |  2 +-
 5 files changed, 5 insertions(+), 35 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6e1b7eb..af3a620 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,8 @@
      descriptors by a single 'OutPath' property.
    - Introduced *Sources and *Origins properties to simplify
      data source definition.
+   - Remove six properties for specifying what relay descriptors to
+     download and replace them with hard-coded 'true' values.
 
 
 # Changes in version 1.0.2 - 2016-10-07
diff --git a/src/main/java/org/torproject/collector/conf/Key.java b/src/main/java/org/torproject/collector/conf/Key.java
index d06fe0c..4b924c7 100644
--- a/src/main/java/org/torproject/collector/conf/Key.java
+++ b/src/main/java/org/torproject/collector/conf/Key.java
@@ -49,12 +49,6 @@ public enum Key {
   CompressRelayDescriptorDownloads(Boolean.class),
   DirectoryAuthoritiesAddresses(String[].class),
   DirectoryAuthoritiesFingerprintsForVotes(String[].class),
-  DownloadCurrentConsensus(Boolean.class),
-  DownloadCurrentMicrodescConsensus(Boolean.class),
-  DownloadCurrentVotes(Boolean.class),
-  DownloadMissingServerDescriptors(Boolean.class),
-  DownloadMissingExtraInfoDescriptors(Boolean.class),
-  DownloadMissingMicrodescriptors(Boolean.class),
   DownloadAllServerDescriptors(Boolean.class),
   DownloadAllExtraInfoDescriptors(Boolean.class),
   KeepDirectoryArchiveImportHistory(Boolean.class),
diff --git a/src/main/java/org/torproject/collector/relaydescs/ArchiveWriter.java b/src/main/java/org/torproject/collector/relaydescs/ArchiveWriter.java
index cdf6506..b2ed0db 100644
--- a/src/main/java/org/torproject/collector/relaydescs/ArchiveWriter.java
+++ b/src/main/java/org/torproject/collector/relaydescs/ArchiveWriter.java
@@ -154,12 +154,8 @@ public class ArchiveWriter extends CollecTorMain {
           config.getStringArray(Key.DirectoryAuthoritiesAddresses);
       rdd = new RelayDescriptorDownloader(rdp, dirSources,
           config.getStringArray(Key.DirectoryAuthoritiesFingerprintsForVotes),
-          config.getBool(Key.DownloadCurrentConsensus),
-          config.getBool(Key.DownloadCurrentMicrodescConsensus),
-          config.getBool(Key.DownloadCurrentVotes),
-          config.getBool(Key.DownloadMissingServerDescriptors),
-          config.getBool(Key.DownloadMissingExtraInfoDescriptors),
-          config.getBool(Key.DownloadMissingMicrodescriptors),
+          true, true, true, // download current consensus, microcons, and votes
+          true, true, true, // download missing serverdesc, extrainfo, and micro
           config.getBool(Key.DownloadAllServerDescriptors),
           config.getBool(Key.DownloadAllExtraInfoDescriptors),
           config.getBool(Key.CompressRelayDescriptorDownloads));
diff --git a/src/main/resources/collector.properties b/src/main/resources/collector.properties
index c8a9e2f..00f4d50 100644
--- a/src/main/resources/collector.properties
+++ b/src/main/resources/collector.properties
@@ -95,28 +95,6 @@ DirectoryAuthoritiesAddresses = 128.31.0.39:9131,86.59.21.38,194.109.206.212,131
 ## votes
 DirectoryAuthoritiesFingerprintsForVotes = 0232AF901C31A04EE9848595AF9BB7620D4C5B2E,14C131DFC5C6F93646BE72FA1401C02A8DF2E8B4,23D15D965BC35114467363C165C4F724B64B4F66,49015F787433103580E3B66A1707A00E60F2D15B,D586D18309DED4CD6D57C18FDB97EFA96D330566,E8A9C45EDE6D711294FADF8E7951F4DE6CA56B58,ED03BB616EB2F60BEC80151114BB25CEF515B226,EFCBE720AB3A82B99F9E953CD5BF50F7EEFC7B97
 #
-## Download the current consensus (only if DownloadRelayDescriptors is 1)
-DownloadCurrentConsensus = true
-#
-## Download the current microdesc consensus (only if
-## DownloadRelayDescriptors is true)
-DownloadCurrentMicrodescConsensus = true
-#
-## Download current votes (only if DownloadRelayDescriptors is true)
-DownloadCurrentVotes = true
-#
-## Download missing server descriptors (only if DownloadRelayDescriptors
-## is true)
-DownloadMissingServerDescriptors = true
-#
-## Download missing extra-info descriptors (only if
-## DownloadRelayDescriptors is true)
-DownloadMissingExtraInfoDescriptors = true
-#
-## Download missing microdescriptors (only if
-## DownloadRelayDescriptors is true)
-DownloadMissingMicrodescriptors = true
-#
 ## Download all server descriptors from the directory authorities at most
 ## once a day (only if DownloadRelayDescriptors is true)
 DownloadAllServerDescriptors = false
diff --git a/src/test/java/org/torproject/collector/conf/ConfigurationTest.java b/src/test/java/org/torproject/collector/conf/ConfigurationTest.java
index 3f9c231..019c481 100644
--- a/src/test/java/org/torproject/collector/conf/ConfigurationTest.java
+++ b/src/test/java/org/torproject/collector/conf/ConfigurationTest.java
@@ -41,7 +41,7 @@ public class ConfigurationTest {
   public void testKeyCount() throws Exception {
     assertEquals("The number of properties keys in enum Key changed."
         + "\n This test class should be adapted.",
-        50, Key.values().length);
+        44, Key.values().length);
   }
 
   @Test()



More information about the tor-commits mailing list