Class CollecTorMain
- java.lang.Object
-
- org.torproject.metrics.collector.sync.SyncManager
-
- org.torproject.metrics.collector.cron.CollecTorMain
-
- All Implemented Interfaces:
java.lang.Runnable
,java.util.concurrent.Callable<java.lang.Object>
,java.util.Observer
- Direct Known Subclasses:
ArchiveWriter
,BridgePoolAssignmentsProcessor
,CreateIndexJson
,ExitListDownloader
,OnionPerfDownloader
,SanitizedBridgesWriter
,SanitizeWeblogs
,SnowflakeStatsDownloader
public abstract class CollecTorMain extends SyncManager implements java.util.concurrent.Callable<java.lang.Object>, java.util.Observer, java.lang.Runnable
-
-
Field Summary
Fields Modifier and Type Field Description protected Configuration
config
protected java.util.Map<java.lang.String,java.lang.Class<? extends org.torproject.descriptor.Descriptor>>
mapPathDescriptors
static java.lang.String
SOURCES
-
Fields inherited from class org.torproject.metrics.collector.sync.SyncManager
SYNCORIGINS
-
-
Constructor Summary
Constructors Constructor Description CollecTorMain(Configuration conf)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Object
call()
Wrapper forrun
.static void
checkAvailableSpace(java.nio.file.Path location)
Checks the available space for the storage the given path is located on and logs a warning, if 200 MiB or less are available, and otherwise logs available space in TRACE level.abstract java.lang.String
module()
Returns the module name for logging purposes.void
run()
Log all errors preventing successful completion of the module.protected abstract void
startProcessing()
Module specific code goes here.java.util.Map<java.lang.String,java.lang.Class<? extends org.torproject.descriptor.Descriptor>>
syncMapPathsDescriptors()
Returns map of path and descriptor type for download.protected abstract java.lang.String
syncMarker()
Returns property prefix/infix/postfix for Sync related properties.void
update(java.util.Observable obs, java.lang.Object obj)
-
Methods inherited from class org.torproject.metrics.collector.sync.SyncManager
merge
-
-
-
-
Field Detail
-
SOURCES
public static final java.lang.String SOURCES
- See Also:
- Constant Field Values
-
config
protected Configuration config
-
mapPathDescriptors
protected final java.util.Map<java.lang.String,java.lang.Class<? extends org.torproject.descriptor.Descriptor>> mapPathDescriptors
-
-
Constructor Detail
-
CollecTorMain
public CollecTorMain(Configuration conf)
-
-
Method Detail
-
run
public final void run()
Log all errors preventing successful completion of the module.- Specified by:
run
in interfacejava.lang.Runnable
-
call
public final java.lang.Object call()
Wrapper forrun
.- Specified by:
call
in interfacejava.util.concurrent.Callable<java.lang.Object>
-
update
public void update(java.util.Observable obs, java.lang.Object obj)
- Specified by:
update
in interfacejava.util.Observer
-
startProcessing
protected abstract void startProcessing() throws ConfigurationException
Module specific code goes here.- Throws:
ConfigurationException
-
syncMarker
protected abstract java.lang.String syncMarker()
Returns property prefix/infix/postfix for Sync related properties.
-
module
public abstract java.lang.String module()
Returns the module name for logging purposes.
-
syncMapPathsDescriptors
public java.util.Map<java.lang.String,java.lang.Class<? extends org.torproject.descriptor.Descriptor>> syncMapPathsDescriptors()
Returns map of path and descriptor type for download.
-
checkAvailableSpace
public static void checkAvailableSpace(java.nio.file.Path location)
Checks the available space for the storage the given path is located on and logs a warning, if 200 MiB or less are available, and otherwise logs available space in TRACE level.
-
-