Class IDTableHashmapImpl

  • All Implemented Interfaces:
    IDTable

    public class IDTableHashmapImpl
    extends java.lang.Object
    implements IDTable
    id table belongs to a storage group and mapping timeseries path to it's schema
    • Field Detail

      • config

        protected static IoTDBConfig config
        iotdb config
    • Constructor Detail

      • IDTableHashmapImpl

        public IDTableHashmapImpl​(java.io.File storageGroupDir)
    • Method Detail

      • createAlignedTimeseries

        public void createAlignedTimeseries​(CreateAlignedTimeSeriesPlan plan)
                                     throws org.apache.iotdb.commons.exception.MetadataException
        create aligned timeseries
        Specified by:
        createAlignedTimeseries in interface IDTable
        Parameters:
        plan - create aligned timeseries plan
        Throws:
        org.apache.iotdb.commons.exception.MetadataException - if the device is not aligned, throw it
      • createTimeseries

        public void createTimeseries​(CreateTimeSeriesPlan plan)
                              throws org.apache.iotdb.commons.exception.MetadataException
        create timeseries
        Specified by:
        createTimeseries in interface IDTable
        Parameters:
        plan - create timeseries plan
        Throws:
        org.apache.iotdb.commons.exception.MetadataException - if the device is aligned, throw it
      • deleteTimeseries

        public org.apache.iotdb.tsfile.utils.Pair<java.lang.Integer,​java.util.Set<java.lang.String>> deleteTimeseries​(java.util.List<org.apache.iotdb.commons.path.PartialPath> fullPaths)
                                                                                                                     throws org.apache.iotdb.commons.exception.MetadataException
        Delete all timeseries matching the given paths
        Specified by:
        deleteTimeseries in interface IDTable
        Parameters:
        fullPaths - paths to be deleted
        Returns:
        deletion failed Timeseries
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getSeriesSchemas

        public IDeviceID getSeriesSchemas​(InsertPlan plan)
                                   throws org.apache.iotdb.commons.exception.MetadataException
        check inserting timeseries existence and fill their measurement mnode
        Specified by:
        getSeriesSchemas in interface IDTable
        Parameters:
        plan - insert plan
        Returns:
        reusable device id
        Throws:
        org.apache.iotdb.commons.exception.MetadataException - if insert plan's aligned value is inconsistent with device
      • registerTrigger

        public void registerTrigger​(org.apache.iotdb.commons.path.PartialPath fullPath,
                                    IMeasurementMNode measurementMNode)
                             throws org.apache.iotdb.commons.exception.MetadataException
        register trigger to the timeseries
        Specified by:
        registerTrigger in interface IDTable
        Parameters:
        fullPath - full path of the timeseries
        measurementMNode - the timeseries measurement mnode
        Throws:
        org.apache.iotdb.commons.exception.MetadataException - if the timeseries is not exits
      • deregisterTrigger

        public void deregisterTrigger​(org.apache.iotdb.commons.path.PartialPath fullPath,
                                      IMeasurementMNode measurementMNode)
                               throws org.apache.iotdb.commons.exception.MetadataException
        deregister trigger to the timeseries
        Specified by:
        deregisterTrigger in interface IDTable
        Parameters:
        fullPath - full path of the timeseries
        measurementMNode - the timeseries measurement mnode
        Throws:
        org.apache.iotdb.commons.exception.MetadataException - if the timeseries is not exits
      • getLastCache

        public org.apache.iotdb.tsfile.read.TimeValuePair getLastCache​(TimeseriesID timeseriesID)
                                                                throws org.apache.iotdb.commons.exception.MetadataException
        get last cache of the timeseies
        Specified by:
        getLastCache in interface IDTable
        Parameters:
        timeseriesID - timeseries ID of the timeseries
        Throws:
        org.apache.iotdb.commons.exception.MetadataException - if the timeseries is not exits
      • updateLastCache

        public void updateLastCache​(TimeseriesID timeseriesID,
                                    org.apache.iotdb.tsfile.read.TimeValuePair pair,
                                    boolean highPriorityUpdate,
                                    java.lang.Long latestFlushedTime)
                             throws org.apache.iotdb.commons.exception.MetadataException
        update last cache of the timeseies
        Specified by:
        updateLastCache in interface IDTable
        Parameters:
        timeseriesID - timeseries ID of the timeseries
        pair - last time value pair
        highPriorityUpdate - is high priority update
        latestFlushedTime - last flushed time
        Throws:
        org.apache.iotdb.commons.exception.MetadataException - if the timeseries is not exits
      • clear

        public void clear()
                   throws java.io.IOException
        Description copied from interface: IDTable
        clear id table and close file
        Specified by:
        clear in interface IDTable
        Throws:
        java.io.IOException
      • getDeviceEntry

        public DeviceEntry getDeviceEntry​(java.lang.String deviceName)
        get device entry from device path
        Specified by:
        getDeviceEntry in interface IDTable
        Parameters:
        deviceName - device name of the time series
        Returns:
        device entry of the timeseries
      • getSeriesSchema

        public org.apache.iotdb.tsfile.write.schema.IMeasurementSchema getSeriesSchema​(java.lang.String deviceName,
                                                                                       java.lang.String measurementName)
        get schema from device and measurements
        Specified by:
        getSeriesSchema in interface IDTable
        Parameters:
        deviceName - device name of the time series
        measurementName - measurement name of the time series
        Returns:
        schema entry of the timeseries
      • getAllDeviceEntry

        public java.util.List<DeviceEntry> getAllDeviceEntry()
        Description copied from interface: IDTable
        get all device entries
        Specified by:
        getAllDeviceEntry in interface IDTable
        Returns:
        all device entries
      • putSchemaEntry

        public void putSchemaEntry​(java.lang.String devicePath,
                                   java.lang.String measurement,
                                   SchemaEntry schemaEntry,
                                   boolean isAligned)
                            throws org.apache.iotdb.commons.exception.MetadataException
        Description copied from interface: IDTable
        put schema entry to id table, currently used in recover
        Specified by:
        putSchemaEntry in interface IDTable
        Parameters:
        devicePath - device path (can be device id formed path)
        measurement - measurement name
        schemaEntry - schema entry to put
        isAligned - is the device aligned
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getDiskSchemaEntries

        public java.util.List<DiskSchemaEntry> getDiskSchemaEntries​(java.util.List<SchemaEntry> schemaEntries)
        get DiskSchemaEntries from disk file
        Specified by:
        getDiskSchemaEntries in interface IDTable
        Parameters:
        schemaEntries - get the disk pointers from schemaEntries
        Returns:
        DiskSchemaEntries