Class BinaryQuantIndex.BinaryQuantMapIndex

java.lang.Object
com.oracle.coherence.ai.index.BinaryQuantIndex.BinaryQuantMapIndex
All Implemented Interfaces:
VectorIndex<K,V,Vector<T>>, MapIndex<K,V,Vector<T>>
Enclosing class:
BinaryQuantIndex<K,V,T>

public class BinaryQuantIndex.BinaryQuantMapIndex extends Object implements VectorIndex<K,V,Vector<T>>
A Binary Quantization VectorIndex.
  • Method Details

    • getValueExtractor

      public ValueExtractor<V,Vector<T>> getValueExtractor()
      Description copied from interface: MapIndex
      Obtain the ValueExtractor object that the MapIndex uses to extract an indexable Object from a value stored in the indexed Map. This property is never null.
      Specified by:
      getValueExtractor in interface MapIndex<K,V,Vector<T>>
      Returns:
      a ValueExtractor object, never null
    • isOrdered

      public boolean isOrdered()
      Description copied from interface: MapIndex
      Determine if the MapIndex orders the contents of the indexed information. To determine in which way the contents are ordered, get the Comparator from the index contents SortedMap object.
      Specified by:
      isOrdered in interface MapIndex<K,V,Vector<T>>
      Returns:
      true if the index contents are ordered, false otherwise
    • isPartial

      public boolean isPartial()
      Description copied from interface: MapIndex
      Determine if indexed information for any entry in the indexed Map has been excluded from this index. This information is used for IndexAwareFilter implementations to determine the most optimal way to apply the index.

      Note: Queries that use a partial index are allowed not to return entries that are not indexed even though they would match the corresponding filter were they evaluated during the full scan (if there were no index). However, it's not allowable for a query to return entries that do not match the corresponding filter, regardless of their presence in the index.

      Specified by:
      isPartial in interface MapIndex<K,V,Vector<T>>
      Returns:
      true if any entry of the indexed Map has been excluded from the index, false otherwise
    • getIndexContents

      public Map<Vector<T>,Set<K>> getIndexContents()
      Description copied from interface: MapIndex
      Get the Map that contains the index contents.

      The keys of the Map are the return values from the ValueExtractor operating against the indexed Map's values, and for each key, the corresponding value stored in the Map is a Set of keys to the indexed Map.

      If the MapIndex is known to be ordered, then the returned Map object will be an instance of SortedMap. The SortedMap may or may not have a Comparator object associated with it; see SortedMap.comparator().

      A client should assume that the returned Map object is read-only and must not attempt to modify it.

      Specified by:
      getIndexContents in interface MapIndex<K,V,Vector<T>>
      Returns:
      a Map (or a SortedMap) of the index contents
    • get

      public Object get(K k)
      Description copied from interface: MapIndex
      Using the index information if possible, get the value associated with the specified key. This is expected to be more efficient than using the ValueExtractor against an object containing the value, because the index should already have the necessary information at hand.
      Specified by:
      get in interface MapIndex<K,V,Vector<T>>
      Parameters:
      k - the key that specifies the object to extract the value from
      Returns:
      the value that would be extracted by this MapIndex's ValueExtractor from the object specified by the passed key; NO_VALUE if the index does not have the necessary information
    • getComparator

      public Comparator<Vector<T>> getComparator()
      Description copied from interface: MapIndex
      Get the Comparator used to sort the index.
      Specified by:
      getComparator in interface MapIndex<K,V,Vector<T>>
      Returns:
      the comparator
    • insert

      public void insert(Map.Entry<? extends K,? extends V> entry)
      Description copied from interface: MapIndex
      Update this index in response to a insert operation on a cache.
      Specified by:
      insert in interface MapIndex<K,V,Vector<T>>
      Parameters:
      entry - the entry representing the object being inserted
    • update

      public void update(Map.Entry<? extends K,? extends V> entry)
      Description copied from interface: MapIndex
      Update this index in response to an update operation on a cache.
      Specified by:
      update in interface MapIndex<K,V,Vector<T>>
      Parameters:
      entry - the entry representing the object being updated
    • delete

      public void delete(Map.Entry<? extends K,? extends V> entry)
      Description copied from interface: MapIndex
      Update this index in response to a remove operation on a cache.
      Specified by:
      delete in interface MapIndex<K,V,Vector<T>>
      Parameters:
      entry - the entry representing the object being removed
    • query

      public BinaryQueryResult[] query(Vector<T> vector, int k, Filter<?> filter)
      Description copied from interface: VectorIndex
      Return the results of the query.
      Specified by:
      query in interface VectorIndex<K,V,Vector<T>>
      Parameters:
      vector - the vector to use to perform the search
      k - the maximum number of results to return
      filter - an optional Filter to filter the returned results
      Returns:
      the search results