public static UseSearchIndex from(Map<String, Object> options) { return options == null || !options.containsKey(VariantSearchManager.USE_SEARCH_INDEX) ? AUTO : UseSearchIndex.valueOf(options.get(VariantSearchManager.USE_SEARCH_INDEX).toString().toUpperCase()); } }
Query query, QueryOptions options, StudyConfigurationManager studyConfigurationManager, String dbName) throws StorageEngineException { if (!VariantStorageEngine.UseSearchIndex.from(options).equals(VariantStorageEngine.UseSearchIndex.NO)) { // YES or AUTO if (isValidParam(query, VariantQueryParam.STUDY)) { if (VariantQueryUtils.splitValue(query.getString(VariantQueryParam.STUDY.key())).getValue().size() > 1) {
UseSearchIndex useSearchIndex = UseSearchIndex.from(options); if (!getOptions().getBoolean(INTERSECT_ACTIVE.key(), INTERSECT_ACTIVE.defaultValue()) || useSearchIndex.equals(UseSearchIndex.NO)) { } else if (!active) { intersect = false; } else if (useSearchIndex.equals(UseSearchIndex.YES) || VariantQueryUtils.isValidParam(query, VariantQueryParam.ANNOT_TRAIT)) { intersect = true; } else { if (useSearchIndex.equals(UseSearchIndex.YES)) { throw new VariantQueryException("Unable to use search index. SearchEngine is not available"); } else if (VariantQueryUtils.isValidParam(query, VariantQueryParam.ANNOT_TRAIT)) {
/** * Decide if a query should be resolved using SearchManager or not. * * @param query Query * @param options QueryOptions * @return true if should resolve only with SearchManager * @throws StorageEngineException StorageEngineException */ protected boolean doQuerySearchManager(Query query, QueryOptions options) throws StorageEngineException { return !UseSearchIndex.from(options).equals(UseSearchIndex.NO) // YES or AUTO && isQueryCovered(query) && (options.getBoolean(QueryOptions.COUNT) || isIncludeCovered(options)) && searchActiveAndAlive(); }
@Override protected boolean doIntersectWithSearch(Query query, QueryOptions options) throws StorageEngineException { boolean doIntersectWithSearch = super.doIntersectWithSearch(query, options); if (doIntersectWithSearch) { if (!isValidParam(query, VariantQueryParam.ANNOT_TRAIT) && VariantStorageEngine.UseSearchIndex.from(options).equals(VariantStorageEngine.UseSearchIndex.AUTO) && doHBaseSampleIndexIntersect(query, options)) { return false; } } return doIntersectWithSearch; }