Class SodDB


  • public class SodDB
    extends edu.sc.seis.fissuresUtil.hibernate.AbstractHibernateDB
    • Constructor Detail

      • 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 Detail

      • configHibernate

        public static void configHibernate​(org.hibernate.cfg.Configuration config)
      • reopenSuspendedEventChannelPairs

        public void reopenSuspendedEventChannelPairs​(java.lang.String processingRule,
                                                     boolean vector)
      • createEventNetworkPair

        public EventNetworkPair createEventNetworkPair​(StatefulEvent event,
                                                       edu.iris.Fissures.network.NetworkAttrImpl net)
      • offerEventNetworkPairs

        public void offerEventNetworkPairs​(java.util.List<EventNetworkPair> staPairList)
      • offerEventStationPair

        public void offerEventStationPair​(java.util.List<EventStationPair> staPairList)
      • loadESPForNetwork

        public java.util.List<EventStationPair> loadESPForNetwork​(StatefulEvent event,
                                                                  edu.iris.Fissures.network.NetworkAttrImpl net)
      • createEventStationPair

        public EventStationPair createEventStationPair​(StatefulEvent event,
                                                       edu.iris.Fissures.network.StationImpl station)
      • isECPTodo

        public boolean isECPTodo()
      • isESPTodo

        public boolean isESPTodo()
      • isENPTodo

        public boolean isENPTodo()
      • getNextENPFromCache

        public EventNetworkPair getNextENPFromCache()
        next successful event-network to process from cache. Returns null if no more events in cache.
      • getNextENP

        public EventNetworkPair getNextENP()
        next successful event-network to process. Returns null if no more events.
      • populateENPToDo

        public void populateENPToDo()
      • getNextESPFromCache

        public EventStationPair getNextESPFromCache()
        next successful event-station to process from memory cache. Returns null if no more esp in memory.
      • getNextESP

        public EventStationPair getNextESP()
        next successful event-station to process. Returns null if no more events.
      • populateESPToDo

        public void populateESPToDo()
      • populateECPToDo

        public void populateECPToDo()
      • getNextECPFromCache

        public AbstractEventChannelPair getNextECPFromCache()
        next successful event-station to process from memory cache. Returns null if no more esp in memory.
      • getNextECP

        public AbstractEventChannelPair getNextECP()
        next successful event-channel to process. Returns null if no more events.
      • isRetryTodo

        public boolean isRetryTodo()
      • populateRetryToDo

        public void populateRetryToDo()
      • getNumWorkUnits

        public int getNumWorkUnits​(Standing standing)
      • getNumEventNetworkWorkUnits

        public int getNumEventNetworkWorkUnits​(Standing standing)
      • getECP

        public EventChannelPair getECP​(edu.sc.seis.fissuresUtil.cache.CacheEvent event,
                                       edu.iris.Fissures.network.ChannelImpl chan)
      • getMinRetryDelay

        public edu.iris.Fissures.model.TimeInterval getMinRetryDelay()
      • getMaxRetries

        public int getMaxRetries()
      • getNumSuccessful

        public int getNumSuccessful()
      • getNumSuccessful

        public int getNumSuccessful​(edu.sc.seis.fissuresUtil.cache.CacheEvent event)
      • getNumSuccessful

        public int getNumSuccessful​(edu.iris.Fissures.network.StationImpl station)
      • getNumSuccessful

        public int getNumSuccessful​(edu.sc.seis.fissuresUtil.cache.CacheEvent event,
                                    edu.iris.Fissures.network.StationImpl station)
      • getNumFailed

        public int getNumFailed​(edu.iris.Fissures.network.StationImpl station)
      • getNumFailed

        public int getNumFailed​(edu.sc.seis.fissuresUtil.cache.CacheEvent event,
                                edu.iris.Fissures.network.StationImpl station)
      • getNumFailed

        public int getNumFailed​(edu.sc.seis.fissuresUtil.cache.CacheEvent event)
      • getNumRetry

        public int getNumRetry​(edu.iris.Fissures.network.StationImpl station)
      • getNumRetry

        public int getNumRetry​(edu.sc.seis.fissuresUtil.cache.CacheEvent event)
      • getNumRetry

        public int getNumRetry​(edu.sc.seis.fissuresUtil.cache.CacheEvent event,
                               edu.iris.Fissures.network.StationImpl station)
      • getSuccessful

        public java.util.List<AbstractEventChannelPair> getSuccessful​(edu.sc.seis.fissuresUtil.cache.CacheEvent event)
      • getSuccessful

        public java.util.List<AbstractEventChannelPair> getSuccessful​(edu.iris.Fissures.network.StationImpl station)
      • getSuccessful

        public java.util.List<AbstractEventChannelPair> getSuccessful​(edu.sc.seis.fissuresUtil.cache.CacheEvent event,
                                                                      edu.iris.Fissures.network.StationImpl station)
      • getFailed

        public java.util.List<AbstractEventChannelPair> getFailed​(edu.iris.Fissures.network.StationImpl station)
      • getFailed

        public java.util.List<AbstractEventChannelPair> getFailed​(edu.sc.seis.fissuresUtil.cache.CacheEvent event,
                                                                  edu.iris.Fissures.network.StationImpl station)
      • getFailed

        public java.util.List<AbstractEventChannelPair> getFailed​(edu.sc.seis.fissuresUtil.cache.CacheEvent event)
      • getRetry

        public java.util.List<AbstractEventChannelPair> getRetry​(edu.iris.Fissures.network.StationImpl station)
      • getRetry

        public java.util.List<AbstractEventChannelPair> getRetry​(edu.sc.seis.fissuresUtil.cache.CacheEvent event)
      • getRetry

        public java.util.List<AbstractEventChannelPair> getRetry​(edu.sc.seis.fissuresUtil.cache.CacheEvent event,
                                                                 edu.iris.Fissures.network.StationImpl station)
      • getStationsForEvent

        public java.util.List<edu.iris.Fissures.network.StationImpl> getStationsForEvent​(edu.sc.seis.fissuresUtil.cache.CacheEvent event)
      • getSuccessfulStationsForEvent

        public java.util.List<edu.iris.Fissures.network.StationImpl> getSuccessfulStationsForEvent​(edu.sc.seis.fissuresUtil.cache.CacheEvent event)
      • getUnsuccessfulStationsForEvent

        public java.util.List<edu.iris.Fissures.network.StationImpl> getUnsuccessfulStationsForEvent​(edu.sc.seis.fissuresUtil.cache.CacheEvent event)
      • getEventsForStation

        public java.util.List<edu.sc.seis.fissuresUtil.cache.CacheEvent> getEventsForStation​(edu.iris.Fissures.network.StationImpl sta)
      • getSuccessfulEventsForStation

        public java.util.List<edu.sc.seis.fissuresUtil.cache.CacheEvent> getSuccessfulEventsForStation​(edu.iris.Fissures.network.StationImpl sta)
      • getUnsuccessfulEventsForStation

        public java.util.List<edu.sc.seis.fissuresUtil.cache.CacheEvent> getUnsuccessfulEventsForStation​(edu.iris.Fissures.network.StationImpl sta)
      • getRecordSectionItemForEvent

        public RecordSectionItem getRecordSectionItemForEvent​(edu.sc.seis.fissuresUtil.cache.CacheEvent event,
                                                              edu.iris.Fissures.network.ChannelImpl channel)
      • getRecordSectionId

        public java.util.List<java.lang.String> getRecordSectionId​(edu.sc.seis.fissuresUtil.cache.CacheEvent event)
        Finds the recordsectionids for this event
      • getRecordSectionOrientations

        public java.util.List<java.lang.String> getRecordSectionOrientations​(edu.sc.seis.fissuresUtil.cache.CacheEvent event)
        Finds the recordsection orientationids for this event
      • getRecordSectionItem

        public RecordSectionItem getRecordSectionItem​(java.lang.String orientationId,
                                                      java.lang.String recordSectionId,
                                                      edu.sc.seis.fissuresUtil.cache.CacheEvent event,
                                                      edu.iris.Fissures.network.ChannelImpl channel)
      • getStationsForRecordSection

        public java.util.List<edu.iris.Fissures.network.StationImpl> getStationsForRecordSection​(java.lang.String orientationId,
                                                                                                 java.lang.String recordSectionId,
                                                                                                 edu.sc.seis.fissuresUtil.cache.CacheEvent event,
                                                                                                 boolean best)
      • getChannelsForRecordSection

        public java.util.List<edu.iris.Fissures.network.ChannelImpl> getChannelsForRecordSection​(java.lang.String orientationId,
                                                                                                 edu.sc.seis.fissuresUtil.cache.CacheEvent event,
                                                                                                 boolean best)
      • getBestForRecordSection

        public java.util.List<RecordSectionItem> getBestForRecordSection​(java.lang.String orientationId,
                                                                         java.lang.String recordSectionId,
                                                                         edu.sc.seis.fissuresUtil.cache.CacheEvent event)
      • updateBestForRecordSection

        public boolean updateBestForRecordSection​(java.lang.String orientationId,
                                                  java.lang.String recordSectionId,
                                                  edu.sc.seis.fissuresUtil.cache.CacheEvent event,
                                                  edu.iris.Fissures.IfNetwork.ChannelId[] channelIds)
      • getRecordSectionItemList

        public java.util.List<RecordSectionItem> getRecordSectionItemList​(java.lang.String orientationId,
                                                                          java.lang.String recordSectionId,
                                                                          edu.sc.seis.fissuresUtil.cache.CacheEvent event)
      • recordSectionsForEvent

        public java.util.List<RecordSectionItem> recordSectionsForEvent​(edu.sc.seis.fissuresUtil.cache.CacheEvent event)
      • putConfig

        public int putConfig​(SodConfig sodConfig)
      • getCurrentConfig

        public SodConfig getCurrentConfig()
      • getConfig

        public SodConfig getConfig​(int configid)
      • getQueryTime

        public QueryTime getQueryTime​(java.lang.String serverName,
                                      java.lang.String serverDNS)
      • putQueryTime

        public int putQueryTime​(QueryTime qtime)
      • getDBVersion

        public Version getDBVersion()
      • putDBVersion

        protected Version putDBVersion()
      • initHQLStmts

        public void initHQLStmts()
      • setDefaultEcpClass

        public static void setDefaultEcpClass​(java.lang.Class<? extends AbstractEventChannelPair> ecpClass)
      • getSingleton

        public static SodDB getSingleton()