Package com.arcadedb.index.lsm
Class LSMTreeIndexMutable
- java.lang.Object
-
- com.arcadedb.engine.PaginatedComponent
-
- com.arcadedb.index.lsm.LSMTreeIndexAbstract
-
- com.arcadedb.index.lsm.LSMTreeIndexMutable
-
public class LSMTreeIndexMutable extends LSMTreeIndexAbstract
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.arcadedb.index.lsm.LSMTreeIndexAbstract
LSMTreeIndexAbstract.COMPACTING_STATUS, LSMTreeIndexAbstract.LookupResult, LSMTreeIndexAbstract.NULL_STRATEGY
-
-
Field Summary
Fields Modifier and Type Field Description static int
CURRENT_VERSION
static String
NOTUNIQUE_INDEX_EXT
static String
UNIQUE_INDEX_EXT
-
Fields inherited from class com.arcadedb.index.lsm.LSMTreeIndexAbstract
binaryKeyTypes, comparator, DEF_PAGE_SIZE, HIGHER, keyTypes, LOWER, mainIndex, nullStrategy, REMOVED_ENTRY_RID, serializer, TEMP_EXT, unique, valueType
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LSMTreeIndexMutable(LSMTreeIndex mainIndex, DatabaseInternal database, String name, boolean unique, String filePath, byte[] keyTypes, int pageSize, int version, LSMTreeIndexCompacted subIndex)
Called at cloning time.protected
LSMTreeIndexMutable(LSMTreeIndex mainIndex, DatabaseInternal database, String name, boolean unique, String filePath, int id, PaginatedFile.MODE mode, int pageSize, int version)
Called at load time (1st page only).protected
LSMTreeIndexMutable(LSMTreeIndex mainIndex, DatabaseInternal database, String name, boolean unique, String filePath, PaginatedFile.MODE mode, Type[] keyTypes, int pageSize, LSMTreeIndexAbstract.NULL_STRATEGY nullStrategy)
Called at creation time.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected LSMTreeIndexAbstract.LookupResult
compareKey(Binary currentPageBuffer, int startIndexArray, Object[] convertedKeys, int mid, int count, int purpose)
LSMTreeIndexCompacted
createNewForCompaction()
protected MutablePage
createNewPage()
IndexCursor
get(Object[] keys, int limit)
protected RID
getRemovedRID(Identifiable record)
Map<String,Long>
getStats()
LSMTreeIndexCompacted
getSubIndex()
protected void
internalPut(Object[] keys, RID[] rids)
protected void
internalRemove(Object[] keys, Identifiable rid)
IndexCursor
iterator(boolean ascendingOrder, Object[] fromKeys, boolean inclusive)
LSMTreeIndexUnderlyingPageCursor
newPageIterator(int pageId, int currentEntryInPage, boolean ascendingOrder)
void
onAfterCommit()
void
onAfterLoad()
void
put(Object[] keys, RID[] rids)
IndexCursor
range(boolean ascending, Object[] fromKeys, boolean beginKeysInclusive, Object[] toKeys, boolean endKeysInclusive)
IndexCursor
range(Object[] fromKeys, boolean beginKeysInclusive, Object[] toKeys, boolean endKeysInclusive)
Auto determine if it's ascending or descending by checking the keys.void
remove(Object[] keys)
void
remove(Object[] keys, Identifiable rid)
void
removeTempSuffix()
void
setCurrentMutablePages(int currentMutablePages)
-
Methods inherited from class com.arcadedb.index.lsm.LSMTreeIndexAbstract
checkForNulls, compareKey, compareKeys, convertKeys, drop, getCount, getFileId, getHeaderSize, getKeyInPagePosition, getKeyTypes, getMainComponent, getNullStrategy, getOriginalRID, getPageBound, getPaginatedComponent, getSerializedKeySize, getValuesFreePosition, isDeletedEntry, isKeyNull, isMutable, isUnique, lookupInPage, lookupInPageAndAddInResultset, readEntryValues, setCount, setMutable, setValuesFreePosition, toString, writeEntry, writeEntry
-
Methods inherited from class com.arcadedb.engine.PaginatedComponent
getDatabase, getId, getName, getOSFile, getPageSize, getTotalPages, getVersion, setPageCount
-
-
-
-
Field Detail
-
CURRENT_VERSION
public static final int CURRENT_VERSION
- See Also:
- Constant Field Values
-
UNIQUE_INDEX_EXT
public static final String UNIQUE_INDEX_EXT
- See Also:
- Constant Field Values
-
NOTUNIQUE_INDEX_EXT
public static final String NOTUNIQUE_INDEX_EXT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LSMTreeIndexMutable
protected LSMTreeIndexMutable(LSMTreeIndex mainIndex, DatabaseInternal database, String name, boolean unique, String filePath, PaginatedFile.MODE mode, Type[] keyTypes, int pageSize, LSMTreeIndexAbstract.NULL_STRATEGY nullStrategy) throws IOException
Called at creation time.- Throws:
IOException
-
LSMTreeIndexMutable
protected LSMTreeIndexMutable(LSMTreeIndex mainIndex, DatabaseInternal database, String name, boolean unique, String filePath, byte[] keyTypes, int pageSize, int version, LSMTreeIndexCompacted subIndex) throws IOException
Called at cloning time.- Throws:
IOException
-
LSMTreeIndexMutable
protected LSMTreeIndexMutable(LSMTreeIndex mainIndex, DatabaseInternal database, String name, boolean unique, String filePath, int id, PaginatedFile.MODE mode, int pageSize, int version) throws IOException
Called at load time (1st page only).- Throws:
IOException
-
-
Method Detail
-
close
public void close()
- Overrides:
close
in classPaginatedComponent
-
onAfterLoad
public void onAfterLoad()
- Overrides:
onAfterLoad
in classPaginatedComponent
-
onAfterCommit
public void onAfterCommit()
- Overrides:
onAfterCommit
in classPaginatedComponent
-
remove
public void remove(Object[] keys)
-
remove
public void remove(Object[] keys, Identifiable rid)
-
createNewForCompaction
public LSMTreeIndexCompacted createNewForCompaction() throws IOException
- Throws:
IOException
-
iterator
public IndexCursor iterator(boolean ascendingOrder, Object[] fromKeys, boolean inclusive) throws IOException
- Throws:
IOException
-
range
public IndexCursor range(Object[] fromKeys, boolean beginKeysInclusive, Object[] toKeys, boolean endKeysInclusive) throws IOException
Auto determine if it's ascending or descending by checking the keys. In case of partial match index, pass the ascending parameter.- Throws:
IOException
-
range
public IndexCursor range(boolean ascending, Object[] fromKeys, boolean beginKeysInclusive, Object[] toKeys, boolean endKeysInclusive) throws IOException
- Throws:
IOException
-
newPageIterator
public LSMTreeIndexUnderlyingPageCursor newPageIterator(int pageId, int currentEntryInPage, boolean ascendingOrder) throws IOException
- Throws:
IOException
-
getSubIndex
public LSMTreeIndexCompacted getSubIndex()
-
get
public IndexCursor get(Object[] keys, int limit) throws IOException
- Throws:
IOException
-
getStats
public Map<String,Long> getStats()
- Overrides:
getStats
in classLSMTreeIndexAbstract
-
removeTempSuffix
public void removeTempSuffix()
- Overrides:
removeTempSuffix
in classLSMTreeIndexAbstract
-
compareKey
protected LSMTreeIndexAbstract.LookupResult compareKey(Binary currentPageBuffer, int startIndexArray, Object[] convertedKeys, int mid, int count, int purpose)
- Specified by:
compareKey
in classLSMTreeIndexAbstract
purpose
- 0 = exists, 1 = retrieve, 2 = ascending iterator, 3 = descending iterator
-
setCurrentMutablePages
public void setCurrentMutablePages(int currentMutablePages)
-
createNewPage
protected MutablePage createNewPage() throws IOException
- Throws:
IOException
-
internalRemove
protected void internalRemove(Object[] keys, Identifiable rid)
-
getRemovedRID
protected RID getRemovedRID(Identifiable record)
-
-