commit 9a282a533047c8f8f48f67cdfb5c9043bc548321 Author: leeroy ter.one.leeboi@hush.com Date: Wed Jul 15 21:39:04 2015 -0400
Add parse history for archives. --- CHANGELOG.md | 6 ++++++ src/main/java/org/torproject/onionoo/updater/DescriptorHistory.java | 1 + src/main/java/org/torproject/onionoo/updater/DescriptorQueue.java | 3 +++ src/main/java/org/torproject/onionoo/updater/DescriptorSource.java | 5 ++++- 4 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a170dd..850e4c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# Changes in version ??? + + * Medium changes + - Add a parse history for imported descriptor archives. + + # Changes in version 4.0-1.2.0 - 2017-02-28
* Medium changes diff --git a/src/main/java/org/torproject/onionoo/updater/DescriptorHistory.java b/src/main/java/org/torproject/onionoo/updater/DescriptorHistory.java index 4cf7d81..ae47c0c 100644 --- a/src/main/java/org/torproject/onionoo/updater/DescriptorHistory.java +++ b/src/main/java/org/torproject/onionoo/updater/DescriptorHistory.java @@ -11,5 +11,6 @@ enum DescriptorHistory { BRIDGE_STATUS_HISTORY, BRIDGE_SERVER_HISTORY, BRIDGE_EXTRAINFO_HISTORY, + ARCHIVED_HISTORY }
diff --git a/src/main/java/org/torproject/onionoo/updater/DescriptorQueue.java b/src/main/java/org/torproject/onionoo/updater/DescriptorQueue.java index 5ce8cfa..e2b320c 100644 --- a/src/main/java/org/torproject/onionoo/updater/DescriptorQueue.java +++ b/src/main/java/org/torproject/onionoo/updater/DescriptorQueue.java @@ -149,6 +149,9 @@ class DescriptorQueue { case BRIDGE_SERVER_HISTORY: historyFileName = "bridge-server-history"; break; + case ARCHIVED_HISTORY: + historyFileName = "archived-history"; + break; default: log.error("Unknown descriptor history. Not excluding " + "files."); diff --git a/src/main/java/org/torproject/onionoo/updater/DescriptorSource.java b/src/main/java/org/torproject/onionoo/updater/DescriptorSource.java index 33c8a8e..c7422e9 100644 --- a/src/main/java/org/torproject/onionoo/updater/DescriptorSource.java +++ b/src/main/java/org/torproject/onionoo/updater/DescriptorSource.java @@ -172,7 +172,9 @@ public class DescriptorSource { } log.info("Reading archived descriptors..."); this.archiveDescriptorQueue = new DescriptorQueue(this.inArchiveDir, - null, null); + null, this.statusDir); + this.archiveDescriptorQueue.readHistoryFile( + DescriptorHistory.ARCHIVED_HISTORY); Descriptor descriptor; while ((descriptor = this.archiveDescriptorQueue.nextDescriptor()) != null) { @@ -217,6 +219,7 @@ public class DescriptorSource { descriptorListener.processDescriptor(descriptor, relay); } } + this.archiveDescriptorQueue.writeHistoryFile(); log.info("Read archived descriptors"); }