Class GridH2ProxyIndex

  • All Implemented Interfaces:
    org.h2.engine.DbObject, org.h2.index.Index, org.h2.schema.SchemaObject
    Direct Known Subclasses:
    GridH2ProxySpatialIndex

    public class GridH2ProxyIndex
    extends H2IndexCostedBase
    Allows to have 'free' index for alias columns Delegates the calls to underlying normal index
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.h2.index.Index idx
      Underlying normal index
      • Fields inherited from class org.h2.index.BaseIndex

        columnIds, columns, indexColumns, indexType, isMultiVersion, table
      • Fields inherited from class org.h2.engine.DbObjectBase

        comment, database, trace
      • Fields inherited from interface org.h2.engine.DbObject

        AGGREGATE, COMMENT, CONSTANT, CONSTRAINT, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, TRIGGER, USER, USER_DATATYPE
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(org.h2.engine.Session session, org.h2.result.Row row)
      boolean canGetFirstOrLast()
      void checkRename()
      void close​(org.h2.engine.Session session)
      org.h2.index.IndexLookupBatch createLookupBatch​(org.h2.table.TableFilter[] filters, int filter)
      org.h2.index.Cursor find​(org.h2.engine.Session session, org.h2.result.SearchRow first, org.h2.result.SearchRow last)
      org.h2.index.Cursor findFirstOrLast​(org.h2.engine.Session session, boolean first)
      double getCost​(org.h2.engine.Session session, int[] masks, org.h2.table.TableFilter[] filters, int filter, org.h2.result.SortOrder sortOrder, HashSet<org.h2.table.Column> allColumnsSet)
      long getDiskSpaceUsed()
      long getRowCount​(org.h2.engine.Session session)
      long getRowCountApproximation()
      boolean needRebuild()
      static org.h2.result.SearchRow prepareProxyIndexRow​(GridQueryRowDescriptor desc, org.h2.result.SearchRow row)
      Clones provided row and copies values of alias key and val columns into respective key and val positions.
      void remove​(org.h2.engine.Session session)
      void remove​(org.h2.engine.Session session, org.h2.result.Row row)
      void truncate​(org.h2.engine.Session session)
      org.h2.index.Index underlyingIndex()  
      • Methods inherited from class org.h2.index.BaseIndex

        canFindNext, canScan, checkIndexColumnTypes, commit, compareRows, find, findNext, getColumnIndex, getColumns, getCostRangeIndex, getCreateSQL, getCreateSQLForCopy, getDropSQL, getDuplicateKeyException, getIndexColumns, getIndexType, getPlanSQL, getRow, getTable, getType, initBaseIndex, isFindUsingFullTableScan, isFirstColumn, isHidden, isRowIdIndex, mayHaveNullDuplicates, removeChildrenAndResources, setSortedInsertMode
      • Methods inherited from class org.h2.schema.SchemaObjectBase

        getSchema, getSQL, initSchemaObjectBase
      • Methods inherited from class org.h2.engine.DbObjectBase

        getChildren, getComment, getDatabase, getId, getModificationId, getName, initDbObjectBase, invalidate, isTemporary, isValid, rename, setComment, setModified, setObjectName, setTemporary, toString
      • Methods inherited from interface org.h2.engine.DbObject

        getChildren, getComment, getDatabase, getId, getName, getSQL, isTemporary, rename, setComment, setTemporary
      • Methods inherited from interface org.h2.schema.SchemaObject

        getSchema
    • Field Detail

      • idx

        protected org.h2.index.Index idx
        Underlying normal index
    • Constructor Detail

      • GridH2ProxyIndex

        public GridH2ProxyIndex​(GridH2Table tbl,
                                String name,
                                List<org.h2.table.IndexColumn> colsList,
                                org.h2.index.Index idx)
        Parameters:
        tbl - Table.
        name - Name of the proxy index.
        colsList - Column list for the proxy index.
        idx - Target index.
    • Method Detail

      • underlyingIndex

        public org.h2.index.Index underlyingIndex()
        Returns:
        Underlying index.
      • checkRename

        public void checkRename()
        Specified by:
        checkRename in interface org.h2.engine.DbObject
        Specified by:
        checkRename in class org.h2.engine.DbObjectBase
      • close

        public void close​(org.h2.engine.Session session)
      • add

        public void add​(org.h2.engine.Session session,
                        org.h2.result.Row row)
      • remove

        public void remove​(org.h2.engine.Session session,
                           org.h2.result.Row row)
      • find

        public org.h2.index.Cursor find​(org.h2.engine.Session session,
                                        org.h2.result.SearchRow first,
                                        org.h2.result.SearchRow last)
      • getCost

        public double getCost​(org.h2.engine.Session session,
                              int[] masks,
                              org.h2.table.TableFilter[] filters,
                              int filter,
                              org.h2.result.SortOrder sortOrder,
                              HashSet<org.h2.table.Column> allColumnsSet)
      • remove

        public void remove​(org.h2.engine.Session session)
      • truncate

        public void truncate​(org.h2.engine.Session session)
      • canGetFirstOrLast

        public boolean canGetFirstOrLast()
      • findFirstOrLast

        public org.h2.index.Cursor findFirstOrLast​(org.h2.engine.Session session,
                                                   boolean first)
      • needRebuild

        public boolean needRebuild()
      • getRowCount

        public long getRowCount​(org.h2.engine.Session session)
      • getRowCountApproximation

        public long getRowCountApproximation()
      • getDiskSpaceUsed

        public long getDiskSpaceUsed()
      • createLookupBatch

        public org.h2.index.IndexLookupBatch createLookupBatch​(org.h2.table.TableFilter[] filters,
                                                               int filter)
        Specified by:
        createLookupBatch in interface org.h2.index.Index
        Overrides:
        createLookupBatch in class org.h2.index.BaseIndex
      • prepareProxyIndexRow

        public static org.h2.result.SearchRow prepareProxyIndexRow​(GridQueryRowDescriptor desc,
                                                                   org.h2.result.SearchRow row)
        Clones provided row and copies values of alias key and val columns into respective key and val positions.
        Parameters:
        desc - Row descriptor.
        row - Source row.
        Returns:
        Result.