Class NonBlockingImportEntryProcessRunnable

    • Constructor Detail

      • NonBlockingImportEntryProcessRunnable

        public NonBlockingImportEntryProcessRunnable()
    • Method Detail

      • processAsync

        public abstract CompletableFuture<?> processAsync​(ImportEntry importEntry)
                                                   throws Exception
        Method that handles asynchronous task execution. It should return a CompletableFuture. When the CompletableFuture is completed, the Import Entry will be marked as processed if it was properly processed. Otherwise, if the CompletableFuture thrown some exception or there was an error, it will be marked with Error. Exceptions should be thrown when the processing of the ImportEntry must fail. This way it is properly handled by the processEntry method and the ImportEntry is properly marked with an Error state and an Error message
        importEntry - Import Entry to process
        a CompletableFuture
      • postProcessEntry

        protected void postProcessEntry​(String importEntryId,
                                        long t0,
                                        ImportEntry localImportEntry,
                                        String typeOfData)
        Description copied from class: ImportEntryProcessor.ImportEntryProcessRunnable
        Method that is executed after processing an Import Entry, it is provided as protected because it might be useful to override it in certain cases where logic needs to be executed before/after the main postProcess. This handles marking the ImportEntry as processed and removing it from the queued list of import entries being processed.
        postProcessEntry in class ImportEntryProcessor.ImportEntryProcessRunnable
        importEntryId - Id of the import entry being processed
        t0 - Original timestamp when the import entry started processing
        localImportEntry - Import entry being processed
        typeOfData - The type of the import entry
      • getExecutorService

        protected ExecutorService getExecutorService()
        Retrieves the executor service where non-blocking execution is expected to be executed
        An executor service with non-blocking threads