Class MySQLSpecifics


  • public class MySQLSpecifics
    extends DBSpecifics
    MySQL-specific implementation of DB methods.
    • Constructor Detail

      • MySQLSpecifics

        public MySQLSpecifics()
    • Method Detail

      • getInstance

        public static DBSpecifics getInstance()
        Get an instance of the MySQL specifics class.
        Returns:
        Instance of the MySQL specifics class.
      • getJobConfigsTmpTable

        public String getJobConfigsTmpTable​(Connection c)
                                     throws SQLException
        Get a temporary table for short-time use. The table should be disposed of with dropTemporaryTable. The table has two columns domain_name varchar(Constants.MAX_NAME_SIZE) config_name varchar(Constants.MAX_NAME_SIZE)
        Specified by:
        getJobConfigsTmpTable in class DBSpecifics
        Parameters:
        c - The DB connection to use.
        Returns:
        The name of the created table
        Throws:
        SQLException - if there is a problem getting the table.
      • dropJobConfigsTmpTable

        public void dropJobConfigsTmpTable​(Connection c,
                                           String tableName)
        Dispose of a temporary table created with getTemporaryTable. This can be expected to be called from within a finally clause, so it mustn't throw exceptions.
        Specified by:
        dropJobConfigsTmpTable in class DBSpecifics
        Parameters:
        c - The DB connection to use.
        tableName - The name of the temporary table
      • getDriverClassName

        public String getDriverClassName()
        Get the name of the JDBC driver class that handles interfacing to this server.
        Specified by:
        getDriverClassName in class DBSpecifics
        Returns:
        The name of a JDBC driver class
      • migrateJobsv3tov4

        protected void migrateJobsv3tov4()
        Migrates the 'jobs' table from version 3 to version 4 consisting of a change of the field forcemaxbytes from int to bigint and setting its default to -1. Furthermore the default value for field num_configs is set to 0.
        Specified by:
        migrateJobsv3tov4 in class DBSpecifics
        Throws:
        IOFailure - in case of problems in interacting with the database
      • migrateJobsv4tov5

        protected void migrateJobsv4tov5()
        Migrates the 'jobs' table from version 4 to version 5 consisting of adding new fields 'resubmitted_as_job' and 'submittedDate'.
        Specified by:
        migrateJobsv4tov5 in class DBSpecifics
        Throws:
        IOFailure - in case of problems in interacting with the database
      • migrateConfigurationsv3ov4

        protected void migrateConfigurationsv3ov4()
        Migrates the 'configurations' table from version 3 to version 4. This consists of altering the default value of field 'maxbytes' to -1.
        Specified by:
        migrateConfigurationsv3ov4 in class DBSpecifics
      • migrateFullharvestsv2tov3

        protected void migrateFullharvestsv2tov3()
        Migrates the 'fullharvests' table from version 2 to version 3. This consists of altering the default value of field 'maxbytes' to -1
        Specified by:
        migrateFullharvestsv2tov3 in class DBSpecifics
      • createGlobalCrawlerTrapLists

        protected void createGlobalCrawlerTrapLists()
        Creates the initial (version 1) of table 'global_crawler_trap_lists'.
        Specified by:
        createGlobalCrawlerTrapLists in class DBSpecifics
      • createGlobalCrawlerTrapExpressions

        protected void createGlobalCrawlerTrapExpressions()
        Creates the initial (version 1) of table 'global_crawler_trap_expressions'.
        Specified by:
        createGlobalCrawlerTrapExpressions in class DBSpecifics
      • supportsClob

        public boolean supportsClob()
        Description copied from class: DBSpecifics
        Returns true if the target RDBMS supports CLOBs. If possible seedlists will be stored as CLOBs.
        Specified by:
        supportsClob in class DBSpecifics
        Returns:
        true if CLOBs are supported, false otherwise.
      • getOrderByLimitAndOffsetSubClause

        public String getOrderByLimitAndOffsetSubClause​(long limit,
                                                        long offset)
        Description copied from class: DBSpecifics
        Formats the LIMIT sub-clause of an SQL order clause. This sub-clause allows to paginate query results and its syntax might be dependant on the target RDBMS
        Specified by:
        getOrderByLimitAndOffsetSubClause in class DBSpecifics
        Parameters:
        limit - the maximum number of rows to fetch.
        offset - the starting offset in the full query results.
        Returns:
        the proper sub-clause.
      • migrateRunningJobsHistoryTableV1ToV2

        protected void migrateRunningJobsHistoryTableV1ToV2()
        Migrates the 'runningjobshistory' table from version 1 to version 2. This consists of adding the new column 'retiredQueuesCount'.
        Specified by:
        migrateRunningJobsHistoryTableV1ToV2 in class DBSpecifics
      • migrateRunningJobsMonitorTableV1ToV2

        protected void migrateRunningJobsMonitorTableV1ToV2()
        Migrates the 'runningjobsmonitor' table from version 1 to version 2. This consists of adding the new column 'retiredQueuesCount'.
        Specified by:
        migrateRunningJobsMonitorTableV1ToV2 in class DBSpecifics
      • migrateDomainsv2tov3

        protected void migrateDomainsv2tov3()
        Description copied from class: DBSpecifics
        Migrates the 'domains' table from version 2 to version 3. This consists of altering the type of the crawlertraps column to "text" in postgres, and noop in derbyDB
        Specified by:
        migrateDomainsv2tov3 in class DBSpecifics
      • migrateConfigurationsv4tov5

        protected void migrateConfigurationsv4tov5()
        Description copied from class: DBSpecifics
        Migrates the 'configurations' table from version 4 to version 5. This consists of altering the field 'maxobjects' from being an int to a bigint.
        Specified by:
        migrateConfigurationsv4tov5 in class DBSpecifics
      • migrateFullharvestsv3tov4

        protected void migrateFullharvestsv3tov4()
        Description copied from class: DBSpecifics
        Migrates the 'fullharvests' table from version 3 to version 4. This consists of adding the field 'maxjobrunningtime'.
        Specified by:
        migrateFullharvestsv3tov4 in class DBSpecifics
      • migrateJobsv5tov6

        protected void migrateJobsv5tov6()
        Description copied from class: DBSpecifics
        Migrates the 'jobs' table from version 5 to version 6. Adds the field 'forcemaxrunningtime'.
        Specified by:
        migrateJobsv5tov6 in class DBSpecifics
      • migrateFullharvestsv4tov5

        protected void migrateFullharvestsv4tov5()
        Description copied from class: DBSpecifics
        Migrates the 'fullharvests' table from version 4 to version 5. This consists of adding the field 'isindexready'.
        Specified by:
        migrateFullharvestsv4tov5 in class DBSpecifics
      • migrateJobsv6tov7

        protected void migrateJobsv6tov7()
        Description copied from class: DBSpecifics
        Migrates the 'jobs' table from version 6 to version 7 consisting of adding the bigint fieldcontinuationof with null as default.
        Specified by:
        migrateJobsv6tov7 in class DBSpecifics
      • migrateJobsv7tov8

        protected void migrateJobsv7tov8()
        Description copied from class: DBSpecifics
        Migrates the 'jobs' table from version 7 to version 8 consisting of adding the date creationdate with null as default.
        Specified by:
        migrateJobsv7tov8 in class DBSpecifics
      • migrateJobsv8tov9

        protected void migrateJobsv8tov9()
        Description copied from class: DBSpecifics
        Migrates the 'jobs' table from version 8 to version 9 consisting of adding the string harvestname_prefix with null as default.
        Specified by:
        migrateJobsv8tov9 in class DBSpecifics
      • migrateHarvestdefinitionsv2tov3

        protected void migrateHarvestdefinitionsv2tov3()
        Description copied from class: DBSpecifics
        Migrates the 'harvestdefinitions' table from version 2 to version 3 consisting of adding the string audience with null as default.
        Specified by:
        migrateHarvestdefinitionsv2tov3 in class DBSpecifics
      • migrateHarvestdefinitionsv3tov4

        protected void migrateHarvestdefinitionsv3tov4()
        Description copied from class: DBSpecifics
        Migrates the 'harvestdefinitions' table from version 3 to version 4 consisting of adding the bigint channel_id field.
        Specified by:
        migrateHarvestdefinitionsv3tov4 in class DBSpecifics
      • migrateJobsv9tov10

        protected void migrateJobsv9tov10()
        Description copied from class: DBSpecifics
        Migrates the 'jobs' table from version 9 to version 10 consisting of adding the channel (varchar 300) and a 'snapshot'
        Specified by:
        migrateJobsv9tov10 in class DBSpecifics
      • migrateExtendedFieldTableV1toV2

        protected void migrateExtendedFieldTableV1toV2()
        Migrates the 'ExtendedFieldTable' from version 1 to version 2 consisting of adding the maxlen field
        Specified by:
        migrateExtendedFieldTableV1toV2 in class DBSpecifics
      • migrateExtendedFieldTableValueV1toV2

        protected void migrateExtendedFieldTableValueV1toV2()
        Migrates the 'ExtendedFieldValueTable' from version 1 to version 2 changing the maxlen of content to 30000
        Specified by:
        migrateExtendedFieldTableValueV1toV2 in class DBSpecifics
      • migrateOrderTemplatesTablev1tov2

        protected void migrateOrderTemplatesTablev1tov2()
        Description copied from class: DBSpecifics
        Migrates the table 'ordertemplates' from version 1 to version 2, adding a boolean 'isActive" flag.
        Specified by:
        migrateOrderTemplatesTablev1tov2 in class DBSpecifics
      • createEavTypeAttributeTable

        public void createEavTypeAttributeTable​(int toVersion)
        Description copied from class: DBSpecifics
        Create the EavTypeAttribute table in the database.
        Specified by:
        createEavTypeAttributeTable in class DBSpecifics
      • createEavAttributeTable

        public void createEavAttributeTable​(int toVersion)
        Description copied from class: DBSpecifics
        Create the EavAttributeTable table in the database.
        Specified by:
        createEavAttributeTable in class DBSpecifics