Tabnine Logo
BardFeatureFlag.isOn
Code IndexAdd Tabnine to your IDE (free)

How to use
isOn
method
in
com.yahoo.bard.webservice.config.BardFeatureFlag

Best Java code snippets using com.yahoo.bard.webservice.config.BardFeatureFlag.isOn (Showing top 20 results out of 315)

origin: yahoo/fili

/**
 *  Returns a key that, when fed into a {@link com.yahoo.bard.webservice.data.dimension.KeyValueStore} returns the
 *  field name used by Lucene.
 *
 * @param columnName  The name of the column to extract from Lucene.
 *
 * @return A key that, when fed into a KeyValueStore, returns the ID used to query a dimension in Lucene.
 */
public static String getColumnKey(String columnName) {
  String key = "";
  if (columnName != null) {
    key = BardFeatureFlag.CASE_SENSITIVE_KEYS.isOn()
        ? columnName : columnName.toLowerCase(Locale.ENGLISH);
  }
  return key + "_column_key";
}
origin: yahoo/fili

@Override
public boolean isOn() {
  if (on == null) {
    // TODO: Remove this if conditional after cache V1 & V2 configuration flags are removed
    if (BardFeatureFlag.DRUID_CACHE.isSet() || BardFeatureFlag.DRUID_CACHE_V2.isSet()) {
      // no cache
      if (this.value.equals("NoCache")) {
        return ! BardFeatureFlag.DRUID_CACHE.isOn();
      }
      return (this.value.equals("Ttl")
          && !BardFeatureFlag.DRUID_CACHE_V2.isOn()
          && BardFeatureFlag.DRUID_CACHE.isOn()
      )
          || (this.value.equals("LocalSignature")
          && BardFeatureFlag.DRUID_CACHE.isOn()
          && BardFeatureFlag.DRUID_CACHE_V2.isOn());
    }
    on = value.equalsIgnoreCase(SYSTEM_CONFIG.getStringProperty(
        SYSTEM_CONFIG.getPackageVariableName("query_response_caching_strategy"), "NoCache")
    );
  }
  return on;
}
origin: yahoo/fili

/**
 * Returns a key that allows access to the dimension rows of a given dimension.
 * <p>
 * Given a dimension field name (such as "id"), and the id of the dimension desired, returns a key. When
 * this key is passed into the appropriate {@link com.yahoo.bard.webservice.data.dimension.KeyValueStore},
 * the KeyValueStore will return the metadata of the associated dimension.
 *
 * @param fieldName  The dimension field name to be appended to the beginning of the key
 * @param fieldValue  The key of the dimension whose data is desired
 *
 * @return A key that, when passed into the appropriate KeyValueStore, will return the associated dimension value.
 */
public static String getRowKey(@NotNull String fieldName, String fieldValue) {
  boolean caseSensitive = BardFeatureFlag.CASE_SENSITIVE_KEYS.isOn();
  String lookupFieldValue = fieldValue == null ? "" : fieldValue;
  return new StringBuilder()
      .append(caseSensitive ? fieldName : fieldName.toLowerCase(Locale.ENGLISH))
      .append(KEY_SEPARATOR)
      .append(caseSensitive ? lookupFieldValue : lookupFieldValue.toLowerCase(Locale.ENGLISH))
      .append(ROW_KEY_SUFFIX)
      .toString();
}
origin: yahoo/fili

  @Override
  public BinaryOperator<PhysicalTable> getBetterTableOperator(QueryPlanningConstraint requestConstraint) {
    List<Comparator<PhysicalTable>> comparators = new ArrayList<>();

    if (BardFeatureFlag.PARTIAL_DATA.isOn()) {
      comparators.add(
          new PartialTimeComparator(requestConstraint, partialDataHandler));
      comparators.add(
          new VolatileTimeComparator(requestConstraint, partialDataHandler, volatileIntervalsService));
    }
    comparators.add(COMPARE_GRANULARITY);
    comparators.add(CARDINALITY_COMPARATOR);

    ChainingComparator<PhysicalTable> tableComparator = new ChainingComparator<>(comparators);
    return BinaryOperator.minBy(tableComparator);
  }
}
origin: yahoo/fili

/**
 * Creates an object that constructs Druid dimension filters from Bard dimension filters.
 * <p>
 * Constructs a {@link DruidInFilterBuilder} by default.
 *
 * @return An object to build Druid filters from API filters
 */
protected DruidFilterBuilder buildDruidFilterBuilder() {
  if (BardFeatureFlag.DEFAULT_IN_FILTER.isOn()) {
    return new DruidInFilterBuilder();
  } else {
    return new DruidOrFilterBuilder();
  }
}
origin: yahoo/fili

/**
 * Determine if the optimization to a TopN query can be done.
 *
 * @param apiRequest  The request data
 * @param templateDruidQuery  The template query
 *
 * @return true if the optimization can be done, false if it can't
 */
protected boolean canOptimizeTopN(DataApiRequest apiRequest, TemplateDruidQuery templateDruidQuery) {
  return apiRequest.getDimensions().size() == 1 &&
      apiRequest.getSorts().size() == 1 &&
      !templateDruidQuery.isNested() &&
      BardFeatureFlag.TOP_N.isOn() &&
      apiRequest.getHavings().isEmpty();
}
origin: yahoo/fili

@Override
public void processResponse(JsonNode json, DruidAggregationQuery<?> druidQuery, LoggingContext metadata) {
  if (CACHE_PARTIAL_DATA.isOn() || isCacheable()) {
    String valueString = null;
    try {
origin: yahoo/fili

    containerRequestContext,
    status,
    UPDATED_METADATA_COLLECTION_NAMES.isOn() ? "feature flags" : "rows",
    Arrays.asList("name", "value")
);
origin: yahoo/fili

Pagination pagination = responseData.getPagination();
boolean paginating = pagination != null;
boolean haveMissingIntervals = BardFeatureFlag.PARTIAL_DATA.isOn() && !missingIntervals.isEmpty();
boolean haveVolatileIntervals = volatileIntervals != null && ! volatileIntervals.isEmpty();
origin: yahoo/fili

    containerRequestContext,
    getDimensionListSummaryView(apiRequest.getDimensions(), uriInfo),
    UPDATED_METADATA_COLLECTION_NAMES.isOn() ? "dimensions" : "rows",
    null
);
origin: yahoo/fili

    containerRequestContext,
    apiRequest.getSlices(),
    UPDATED_METADATA_COLLECTION_NAMES.isOn() ? "slices" : "rows",
    null
);
origin: yahoo/fili

    containerRequestContext,
    getLogicalTableListSummaryView(tablesApiRequestImpl.getTables(), uriInfo),
    UPDATED_METADATA_COLLECTION_NAMES.isOn() ? "tables" : "rows",
    null
);
origin: yahoo/fili

    containerRequestContext,
    getLogicalMetricListSummaryView(apiRequest.getMetrics(), uriInfo),
    UPDATED_METADATA_COLLECTION_NAMES.isOn() ? "metrics" : "rows",
    null
);
origin: yahoo/fili

@Override
protected DataCache<?> buildCache() {
  if (BardFeatureFlag.DRUID_CACHE.isOn()) {
    // test cache stored in memory
    if (BardFeatureFlag.DRUID_CACHE_V2.isOn()) {
      state.cache = new TestTupleDataCache();
    } else {
      state.cache = new HashDataCache<>(new TestDataCache());
    }
  } else {
    state.cache = new StubDataCache<>();
  }
  return state.cache;
}
origin: com.yahoo.fili/fili-core

@Override
protected DataCache<?> buildCache() {
  if (BardFeatureFlag.DRUID_CACHE.isOn()) {
    // test cache stored in memory
    if (BardFeatureFlag.DRUID_CACHE_V2.isOn()) {
      state.cache = new TestTupleDataCache();
    } else {
      state.cache = new HashDataCache<>(new TestDataCache());
    }
  } else {
    state.cache = new StubDataCache<>();
  }
  return state.cache;
}
origin: yahoo/fili

if (!BardFeatureFlag.DATA_FILTER_SUBSTRING_OPERATIONS.isOn()) {
  FilterOperation filterOperation = newFilter.getOperation();
  if (filterOperation.equals(DefaultFilterOperation.startswith)
origin: yahoo/fili

/**
 * Bind the query interval string to a list of intervals.
 *
 * @param intervalsName  The query string describing the intervals
 * @param granularity  The granularity for this request
 * @param timeZone  The time zone to evaluate interval timestamps in
 *
 * @return  A bound list of intervals for the query
 */
protected List<Interval> bindIntervals(String intervalsName, Granularity granularity, DateTimeZone timeZone) {
  DateTimeFormatter dateTimeFormatter = generateDateTimeFormatter(timeZone);
  List<Interval> result;
  if (BardFeatureFlag.CURRENT_MACRO_USES_LATEST.isOn()) {
    SimplifiedIntervalList availability = TableUtils.logicalTableAvailability(getTable());
    DateTime adjustedNow = new DateTime();
    if (! availability.isEmpty()) {
      DateTime firstUnavailable =  availability.getLast().getEnd();
      if (firstUnavailable.isBeforeNow()) {
        adjustedNow = firstUnavailable;
      }
    }
    result = generateIntervals(adjustedNow, intervalsName, granularity, dateTimeFormatter);
  } else {
    result = generateIntervals(intervalsName, granularity, dateTimeFormatter);
  }
  return result;
}
origin: yahoo/fili

if (BardFeatureFlag.PARTIAL_DATA.isOn()) {
  PartialDataResultSetMapper mapper = new PartialDataResultSetMapper(
      missingIntervals,
origin: yahoo/fili

if (BardFeatureFlag.QUERY_SPLIT.isOn()) {
  handler = new SplitQueryRequestHandler(handler);
origin: yahoo/fili

if (BardFeatureFlag.QUERY_SPLIT.isOn()) {
  handler = new SplitQueryRequestHandler(handler);
com.yahoo.bard.webservice.configBardFeatureFlagisOn

Popular methods of BardFeatureFlag

  • isSet

Popular in Java

  • Running tasks concurrently on multiple threads
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • getExternalFilesDir (Context)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • String (java.lang)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now