Class SyncPersistence
java.lang.Object
org.torproject.metrics.collector.sync.SyncPersistence
public class SyncPersistence
extends java.lang.Object
Provides persistence for descriptors based on the descriptor type.
-
Constructor Summary
Constructors Constructor Description SyncPersistence(Configuration conf)
Initialize with the given configuration. -
Method Summary
Modifier and Type Method Description void
cleanDirectory()
Cleans the directory inRecentPath
after storing descriptors.void
storeDesc(org.torproject.descriptor.Descriptor desc, long received)
Stores a descriptor in main storage and recent.void
storeDescs(java.lang.Iterable<org.torproject.descriptor.Descriptor> descs, long received)
Stores descriptors in main storage and recent.
-
Constructor Details
-
SyncPersistence
Initialize with the given configuration.- Throws:
ConfigurationException
-
-
Method Details
-
cleanDirectory
public void cleanDirectory()Cleans the directory inRecentPath
after storing descriptors. -
storeDescs
public void storeDescs(java.lang.Iterable<org.torproject.descriptor.Descriptor> descs, long received)Stores descriptors in main storage and recent. The storage locations are taken fromcollector.properties
' optionsOutputPath
andRecentPath
. -
storeDesc
public void storeDesc(org.torproject.descriptor.Descriptor desc, long received)Stores a descriptor in main storage and recent. The storage locations are taken fromcollector.properties
' optionsOutputPath
andRecentPath
.
-