Class ImportEntryManager

    • Constructor Detail

      • ImportEntryManager

        public ImportEntryManager()
    • Method Detail

      • isShutDown

        public boolean isShutDown()
        Returns:
        true if the ImportEntryManager is shut down. Otherwise false is returned. The ImportEntryManager can be shut down because of any of these reasons: 1- The shutdown() method has been invoked
        2- In a clustered environment, the current node is not in charge of handling import entries
      • start

        public void start()
      • getNumberOfQueuedTasks

        public long getNumberOfQueuedTasks()
      • getNumberOfActiveTasks

        public long getNumberOfActiveTasks()
      • isExecutorRunning

        public boolean isExecutorRunning()
      • notifyStartProcessingInCluster

        public void notifyStartProcessingInCluster()
        This method is used to set the cluster service into an state that indicates that it is currently processing import entries. Note that if we are not in a clustered environment, this method has no effect.
      • notifyEndProcessingInCluster

        public void notifyEndProcessingInCluster()
        This method is used to set the cluster service into an state that indicates that it is currently not processing import entries. Note that if we are not in a clustered environment, this method has no effect.
      • shutdown

        public void shutdown()
        Shutdown all the threads being used by the import framework
      • reportStats

        public void reportStats​(String typeOfData,
                                long timeForEntry)
      • notifyNewImportEntryCreated

        public void notifyNewImportEntryCreated()
        Is used to tell the import entry manager that a new entry was created in the import entry table, so it can go process it immediately.
        Specified by:
        notifyNewImportEntryCreated in interface ImportEntryManagerMBean
      • commitCurrentTransaction

        public void commitCurrentTransaction()
                                      throws SQLException
        Commits the current transaction if the current node is in charge of handling the import entries. This method is intended to be used by those import entry processors which need to commit their changes in the middle of the process. If processors don't use this method for committing the changes they can leave an inconsistent state in the system if a subsequent call to setImportEntryProcessed(String) detects that we are not in the node that should handle the import entries.
        Throws:
        OBException - if this method is invoked in a cluster node which is not handling the import entries
        SQLException
      • setImportEntryProcessed

        public void setImportEntryProcessed​(String importEntryId)
        Set the ImportEntry to status Processed in the same transaction as the caller.
        Throws:
        OBException - if the import entry can't be set as processed because the current cluster node is not in charge of processing import entries
      • setImportEntryError

        public void setImportEntryError​(String importEntryId,
                                        Throwable t)
        Set the ImportEntry to status Error in the same transaction as the caller.
      • isImportEntryError

        public boolean isImportEntryError​(String importEntryId)
        Returns whether the ImportEntry is in status Error in the same transaction as the caller.
      • setImportEntryErrorIndependent

        public void setImportEntryErrorIndependent​(String importEntryId,
                                                   Throwable t)
        Sets an ImportEntry in status Error but does this in its own transaction so not together with the original data. This is relevant when the previous transaction which tried to import the data fails.