Skip to content

Commit

Permalink
add singleStudyUnfiltered condition to cacheable clickhouse methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Lai committed Oct 24, 2024
1 parent b2ce990 commit 0a431c7
Showing 1 changed file with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.cbioportal.web.parameter.GenomicDataFilter;
import org.cbioportal.web.parameter.StudyViewFilter;
import org.cbioportal.web.columnar.util.CustomDataFilterUtil;
import org.cbioportal.web.util.StudyViewFilterUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
Expand Down Expand Up @@ -55,7 +56,7 @@ public StudyViewColumnarServiceImpl(StudyViewRepository studyViewRepository, Alt
// should condition = "@cacheEnabledConfig.getEnabledClickhouse() && #singleStudyUnfiltered"
@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse()"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
)
@Override
public List<Sample> getFilteredSamples(StudyViewFilter studyViewFilter) {
Expand All @@ -65,7 +66,7 @@ public List<Sample> getFilteredSamples(StudyViewFilter studyViewFilter) {

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse()"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
)
@Override
public List<AlterationCountByGene> getMutatedGenes(StudyViewFilter studyViewFilter) throws StudyNotFoundException {
Expand All @@ -74,7 +75,7 @@ public List<AlterationCountByGene> getMutatedGenes(StudyViewFilter studyViewFilt

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse()"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
)
@Override
public List<GenomicDataCount> getMolecularProfileSampleCounts(StudyViewFilter studyViewFilter) {
Expand All @@ -83,7 +84,7 @@ public List<GenomicDataCount> getMolecularProfileSampleCounts(StudyViewFilter st

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse()"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
)
@Override
public List<ClinicalEventTypeCount> getClinicalEventTypeCounts(StudyViewFilter studyViewFilter) {
Expand All @@ -92,7 +93,7 @@ public List<ClinicalEventTypeCount> getClinicalEventTypeCounts(StudyViewFilter s

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse()"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
)
@Override
public PatientTreatmentReport getPatientTreatmentReport(StudyViewFilter studyViewFilter) {
Expand All @@ -101,7 +102,7 @@ public PatientTreatmentReport getPatientTreatmentReport(StudyViewFilter studyVie

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse()"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
)
@Override
public SampleTreatmentReport getSampleTreatmentReport(StudyViewFilter studyViewFilter) {
Expand All @@ -110,7 +111,7 @@ public SampleTreatmentReport getSampleTreatmentReport(StudyViewFilter studyViewF

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse()"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
)
@Override
public List<ClinicalDataCountItem> getGenomicDataBinCounts(StudyViewFilter studyViewFilter, List<GenomicDataBinFilter> genomicDataBinFilters) {
Expand All @@ -119,7 +120,7 @@ public List<ClinicalDataCountItem> getGenomicDataBinCounts(StudyViewFilter study

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse()"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
)
@Override
public List<ClinicalDataCountItem> getGenericAssayDataBinCounts(StudyViewFilter studyViewFilter, List<GenericAssayDataBinFilter> genericAssayDataBinFilters) {
Expand All @@ -132,7 +133,7 @@ public List<CopyNumberCountByGene> getCnaGenes(StudyViewFilter studyViewFilter)

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse()"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
)
@Override
public List<AlterationCountByGene> getStructuralVariantGenes(StudyViewFilter studyViewFilter) throws StudyNotFoundException {
Expand All @@ -141,7 +142,7 @@ public List<AlterationCountByGene> getStructuralVariantGenes(StudyViewFilter stu

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse()"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
)
@Override
public Map<String, ClinicalDataType> getClinicalAttributeDatatypeMap() {
Expand All @@ -150,7 +151,7 @@ public Map<String, ClinicalDataType> getClinicalAttributeDatatypeMap() {

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse()"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
)
@Override
public List<ClinicalDataCountItem> getClinicalDataCounts(StudyViewFilter studyViewFilter, List<String> filteredAttributes) {
Expand All @@ -169,7 +170,7 @@ public List<ClinicalDataCountItem> getClinicalDataCounts(StudyViewFilter studyVi

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse()"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
)
@Override
public List<CaseListDataCount> getCaseListDataCounts(StudyViewFilter studyViewFilter) {
Expand All @@ -181,7 +182,7 @@ public List<CaseListDataCount> getCaseListDataCounts(StudyViewFilter studyViewFi

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse()"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
)
@Override
public List<ClinicalData> getPatientClinicalData(StudyViewFilter studyViewFilter, List<String> attributeIds) {
Expand All @@ -190,7 +191,7 @@ public List<ClinicalData> getPatientClinicalData(StudyViewFilter studyViewFilter

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse()"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
)
@Override
public List<ClinicalData> getSampleClinicalData(StudyViewFilter studyViewFilter, List<String> attributeIds) {
Expand All @@ -199,7 +200,7 @@ public List<ClinicalData> getSampleClinicalData(StudyViewFilter studyViewFilter,

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse()"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
)
@Override
public List<GenomicDataCountItem> getCNACountsByGeneSpecific(StudyViewFilter studyViewFilter, List<GenomicDataFilter> genomicDataFilters) {
Expand All @@ -208,7 +209,7 @@ public List<GenomicDataCountItem> getCNACountsByGeneSpecific(StudyViewFilter stu

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse()"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
)
@Override
public List<GenericAssayDataCountItem> getGenericAssayDataCounts(StudyViewFilter studyViewFilter, List<GenericAssayDataFilter> genericAssayDataFilters) {
Expand All @@ -217,7 +218,7 @@ public List<GenericAssayDataCountItem> getGenericAssayDataCounts(StudyViewFilter

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse()"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
)
@Override
public List<GenomicDataCountItem> getMutationCountsByGeneSpecific(StudyViewFilter studyViewFilter, List<GenomicDataFilter> genomicDataFilters) {
Expand All @@ -238,7 +239,7 @@ public List<GenomicDataCountItem> getMutationCountsByGeneSpecific(StudyViewFilte

@Cacheable(
cacheResolver = "staticRepositoryCacheOneResolver",
condition = "@cacheEnabledConfig.getEnabledClickhouse()"
condition = "@cacheEnabledConfig.getEnabledClickhouse() && @studyViewFilterUtil.isSingleStudyUnfiltered(#studyViewFilter)"
)
@Override
public List<GenomicDataCountItem> getMutationTypeCountsByGeneSpecific(StudyViewFilter studyViewFilter, List<GenomicDataFilter> genomicDataFilters) {
Expand Down

0 comments on commit 0a431c7

Please sign in to comment.