Class CollecTorMain

    • 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  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object call()
      Wrapper for run.
      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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mapPathDescriptors

        protected final java.util.Map<java.lang.String,​java.lang.Class<? extends org.torproject.descriptor.Descriptor>> mapPathDescriptors
    • Constructor Detail

    • Method Detail

      • run

        public final void run()
        Log all errors preventing successful completion of the module.
        Specified by:
        run in interface java.lang.Runnable
      • call

        public final java.lang.Object call()
        Wrapper for run.
        Specified by:
        call in interface java.util.concurrent.Callable<java.lang.Object>
      • update

        public void update​(java.util.Observable obs,
                           java.lang.Object obj)
        Specified by:
        update in interface java.util.Observer
      • 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.