Ingestion Framework
Child pages (Children Display) |
---|
Custom ETL (Extract, Transform, Load) implementation that facilitates the ingestion and processing of content from different data sources so this content can be made available through the Discovery API.
...
Examples of clean up implementations:
- Delete seed scan/failure indexes
- Delete remaining cache in disk
The actual clean up implementation does nothing, the class to process the job is created to be replaced. The default implementation locations is SeedCleanUpProcessor
You can replace this default behavior based on Bean Replacement of Micronaut, for example:
Default class
@Singleton
@Named(SeedCleanUpRequest.TASK_NAME + MaintenanceProcessor.BEAN_SUFFIX)
public class SeedCleanUpProcessor implements MaintenanceProcessor<SeedCleanUpRequest> {
@Override
public void execute(SeedCleanUpRequest config) {
// Implement the necessary clean up seed
}
}
New class implementing indexes delete
@Replaces(SeedCleanUpProcessor.class)
@Singleton
@Named(SeedCleanUpRequest.TASK_NAME + MaintenanceProcessor.BEAN_SUFFIX)
public class SeedCleanUpIndexesProcessor implements MaintenanceProcessor<SeedCleanUpRequest> {
@Inject
protected ElasticsearchSimpleClient elasticsearchSimpleClient;
@Override
public void execute(SeedCleanUpRequest config) {
elasticsearchSimpleClient.deleteIndex(String.format("scan.%s", config.getSeedId()));
elasticsearchSimpleClient.deleteIndex(String.format("failures.%s", config.getSeedId()));
}
}
The example above shows how to replace the class SeedCleanUpProcessor
with SeedCleanUpIndexesProcessor
.
...