commit c95125a2b329c801db84eea2bdbc4e5118bde9b2 Author: Karsten Loesing karsten.loesing@gmx.net Date: Wed Nov 14 10:48:56 2018 +0100
Rename ipv6servers module to servers.
Part of #28116. --- build.xml | 12 ++++++------ .../metrics/stats/ipv6servers/Configuration.java | 18 ------------------ .../metrics/stats/servers/Configuration.java | 18 ++++++++++++++++++ .../stats/{ipv6servers => servers}/Database.java | 2 +- .../{ipv6servers => servers}/Ipv6NetworkStatus.java | 2 +- .../{ipv6servers => servers}/Ipv6ServerDescriptor.java | 2 +- .../metrics/stats/{ipv6servers => servers}/Main.java | 8 ++++---- .../metrics/stats/{ipv6servers => servers}/Parser.java | 2 +- .../metrics/stats/{ipv6servers => servers}/Writer.java | 2 +- .../Ipv6NetworkStatusTest.java | 6 +++--- .../Ipv6ServerDescriptorTest.java | 14 +++++++------- .../000a7fe20a17bf5d9839a126b1dff43f998aac6f | 0 .../0018ab4f2f28af683d52f06407edbf7ce1bd3b7d | 0 .../0041dbf9fe846f9765882f7dc8332f94b709e35a | 0 .../01003df74972ce952ebfa390f468ef63c50efa25 | 0 .../018c1229d5f56eebfc1d709d4692673d098800e8 | 0 .../2017-12-04-20-00-00-consensus.part | 0 ...90507-1D8F3A91C37C5D1C4C19B1AD1D0CFBE8BF72D8E1.part | 0 .../64dd486d89af14027c9a7b4347a94b74dddb5cdb | 0 .../sql/{ipv6servers => servers}/test-ipv6servers.sql | 0 20 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/build.xml b/build.xml index a391416..89c8b31 100644 --- a/build.xml +++ b/build.xml @@ -105,7 +105,7 @@ depends="init" description="Run all available database pgTAP tests." > <antcall target="test-db"> - <param name="db2test" value="ipv6servers" /> + <param name="db2test" value="servers" /> </antcall> <antcall target="test-db"> <param name="db2test" value="userstats" /> @@ -319,7 +319,7 @@ <antcall target="advbwdist" /> <antcall target="hidserv" /> <antcall target="clients" /> - <antcall target="ipv6servers" /> + <antcall target="servers" /> <antcall target="webstats" /> <antcall target="totalcw" /> <antcall target="make-data-available" /> @@ -416,11 +416,11 @@ </antcall> </target>
- <target name="ipv6servers" > - <property name="module.name" value="ipv6servers" /> + <target name="servers" > + <property name="module.name" value="servers" /> <antcall target="run-java" > <param name="module.main" - value="org.torproject.metrics.stats.ipv6servers.Main" /> + value="org.torproject.metrics.stats.servers.Main" /> </antcall> </target>
@@ -477,7 +477,7 @@ <fileset dir="${modulebase}/hidserv/stats" includes="hidserv.csv" /> <fileset dir="${modulebase}/clients/stats" includes="clients*.csv userstats-combined.csv" /> - <fileset dir="${modulebase}/ipv6servers/stats" includes="*.csv" /> + <fileset dir="${modulebase}/servers/stats" includes="*.csv" /> <fileset dir="${modulebase}/webstats/stats" includes="webstats.csv" /> <fileset dir="${modulebase}/totalcw/stats" includes="totalcw.csv" /> </copy> diff --git a/src/main/java/org/torproject/metrics/stats/ipv6servers/Configuration.java b/src/main/java/org/torproject/metrics/stats/ipv6servers/Configuration.java deleted file mode 100644 index d849cb6..0000000 --- a/src/main/java/org/torproject/metrics/stats/ipv6servers/Configuration.java +++ /dev/null @@ -1,18 +0,0 @@ -/* Copyright 2017--2018 The Tor Project - * See LICENSE for licensing information */ - -package org.torproject.metrics.stats.ipv6servers; - -/** Configuration options parsed from Java properties with reasonable hard-coded - * defaults. */ -class Configuration { - static String descriptors = System.getProperty("ipv6servers.descriptors", - "../../shared/in/"); - static String database = System.getProperty("ipv6servers.database", - "jdbc:postgresql:ipv6servers"); - static String history = System.getProperty("ipv6servers.history", - "status/read-descriptors"); - static String output = System.getProperty("ipv6servers.output", - "stats/"); -} - diff --git a/src/main/java/org/torproject/metrics/stats/servers/Configuration.java b/src/main/java/org/torproject/metrics/stats/servers/Configuration.java new file mode 100644 index 0000000..1b7c217 --- /dev/null +++ b/src/main/java/org/torproject/metrics/stats/servers/Configuration.java @@ -0,0 +1,18 @@ +/* Copyright 2017--2018 The Tor Project + * See LICENSE for licensing information */ + +package org.torproject.metrics.stats.servers; + +/** Configuration options parsed from Java properties with reasonable hard-coded + * defaults. */ +class Configuration { + static String descriptors = System.getProperty("servers.descriptors", + "../../shared/in/"); + static String database = System.getProperty("servers.database", + "jdbc:postgresql:ipv6servers"); + static String history = System.getProperty("servers.history", + "status/read-descriptors"); + static String output = System.getProperty("servers.output", + "stats/"); +} + diff --git a/src/main/java/org/torproject/metrics/stats/ipv6servers/Database.java b/src/main/java/org/torproject/metrics/stats/servers/Database.java similarity index 99% rename from src/main/java/org/torproject/metrics/stats/ipv6servers/Database.java rename to src/main/java/org/torproject/metrics/stats/servers/Database.java index b5efe3e..9c9bda3 100644 --- a/src/main/java/org/torproject/metrics/stats/ipv6servers/Database.java +++ b/src/main/java/org/torproject/metrics/stats/servers/Database.java @@ -1,7 +1,7 @@ /* Copyright 2017--2018 The Tor Project * See LICENSE for licensing information */
-package org.torproject.metrics.stats.ipv6servers; +package org.torproject.metrics.stats.servers;
import java.sql.Connection; import java.sql.DriverManager; diff --git a/src/main/java/org/torproject/metrics/stats/ipv6servers/Ipv6NetworkStatus.java b/src/main/java/org/torproject/metrics/stats/servers/Ipv6NetworkStatus.java similarity index 98% rename from src/main/java/org/torproject/metrics/stats/ipv6servers/Ipv6NetworkStatus.java rename to src/main/java/org/torproject/metrics/stats/servers/Ipv6NetworkStatus.java index 526adc7..2f40854 100644 --- a/src/main/java/org/torproject/metrics/stats/ipv6servers/Ipv6NetworkStatus.java +++ b/src/main/java/org/torproject/metrics/stats/servers/Ipv6NetworkStatus.java @@ -1,7 +1,7 @@ /* Copyright 2017--2018 The Tor Project * See LICENSE for licensing information */
-package org.torproject.metrics.stats.ipv6servers; +package org.torproject.metrics.stats.servers;
import java.time.LocalDateTime; import java.util.ArrayList; diff --git a/src/main/java/org/torproject/metrics/stats/ipv6servers/Ipv6ServerDescriptor.java b/src/main/java/org/torproject/metrics/stats/servers/Ipv6ServerDescriptor.java similarity index 95% rename from src/main/java/org/torproject/metrics/stats/ipv6servers/Ipv6ServerDescriptor.java rename to src/main/java/org/torproject/metrics/stats/servers/Ipv6ServerDescriptor.java index 387024b..4450a3c 100644 --- a/src/main/java/org/torproject/metrics/stats/ipv6servers/Ipv6ServerDescriptor.java +++ b/src/main/java/org/torproject/metrics/stats/servers/Ipv6ServerDescriptor.java @@ -1,7 +1,7 @@ /* Copyright 2017--2018 The Tor Project * See LICENSE for licensing information */
-package org.torproject.metrics.stats.ipv6servers; +package org.torproject.metrics.stats.servers;
/** Data object holding all relevant parts parsed from a (relay or bridge) * server descriptor. */ diff --git a/src/main/java/org/torproject/metrics/stats/ipv6servers/Main.java b/src/main/java/org/torproject/metrics/stats/servers/Main.java similarity index 95% rename from src/main/java/org/torproject/metrics/stats/ipv6servers/Main.java rename to src/main/java/org/torproject/metrics/stats/servers/Main.java index d322a2e..54f44d0 100644 --- a/src/main/java/org/torproject/metrics/stats/ipv6servers/Main.java +++ b/src/main/java/org/torproject/metrics/stats/servers/Main.java @@ -1,7 +1,7 @@ /* Copyright 2017--2018 The Tor Project * See LICENSE for licensing information */
-package org.torproject.metrics.stats.ipv6servers; +package org.torproject.metrics.stats.servers;
import org.torproject.descriptor.BridgeNetworkStatus; import org.torproject.descriptor.Descriptor; @@ -18,7 +18,7 @@ import java.nio.file.Paths; import java.sql.SQLException; import java.util.Arrays;
-/** Main class of the ipv6servers module that imports relevant parts from server +/** Main class of the servers module that imports relevant parts from server * descriptors and network statuses into a database, and exports aggregate * statistics to CSV files. */ public class Main { @@ -38,7 +38,7 @@ public class Main { /** Run the module. */ public static void main(String[] args) throws Exception {
- log.info("Starting ipv6servers module."); + log.info("Starting servers module.");
log.info("Reading descriptors and inserting relevant parts into the " + "database."); @@ -99,7 +99,7 @@ public class Main { new Writer().write(Paths.get(Configuration.output, "platforms.csv"), database.queryPlatforms());
- log.info("Terminating ipv6servers module."); + log.info("Terminating servers module."); } catch (SQLException sqle) { log.error("Cannot recover from SQL exception while querying. Not writing " + "output file.", sqle); diff --git a/src/main/java/org/torproject/metrics/stats/ipv6servers/Parser.java b/src/main/java/org/torproject/metrics/stats/servers/Parser.java similarity index 99% rename from src/main/java/org/torproject/metrics/stats/ipv6servers/Parser.java rename to src/main/java/org/torproject/metrics/stats/servers/Parser.java index 9d8b71a..65055f9 100644 --- a/src/main/java/org/torproject/metrics/stats/ipv6servers/Parser.java +++ b/src/main/java/org/torproject/metrics/stats/servers/Parser.java @@ -1,7 +1,7 @@ /* Copyright 2017--2018 The Tor Project * See LICENSE for licensing information */
-package org.torproject.metrics.stats.ipv6servers; +package org.torproject.metrics.stats.servers;
import org.torproject.descriptor.BridgeNetworkStatus; import org.torproject.descriptor.NetworkStatusEntry; diff --git a/src/main/java/org/torproject/metrics/stats/ipv6servers/Writer.java b/src/main/java/org/torproject/metrics/stats/servers/Writer.java similarity index 96% rename from src/main/java/org/torproject/metrics/stats/ipv6servers/Writer.java rename to src/main/java/org/torproject/metrics/stats/servers/Writer.java index 4e2893c..5ff1858 100644 --- a/src/main/java/org/torproject/metrics/stats/ipv6servers/Writer.java +++ b/src/main/java/org/torproject/metrics/stats/servers/Writer.java @@ -1,7 +1,7 @@ /* Copyright 2017--2018 The Tor Project * See LICENSE for licensing information */
-package org.torproject.metrics.stats.ipv6servers; +package org.torproject.metrics.stats.servers;
import java.io.File; import java.io.IOException; diff --git a/src/test/java/org/torproject/metrics/stats/ipv6servers/Ipv6NetworkStatusTest.java b/src/test/java/org/torproject/metrics/stats/servers/Ipv6NetworkStatusTest.java similarity index 96% rename from src/test/java/org/torproject/metrics/stats/ipv6servers/Ipv6NetworkStatusTest.java rename to src/test/java/org/torproject/metrics/stats/servers/Ipv6NetworkStatusTest.java index 2f3ca42..4ad0b9c 100644 --- a/src/test/java/org/torproject/metrics/stats/ipv6servers/Ipv6NetworkStatusTest.java +++ b/src/test/java/org/torproject/metrics/stats/servers/Ipv6NetworkStatusTest.java @@ -1,7 +1,7 @@ /* Copyright 2017--2018 The Tor Project * See LICENSE for licensing information */
-package org.torproject.metrics.stats.ipv6servers; +package org.torproject.metrics.stats.servers;
import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.fail; @@ -33,8 +33,8 @@ public class Ipv6NetworkStatusTest { /** Provide test data. */ @Parameters public static Collection<Object[]> data() { - String relayFileName = "ipv6servers/2017-12-04-20-00-00-consensus.part"; - String bridgeFileName = "ipv6servers/" + String relayFileName = "servers/2017-12-04-20-00-00-consensus.part"; + String bridgeFileName = "servers/" + "20171204-190507-1D8F3A91C37C5D1C4C19B1AD1D0CFBE8BF72D8E1.part"; return Arrays.asList(new Object[][] { { "Relay status without Guard or Exit flag and without IPv6 address. ", diff --git a/src/test/java/org/torproject/metrics/stats/ipv6servers/Ipv6ServerDescriptorTest.java b/src/test/java/org/torproject/metrics/stats/servers/Ipv6ServerDescriptorTest.java similarity index 86% rename from src/test/java/org/torproject/metrics/stats/ipv6servers/Ipv6ServerDescriptorTest.java rename to src/test/java/org/torproject/metrics/stats/servers/Ipv6ServerDescriptorTest.java index 7b63c1e..54a6941 100644 --- a/src/test/java/org/torproject/metrics/stats/ipv6servers/Ipv6ServerDescriptorTest.java +++ b/src/test/java/org/torproject/metrics/stats/servers/Ipv6ServerDescriptorTest.java @@ -1,7 +1,7 @@ /* Copyright 2017--2018 The Tor Project * See LICENSE for licensing information */
-package org.torproject.metrics.stats.ipv6servers; +package org.torproject.metrics.stats.servers;
import static junit.framework.TestCase.assertEquals; import static org.junit.Assert.assertNotNull; @@ -32,22 +32,22 @@ public class Ipv6ServerDescriptorTest { public static Collection<Object[]> data() { return Arrays.asList(new Object[][] { { "Relay server descriptor without or-address or ipv6-policy line.", - "ipv6servers/0018ab4f2f28af683d52f06407edbf7ce1bd3b7d", + "servers/0018ab4f2f28af683d52f06407edbf7ce1bd3b7d", 819200, false, false }, { "Relay server descriptor with or-address and ipv6-policy line.", - "ipv6servers/01003df74972ce952ebfa390f468ef63c50efa25", + "servers/01003df74972ce952ebfa390f468ef63c50efa25", 6576128, true, true }, { "Relay server descriptor with or-address line only.", - "ipv6servers/018c1229d5f56eebfc1d709d4692673d098800e8", + "servers/018c1229d5f56eebfc1d709d4692673d098800e8", 0, true, false }, { "Bridge server descriptor without or-address or ipv6-policy line.", - "ipv6servers/000a7fe20a17bf5d9839a126b1dff43f998aac6f", + "servers/000a7fe20a17bf5d9839a126b1dff43f998aac6f", 0, false, false }, { "Bridge server descriptor with or-address line.", - "ipv6servers/0041dbf9fe846f9765882f7dc8332f94b709e35a", + "servers/0041dbf9fe846f9765882f7dc8332f94b709e35a", 0, true, false }, { "Bridge server descriptor with (ignored) ipv6-policy accept line.", - "ipv6servers/64dd486d89af14027c9a7b4347a94b74dddb5cdb", + "servers/64dd486d89af14027c9a7b4347a94b74dddb5cdb", 0, false, false } }); } diff --git a/src/test/resources/ipv6servers/000a7fe20a17bf5d9839a126b1dff43f998aac6f b/src/test/resources/servers/000a7fe20a17bf5d9839a126b1dff43f998aac6f similarity index 100% rename from src/test/resources/ipv6servers/000a7fe20a17bf5d9839a126b1dff43f998aac6f rename to src/test/resources/servers/000a7fe20a17bf5d9839a126b1dff43f998aac6f diff --git a/src/test/resources/ipv6servers/0018ab4f2f28af683d52f06407edbf7ce1bd3b7d b/src/test/resources/servers/0018ab4f2f28af683d52f06407edbf7ce1bd3b7d similarity index 100% rename from src/test/resources/ipv6servers/0018ab4f2f28af683d52f06407edbf7ce1bd3b7d rename to src/test/resources/servers/0018ab4f2f28af683d52f06407edbf7ce1bd3b7d diff --git a/src/test/resources/ipv6servers/0041dbf9fe846f9765882f7dc8332f94b709e35a b/src/test/resources/servers/0041dbf9fe846f9765882f7dc8332f94b709e35a similarity index 100% rename from src/test/resources/ipv6servers/0041dbf9fe846f9765882f7dc8332f94b709e35a rename to src/test/resources/servers/0041dbf9fe846f9765882f7dc8332f94b709e35a diff --git a/src/test/resources/ipv6servers/01003df74972ce952ebfa390f468ef63c50efa25 b/src/test/resources/servers/01003df74972ce952ebfa390f468ef63c50efa25 similarity index 100% rename from src/test/resources/ipv6servers/01003df74972ce952ebfa390f468ef63c50efa25 rename to src/test/resources/servers/01003df74972ce952ebfa390f468ef63c50efa25 diff --git a/src/test/resources/ipv6servers/018c1229d5f56eebfc1d709d4692673d098800e8 b/src/test/resources/servers/018c1229d5f56eebfc1d709d4692673d098800e8 similarity index 100% rename from src/test/resources/ipv6servers/018c1229d5f56eebfc1d709d4692673d098800e8 rename to src/test/resources/servers/018c1229d5f56eebfc1d709d4692673d098800e8 diff --git a/src/test/resources/ipv6servers/2017-12-04-20-00-00-consensus.part b/src/test/resources/servers/2017-12-04-20-00-00-consensus.part similarity index 100% rename from src/test/resources/ipv6servers/2017-12-04-20-00-00-consensus.part rename to src/test/resources/servers/2017-12-04-20-00-00-consensus.part diff --git a/src/test/resources/ipv6servers/20171204-190507-1D8F3A91C37C5D1C4C19B1AD1D0CFBE8BF72D8E1.part b/src/test/resources/servers/20171204-190507-1D8F3A91C37C5D1C4C19B1AD1D0CFBE8BF72D8E1.part similarity index 100% rename from src/test/resources/ipv6servers/20171204-190507-1D8F3A91C37C5D1C4C19B1AD1D0CFBE8BF72D8E1.part rename to src/test/resources/servers/20171204-190507-1D8F3A91C37C5D1C4C19B1AD1D0CFBE8BF72D8E1.part diff --git a/src/test/resources/ipv6servers/64dd486d89af14027c9a7b4347a94b74dddb5cdb b/src/test/resources/servers/64dd486d89af14027c9a7b4347a94b74dddb5cdb similarity index 100% rename from src/test/resources/ipv6servers/64dd486d89af14027c9a7b4347a94b74dddb5cdb rename to src/test/resources/servers/64dd486d89af14027c9a7b4347a94b74dddb5cdb diff --git a/src/test/sql/ipv6servers/test-ipv6servers.sql b/src/test/sql/servers/test-ipv6servers.sql similarity index 100% rename from src/test/sql/ipv6servers/test-ipv6servers.sql rename to src/test/sql/servers/test-ipv6servers.sql