use of org.obiba.mica.dataset.event.IndexDatasetsEvent in project mica2 by obiba.
the class ElasticsearchUpgrade method execute.
@Override
public void execute(Version version) {
log.info("Rebuild elasticsearch indices.");
cacheService.clearOpalTaxonomiesCache();
eventBus.post(new IndexStudiesEvent());
eventBus.post(new IndexFilesEvent());
eventBus.post(new IndexContactsEvent());
eventBus.post(new IndexNetworksEvent());
eventBus.post(new IndexDatasetsEvent());
}
use of org.obiba.mica.dataset.event.IndexDatasetsEvent in project mica2 by obiba.
the class Mica380Upgrade method execute.
@Override
public void execute(Version version) {
logger.info("Executing Mica upgrade to version 3.8.0");
cacheService.clearAllCaches();
eventBus.post(new DeleteTaxonomiesEvent());
try {
logger.info("Ensure Study taxonomy's investigator and contact vocabulary are of type `text`");
ensureVocabularyType(TaxonomyTarget.STUDY, "investigator", "contact");
} catch (RuntimeException e) {
logger.error("Error occurred when ensuring Study taxonomy's investigator and contact vocabulary are of type `text`.", e);
}
try {
logger.info("Ensure Network taxonomy's investigator and contact vocabulary are of type `text`");
ensureVocabularyType(TaxonomyTarget.NETWORK, "investigator", "contact");
} catch (RuntimeException e) {
logger.error("Error occurred when ensuring Network taxonomy's investigator and contact vocabulary are of type `text`.", e);
}
logger.info("Update all indices, this may take a long while...");
// TODO implement a queue so that indexing is done in order
eventBus.post(new IndexStudiesEvent());
eventBus.post(new IndexFilesEvent());
eventBus.post(new IndexContactsEvent());
eventBus.post(new IndexNetworksEvent());
eventBus.post(new IndexDatasetsEvent());
eventBus.post(new TaxonomiesUpdatedEvent());
}
use of org.obiba.mica.dataset.event.IndexDatasetsEvent in project mica2 by obiba.
the class MicaConfigResource method updateIndices.
@PUT
@Path("/_index")
@Timed
@RequiresRoles(Roles.MICA_ADMIN)
public Response updateIndices() {
eventBus.post(new IndexStudiesEvent());
eventBus.post(new IndexFilesEvent());
eventBus.post(new IndexContactsEvent());
eventBus.post(new IndexNetworksEvent());
eventBus.post(new IndexDatasetsEvent());
eventBus.post(new IndexProjectsEvent());
eventBus.post(new TaxonomiesUpdatedEvent());
return Response.noContent().build();
}
use of org.obiba.mica.dataset.event.IndexDatasetsEvent in project mica2 by obiba.
the class HarmonizationDatasetUpgrade method execute.
@Override
public void execute(Version version) {
log.info("Executing harmonization datasets network tables upgrade");
List<HarmonizationDataset> datasets = harmonizationDatasetRepository.findAll();
datasets.forEach(dataset -> {
int i = 0;
for (StudyTable st : dataset.getStudyTables()) {
st.setWeight(i++);
}
});
harmonizationDatasetRepository.save(datasets);
eventBus.post(new IndexDatasetsEvent());
}
Aggregations