Package edu.sc.seis.sod.hibernate
Class SodDB
java.lang.Object
edu.sc.seis.sod.hibernate.AbstractHibernateDB
edu.sc.seis.sod.hibernate.SodDB
public class SodDB extends AbstractHibernateDB
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
AT_LEAST_ONCE
static java.lang.String
AT_MOST_ONCE
static java.lang.Class<? extends AbstractEventChannelPair>
defaultEcpClass
java.lang.Class<? extends AbstractEventChannelPair>
ecpClass
Fields inherited from class edu.sc.seis.sod.hibernate.AbstractHibernateDB
DEBUG_SESSION_CREATION, DEBUG_SESSION_CREATION_SECONDS, sessionFactory
-
Constructor Summary
Constructors Modifier Constructor Description protected
SodDB()
database should use one of EventVectorPair or EventChannelPair. -
Method Summary
Modifier and Type Method Description EventChannelPair
createEventChannelPair(edu.sc.seis.sod.model.event.StatefulEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Channel chan, EventStationPair esp)
EventNetworkPair
createEventNetworkPair(edu.sc.seis.sod.model.event.StatefulEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Network net)
EventStationPair
createEventStationPair(edu.sc.seis.sod.model.event.StatefulEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Station station)
static java.lang.Class<? extends AbstractEventChannelPair>
discoverDbEcpClass()
java.util.List<AbstractEventChannelPair>
getAll(edu.sc.seis.sod.model.event.CacheEvent event)
SodConfig
getConfig(int configid)
SodConfig
getCurrentConfig()
edu.sc.seis.sod.model.common.Version
getDBVersion()
EventChannelPair
getECP(edu.sc.seis.sod.model.event.CacheEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Channel chan)
java.lang.Class<? extends AbstractEventChannelPair>
getEcpClass()
java.util.List<edu.sc.seis.sod.model.event.CacheEvent>
getEventsForStation(edu.sc.seis.seisFile.fdsnws.stationxml.Station sta)
EventStationPair
getEventStationPair(edu.sc.seis.sod.model.event.CacheEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Station station)
java.util.List<AbstractEventChannelPair>
getFailed(edu.sc.seis.seisFile.fdsnws.stationxml.Station station)
java.util.List<AbstractEventChannelPair>
getFailed(edu.sc.seis.sod.model.event.CacheEvent event)
java.util.List<AbstractEventChannelPair>
getFailed(edu.sc.seis.sod.model.event.CacheEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Station station)
int
getMaxRetries()
java.time.Duration
getMinRetryDelay()
AbstractEventChannelPair
getNextECP()
next successful event-channel to process.AbstractEventChannelPair
getNextECPFromCache()
next successful event-station to process from memory cache.EventNetworkPair
getNextENP()
next successful event-network to process.EventNetworkPair
getNextENPFromCache()
next successful event-network to process from cache.EventStationPair
getNextESP()
next successful event-station to process.EventStationPair
getNextESPFromCache()
next successful event-station to process from memory cache.AbstractEventChannelPair
getNextRetryECPFromCache()
int
getNumEventNetworkWorkUnits(edu.sc.seis.sod.model.status.Standing standing)
int
getNumFailed(edu.sc.seis.seisFile.fdsnws.stationxml.Station station)
int
getNumFailed(edu.sc.seis.sod.model.event.CacheEvent event)
int
getNumFailed(edu.sc.seis.sod.model.event.CacheEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Station station)
int
getNumRetry(edu.sc.seis.seisFile.fdsnws.stationxml.Station station)
int
getNumRetry(edu.sc.seis.sod.model.event.CacheEvent event)
int
getNumRetry(edu.sc.seis.sod.model.event.CacheEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Station station)
int
getNumSuccessful()
int
getNumSuccessful(edu.sc.seis.seisFile.fdsnws.stationxml.Station station)
int
getNumSuccessful(edu.sc.seis.sod.model.event.CacheEvent event)
int
getNumSuccessful(edu.sc.seis.sod.model.event.CacheEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Station station)
int
getNumWorkUnits(edu.sc.seis.sod.model.status.Standing standing)
QueryTime
getQueryTime(java.lang.String serverName)
java.util.List<AbstractEventChannelPair>
getRetry(edu.sc.seis.seisFile.fdsnws.stationxml.Station station)
java.util.List<AbstractEventChannelPair>
getRetry(edu.sc.seis.sod.model.event.CacheEvent event)
java.util.List<AbstractEventChannelPair>
getRetry(edu.sc.seis.sod.model.event.CacheEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Station station)
java.util.List<AbstractEventChannelPair>
getRetryToDo()
static SodDB
getSingleton()
java.util.List<edu.sc.seis.seisFile.fdsnws.stationxml.Station>
getStationsForEvent(edu.sc.seis.sod.model.event.CacheEvent event)
java.util.List<AbstractEventChannelPair>
getSuccessful(edu.sc.seis.seisFile.fdsnws.stationxml.Station station)
java.util.List<AbstractEventChannelPair>
getSuccessful(edu.sc.seis.sod.model.event.CacheEvent event)
java.util.List<AbstractEventChannelPair>
getSuccessful(edu.sc.seis.sod.model.event.CacheEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Station station)
java.util.List<EventStationPair>
getSuccessfulESPForEvent(edu.sc.seis.sod.model.event.CacheEvent event)
java.util.List<EventStationPair>
getSuccessfulESPForStation(edu.sc.seis.seisFile.fdsnws.stationxml.Station sta)
java.util.List<edu.sc.seis.sod.model.event.StatefulEvent>
getSuccessfulEventsForStation(edu.sc.seis.seisFile.fdsnws.stationxml.Station sta)
java.util.List<edu.sc.seis.seisFile.fdsnws.stationxml.Station>
getSuccessfulStationsForEvent(edu.sc.seis.sod.model.event.CacheEvent event)
java.util.List<edu.sc.seis.sod.model.event.CacheEvent>
getUnsuccessfulEventsForStation(edu.sc.seis.seisFile.fdsnws.stationxml.Station sta)
java.util.List<edu.sc.seis.seisFile.fdsnws.stationxml.Station>
getUnsuccessfulStationsForEvent(edu.sc.seis.sod.model.event.CacheEvent event)
void
initHQLStmts()
boolean
isECPTodo()
boolean
isENPTodo()
boolean
isESPTodo()
boolean
isRetryTodo()
java.util.List<EventStationPair>
loadESPForNetwork(edu.sc.seis.sod.model.event.StatefulEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Network net)
void
offerEventChannelPair(java.util.List<AbstractEventChannelPair> chanPairList)
void
offerEventNetworkPairs(java.util.List<EventNetworkPair> staPairList)
void
offerEventStationPair(java.util.List<EventStationPair> staPairList)
void
populateECPToDo()
void
populateENPToDo()
void
populateESPToDo()
void
populateRetryToDo()
EventVectorPair
put(EventVectorPair eventVectorPair)
int
putConfig(SodConfig sodConfig)
protected edu.sc.seis.sod.model.common.Version
putDBVersion()
int
putQueryTime(QueryTime qtime)
void
reopenSuspendedEventChannelPairs(java.lang.String processingRule, boolean vector)
static void
setDefaultEcpClass(java.lang.Class<? extends AbstractEventChannelPair> ecpClass)
Methods inherited from class edu.sc.seis.sod.hibernate.AbstractHibernateDB
commit, createSession, flush, getReadOnlySession, getSession, getSessionFactory, getTXID, getUnitCache, intern, internUnit, internUnit, isSessionOpen, rollback
-
Field Details
-
defaultEcpClass
-
ecpClass
-
AT_LEAST_ONCE
public static final java.lang.String AT_LEAST_ONCE- See Also:
- Constant Field Values
-
AT_MOST_ONCE
public static final java.lang.String AT_MOST_ONCE- See Also:
- Constant Field Values
-
-
Constructor Details
-
SodDB
protected SodDB()database should use one of EventVectorPair or EventChannelPair. Using AbstractEventChannelPair results in very slow union in selects in hsqldb. By specifying which table we are using, the queries are several orders of magnitude faster and do not use huge amounts of memory, which matters a lot when the number of ecps becomes large.
-
-
Method Details
-
reopenSuspendedEventChannelPairs
public void reopenSuspendedEventChannelPairs(java.lang.String processingRule, boolean vector) -
createEventNetworkPair
public EventNetworkPair createEventNetworkPair(edu.sc.seis.sod.model.event.StatefulEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Network net) -
offerEventNetworkPairs
-
offerEventStationPair
-
offerEventChannelPair
-
loadESPForNetwork
public java.util.List<EventStationPair> loadESPForNetwork(edu.sc.seis.sod.model.event.StatefulEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Network net) -
createEventStationPair
public EventStationPair createEventStationPair(edu.sc.seis.sod.model.event.StatefulEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Station station) -
createEventChannelPair
public EventChannelPair createEventChannelPair(edu.sc.seis.sod.model.event.StatefulEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Channel chan, EventStationPair esp) -
isECPTodo
public boolean isECPTodo() -
isESPTodo
public boolean isESPTodo() -
isENPTodo
public boolean isENPTodo() -
getNextENPFromCache
next successful event-network to process from cache. Returns null if no more events in cache. -
getNextENP
next successful event-network to process. Returns null if no more events. -
populateENPToDo
public void populateENPToDo() -
getNextESPFromCache
next successful event-station to process from memory cache. Returns null if no more esp in memory. -
getNextESP
next successful event-station to process. Returns null if no more events. -
populateESPToDo
public void populateESPToDo() -
populateECPToDo
public void populateECPToDo() -
getNextECPFromCache
next successful event-station to process from memory cache. Returns null if no more esp in memory. -
getNextECP
next successful event-channel to process. Returns null if no more events. -
getNextRetryECPFromCache
-
isRetryTodo
public boolean isRetryTodo() -
getRetryToDo
-
populateRetryToDo
public void populateRetryToDo() -
getNumWorkUnits
public int getNumWorkUnits(edu.sc.seis.sod.model.status.Standing standing) -
getNumEventNetworkWorkUnits
public int getNumEventNetworkWorkUnits(edu.sc.seis.sod.model.status.Standing standing) -
getECP
public EventChannelPair getECP(edu.sc.seis.sod.model.event.CacheEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Channel chan) -
put
-
getMinRetryDelay
public java.time.Duration getMinRetryDelay() -
getMaxRetries
public int getMaxRetries() -
getNumSuccessful
public int getNumSuccessful() -
getNumSuccessful
public int getNumSuccessful(edu.sc.seis.sod.model.event.CacheEvent event) -
getNumSuccessful
public int getNumSuccessful(edu.sc.seis.seisFile.fdsnws.stationxml.Station station) -
getNumSuccessful
public int getNumSuccessful(edu.sc.seis.sod.model.event.CacheEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Station station) -
getNumFailed
public int getNumFailed(edu.sc.seis.seisFile.fdsnws.stationxml.Station station) -
getNumFailed
public int getNumFailed(edu.sc.seis.sod.model.event.CacheEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Station station) -
getNumFailed
public int getNumFailed(edu.sc.seis.sod.model.event.CacheEvent event) -
getNumRetry
public int getNumRetry(edu.sc.seis.seisFile.fdsnws.stationxml.Station station) -
getNumRetry
public int getNumRetry(edu.sc.seis.sod.model.event.CacheEvent event) -
getNumRetry
public int getNumRetry(edu.sc.seis.sod.model.event.CacheEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Station station) -
getAll
public java.util.List<AbstractEventChannelPair> getAll(edu.sc.seis.sod.model.event.CacheEvent event) -
getSuccessful
public java.util.List<AbstractEventChannelPair> getSuccessful(edu.sc.seis.sod.model.event.CacheEvent event) -
getSuccessful
public java.util.List<AbstractEventChannelPair> getSuccessful(edu.sc.seis.seisFile.fdsnws.stationxml.Station station) -
getSuccessful
public java.util.List<AbstractEventChannelPair> getSuccessful(edu.sc.seis.sod.model.event.CacheEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Station station) -
getFailed
public java.util.List<AbstractEventChannelPair> getFailed(edu.sc.seis.seisFile.fdsnws.stationxml.Station station) -
getFailed
public java.util.List<AbstractEventChannelPair> getFailed(edu.sc.seis.sod.model.event.CacheEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Station station) -
getFailed
public java.util.List<AbstractEventChannelPair> getFailed(edu.sc.seis.sod.model.event.CacheEvent event) -
getRetry
public java.util.List<AbstractEventChannelPair> getRetry(edu.sc.seis.seisFile.fdsnws.stationxml.Station station) -
getRetry
public java.util.List<AbstractEventChannelPair> getRetry(edu.sc.seis.sod.model.event.CacheEvent event) -
getRetry
public java.util.List<AbstractEventChannelPair> getRetry(edu.sc.seis.sod.model.event.CacheEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Station station) -
getStationsForEvent
public java.util.List<edu.sc.seis.seisFile.fdsnws.stationxml.Station> getStationsForEvent(edu.sc.seis.sod.model.event.CacheEvent event) -
getEventStationPair
public EventStationPair getEventStationPair(edu.sc.seis.sod.model.event.CacheEvent event, edu.sc.seis.seisFile.fdsnws.stationxml.Station station) -
getSuccessfulStationsForEvent
public java.util.List<edu.sc.seis.seisFile.fdsnws.stationxml.Station> getSuccessfulStationsForEvent(edu.sc.seis.sod.model.event.CacheEvent event) -
getUnsuccessfulStationsForEvent
public java.util.List<edu.sc.seis.seisFile.fdsnws.stationxml.Station> getUnsuccessfulStationsForEvent(edu.sc.seis.sod.model.event.CacheEvent event) -
getSuccessfulESPForEvent
public java.util.List<EventStationPair> getSuccessfulESPForEvent(edu.sc.seis.sod.model.event.CacheEvent event) -
getEventsForStation
public java.util.List<edu.sc.seis.sod.model.event.CacheEvent> getEventsForStation(edu.sc.seis.seisFile.fdsnws.stationxml.Station sta) -
getSuccessfulESPForStation
public java.util.List<EventStationPair> getSuccessfulESPForStation(edu.sc.seis.seisFile.fdsnws.stationxml.Station sta) -
getSuccessfulEventsForStation
public java.util.List<edu.sc.seis.sod.model.event.StatefulEvent> getSuccessfulEventsForStation(edu.sc.seis.seisFile.fdsnws.stationxml.Station sta) -
getUnsuccessfulEventsForStation
public java.util.List<edu.sc.seis.sod.model.event.CacheEvent> getUnsuccessfulEventsForStation(edu.sc.seis.seisFile.fdsnws.stationxml.Station sta) -
putConfig
-
getCurrentConfig
-
getConfig
-
getQueryTime
-
putQueryTime
-
getDBVersion
public edu.sc.seis.sod.model.common.Version getDBVersion() -
putDBVersion
protected edu.sc.seis.sod.model.common.Version putDBVersion() -
initHQLStmts
public void initHQLStmts() -
discoverDbEcpClass
-
setDefaultEcpClass
public static void setDefaultEcpClass(java.lang.Class<? extends AbstractEventChannelPair> ecpClass) -
getEcpClass
-
getSingleton
-