Codota Logo
BardFeatureFlag
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
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
  • getContentResolver (Context)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • setContentView (Activity)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JComboBox (javax.swing)
  • JFrame (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now