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 String
Property for archive event sourcestatic final String
Deprecated.static final String
Property for archive maximum depthstatic final String
Property for archive maximum event agestatic final String
Property for archive maximum event timestatic final String
Property for archive maximum latitudestatic final String
Property for archive maximum longitudestatic final String
Property for archive maximum magstatic final String
Deprecated.static final String
Property for archive minimum depthstatic final String
Property for archive minimum event agestatic final String
Property for archive minimum event timestatic final String
Property for archive minimum latitudestatic final String
Property for archive minimum longitudestatic final String
Property for archive minimum magprotected String
Configured parameter var for eventSourceprotected Long
Deprecated.protected BigDecimal
Configured parameter var for maxDepthprotected Long
Configured parameter var for maxEventAgeprotected Long
Configured parameter var for maxEventTimeprotected BigDecimal
Configured parameter var for maxLatprotected BigDecimal
Configured parameter var for maxLngprotected BigDecimal
Configured parameter var for maxMagprotected Long
Deprecated.protected BigDecimal
Configured parameter var for minDepthprotected Long
Configured parameter var for minEventAgeprotected Long
Configured parameter var for minEventTimeprotected BigDecimal
Configured parameter var for minLatprotected BigDecimal
Configured parameter var for minLngprotected BigDecimal
Configured parameter var for minMag -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Process configuration settings.Deprecated.Deprecated.boolean
protected BigDecimal
parseBigDecimal
(Config config, String name) Gets the property 'name' from config and returns a BigDecimal of itprotected Long
parseDateOrLong
(Config config, String name) Gets the property 'name' from config and returns a Date/Long of itprotected Long
Gets the property 'name' from config and returns a Long of itvoid
setEventSource
(String eventSource) void
Deprecated.void
setMaxDepth
(BigDecimal maxDepth) void
setMaxEventAge
(Long maxEventAge) void
setMaxEventTime
(Long maxEventTime) void
setMaxLat
(BigDecimal maxLat) void
setMaxLng
(BigDecimal maxLng) void
setMaxMag
(BigDecimal maxMag) void
Deprecated.void
setMinDepth
(BigDecimal minDepth) void
setMinEventAge
(Long minEventAge) void
setMinEventTime
(Long minEventTime) void
setMinLat
(BigDecimal minLat) void
setMinLng
(BigDecimal minLng) void
setMinMag
(BigDecimal minMag) void
shutdown()
Stop any processing/background threads.void
startup()
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:DefaultConfigurable
Process configuration settings. Called before startup().- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classDefaultConfigurable
- Parameters:
config
- the Config object with settings.- Throws:
Exception
- if configuration exceptions occur.
-
shutdown
Description copied from class:DefaultConfigurable
Stop any processing/background threads.- Specified by:
shutdown
in interfaceConfigurable
- Overrides:
shutdown
in classDefaultConfigurable
- Throws:
Exception
- if exceptions occur while starting.
-
startup
Description copied from class:DefaultConfigurable
Start any processing/background threads.- Specified by:
startup
in interfaceConfigurable
- Overrides:
startup
in 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
-