Package gov.usgs.earthquake.indexer
Class ArchivePolicy
java.lang.Object
gov.usgs.util.DefaultConfigurable
gov.usgs.earthquake.indexer.ArchivePolicy
- All Implemented Interfaces:
Configurable
- Direct Known Subclasses:
ProductArchivePolicy
A policy for the Indexer to clean up Events in its ProductIndex.
The policy is created by configuration parameters and generates a
ProductIndexQuery. Any product/event matching the product index query is
archived. Generally, archiving means the data for that product/event is
removed from the index as well as the storage. Upon archiving, an
EVENT_ARCHIVED type of IndexerEvent is sent to interested listeners.
All archive policies run in their own thread (one thread separate from
indexing for all archive policies, not one each) and execute at configured
intervals.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty for archive event sourcestatic final StringDeprecated.static final StringProperty for archive maximum depthstatic final StringProperty for archive maximum event agestatic final StringProperty for archive maximum event timestatic final StringProperty for archive maximum latitudestatic final StringProperty for archive maximum longitudestatic final StringProperty for archive maximum magstatic final StringDeprecated.static final StringProperty for archive minimum depthstatic final StringProperty for archive minimum event agestatic final StringProperty for archive minimum event timestatic final StringProperty for archive minimum latitudestatic final StringProperty for archive minimum longitudestatic final StringProperty for archive minimum magprotected StringConfigured parameter var for eventSourceprotected LongDeprecated.protected BigDecimalConfigured parameter var for maxDepthprotected LongConfigured parameter var for maxEventAgeprotected LongConfigured parameter var for maxEventTimeprotected BigDecimalConfigured parameter var for maxLatprotected BigDecimalConfigured parameter var for maxLngprotected BigDecimalConfigured parameter var for maxMagprotected LongDeprecated.protected BigDecimalConfigured parameter var for minDepthprotected LongConfigured parameter var for minEventAgeprotected LongConfigured parameter var for minEventTimeprotected BigDecimalConfigured parameter var for minLatprotected BigDecimalConfigured parameter var for minLngprotected BigDecimalConfigured parameter var for minMag -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidProcess configuration settings.Deprecated.Deprecated.booleanprotected BigDecimalparseBigDecimal(Config config, String name) Gets the property 'name' from config and returns a BigDecimal of itprotected LongparseDateOrLong(Config config, String name) Gets the property 'name' from config and returns a Date/Long of itprotected LongGets the property 'name' from config and returns a Long of itvoidsetEventSource(String eventSource) voidDeprecated.voidsetMaxDepth(BigDecimal maxDepth) voidsetMaxEventAge(Long maxEventAge) voidsetMaxEventTime(Long maxEventTime) voidsetMaxLat(BigDecimal maxLat) voidsetMaxLng(BigDecimal maxLng) voidsetMaxMag(BigDecimal maxMag) voidDeprecated.voidsetMinDepth(BigDecimal minDepth) voidsetMinEventAge(Long minEventAge) voidsetMinEventTime(Long minEventTime) voidsetMinLat(BigDecimal minLat) voidsetMinLng(BigDecimal minLng) voidsetMinMag(BigDecimal minMag) voidshutdown()Stop any processing/background threads.voidstartup()Start any processing/background threads.Methods inherited from class gov.usgs.util.DefaultConfigurable
getName, setName
-
Field Details
-
ARCHIVE_MIN_AGE_PROPERTY
Deprecated.- See Also:
-
ARCHIVE_MAX_AGE_PROPERTY
Deprecated.- See Also:
-
ARCHIVE_MIN_EVENT_AGE_PROPERTY
Property for archive minimum event age- See Also:
-
ARCHIVE_MAX_EVENT_AGE_PROPERTY
Property for archive maximum event age- See Also:
-
ARCHIVE_MIN_EVENT_TIME_PROPERTY
Property for archive minimum event time- See Also:
-
ARCHIVE_MAX_EVENT_TIME_PROPERTY
Property for archive maximum event time- See Also:
-
ARCHIVE_MIN_MAG_PROPERTY
Property for archive minimum mag- See Also:
-
ARCHIVE_MAX_MAG_PROPERTY
Property for archive maximum mag- See Also:
-
ARCHIVE_MIN_LAT_PROPERTY
Property for archive minimum latitude- See Also:
-
ARCHIVE_MAX_LAT_PROPERTY
Property for archive maximum latitude- See Also:
-
ARCHIVE_MIN_LNG_PROPERTY
Property for archive minimum longitude- See Also:
-
ARCHIVE_MAX_LNG_PROPERTY
Property for archive maximum longitude- See Also:
-
ARCHIVE_MIN_DEPTH_PROPERTY
Property for archive minimum depth- See Also:
-
ARCHIVE_MAX_DEPTH_PROPERTY
Property for archive maximum depth- See Also:
-
ARCHIVE_EVENT_SOURCE_PROPERTY
Property for archive event source- See Also:
-
minAge
Deprecated. -
maxAge
Deprecated. -
minEventAge
Configured parameter var for minEventAge -
maxEventAge
Configured parameter var for maxEventAge -
minEventTime
Configured parameter var for minEventTime -
maxEventTime
Configured parameter var for maxEventTime -
minMag
Configured parameter var for minMag -
maxMag
Configured parameter var for maxMag -
minLat
Configured parameter var for minLat -
maxLat
Configured parameter var for maxLat -
minLng
Configured parameter var for minLng -
maxLng
Configured parameter var for maxLng -
minDepth
Configured parameter var for minDepth -
maxDepth
Configured parameter var for maxDepth -
eventSource
Configured parameter var for eventSource
-
-
Constructor Details
-
ArchivePolicy
public ArchivePolicy()Default Constructor
-
-
Method Details
-
configure
Description copied from class:DefaultConfigurableProcess configuration settings. Called before startup().- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classDefaultConfigurable- Parameters:
config- the Config object with settings.- Throws:
Exception- if configuration exceptions occur.
-
shutdown
Description copied from class:DefaultConfigurableStop any processing/background threads.- Specified by:
shutdownin interfaceConfigurable- Overrides:
shutdownin classDefaultConfigurable- Throws:
Exception- if exceptions occur while starting.
-
startup
Description copied from class:DefaultConfigurableStart any processing/background threads.- Specified by:
startupin interfaceConfigurable- Overrides:
startupin classDefaultConfigurable- Throws:
Exception- if exceptions occur while starting.
-
getIndexQuery
- Returns:
- a ProductIndexQuery
-
isValidPolicy
public boolean isValidPolicy()- Returns:
- boolean if the policy is valid
-
parseBigDecimal
Gets the property 'name' from config and returns a BigDecimal of it- Parameters:
config- Config filename- name of property from config- Returns:
- BigDecimal of property
-
parseDateOrLong
Gets the property 'name' from config and returns a Date/Long of it- Parameters:
config- Config filename- name of property from config- Returns:
- Date/Long of property
-
parseLong
Gets the property 'name' from config and returns a Long of it- Parameters:
config- Config filename- name of property from config- Returns:
- Long of property
-
getMinAge
Deprecated.- Returns:
- minAge
-
setMinAge
Deprecated.- Parameters:
minAge- to set
-
getMaxAge
Deprecated.- Returns:
- maxAge
-
setMaxAge
Deprecated.- Parameters:
maxAge- to set
-
getMinEventAge
- Returns:
- minEventAge
-
setMinEventAge
- Parameters:
minEventAge- to set
-
getMaxEventAge
- Returns:
- maxEventAge
-
setMaxEventAge
- Parameters:
maxEventAge- to set
-
getMinEventTime
- Returns:
- minEventTime
-
setMinEventTime
- Parameters:
minEventTime- to set
-
getMaxEventTime
- Returns:
- maxEventTime
-
setMaxEventTime
- Parameters:
maxEventTime- to set
-
getMinMag
- Returns:
- minMag
-
setMinMag
- Parameters:
minMag- to set
-
getMaxMag
- Returns:
- maxMag
-
setMaxMag
- Parameters:
maxMag- to set
-
getMinLat
- Returns:
- minLat
-
setMinLat
- Parameters:
minLat- to set
-
getMaxLat
- Returns:
- maxLat
-
setMaxLat
- Parameters:
maxLat- to set
-
getMinLng
- Returns:
- minLng
-
setMinLng
- Parameters:
minLng- to set
-
getMaxLng
- Returns:
- maxLng
-
setMaxLng
- Parameters:
maxLng- to set
-
getMinDepth
- Returns:
- minDepth
-
setMinDepth
- Parameters:
minDepth- to set
-
getMaxDepth
- Returns:
- maxDepth
-
setMaxDepth
- Parameters:
maxDepth- to set
-
getEventSource
- Returns:
- eventSource
-
setEventSource
- Parameters:
eventSource- to set
-