Class Parser
- java.lang.Object
-
- org.torproject.metrics.stats.hidserv.Parser
-
public class Parser extends java.lang.Object
Parse hidden-service statistics from extra-info descriptors, compute network fractions from consensuses, and write parsed contents to document files for later use.
-
-
Constructor Summary
Constructors Constructor Description Parser(java.io.File[] inDirectories, java.io.File statusDirectory, DocumentStore<ReportedHidServStats> reportedHidServStatsStore, DocumentStore<ComputedNetworkFractions> computedNetworkFractionsStore)
Initializes a new parser object using the given directories and document stores.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
parseDescriptors()
Instructs the descriptor reader to parse descriptor files, and handles the resulting parsed descriptors if they are either extra-info descriptors or consensuses.void
parseRelayNetworkStatusConsensus(org.torproject.descriptor.RelayNetworkStatusConsensus consensus)
Parses the given consensus.void
readParseHistory()
Reads the parse history file to avoid parsing descriptor files that have not changed since the previous execution.void
writeParseHistory()
Writes parsed or skipped descriptor files with last-modified times and absolute paths to the parse history file to avoid parsing these files again, unless they change until the next execution.
-
-
-
Constructor Detail
-
Parser
public Parser(java.io.File[] inDirectories, java.io.File statusDirectory, DocumentStore<ReportedHidServStats> reportedHidServStatsStore, DocumentStore<ComputedNetworkFractions> computedNetworkFractionsStore)
Initializes a new parser object using the given directories and document stores.
-
-
Method Detail
-
readParseHistory
public void readParseHistory()
Reads the parse history file to avoid parsing descriptor files that have not changed since the previous execution.
-
writeParseHistory
public void writeParseHistory()
Writes parsed or skipped descriptor files with last-modified times and absolute paths to the parse history file to avoid parsing these files again, unless they change until the next execution.
-
parseDescriptors
public void parseDescriptors()
Instructs the descriptor reader to parse descriptor files, and handles the resulting parsed descriptors if they are either extra-info descriptors or consensuses.
-
parseRelayNetworkStatusConsensus
public void parseRelayNetworkStatusConsensus(org.torproject.descriptor.RelayNetworkStatusConsensus consensus)
Parses the given consensus.
-
-