Class ReindexResourceDAO

    • Method Detail

      • getTranslator

        protected IDatabaseTranslator getTranslator()
        Getter for the translator currently held by this DAO
        Returns:
      • getNextResource

        protected ResourceIndexRecord getNextResource​(SecureRandom random,
                                                      Instant reindexTstamp,
                                                      Integer resourceTypeId,
                                                      String logicalId)
                                               throws Exception
        Pick the next resource to process resource and lock it. Specializations for different databases may use different techniques to optimize locking/concurrency control
        Parameters:
        reindexTstamp -
        Returns:
        Throws:
        Exception
      • getResourceToReindex

        public ResourceIndexRecord getResourceToReindex​(Instant reindexTstamp,
                                                        Integer resourceTypeId,
                                                        String logicalId)
                                                 throws Exception
        Get the resource record we want to reindex. This might take a few attempts, because there could be hundreds of threads all trying to do the same thing, and we may see collisions which will cause the FOR UPDATE to block, then return no rows.
        Parameters:
        reindexTstamp -
        resourceCount -
        Returns:
        the resource record, or null when there is nothing left to do
        Throws:
        Exception
      • updateParameters

        public void updateParameters​(String tablePrefix,
                                     List<ExtractedParameterValue> parameters,
                                     String logicalId,
                                     long logicalResourceId)
                              throws Exception
        Reindex the resource by deleting existing parameters and replacing them with those passed in.
        Parameters:
        tablePrefix - the table prefix
        parameters - the extracted parameters
        logicalId - the logical id
        logicalResourceId - the logical resource id
        Throws:
        Exception
      • deleteFromParameterTable

        protected void deleteFromParameterTable​(Connection conn,
                                                String tableName,
                                                long logicalResourceId)
                                         throws SQLException
        Delete all parameters for the given resourceId from the parameters table
        Parameters:
        conn -
        tableName -
        logicalResourceId -
        Throws:
        SQLException