Class AbstractMemTable

    • Field Detail

      • memTableIdCounter

        public static final java.util.concurrent.atomic.AtomicLong memTableIdCounter
        each memTable node has a unique int value identifier, init when recovering wal
      • disableMemControl

        protected boolean disableMemControl
        The initial value is true because we want calculate the text data size when recover memTable!!
    • Constructor Detail

      • AbstractMemTable

        public AbstractMemTable()
    • Method Detail

      • insert

        public void insert​(InsertRowPlan insertRowPlan)
        Description copied from interface: IMemTable
        insert into this memtable
        Specified by:
        insert in interface IMemTable
        Parameters:
        insertRowPlan - insertRowPlan
      • insertTablet

        public void insertTablet​(InsertTabletPlan insertTabletPlan,
                                 int start,
                                 int end)
                          throws WriteProcessException
        Description copied from interface: IMemTable
        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}
        Specified by:
        insertTablet in interface IMemTable
        Parameters:
        insertTabletPlan - insertTabletPlan
        start - included
        end - excluded
        Throws:
        WriteProcessException
      • write

        public void write​(IDeviceID deviceId,
                          java.util.List<org.apache.iotdb.tsfile.write.schema.IMeasurementSchema> schemaList,
                          long insertTime,
                          java.lang.Object[] objectValue)
        Specified by:
        write in interface IMemTable
      • writeAlignedRow

        public void writeAlignedRow​(IDeviceID deviceId,
                                    java.util.List<org.apache.iotdb.tsfile.write.schema.IMeasurementSchema> schemaList,
                                    long insertTime,
                                    java.lang.Object[] objectValue)
        Specified by:
        writeAlignedRow in interface IMemTable
      • write

        public void write​(InsertTabletPlan insertTabletPlan,
                          int start,
                          int end)
        Description copied from interface: IMemTable
        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}
        Specified by:
        write in interface IMemTable
      • write

        public void write​(InsertTabletNode insertTabletNode,
                          int start,
                          int end)
      • writeAlignedTablet

        public void writeAlignedTablet​(InsertTabletNode insertTabletNode,
                                       int start,
                                       int end)
      • checkIfChunkDoesNotExist

        public boolean checkIfChunkDoesNotExist​(IDeviceID deviceId,
                                                java.lang.String measurement)
        Description copied from interface: IMemTable
        must guarantee the device exists in the work memtable only used when mem control enabled
        Specified by:
        checkIfChunkDoesNotExist in interface IMemTable
      • getCurrentTVListSize

        public long getCurrentTVListSize​(IDeviceID deviceId,
                                         java.lang.String measurement)
        Description copied from interface: IMemTable
        only used when mem control enabled
        Specified by:
        getCurrentTVListSize in interface IMemTable
      • size

        public long size()
        Specified by:
        size in interface IMemTable
        Returns:
        the number of points
      • memSize

        public long memSize()
        Specified by:
        memSize in interface IMemTable
        Returns:
        memory usage
      • reachTotalPointNumThreshold

        public boolean reachTotalPointNumThreshold()
        Description copied from interface: IMemTable
        only used when mem control enabled
        Specified by:
        reachTotalPointNumThreshold in interface IMemTable
        Returns:
        whether the average number of points in each WritableChunk reaches the threshold
      • clear

        public void clear()
        Description copied from interface: IMemTable
        putBack all the memory resources.
        Specified by:
        clear in interface IMemTable
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface IMemTable
      • delete

        public void delete​(org.apache.iotdb.commons.path.PartialPath originalPath,
                           org.apache.iotdb.commons.path.PartialPath devicePath,
                           long startTimestamp,
                           long endTimestamp)
        Description copied from interface: IMemTable
        Delete data in it whose timestamp <= 'timestamp' and belonging to timeseries path. Only called for non-flushing MemTable.
        Specified by:
        delete in interface IMemTable
        Parameters:
        originalPath - 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
      • addTVListRamCost

        public void addTVListRamCost​(long cost)
        Description copied from interface: IMemTable
        only used when mem control enabled
        Specified by:
        addTVListRamCost in interface IMemTable
      • releaseTVListRamCost

        public void releaseTVListRamCost​(long cost)
        Description copied from interface: IMemTable
        only used when mem control enabled
        Specified by:
        releaseTVListRamCost in interface IMemTable
      • getTVListsRamCost

        public long getTVListsRamCost()
        Description copied from interface: IMemTable
        only used when mem control enabled
        Specified by:
        getTVListsRamCost in interface IMemTable
      • addTextDataSize

        public void addTextDataSize​(long textDataSize)
        Description copied from interface: IMemTable
        only used when mem control enabled
        Specified by:
        addTextDataSize in interface IMemTable
      • releaseTextDataSize

        public void releaseTextDataSize​(long textDataSize)
        Description copied from interface: IMemTable
        only used when mem control enabled
        Specified by:
        releaseTextDataSize in interface IMemTable
      • release

        public void release()
        Description copied from interface: IMemTable
        release resource of this memtable
        Specified by:
        release in interface IMemTable
      • serializedSize

        public int serializedSize()
        Notice: this method is concurrent unsafe
        Specified by:
        serializedSize in interface SerializedSize
        Returns:
        bytes number
      • deserialize

        public void deserialize​(java.io.DataInputStream stream)
                         throws java.io.IOException
        Throws:
        java.io.IOException