congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
IndexStoreStrategy.count
Code IndexAdd Tabnine to your IDE (free)

How to use
count
method
in
org.apache.jackrabbit.oak.plugins.index.property.strategy.IndexStoreStrategy

Best Java code snippets using org.apache.jackrabbit.oak.plugins.index.property.strategy.IndexStoreStrategy.count (Showing top 20 results out of 315)

origin: apache/jackrabbit-oak

@Override
public long count(Filter filter, NodeState root, NodeState indexMeta,
    Set<String> values, int max) {
  return strategy.count(filter, root, indexMeta, values, max);
}
origin: apache/jackrabbit-oak

@Override
public long count(NodeState root, NodeState indexMeta, Set<String> values,
    int max) {
  return strategy.count(root, indexMeta, values, max);
}
origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Override
public long count(Filter filter, NodeState root, NodeState indexMeta,
    Set<String> values, int max) {
  return strategy.count(filter, root, indexMeta, values, max);
}
origin: org.apache.jackrabbit/oak-core

@Override
public long count(NodeState root, NodeState indexMeta, Set<String> values,
    int max) {
  return strategy.count(root, indexMeta, values, max);
}
origin: org.apache.jackrabbit/oak-core

@Override
public long count(Filter filter, NodeState root, NodeState indexMeta,
    Set<String> values, int max) {
  return strategy.count(filter, root, indexMeta, values, max);
}
origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Override
public long count(NodeState root, NodeState indexMeta, Set<String> values,
    int max) {
  return strategy.count(root, indexMeta, values, max);
}
origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

private static boolean hasReferences(IndexStoreStrategy refStore,
               NodeState root,
               NodeState definition,
               String name,
               String key) {
  return definition.hasChildNode(name)
      && refStore.count(root, definition, of(key), 1) > 0;
}
origin: apache/jackrabbit-oak

private static boolean hasReferences(IndexStoreStrategy refStore,
               NodeState root,
               NodeState definition,
               String name,
               String key) {
  return definition.hasChildNode(name)
      && refStore.count(root, definition, of(key), 1) > 0;
}
origin: org.apache.jackrabbit/oak-core

private static boolean hasReferences(IndexStoreStrategy refStore,
               NodeState root,
               NodeState definition,
               String name,
               String key) {
  return definition.hasChildNode(name)
      && refStore.count(root, definition, of(key), 1) > 0;
}
origin: apache/jackrabbit-oak

/**
 * From a set of keys, get the first that has multiple entries, if any.
 * 
 * @param keys the keys
 * @param indexMeta the index configuration
 * @return the first duplicate, or null if none was found
 */
private String getFirstDuplicate(Set<String> keys, NodeState indexMeta) {
  for (String key : keys) {
    long count = 0;
    for (IndexStoreStrategy s : getStrategies(true)) {
      count += s.count(root, indexMeta, singleton(key), 2);
      if (count > 1) {
        Iterator<String> it = s.query(null, null, indexMeta, singleton(key)).iterator();
        if (it.hasNext()) {
          return key + ": " + it.next();
        }
        return key;
      }
    }
  }
  return null;
}
origin: org.apache.jackrabbit/oak-core

/**
 * From a set of keys, get the first that has multiple entries, if any.
 * 
 * @param keys the keys
 * @param indexMeta the index configuration
 * @return the first duplicate, or null if none was found
 */
private String getFirstDuplicate(Set<String> keys, NodeState indexMeta) {
  for (String key : keys) {
    long count = 0;
    for (IndexStoreStrategy s : getStrategies(true)) {
      count += s.count(root, indexMeta, singleton(key), 2);
      if (count > 1) {
        Iterator<String> it = s.query(null, null, indexMeta, singleton(key)).iterator();
        if (it.hasNext()) {
          return key + ": " + it.next();
        }
        return key;
      }
    }
  }
  return null;
}
origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

/**
 * From a set of keys, get the first that has multiple entries, if any.
 * 
 * @param keys the keys
 * @param indexMeta the index configuration
 * @return the first duplicate, or null if none was found
 */
private String getFirstDuplicate(Set<String> keys, NodeState indexMeta) {
  for (String key : keys) {
    long count = 0;
    for (IndexStoreStrategy s : getStrategies(true)) {
      count += s.count(root, indexMeta, singleton(key), 2);
      if (count > 1) {
        Iterator<String> it = s.query(null, null, indexMeta, singleton(key)).iterator();
        if (it.hasNext()) {
          return key + ": " + it.next();
        }
        return key;
      }
    }
  }
  return null;
}
origin: apache/jackrabbit-oak

public double getCost(Filter filter, String propertyName, PropertyValue value) {
  NodeState indexMeta = getIndexNode(root, propertyName, filter);
  if (indexMeta == null) {
    return Double.POSITIVE_INFINITY;
  }
  Set<IndexStoreStrategy> strategies = getStrategies(indexMeta);
  ValuePattern pattern = new ValuePattern(indexMeta);
  double cost = strategies.isEmpty() ? MAX_COST : COST_OVERHEAD;
  for (IndexStoreStrategy s : strategies) {
    cost += s.count(filter, root, indexMeta, encode(value, pattern), MAX_COST);
  }
  return cost;
}
origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

public double getCost(Filter filter, String propertyName, PropertyValue value) {
  NodeState indexMeta = getIndexNode(root, propertyName, filter);
  if (indexMeta == null) {
    return Double.POSITIVE_INFINITY;
  }
  Set<IndexStoreStrategy> strategies = getStrategies(indexMeta);
  ValuePattern pattern = new ValuePattern(indexMeta);
  double cost = strategies.isEmpty() ? MAX_COST : COST_OVERHEAD;
  for (IndexStoreStrategy s : strategies) {
    cost += s.count(filter, root, indexMeta, encode(value, pattern), MAX_COST);
  }
  return cost;
}
origin: org.apache.jackrabbit/oak-core

public double getCost(Filter filter, String propertyName, PropertyValue value) {
  NodeState indexMeta = getIndexNode(root, propertyName, filter);
  if (indexMeta == null) {
    return Double.POSITIVE_INFINITY;
  }
  Set<IndexStoreStrategy> strategies = getStrategies(indexMeta);
  ValuePattern pattern = new ValuePattern(indexMeta);
  double cost = strategies.isEmpty() ? MAX_COST : COST_OVERHEAD;
  for (IndexStoreStrategy s : strategies) {
    cost += s.count(filter, root, indexMeta, encode(value, pattern), MAX_COST);
  }
  return cost;
}
origin: apache/jackrabbit-oak

@Test
public void testUnique() throws CommitFailedException {
  IndexStoreStrategy store = new ContentMirrorStoreStrategy();
  NodeState root = EMPTY_NODE;
  NodeBuilder indexMeta = root.builder();
  Supplier<NodeBuilder> index = memoize(() -> indexMeta.child(INDEX_CONTENT_NODE_NAME));
  store.update(index, "a", null, null, EMPTY, KEY);
  store.update(index, "b", null, null, EMPTY, KEY);
  Assert.assertTrue(
      "ContentMirrorStoreStrategy should guarantee uniqueness on insert",
      store.count(root, indexMeta.getNodeState(), Collections.singleton("key"), 2) > 1);
}

origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

double cost = strategies.isEmpty() ? MAX_COST : 0;
for (IndexStoreStrategy strategy : strategies) {
  cost += strategy.count(filter, root, definition,
      values, MAX_COST);
origin: apache/jackrabbit-oak

    approxNodeCount, store.count(root, indexMeta.getNodeState(),
        null, maxTraversal));
    approxKeyCount, store.count(root, indexMeta.getNodeState(),
        KEY, maxTraversal));
Assert.assertEquals(
    "Entry count not used even when present for is-not-null query",
    entryCount, store.count(root, indexMeta.getNodeState(), null,
        maxTraversal));
    entryCount > store.count(root, indexMeta.getNodeState(), KEY,
        maxTraversal));
    entryCount > store.count(root, indexMeta.getNodeState(), KEY,
        maxTraversal));
Assert.assertEquals(
    "Entry count not used even when present for is-not-null query",
    0, store.count(root, indexMeta.getNodeState(), null,
        maxTraversal));
origin: apache/jackrabbit-oak

double cost = strategies.isEmpty() ? MAX_COST : 0;
for (IndexStoreStrategy strategy : strategies) {
  cost += strategy.count(filter, root, definition,
      values, MAX_COST);
origin: apache/jackrabbit-oak

"Approximate count not used for is-not-null query",
approxNodeCount,
store.count(filter, root, indexMeta.getNodeState(),
      null, maxTraversal));
"Approximate count not used for key=value query",
approxKeyCount,
store.count(filter, root, indexMeta.getNodeState(),
      KEY, maxTraversal));
entryCount,
filteredNodeFactor *
    store.count(filter, root, indexMeta.getNodeState(),
        null, maxTraversal));
"Rough key count not considered for key=value query",
entryCount > filteredNodeFactor *
    store.count(filter, root, indexMeta.getNodeState(),
        KEY, maxTraversal));
"Key count not considered for key=value query",
entryCount > filteredNodeFactor *
    store.count(filter, root, indexMeta.getNodeState(),
        KEY, maxTraversal));
org.apache.jackrabbit.oak.plugins.index.property.strategyIndexStoreStrategycount

Javadoc

Count the occurrence of a given set of values. Used in calculating the cost of an index.

Popular methods of IndexStoreStrategy

  • query
    Search for a given set of values.
  • update
    Updates the index for the given path.
  • exists
    Check whether an entry for the given key exists.
  • getIndexNodeName

Popular in Java

  • Reactive rest calls using spring rest template
  • getResourceAsStream (ClassLoader)
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JFileChooser (javax.swing)
  • Top PhpStorm plugins
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