Package org.h2.mvstore.db

# Class MVIndex<K,V>

java.lang.Object
org.h2.engine.DbObject
org.h2.schema.SchemaObject
org.h2.index.Index
org.h2.mvstore.db.MVIndex<K,V>

All Implemented Interfaces:
  `HasSQL`

Direct Known Subclasses:
  `MVDelegateIndex`, `MVPrimaryIndex`, `MVSecondaryIndex`, `MVSpatialIndex`

public abstract class MVIndex<K,V> extends Index
An index that stores the data in an MVStore.

## Field Summary

### Fields inherited from class org.h2.index.Index

`columnIds, columns, indexColumns, indexType, table, uniqueColumnColumn`

### Fields inherited from class org.h2.engine.DbObject

`AGGREGATE, comment, COMMENT, CONSTANT, CONSTRAINT, database, DOMAIN, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, trace, TRIGGER, USER`

### Fields inherited from interface org.h2.util.HasSQL

`ADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`MVIndex(Table newTable, int id, String name, IndexColumn[] newIndexColumns, int uniqueColumnCount, IndexType newIndexType)`

## Method Summary

Modifier and Type
Method
Description
`abstract void`
`addBufferedRows(List<String> bufferNames)`
Add all the index data from the buffers to the index.
`abstract void`
`addRowsToBuffer(List<Row> rows, String bufferName)`
Add the rows to a temporary storage (not to the index yet).
`long`
`getDiskSpaceUsed(boolean approximate)`
Get the used disk space for this index.
`abstract MVMap<K,VersionedValue<V>>`
`getMVMap()`

### Methods inherited from class org.h2.index.Index

`add, canFindNext, canGetFirstOrLast, canScan, checkIndexColumnTypes, close, compareRows, find, findFirstOrLast, findNext, getColumnIndex, getColumns, getCost, getCostRangeIndex, getCreateSQL, getCreateSQLForCopy, getDuplicateKeyException, getDuplicatePrimaryKeyMessage, getIndexColumns, getIndexType, getPlanSQL, getRow, getRowCount, getRowCountApproximation, getRowFactory, getTable, getType, getUniqueColumnCount, getUniqueRowFactory, isFindUsingFullTableScan, isFirstColumn, isRowIdIndex, needRebuild, needsUniqueCheck, remove, remove, removeChildrenAndResources, truncate, update`

### Methods inherited from class org.h2.schema.SchemaObject

`getSchema, getSQL, getSQL`

### Methods inherited from class org.h2.engine.DbObject

`checkRename, equals, getChildren, getComment, getCreateSQLForMeta, getDatabase, getDropSQL, getId, getModificationId, getName, hashCode, invalidate, isTemporary, isValid, rename, setComment, setModified, setObjectName, setTemporary, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.h2.util.HasSQL

`getTraceSQL`

## Constructor Details

### MVIndex

protected MVIndex(Table newTable, int id, String name, IndexColumn[] newIndexColumns, int uniqueColumnCount, IndexType newIndexType)

## Method Details

### addRowsToBuffer

public abstract void addRowsToBuffer(List<Row> rows, String bufferName)
Add the rows to a temporary storage (not to the index yet). The rows are sorted by the index columns. This is to more quickly build the index.

Parameters:
  `rows` - the rows
  `bufferName` - the name of the temporary storage

### addBufferedRows

public abstract void addBufferedRows(List<String> bufferNames)
Add all the index data from the buffers to the index. The index will typically use merge sort to add the data more quickly in sorted order.

Parameters:
  `bufferNames` - the names of the temporary storage

### getMVMap

public abstract MVMap<K,VersionedValue<V>> getMVMap()

### getDiskSpaceUsed

public long getDiskSpaceUsed(boolean approximate)
Description copied from class: `Index`
Get the used disk space for this index.

Overrides:
  `getDiskSpaceUsed` in class `Index`
Parameters:
  `approximate` - `true` to return quick approximation
Returns:
  the estimated number of bytes