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

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

Best Java code snippets using com.yahoo.bard.webservice.config.BardFeatureFlag (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

/**
 * Builds and returns an instance of local signature cache.
 *
 * @return the instance of local signature cache
 */
private DataCache<?> buildLocalSignatureCache() {
  if (BardFeatureFlag.DRUID_CACHE_V2.isSet()) {
    LOG.warn("Cache V2 feature flag is deprecated, " +
        "use the new configuration parameter to set desired caching strategy"
    );
  }
  try {
    MemTupleDataCache<Long, String> cache = new MemTupleDataCache<>();
    LOG.info("MemcachedClient Version 2 started {}", cache);
    return cache;
  } catch (IOException e) {
    LOG.error("MemcachedClient Version 2 failed to start {}", e);
    throw new IllegalStateException(e);
  }
}
origin: yahoo/fili

/**
 * Builds and returns an instance of TTL cache.
 *
 * @return the instance of TTL cache
 */
private DataCache<?> buildTtlCache() {
  if (BardFeatureFlag.DRUID_CACHE.isSet()) {
    LOG.warn("Cache V1 feature flag is deprecated, " +
        "use the new configuration parameter to set desired caching strategy"
    );
  }
  try {
    DataCache<String> cache = new HashDataCache<>(new MemDataCache<HashDataCache.Pair<String, String>>());
    LOG.info("MemcachedClient started {}", cache);
    return cache;
  } catch (IOException e) {
    LOG.error("MemcachedClient failed to start {}", e);
    throw new IllegalStateException(e);
  }
}
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,
    getLogicalMetricListSummaryView(apiRequest.getMetrics(), uriInfo),
    UPDATED_METADATA_COLLECTION_NAMES.isOn() ? "metrics" : "rows",
    null
);
origin: yahoo/fili

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

    containerRequestContext,
    rows,
    UPDATED_METADATA_COLLECTION_NAMES.isOn() ? "dimensions" : "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.INTERSECTION_REPORTING.isOn()) {
  ArrayNode metricsJsonArray;
  try {
origin: yahoo/fili

if (!BardFeatureFlag.DATA_FILTER_SUBSTRING_OPERATIONS.isOn()) {
  FilterOperation filterOperation = newFilter.getOperation();
  if (filterOperation.equals(DefaultFilterOperation.startswith)
com.yahoo.bard.webservice.configBardFeatureFlag

Javadoc

Feature flags bind an object to a system configuration name.

Most used methods

  • isOn
  • isSet

Popular in Java

  • Start an intent from android
  • addToBackStack (FragmentTransaction)
  • compareTo (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Top 12 Jupyter Notebook extensions
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