[tor-bugs] #16151 [metrics-lib]: Add new descriptor source to fetch descriptors from CollecTor via https
Tor Bug Tracker & Wiki
blackhole at torproject.org
Wed May 27 15:21:36 UTC 2015
#16151: Add new descriptor source to fetch descriptors from CollecTor via https
-----------------------------+--------------------------
Reporter: karsten | Owner: karsten
Type: enhancement | Status: needs_review
Priority: normal | Milestone:
Component: metrics-lib | Version:
Resolution: | Keywords:
Actual Points: | Parent ID:
Points: |
-----------------------------+--------------------------
Comment (by karsten):
Those are good suggestions!
I changed the interface towards a single method `collectRemoteFiles()`
with five parameters. I took out the timeouts entirely, because I don't
consider them important at all; having them in the previous interface was
okay, but this interface is better with as few parameters as possible. We
could have used overloaded methods, but these five parameters all looked
reasonable to have in the interface.
Please find the [https://gitweb.torproject.org/user/karsten/metrics-
lib.git/commit/?h=task-16151&id=fd988f26413f8ea85551911220cfdf83e1ba477d
latest commit] in the [https://gitweb.torproject.org/user/karsten/metrics-
lib.git/log/?h=task-16151 updated branch task-16151 in my public
repository]. It comes with tests!
And here's the updated ExoneraTor method that uses this code:
{{{
private static void fetchDescriptors() {
DescriptorCollector collector =
DescriptorSourceFactory.createDescriptorCollector();
collector.collectRemoteFiles("https://collector.torproject.org",
new String[] { "/recent/relay-descriptors/consensuses/",
"/recent/relay-descriptors/server-descriptors/",
"/recent/exit-lists/" }, 0L, new File(importDirString), true);
}
}}}
I'm going to merge soon. If you have more suggestions, in particular on
the interface (which would be harder to change later), please do tell!
Thanks!
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/16151#comment:8>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list