Class DBHandler


  • public class DBHandler
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      DBHandler​(int size, IDGenerator gen)
      constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addToDB​(MemQ chunk)
      thread run method stores pages from chunk to the system store
      void emptySystemStore()
      Deletes contents of table associated with queue
      PESConnector getConnect()  
      void initialize​(java.lang.String sDBName, java.lang.String jdbcLogin, java.lang.String jdbcPassword, java.lang.String sTblName)
      Initializes the system store parameters
      boolean isStoreEmpty()  
      void terminate()
      terminates the system store operation
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • size

        protected int size
      • bDirty

        protected static boolean bDirty
      • pageSize

        protected int pageSize
    • Constructor Detail

      • DBHandler

        public DBHandler​(int size,
                         IDGenerator gen)
                  throws java.lang.Exception
        constructor
        Parameters:
        size - threshold if loading pagesize if storing
        gen -
        Throws:
        java.lang.Exception
    • Method Detail

      • initialize

        public void initialize​(java.lang.String sDBName,
                               java.lang.String jdbcLogin,
                               java.lang.String jdbcPassword,
                               java.lang.String sTblName)
                        throws java.lang.Exception
        Initializes the system store parameters
        Parameters:
        sDBName - system store database name
        jdbcLogin - username to connect to the db
        jdbcPassword - password to connect to the db
        sTblName - table name
        Throws:
        java.lang.Exception - if system store is not initialized properly
      • terminate

        public void terminate()
        terminates the system store operation
      • isStoreEmpty

        public boolean isStoreEmpty()
      • emptySystemStore

        public void emptySystemStore()
                              throws java.lang.Exception
        Deletes contents of table associated with queue
        Throws:
        java.lang.Exception
      • addToDB

        public void addToDB​(MemQ chunk)
                     throws java.lang.Exception
        thread run method stores pages from chunk to the system store
        Throws:
        java.lang.Exception