Class LocalSchemaProcessor


  • public class LocalSchemaProcessor
    extends java.lang.Object
    This class takes the responsibility of serialization of all the metadata info and persistent it into files. This class contains all the interfaces to modify the metadata for delta system.

    Since there are too many interfaces and methods in this class, we use code region to help manage code. The code region starts with //region and ends with //endregion. When using Intellij Idea to develop, it's easy to fold the code region and see code region overview by collapsing all.

    The codes are divided into the following code regions:

    1. SchemaProcessor Singleton
    2. Interfaces and Implementation of Operating PhysicalPlans of Metadata
    3. Interfaces and Implementation for Timeseries operation
    4. Interfaces and Implementation for StorageGroup and TTL operation
    5. Interfaces for metadata info Query
      1. Interfaces for metadata count
      2. Interfaces for level Node info Query
      3. Interfaces for StorageGroup and TTL info Query
      4. Interfaces for Entity/Device info Query
      5. Interfaces for timeseries, measurement and schema info Query
    6. Interfaces and methods for MNode query
    7. Interfaces for alias and tag/attribute operations
    8. Interfaces only for Cluster module usage
    9. Interfaces for lastCache operations
    10. Interfaces and Implementation for InsertPlan process
    11. Interfaces and Implementation for Template operations
    12. Interfaces for Trigger
    13. TestOnly Interfaces
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  LocalSchemaProcessor.StorageGroupFilter
      StorageGroupFilter filters unsatisfied storage groups in metadata queries to speed up and deduplicate.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static IoTDBConfig config  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected LocalSchemaProcessor()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAttributes​(java.util.Map<java.lang.String,​java.lang.String> attributesMap, org.apache.iotdb.commons.path.PartialPath fullPath)
      add new attributes key-value for the timeseries
      void addTags​(java.util.Map<java.lang.String,​java.lang.String> tagsMap, org.apache.iotdb.commons.path.PartialPath fullPath)
      add new tags key-value for the timeseries
      void appendSchemaTemplate​(AppendTemplatePlan plan)  
      void cacheMeta​(org.apache.iotdb.commons.path.PartialPath path, IMeasurementMNode measurementMNode, boolean needSetFullPath)
      if the path is in local mtree, nothing needed to do (because mtree is in the memory); Otherwise cache the path to mRemoteSchemaCache
      void changeAlias​(org.apache.iotdb.commons.path.PartialPath path, java.lang.String alias)  
      boolean checkStorageGroupByPath​(org.apache.iotdb.commons.path.PartialPath path)
      Check whether the given path contains a storage group
      int countMeasurementsInTemplate​(java.lang.String templateName)  
      void createAlignedTimeSeries​(org.apache.iotdb.commons.path.PartialPath prefixPath, java.util.List<java.lang.String> measurements, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> dataTypes, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding> encodings, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.CompressionType> compressors)  
      void createAlignedTimeSeries​(CreateAlignedTimeSeriesPlan plan)
      create aligned timeseries
      void createSchemaTemplate​(CreateTemplatePlan plan)  
      void createTimeseries​(org.apache.iotdb.commons.path.PartialPath path, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType dataType, org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding encoding, org.apache.iotdb.tsfile.file.metadata.enums.CompressionType compressor, java.util.Map<java.lang.String,​java.lang.String> props)
      Add one timeseries to metadata tree, if the timeseries already exists, throw exception
      void createTimeseries​(CreateTimeSeriesPlan plan)  
      void createTimeseries​(CreateTimeSeriesPlan plan, long offset)  
      void deleteLastCacheByDevice​(org.apache.iotdb.commons.path.PartialPath deviceId)
      delete all the last cache value of any timeseries or aligned timeseries under the device
      void deleteLastCacheByDevice​(org.apache.iotdb.commons.path.PartialPath deviceId, org.apache.iotdb.commons.path.PartialPath originalPath, long startTime, long endTime)
      delete the last cache value of timeseries or subMeasurement of some aligned timeseries, which is under the device and matching the originalPath
      void deleteStorageGroups​(java.util.List<org.apache.iotdb.commons.path.PartialPath> storageGroups)
      Delete storage groups of given paths from MTree.
      java.lang.String deleteTimeseries​(org.apache.iotdb.commons.path.PartialPath pathPattern)
      Delete all timeseries matching the given path pattern, may cross different storage group
      java.lang.String deleteTimeseries​(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch)
      Delete all timeseries matching the given path pattern, may cross different storage group.
      void dropSchemaTemplate​(DropTemplatePlan plan)  
      void dropTagsOrAttributes​(java.util.Set<java.lang.String> keySet, org.apache.iotdb.commons.path.PartialPath fullPath)
      drop tags or attributes of the timeseries
      void forceMlog()  
      java.util.List<MeasurementPath> getAllMeasurementByDevicePath​(org.apache.iotdb.commons.path.PartialPath devicePath)  
      java.util.List<IStorageGroupMNode> getAllStorageGroupNodes()
      Get all storage group MNodes
      java.util.List<org.apache.iotdb.commons.path.PartialPath> getAllStorageGroupPaths()
      Get all storage group paths
      java.util.Set<java.lang.String> getAllTemplates()  
      int getAllTimeseriesCount​(org.apache.iotdb.commons.path.PartialPath pathPattern)
      To calculate the count of timeseries matching given path.
      int getAllTimeseriesCount​(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch)
      To calculate the count of timeseries matching given path.
      java.util.Set<org.apache.iotdb.commons.path.PartialPath> getBelongedDevices​(org.apache.iotdb.commons.path.PartialPath timeseries)
      Get all devices that one of the timeseries, matching the given timeseries path pattern, belongs to.
      org.apache.iotdb.commons.path.PartialPath getBelongedStorageGroup​(org.apache.iotdb.commons.path.PartialPath path)
      Get storage group name by path
      java.util.List<org.apache.iotdb.commons.path.PartialPath> getBelongedStorageGroups​(org.apache.iotdb.commons.path.PartialPath pathPattern)
      Get the storage group that given path pattern matches or belongs to.
      java.util.Set<java.lang.String> getChildNodeNameInNextLevel​(org.apache.iotdb.commons.path.PartialPath pathPattern)
      Get child node in the next level of the given path pattern.
      java.util.Set<org.apache.iotdb.common.rpc.thrift.TSchemaNode> getChildNodePathInNextLevel​(org.apache.iotdb.commons.path.PartialPath pathPattern)
      Get child node path in the next level of the given path pattern.
      java.lang.String getDeviceId​(org.apache.iotdb.commons.path.PartialPath devicePath)
      To reduce the String number in memory, use the deviceId from SchemaProcessor instead of the deviceId read from disk
      IMNode getDeviceNode​(org.apache.iotdb.commons.path.PartialPath path)  
      int getDevicesNum​(org.apache.iotdb.commons.path.PartialPath pathPattern)
      To calculate the count of devices for given path pattern.
      int getDevicesNum​(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch)
      To calculate the count of devices for given path pattern.
      static LocalSchemaProcessor getInstance()
      we should not use this function in other place, but only in IoTDB class
      org.apache.iotdb.tsfile.read.TimeValuePair getLastCache​(org.apache.iotdb.commons.path.PartialPath seriesPath)
      Get the last cache value of time series of given seriesPath.
      org.apache.iotdb.tsfile.read.TimeValuePair getLastCache​(IMeasurementMNode node)
      Get the last cache value in given MeasurementMNode.
      java.util.Set<org.apache.iotdb.commons.path.PartialPath> getMatchedDevices​(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch)
      Get all device paths matching the path pattern.
      java.util.List<ShowDevicesResult> getMatchedDevices​(ShowDevicesPlan plan)
      Get all device paths and according storage group paths as ShowDevicesResult.
      java.util.List<org.apache.iotdb.commons.path.PartialPath> getMatchedStorageGroups​(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch)
      Get all storage group matching given path pattern.
      java.util.Map<org.apache.iotdb.commons.path.PartialPath,​java.lang.Integer> getMeasurementCountGroupByLevel​(org.apache.iotdb.commons.path.PartialPath pathPattern, int level, boolean isPrefixMatch)  
      IMeasurementMNode getMeasurementMNode​(org.apache.iotdb.commons.path.PartialPath fullPath)  
      protected IMeasurementMNode getMeasurementMNode​(IMNode deviceMNode, java.lang.String measurementName)
      Invoked during insertPlan process.
      java.util.List<MeasurementPath> getMeasurementPaths​(org.apache.iotdb.commons.path.PartialPath pathPattern)
      Return all measurement paths for given path if the path is abstract.
      java.util.List<MeasurementPath> getMeasurementPaths​(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch)
      Return all measurement paths for given path if the path is abstract.
      org.apache.iotdb.tsfile.utils.Pair<java.util.List<MeasurementPath>,​java.lang.Integer> getMeasurementPathsWithAlias​(org.apache.iotdb.commons.path.PartialPath pathPattern, int limit, int offset, boolean isPrefixMatch)
      Similar to method getMeasurementPaths(), but return Path with alias and filter the result by limit and offset.
      java.util.List<java.lang.String> getMeasurementsInTemplate​(java.lang.String templateName, java.lang.String path)  
      java.lang.String getMetadataInString()
      Get metadata in string
      IMNode getMNodeForTrigger​(org.apache.iotdb.commons.path.PartialPath fullPath)  
      int getNodesCountInGivenLevel​(org.apache.iotdb.commons.path.PartialPath pathPattern, int level)
      To calculate the count of nodes in the given level for given path pattern.
      int getNodesCountInGivenLevel​(org.apache.iotdb.commons.path.PartialPath pathPattern, int level, boolean isPrefixMatch)
      To calculate the count of nodes in the given level for given path pattern.
      java.util.List<org.apache.iotdb.commons.path.PartialPath> getNodesListInGivenLevel​(org.apache.iotdb.commons.path.PartialPath pathPattern, int nodeLevel)
      Get all nodes matching the given path pattern in the given level.
      java.util.List<org.apache.iotdb.commons.path.PartialPath> getNodesListInGivenLevel​(org.apache.iotdb.commons.path.PartialPath pathPattern, int nodeLevel, LocalSchemaProcessor.StorageGroupFilter filter)  
      java.util.Set<java.lang.String> getPathsSetTemplate​(java.lang.String templateName)
      Get all paths set designated template
      java.util.Set<java.lang.String> getPathsUsingTemplate​(java.lang.String templateName)  
      java.util.List<org.apache.iotdb.tsfile.utils.Pair<java.lang.String,​org.apache.iotdb.tsfile.write.schema.IMeasurementSchema>> getSchemasInTemplate​(java.lang.String templateName, java.lang.String path)  
      org.apache.iotdb.tsfile.write.schema.IMeasurementSchema getSeriesSchema​(org.apache.iotdb.commons.path.PartialPath fullPath)
      Get schema of paritialPath
      IMNode getSeriesSchemasAndReadLockDevice​(InsertPlan plan)
      get schema for device.
      org.apache.iotdb.tsfile.file.metadata.enums.TSDataType getSeriesType​(org.apache.iotdb.commons.path.PartialPath fullPath)
      Get series type for given seriesPath.
      IStorageGroupMNode getStorageGroupNodeByPath​(org.apache.iotdb.commons.path.PartialPath path)
      Get storage group node by path.
      int getStorageGroupNum​(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch)
      To calculate the count of storage group for given path pattern.
      java.util.Map<org.apache.iotdb.commons.path.PartialPath,​java.lang.Long> getStorageGroupsTTL()
      get all storageGroups ttl
      Template getTemplate​(java.lang.String templateName)  
      long getTotalSeriesNumber()  
      java.util.Map<java.lang.String,​java.util.List<org.apache.iotdb.commons.path.PartialPath>> groupPathByStorageGroup​(org.apache.iotdb.commons.path.PartialPath path)
      For a path, infer all storage groups it may belong to.
      boolean isMeasurementInTemplate​(java.lang.String templateName, java.lang.String path)  
      boolean isPathExist​(org.apache.iotdb.commons.path.PartialPath path)
      Check whether the path exists.
      boolean isPathExistsInTemplate​(java.lang.String templateName, java.lang.String path)  
      boolean isStorageGroup​(org.apache.iotdb.commons.path.PartialPath path)
      Check if the given path is storage group or not.
      void operation​(PhysicalPlan plan)  
      void pruneSchemaTemplate​(PruneTemplatePlan plan)  
      void releaseMNodeAfterDropTrigger​(IMNode imNode)  
      void renameTagOrAttributeKey​(java.lang.String oldKey, java.lang.String newKey, org.apache.iotdb.commons.path.PartialPath fullPath)
      rename the tag or attribute's key of the timeseries
      void resetLastCache​(org.apache.iotdb.commons.path.PartialPath seriesPath)
      Reset the last cache value of time series of given seriesPath.
      void setSchemaTemplate​(SetTemplatePlan plan)  
      void setStorageGroup​(org.apache.iotdb.commons.path.PartialPath storageGroup)
      Set storage group of the given path to MTree.
      void setTagsOrAttributesValue​(java.util.Map<java.lang.String,​java.lang.String> alterMap, org.apache.iotdb.commons.path.PartialPath fullPath)
      set/change the values of tags or attributes
      void setTTL​(org.apache.iotdb.commons.path.PartialPath storageGroup, long dataTTL)  
      void setUsingSchemaTemplate​(ActivateTemplatePlan plan)  
      java.util.List<ShowTimeSeriesResult> showTimeseries​(ShowTimeSeriesPlan plan, QueryContext context)  
      void unsetSchemaTemplate​(UnsetTemplatePlan plan)  
      void updateLastCache​(org.apache.iotdb.commons.path.PartialPath seriesPath, org.apache.iotdb.tsfile.read.TimeValuePair timeValuePair, boolean highPriorityUpdate, java.lang.Long latestFlushedTime)
      Update the last cache value of time series of given seriesPath.
      void updateLastCache​(IMeasurementMNode node, org.apache.iotdb.tsfile.read.TimeValuePair timeValuePair, boolean highPriorityUpdate, java.lang.Long latestFlushedTime)
      Update the last cache value in given MeasurementMNode.
      void upsertTagsAndAttributes​(java.lang.String alias, java.util.Map<java.lang.String,​java.lang.String> tagsMap, java.util.Map<java.lang.String,​java.lang.String> attributesMap, org.apache.iotdb.commons.path.PartialPath fullPath)
      upsert tags and attributes key-value for the timeseries if the key has existed, just use the new value to update it.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LocalSchemaProcessor

        protected LocalSchemaProcessor()
    • Method Detail

      • getInstance

        public static LocalSchemaProcessor getInstance()
        we should not use this function in other place, but only in IoTDB class
      • operation

        public void operation​(PhysicalPlan plan)
                       throws java.io.IOException,
                              org.apache.iotdb.commons.exception.MetadataException
        Throws:
        java.io.IOException
        org.apache.iotdb.commons.exception.MetadataException
      • createTimeseries

        public void createTimeseries​(CreateTimeSeriesPlan plan)
                              throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • createTimeseries

        public void createTimeseries​(CreateTimeSeriesPlan plan,
                                     long offset)
                              throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • createTimeseries

        public void createTimeseries​(org.apache.iotdb.commons.path.PartialPath path,
                                     org.apache.iotdb.tsfile.file.metadata.enums.TSDataType dataType,
                                     org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding encoding,
                                     org.apache.iotdb.tsfile.file.metadata.enums.CompressionType compressor,
                                     java.util.Map<java.lang.String,​java.lang.String> props)
                              throws org.apache.iotdb.commons.exception.MetadataException
        Add one timeseries to metadata tree, if the timeseries already exists, throw exception
        Parameters:
        path - the timeseries path
        dataType - the dateType DataType of the timeseries
        encoding - the encoding function Encoding of the timeseries
        compressor - the compressor function Compressor of the time series
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • createAlignedTimeSeries

        public void createAlignedTimeSeries​(org.apache.iotdb.commons.path.PartialPath prefixPath,
                                            java.util.List<java.lang.String> measurements,
                                            java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> dataTypes,
                                            java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding> encodings,
                                            java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.CompressionType> compressors)
                                     throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • createAlignedTimeSeries

        public void createAlignedTimeSeries​(CreateAlignedTimeSeriesPlan plan)
                                     throws org.apache.iotdb.commons.exception.MetadataException
        create aligned timeseries
        Parameters:
        plan - CreateAlignedTimeSeriesPlan
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • deleteTimeseries

        public java.lang.String deleteTimeseries​(org.apache.iotdb.commons.path.PartialPath pathPattern,
                                                 boolean isPrefixMatch)
                                          throws org.apache.iotdb.commons.exception.MetadataException
        Delete all timeseries matching the given path pattern, may cross different storage group. If using prefix match, the path pattern is used to match prefix path. All timeseries start with the matched prefix path will be deleted.
        Parameters:
        pathPattern - path to be deleted
        isPrefixMatch - if true, the path pattern is used to match prefix path
        Returns:
        deletion failed Timeseries
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • deleteTimeseries

        public java.lang.String deleteTimeseries​(org.apache.iotdb.commons.path.PartialPath pathPattern)
                                          throws org.apache.iotdb.commons.exception.MetadataException
        Delete all timeseries matching the given path pattern, may cross different storage group
        Parameters:
        pathPattern - path to be deleted
        Returns:
        deletion failed Timeseries
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • setStorageGroup

        public void setStorageGroup​(org.apache.iotdb.commons.path.PartialPath storageGroup)
                             throws org.apache.iotdb.commons.exception.MetadataException
        Set storage group of the given path to MTree.
        Parameters:
        storageGroup - root.node.(node)*
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • deleteStorageGroups

        public void deleteStorageGroups​(java.util.List<org.apache.iotdb.commons.path.PartialPath> storageGroups)
                                 throws org.apache.iotdb.commons.exception.MetadataException
        Delete storage groups of given paths from MTree.
        Parameters:
        storageGroups - list of paths to be deleted.
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • setTTL

        public void setTTL​(org.apache.iotdb.commons.path.PartialPath storageGroup,
                           long dataTTL)
                    throws org.apache.iotdb.commons.exception.MetadataException,
                           java.io.IOException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
        java.io.IOException
      • isPathExist

        public boolean isPathExist​(org.apache.iotdb.commons.path.PartialPath path)
        Check whether the path exists.
        Parameters:
        path - a full path or a prefix path
      • getMetadataInString

        public java.lang.String getMetadataInString()
        Get metadata in string
      • getAllTimeseriesCount

        public int getAllTimeseriesCount​(org.apache.iotdb.commons.path.PartialPath pathPattern,
                                         boolean isPrefixMatch)
                                  throws org.apache.iotdb.commons.exception.MetadataException
        To calculate the count of timeseries matching given path. The path could be a pattern of a full path, may contain wildcard. If using prefix match, the path pattern is used to match prefix path. All timeseries start with the matched prefix path will be counted.
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getAllTimeseriesCount

        public int getAllTimeseriesCount​(org.apache.iotdb.commons.path.PartialPath pathPattern)
                                  throws org.apache.iotdb.commons.exception.MetadataException
        To calculate the count of timeseries matching given path. The path could be a pattern of a full path, may contain wildcard.
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getDevicesNum

        public int getDevicesNum​(org.apache.iotdb.commons.path.PartialPath pathPattern,
                                 boolean isPrefixMatch)
                          throws org.apache.iotdb.commons.exception.MetadataException
        To calculate the count of devices for given path pattern. If using prefix match, the path pattern is used to match prefix path. All timeseries start with the matched prefix path will be counted.
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getDevicesNum

        public int getDevicesNum​(org.apache.iotdb.commons.path.PartialPath pathPattern)
                          throws org.apache.iotdb.commons.exception.MetadataException
        To calculate the count of devices for given path pattern.
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getStorageGroupNum

        public int getStorageGroupNum​(org.apache.iotdb.commons.path.PartialPath pathPattern,
                                      boolean isPrefixMatch)
                               throws org.apache.iotdb.commons.exception.MetadataException
        To calculate the count of storage group for given path pattern. If using prefix match, the path pattern is used to match prefix path. All timeseries start with the matched prefix path will be counted.
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getNodesCountInGivenLevel

        public int getNodesCountInGivenLevel​(org.apache.iotdb.commons.path.PartialPath pathPattern,
                                             int level,
                                             boolean isPrefixMatch)
                                      throws org.apache.iotdb.commons.exception.MetadataException
        To calculate the count of nodes in the given level for given path pattern. If using prefix match, the path pattern is used to match prefix path. All nodes start with the matched prefix path will be counted.
        Parameters:
        pathPattern - a path pattern or a full path
        level - the level should match the level of the path
        isPrefixMatch - if true, the path pattern is used to match prefix path
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getNodesCountInGivenLevel

        public int getNodesCountInGivenLevel​(org.apache.iotdb.commons.path.PartialPath pathPattern,
                                             int level)
                                      throws org.apache.iotdb.commons.exception.MetadataException
        To calculate the count of nodes in the given level for given path pattern.
        Parameters:
        pathPattern - a path pattern or a full path
        level - the level should match the level of the path
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getMeasurementCountGroupByLevel

        public java.util.Map<org.apache.iotdb.commons.path.PartialPath,​java.lang.Integer> getMeasurementCountGroupByLevel​(org.apache.iotdb.commons.path.PartialPath pathPattern,
                                                                                                                                int level,
                                                                                                                                boolean isPrefixMatch)
                                                                                                                         throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getNodesListInGivenLevel

        public java.util.List<org.apache.iotdb.commons.path.PartialPath> getNodesListInGivenLevel​(org.apache.iotdb.commons.path.PartialPath pathPattern,
                                                                                                  int nodeLevel)
                                                                                           throws org.apache.iotdb.commons.exception.MetadataException
        Get all nodes matching the given path pattern in the given level. The level of the path should match the nodeLevel. 1. The given level equals the path level without **, e.g. give path root.*.d.* and the level should be 4. 2. The given level is greater than path level with **, e.g. give path root.** and the level could be 2 or 3.
        Parameters:
        pathPattern - can be a pattern of a full path.
        nodeLevel - the level should match the level of the path
        Returns:
        A List instance which stores all node at given level
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getNodesListInGivenLevel

        public java.util.List<org.apache.iotdb.commons.path.PartialPath> getNodesListInGivenLevel​(org.apache.iotdb.commons.path.PartialPath pathPattern,
                                                                                                  int nodeLevel,
                                                                                                  LocalSchemaProcessor.StorageGroupFilter filter)
                                                                                           throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getChildNodePathInNextLevel

        public java.util.Set<org.apache.iotdb.common.rpc.thrift.TSchemaNode> getChildNodePathInNextLevel​(org.apache.iotdb.commons.path.PartialPath pathPattern)
                                                                                                  throws org.apache.iotdb.commons.exception.MetadataException
        Get child node path in the next level of the given path pattern.

        give pathPattern and the child nodes is those matching pathPattern.*

        e.g., MTree has [root.sg1.d1.s1, root.sg1.d1.s2, root.sg1.d2.s1] given path = root.sg1, return [root.sg1.d1, root.sg1.d2]

        Parameters:
        pathPattern - The given path
        Returns:
        All child nodes' seriesPath(s) of given seriesPath.
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getChildNodeNameInNextLevel

        public java.util.Set<java.lang.String> getChildNodeNameInNextLevel​(org.apache.iotdb.commons.path.PartialPath pathPattern)
                                                                    throws org.apache.iotdb.commons.exception.MetadataException
        Get child node in the next level of the given path pattern.

        give pathPattern and the child nodes is those matching pathPattern.*

        e.g., MTree has [root.sg1.d1.s1, root.sg1.d1.s2, root.sg1.d2.s1] given path = root.sg1, return [d1, d2] given path = root.sg.d1 return [s1,s2]

        Returns:
        All child nodes of given seriesPath.
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • isStorageGroup

        public boolean isStorageGroup​(org.apache.iotdb.commons.path.PartialPath path)
        Check if the given path is storage group or not.
        Parameters:
        path - Format: root.node.(node)*
      • checkStorageGroupByPath

        public boolean checkStorageGroupByPath​(org.apache.iotdb.commons.path.PartialPath path)
        Check whether the given path contains a storage group
      • getBelongedStorageGroup

        public org.apache.iotdb.commons.path.PartialPath getBelongedStorageGroup​(org.apache.iotdb.commons.path.PartialPath path)
                                                                          throws StorageGroupNotSetException
        Get storage group name by path

        e.g., root.sg1 is a storage group and path = root.sg1.d1, return root.sg1

        Parameters:
        path - only full path, cannot be path pattern
        Returns:
        storage group in the given path
        Throws:
        StorageGroupNotSetException
      • getBelongedStorageGroups

        public java.util.List<org.apache.iotdb.commons.path.PartialPath> getBelongedStorageGroups​(org.apache.iotdb.commons.path.PartialPath pathPattern)
                                                                                           throws org.apache.iotdb.commons.exception.MetadataException
        Get the storage group that given path pattern matches or belongs to.

        Suppose we have (root.sg1.d1.s1, root.sg2.d2.s2), refer the following cases: 1. given path "root.sg1", ("root.sg1") will be returned. 2. given path "root.*", ("root.sg1", "root.sg2") will be returned. 3. given path "root.*.d1.s1", ("root.sg1", "root.sg2") will be returned.

        Parameters:
        pathPattern - a path pattern or a full path
        Returns:
        a list contains all storage groups related to given path pattern
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getMatchedStorageGroups

        public java.util.List<org.apache.iotdb.commons.path.PartialPath> getMatchedStorageGroups​(org.apache.iotdb.commons.path.PartialPath pathPattern,
                                                                                                 boolean isPrefixMatch)
                                                                                          throws org.apache.iotdb.commons.exception.MetadataException
        Get all storage group matching given path pattern. If using prefix match, the path pattern is used to match prefix path. All timeseries start with the matched prefix path will be collected.
        Parameters:
        pathPattern - a pattern of a full path
        isPrefixMatch - if true, the path pattern is used to match prefix path
        Returns:
        A ArrayList instance which stores storage group paths matching given path pattern.
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getAllStorageGroupPaths

        public java.util.List<org.apache.iotdb.commons.path.PartialPath> getAllStorageGroupPaths()
        Get all storage group paths
      • getStorageGroupsTTL

        public java.util.Map<org.apache.iotdb.commons.path.PartialPath,​java.lang.Long> getStorageGroupsTTL()
        get all storageGroups ttl
        Returns:
        key-> storageGroupPath, value->ttl
      • getBelongedDevices

        public java.util.Set<org.apache.iotdb.commons.path.PartialPath> getBelongedDevices​(org.apache.iotdb.commons.path.PartialPath timeseries)
                                                                                    throws org.apache.iotdb.commons.exception.MetadataException
        Get all devices that one of the timeseries, matching the given timeseries path pattern, belongs to.
        Parameters:
        timeseries - a path pattern of the target timeseries
        Returns:
        A HashSet instance which stores devices paths.
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getMatchedDevices

        public java.util.Set<org.apache.iotdb.commons.path.PartialPath> getMatchedDevices​(org.apache.iotdb.commons.path.PartialPath pathPattern,
                                                                                          boolean isPrefixMatch)
                                                                                   throws org.apache.iotdb.commons.exception.MetadataException
        Get all device paths matching the path pattern. If using prefix match, the path pattern is used to match prefix path. All timeseries start with the matched prefix path will be collected.
        Parameters:
        pathPattern - the pattern of the target devices.
        isPrefixMatch - if true, the path pattern is used to match prefix path.
        Returns:
        A HashSet instance which stores devices paths matching the given path pattern.
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getMatchedDevices

        public java.util.List<ShowDevicesResult> getMatchedDevices​(ShowDevicesPlan plan)
                                                            throws org.apache.iotdb.commons.exception.MetadataException
        Get all device paths and according storage group paths as ShowDevicesResult.
        Parameters:
        plan - ShowDevicesPlan which contains the path pattern and restriction params.
        Returns:
        ShowDevicesResult.
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getMeasurementPaths

        public java.util.List<MeasurementPath> getMeasurementPaths​(org.apache.iotdb.commons.path.PartialPath pathPattern,
                                                                   boolean isPrefixMatch)
                                                            throws org.apache.iotdb.commons.exception.MetadataException
        Return all measurement paths for given path if the path is abstract. Or return the path itself. Regular expression in this method is formed by the amalgamation of seriesPath and the character '*'. If using prefix match, the path pattern is used to match prefix path. All timeseries start with the matched prefix path will be collected.
        Parameters:
        pathPattern - can be a pattern or a full path of timeseries.
        isPrefixMatch - if true, the path pattern is used to match prefix path
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getMeasurementPaths

        public java.util.List<MeasurementPath> getMeasurementPaths​(org.apache.iotdb.commons.path.PartialPath pathPattern)
                                                            throws org.apache.iotdb.commons.exception.MetadataException
        Return all measurement paths for given path if the path is abstract. Or return the path itself. Regular expression in this method is formed by the amalgamation of seriesPath and the character '*'.
        Parameters:
        pathPattern - can be a pattern or a full path of timeseries.
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getMeasurementPathsWithAlias

        public org.apache.iotdb.tsfile.utils.Pair<java.util.List<MeasurementPath>,​java.lang.Integer> getMeasurementPathsWithAlias​(org.apache.iotdb.commons.path.PartialPath pathPattern,
                                                                                                                                        int limit,
                                                                                                                                        int offset,
                                                                                                                                        boolean isPrefixMatch)
                                                                                                                                 throws org.apache.iotdb.commons.exception.MetadataException
        Similar to method getMeasurementPaths(), but return Path with alias and filter the result by limit and offset. If using prefix match, the path pattern is used to match prefix path. All timeseries start with the matched prefix path will be collected.
        Parameters:
        isPrefixMatch - if true, the path pattern is used to match prefix path
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • showTimeseries

        public java.util.List<ShowTimeSeriesResult> showTimeseries​(ShowTimeSeriesPlan plan,
                                                                   QueryContext context)
                                                            throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getSeriesType

        public org.apache.iotdb.tsfile.file.metadata.enums.TSDataType getSeriesType​(org.apache.iotdb.commons.path.PartialPath fullPath)
                                                                             throws org.apache.iotdb.commons.exception.MetadataException
        Get series type for given seriesPath.
        Parameters:
        fullPath - full path
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getSeriesSchema

        public org.apache.iotdb.tsfile.write.schema.IMeasurementSchema getSeriesSchema​(org.apache.iotdb.commons.path.PartialPath fullPath)
                                                                                throws org.apache.iotdb.commons.exception.MetadataException
        Get schema of paritialPath
        Parameters:
        fullPath - (may be ParitialPath or AlignedPath)
        Returns:
        MeasurementSchema
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getStorageGroupNodeByPath

        public IStorageGroupMNode getStorageGroupNodeByPath​(org.apache.iotdb.commons.path.PartialPath path)
                                                     throws org.apache.iotdb.commons.exception.MetadataException
        Get storage group node by path. the give path don't need to be storage group path.
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getAllStorageGroupNodes

        public java.util.List<IStorageGroupMNode> getAllStorageGroupNodes()
        Get all storage group MNodes
      • getDeviceNode

        public IMNode getDeviceNode​(org.apache.iotdb.commons.path.PartialPath path)
                             throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getMeasurementMNode

        public IMeasurementMNode getMeasurementMNode​(org.apache.iotdb.commons.path.PartialPath fullPath)
                                              throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getMeasurementMNode

        protected IMeasurementMNode getMeasurementMNode​(IMNode deviceMNode,
                                                        java.lang.String measurementName)
                                                 throws org.apache.iotdb.commons.exception.MetadataException
        Invoked during insertPlan process. Get target MeasurementMNode from given EntityMNode. If the result is not null and is not MeasurementMNode, it means a timeseries with same path cannot be created thus throw PathAlreadyExistException.
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • changeAlias

        public void changeAlias​(org.apache.iotdb.commons.path.PartialPath path,
                                java.lang.String alias)
                         throws org.apache.iotdb.commons.exception.MetadataException,
                                java.io.IOException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
        java.io.IOException
      • upsertTagsAndAttributes

        public void upsertTagsAndAttributes​(java.lang.String alias,
                                            java.util.Map<java.lang.String,​java.lang.String> tagsMap,
                                            java.util.Map<java.lang.String,​java.lang.String> attributesMap,
                                            org.apache.iotdb.commons.path.PartialPath fullPath)
                                     throws org.apache.iotdb.commons.exception.MetadataException,
                                            java.io.IOException
        upsert tags and attributes key-value for the timeseries if the key has existed, just use the new value to update it.
        Parameters:
        alias - newly added alias
        tagsMap - newly added tags map
        attributesMap - newly added attributes map
        fullPath - timeseries
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
        java.io.IOException
      • addAttributes

        public void addAttributes​(java.util.Map<java.lang.String,​java.lang.String> attributesMap,
                                  org.apache.iotdb.commons.path.PartialPath fullPath)
                           throws org.apache.iotdb.commons.exception.MetadataException,
                                  java.io.IOException
        add new attributes key-value for the timeseries
        Parameters:
        attributesMap - newly added attributes map
        fullPath - timeseries
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
        java.io.IOException
      • addTags

        public void addTags​(java.util.Map<java.lang.String,​java.lang.String> tagsMap,
                            org.apache.iotdb.commons.path.PartialPath fullPath)
                     throws org.apache.iotdb.commons.exception.MetadataException,
                            java.io.IOException
        add new tags key-value for the timeseries
        Parameters:
        tagsMap - newly added tags map
        fullPath - timeseries
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
        java.io.IOException
      • dropTagsOrAttributes

        public void dropTagsOrAttributes​(java.util.Set<java.lang.String> keySet,
                                         org.apache.iotdb.commons.path.PartialPath fullPath)
                                  throws org.apache.iotdb.commons.exception.MetadataException,
                                         java.io.IOException
        drop tags or attributes of the timeseries
        Parameters:
        keySet - tags key or attributes key
        fullPath - timeseries path
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
        java.io.IOException
      • setTagsOrAttributesValue

        public void setTagsOrAttributesValue​(java.util.Map<java.lang.String,​java.lang.String> alterMap,
                                             org.apache.iotdb.commons.path.PartialPath fullPath)
                                      throws org.apache.iotdb.commons.exception.MetadataException,
                                             java.io.IOException
        set/change the values of tags or attributes
        Parameters:
        alterMap - the new tags or attributes key-value
        fullPath - timeseries
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
        java.io.IOException
      • renameTagOrAttributeKey

        public void renameTagOrAttributeKey​(java.lang.String oldKey,
                                            java.lang.String newKey,
                                            org.apache.iotdb.commons.path.PartialPath fullPath)
                                     throws org.apache.iotdb.commons.exception.MetadataException,
                                            java.io.IOException
        rename the tag or attribute's key of the timeseries
        Parameters:
        oldKey - old key of tag or attribute
        newKey - new key of tag or attribute
        fullPath - timeseries
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
        java.io.IOException
      • groupPathByStorageGroup

        public java.util.Map<java.lang.String,​java.util.List<org.apache.iotdb.commons.path.PartialPath>> groupPathByStorageGroup​(org.apache.iotdb.commons.path.PartialPath path)
                                                                                                                                throws org.apache.iotdb.commons.exception.MetadataException
        For a path, infer all storage groups it may belong to. The path can have wildcards. Resolve the path or path pattern into StorageGroupName-FullPath pairs that FullPath matches the given path.

        Consider the path into two parts: (1) the sub path which can not contain a storage group name and (2) the sub path which is substring that begin after the storage group name.

        (1) Suppose the part of the path can not contain a storage group name (e.g., "root".contains("root.sg") == false), then: For each one level wildcard *, only one level will be inferred and the wildcard will be removed. For each multi level wildcard **, then the inference will go on until the storage groups are found and the wildcard will be kept. (2) Suppose the part of the path is a substring that begin after the storage group name. (e.g., For "root.*.sg1.a.*.b.*" and "root.x.sg1" is a storage group, then this part is "a.*.b.*"). For this part, keep what it is.

        Assuming we have three SGs: root.group1, root.group2, root.area1.group3 Eg1: for input "root.**", returns ("root.group1", "root.group1.**"), ("root.group2", "root.group2.**") ("root.area1.group3", "root.area1.group3.**") Eg2: for input "root.*.s1", returns ("root.group1", "root.group1.s1"), ("root.group2", "root.group2.s1")

        Eg3: for input "root.area1.**", returns ("root.area1.group3", "root.area1.group3.**")

        Parameters:
        path - can be a path pattern or a full path.
        Returns:
        StorageGroupName-FullPath pairs
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • cacheMeta

        public void cacheMeta​(org.apache.iotdb.commons.path.PartialPath path,
                              IMeasurementMNode measurementMNode,
                              boolean needSetFullPath)
        if the path is in local mtree, nothing needed to do (because mtree is in the memory); Otherwise cache the path to mRemoteSchemaCache
      • updateLastCache

        public void updateLastCache​(org.apache.iotdb.commons.path.PartialPath seriesPath,
                                    org.apache.iotdb.tsfile.read.TimeValuePair timeValuePair,
                                    boolean highPriorityUpdate,
                                    java.lang.Long latestFlushedTime)
        Update the last cache value of time series of given seriesPath.

        SchemaProcessor will use the seriesPath to search the node first and then process the lastCache in the MeasurementMNode

        Invoking scenario: (1) after executing insertPlan (2) after reading last value from file during last Query

        Parameters:
        seriesPath - the PartialPath of full path from root to Measurement
        timeValuePair - the latest point value
        highPriorityUpdate - the last value from insertPlan is high priority
        latestFlushedTime - latest flushed time
      • updateLastCache

        public void updateLastCache​(IMeasurementMNode node,
                                    org.apache.iotdb.tsfile.read.TimeValuePair timeValuePair,
                                    boolean highPriorityUpdate,
                                    java.lang.Long latestFlushedTime)
        Update the last cache value in given MeasurementMNode. work.

        Invoking scenario: (1) after executing insertPlan (2) after reading last value from file during last Query

        Parameters:
        node - the measurementMNode holding the lastCache
        timeValuePair - the latest point value
        highPriorityUpdate - the last value from insertPlan is high priority
        latestFlushedTime - latest flushed time
      • getLastCache

        public org.apache.iotdb.tsfile.read.TimeValuePair getLastCache​(org.apache.iotdb.commons.path.PartialPath seriesPath)
        Get the last cache value of time series of given seriesPath. SchemaProcessor will use the seriesPath to search the node.

        Invoking scenario: last cache read during last Query

        Parameters:
        seriesPath - the PartialPath of full path from root to Measurement
        Returns:
        the last cache value
      • getLastCache

        public org.apache.iotdb.tsfile.read.TimeValuePair getLastCache​(IMeasurementMNode node)
        Get the last cache value in given MeasurementMNode.

        Invoking scenario: last cache read during last Query

        Parameters:
        node - the measurementMNode holding the lastCache
        Returns:
        the last cache value
      • resetLastCache

        public void resetLastCache​(org.apache.iotdb.commons.path.PartialPath seriesPath)
        Reset the last cache value of time series of given seriesPath. SchemaProcessor will use the seriesPath to search the node.
        Parameters:
        seriesPath - the PartialPath of full path from root to Measurement
      • deleteLastCacheByDevice

        public void deleteLastCacheByDevice​(org.apache.iotdb.commons.path.PartialPath deviceId)
                                     throws org.apache.iotdb.commons.exception.MetadataException
        delete all the last cache value of any timeseries or aligned timeseries under the device

        Invoking scenario (1) after upload tsfile

        Parameters:
        deviceId - path of device
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • deleteLastCacheByDevice

        public void deleteLastCacheByDevice​(org.apache.iotdb.commons.path.PartialPath deviceId,
                                            org.apache.iotdb.commons.path.PartialPath originalPath,
                                            long startTime,
                                            long endTime)
                                     throws org.apache.iotdb.commons.exception.MetadataException
        delete the last cache value of timeseries or subMeasurement of some aligned timeseries, which is under the device and matching the originalPath

        Invoking scenario (1) delete timeseries

        Parameters:
        deviceId - path of device
        originalPath - origin timeseries path
        startTime - startTime
        endTime - endTime
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getSeriesSchemasAndReadLockDevice

        public IMNode getSeriesSchemasAndReadLockDevice​(InsertPlan plan)
                                                 throws org.apache.iotdb.commons.exception.MetadataException,
                                                        java.io.IOException
        get schema for device. Attention!!! Only support insertPlan
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
        java.io.IOException
      • createSchemaTemplate

        public void createSchemaTemplate​(CreateTemplatePlan plan)
                                  throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • appendSchemaTemplate

        public void appendSchemaTemplate​(AppendTemplatePlan plan)
                                  throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • pruneSchemaTemplate

        public void pruneSchemaTemplate​(PruneTemplatePlan plan)
                                 throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • countMeasurementsInTemplate

        public int countMeasurementsInTemplate​(java.lang.String templateName)
                                        throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • isMeasurementInTemplate

        public boolean isMeasurementInTemplate​(java.lang.String templateName,
                                               java.lang.String path)
                                        throws org.apache.iotdb.commons.exception.MetadataException
        Parameters:
        templateName - name of template to check
        path - full path to check
        Returns:
        if path correspond to a measurement in template
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • isPathExistsInTemplate

        public boolean isPathExistsInTemplate​(java.lang.String templateName,
                                              java.lang.String path)
                                       throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getMeasurementsInTemplate

        public java.util.List<java.lang.String> getMeasurementsInTemplate​(java.lang.String templateName,
                                                                          java.lang.String path)
                                                                   throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getSchemasInTemplate

        public java.util.List<org.apache.iotdb.tsfile.utils.Pair<java.lang.String,​org.apache.iotdb.tsfile.write.schema.IMeasurementSchema>> getSchemasInTemplate​(java.lang.String templateName,
                                                                                                                                                                       java.lang.String path)
                                                                                                                                                                throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getAllTemplates

        public java.util.Set<java.lang.String> getAllTemplates()
      • getPathsSetTemplate

        public java.util.Set<java.lang.String> getPathsSetTemplate​(java.lang.String templateName)
                                                            throws org.apache.iotdb.commons.exception.MetadataException
        Get all paths set designated template
        Parameters:
        templateName - designated template name, blank string for any template exists
        Returns:
        paths set
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getPathsUsingTemplate

        public java.util.Set<java.lang.String> getPathsUsingTemplate​(java.lang.String templateName)
                                                              throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • dropSchemaTemplate

        public void dropSchemaTemplate​(DropTemplatePlan plan)
                                throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • setSchemaTemplate

        public void setSchemaTemplate​(SetTemplatePlan plan)
                               throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • unsetSchemaTemplate

        public void unsetSchemaTemplate​(UnsetTemplatePlan plan)
                                 throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • setUsingSchemaTemplate

        public void setUsingSchemaTemplate​(ActivateTemplatePlan plan)
                                    throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • getMNodeForTrigger

        public IMNode getMNodeForTrigger​(org.apache.iotdb.commons.path.PartialPath fullPath)
                                  throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • releaseMNodeAfterDropTrigger

        public void releaseMNodeAfterDropTrigger​(IMNode imNode)
                                          throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException
      • forceMlog

        public void forceMlog()
      • getTotalSeriesNumber

        public long getTotalSeriesNumber()
      • getDeviceId

        public java.lang.String getDeviceId​(org.apache.iotdb.commons.path.PartialPath devicePath)
        To reduce the String number in memory, use the deviceId from SchemaProcessor instead of the deviceId read from disk
        Parameters:
        devicePath - read from disk
        Returns:
        deviceId
      • getTemplate

        public Template getTemplate​(java.lang.String templateName)
                             throws org.apache.iotdb.commons.exception.MetadataException
        Throws:
        org.apache.iotdb.commons.exception.MetadataException