Interface IMemTable
-
- All Superinterfaces:
SerializedSize,WALEntryValue
- All Known Implementing Classes:
AbstractMemTable,NotifyFlushMemTable,PrimitiveMemTable
public interface IMemTable extends WALEntryValue
IMemTable is designed to store data points which are not flushed into TsFile yet. An instance of IMemTable maintains all series belonging to one StorageGroup, corresponding to one StorageGroupProcessor.
The concurrent control of IMemTable is based on the concurrent control of StorageGroupProcessor, i.e., Writing and querying operations must already have gotten writeLock and readLock respectively.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddTextDataSize(long textDataIncrement)only used when mem control enabledvoidaddTVListRamCost(long cost)only used when mem control enabledbooleancheckIfChunkDoesNotExist(IDeviceID deviceId, java.lang.String measurement)must guarantee the device exists in the work memtable only used when mem control enabledvoidclear()putBack all the memory resources.IMemTablecopy()Make a copy of this MemTable.voiddelete(org.apache.iotdb.commons.path.PartialPath path, org.apache.iotdb.commons.path.PartialPath devicePath, long startTimestamp, long endTimestamp)Delete data in it whose timestamp <= 'timestamp' and belonging to timeseries path.longgetCreatedTime()longgetCurrentTVListSize(IDeviceID deviceId, java.lang.String measurement)only used when mem control enabledFlushStatusgetFlushStatus()longgetMaxPlanIndex()longgetMemTableId()java.util.Map<IDeviceID,IWritableMemChunkGroup>getMemTableMap()longgetMinPlanIndex()intgetSeriesNumber()longgetTotalPointsNum()longgetTVListsRamCost()only used when mem control enabledvoidinsert(InsertRowNode insertRowNode)voidinsert(InsertRowPlan insertRowPlan)insert into this memtablevoidinsertAlignedRow(InsertRowNode insertRowNode)voidinsertAlignedRow(InsertRowPlan insertRowPlan)voidinsertAlignedTablet(InsertTabletNode insertTabletNode, int start, int end)voidinsertAlignedTablet(InsertTabletPlan insertTabletPlan, int start, int end)voidinsertTablet(InsertTabletNode insertTabletNode, int start, int end)voidinsertTablet(InsertTabletPlan insertTabletPlan, int start, int end)insert tablet into this memtable.booleanisEmpty()booleanisSignalMemTable()longmemSize()ReadOnlyMemChunkquery(org.apache.iotdb.commons.path.PartialPath fullPath, long ttlLowerBound, java.util.List<org.apache.iotdb.tsfile.utils.Pair<Modification,IMemTable>> modsToMemtable)booleanreachTotalPointNumThreshold()only used when mem control enabledvoidrelease()release resource of this memtablevoidreleaseTextDataSize(long textDataDecrement)only used when mem control enabledvoidreleaseTVListRamCost(long cost)only used when mem control enabledvoidsetFlushStatus(FlushStatus flushStatus)voidsetShouldFlush()booleanshouldFlush()longsize()voidwrite(IDeviceID deviceId, java.util.List<org.apache.iotdb.tsfile.write.schema.IMeasurementSchema> schemaList, long insertTime, java.lang.Object[] objectValue)voidwrite(InsertTabletPlan insertTabletPlan, int start, int end)write data in the range [start, end).voidwriteAlignedRow(IDeviceID deviceId, java.util.List<org.apache.iotdb.tsfile.write.schema.IMeasurementSchema> schemaList, long insertTime, java.lang.Object[] objectValue)voidwriteAlignedTablet(InsertTabletPlan insertTabletPlan, int start, int end)-
Methods inherited from interface org.apache.iotdb.db.utils.SerializedSize
serializedSize
-
Methods inherited from interface org.apache.iotdb.db.wal.buffer.WALEntryValue
serializeToWAL
-
-
-
-
Method Detail
-
getMemTableMap
java.util.Map<IDeviceID,IWritableMemChunkGroup> getMemTableMap()
-
write
void write(IDeviceID deviceId, java.util.List<org.apache.iotdb.tsfile.write.schema.IMeasurementSchema> schemaList, long insertTime, java.lang.Object[] objectValue)
-
writeAlignedRow
void writeAlignedRow(IDeviceID deviceId, java.util.List<org.apache.iotdb.tsfile.write.schema.IMeasurementSchema> schemaList, long insertTime, java.lang.Object[] objectValue)
-
write
void write(InsertTabletPlan insertTabletPlan, int start, int end)
write data in the range [start, end). Null value in each column values will be replaced by the subsequent non-null value, e.g., {1, null, 3, null, 5} will be {1, 3, 5, null, 5}
-
writeAlignedTablet
void writeAlignedTablet(InsertTabletPlan insertTabletPlan, int start, int end)
-
size
long size()
- Returns:
- the number of points
-
memSize
long memSize()
- Returns:
- memory usage
-
addTVListRamCost
void addTVListRamCost(long cost)
only used when mem control enabled
-
releaseTVListRamCost
void releaseTVListRamCost(long cost)
only used when mem control enabled
-
getTVListsRamCost
long getTVListsRamCost()
only used when mem control enabled
-
reachTotalPointNumThreshold
boolean reachTotalPointNumThreshold()
only used when mem control enabled- Returns:
- whether the average number of points in each WritableChunk reaches the threshold
-
getSeriesNumber
int getSeriesNumber()
-
getTotalPointsNum
long getTotalPointsNum()
-
insert
void insert(InsertRowPlan insertRowPlan)
insert into this memtable- Parameters:
insertRowPlan- insertRowPlan
-
insertAlignedRow
void insertAlignedRow(InsertRowPlan insertRowPlan)
-
insert
void insert(InsertRowNode insertRowNode)
-
insertAlignedRow
void insertAlignedRow(InsertRowNode insertRowNode)
-
insertTablet
void insertTablet(InsertTabletPlan insertTabletPlan, int start, int end) throws WriteProcessException
insert tablet into this memtable. The rows to be inserted are in the range [start, end). Null value in each column values will be replaced by the subsequent non-null value, e.g., {1, null, 3, null, 5} will be {1, 3, 5, null, 5}- Parameters:
insertTabletPlan- insertTabletPlanstart- includedend- excluded- Throws:
WriteProcessException
-
insertAlignedTablet
void insertAlignedTablet(InsertTabletPlan insertTabletPlan, int start, int end) throws WriteProcessException
- Throws:
WriteProcessException
-
insertTablet
void insertTablet(InsertTabletNode insertTabletNode, int start, int end) throws WriteProcessException
- Throws:
WriteProcessException
-
insertAlignedTablet
void insertAlignedTablet(InsertTabletNode insertTabletNode, int start, int end) throws WriteProcessException
- Throws:
WriteProcessException
-
query
ReadOnlyMemChunk query(org.apache.iotdb.commons.path.PartialPath fullPath, long ttlLowerBound, java.util.List<org.apache.iotdb.tsfile.utils.Pair<Modification,IMemTable>> modsToMemtable) throws java.io.IOException, QueryProcessException, org.apache.iotdb.commons.exception.MetadataException
- Throws:
java.io.IOExceptionQueryProcessExceptionorg.apache.iotdb.commons.exception.MetadataException
-
clear
void clear()
putBack all the memory resources.
-
isEmpty
boolean isEmpty()
-
delete
void delete(org.apache.iotdb.commons.path.PartialPath path, org.apache.iotdb.commons.path.PartialPath devicePath, long startTimestamp, long endTimestamp)Delete data in it whose timestamp <= 'timestamp' and belonging to timeseries path. Only called for non-flushing MemTable.- Parameters:
path- the PartialPath the timeseries to be deleted.devicePath- the device path of the timeseries to be deleted.startTimestamp- the lower-bound of deletion time.endTimestamp- the upper-bound of deletion time
-
copy
IMemTable copy()
Make a copy of this MemTable.- Returns:
- a MemTable with the same data as this one.
-
isSignalMemTable
boolean isSignalMemTable()
-
setShouldFlush
void setShouldFlush()
-
shouldFlush
boolean shouldFlush()
-
release
void release()
release resource of this memtable
-
checkIfChunkDoesNotExist
boolean checkIfChunkDoesNotExist(IDeviceID deviceId, java.lang.String measurement)
must guarantee the device exists in the work memtable only used when mem control enabled
-
getCurrentTVListSize
long getCurrentTVListSize(IDeviceID deviceId, java.lang.String measurement)
only used when mem control enabled
-
addTextDataSize
void addTextDataSize(long textDataIncrement)
only used when mem control enabled
-
releaseTextDataSize
void releaseTextDataSize(long textDataDecrement)
only used when mem control enabled
-
getMaxPlanIndex
long getMaxPlanIndex()
-
getMinPlanIndex
long getMinPlanIndex()
-
getMemTableId
long getMemTableId()
-
getCreatedTime
long getCreatedTime()
-
getFlushStatus
FlushStatus getFlushStatus()
-
setFlushStatus
void setFlushStatus(FlushStatus flushStatus)
-
-