Class MTreeBelowSGCachedImpl
- java.lang.Object
-
- org.apache.iotdb.db.metadata.mtree.MTreeBelowSGCachedImpl
-
- All Implemented Interfaces:
IMTreeBelowSG
public class MTreeBelowSGCachedImpl extends java.lang.Object implements IMTreeBelowSG
The hierarchical struct of the Metadata Tree is implemented in this class.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:
- MTree initialization, clear and serialization
- Timeseries operation, including create and delete
- Entity/Device operation
- Interfaces and Implementation for metadata info Query
- Interfaces for Device info Query
- Interfaces for timeseries, measurement and schema info Query
- Interfaces for Level Node info Query
- Interfaces and Implementation for metadata count
- Interfaces and Implementation for MNode Query
- Interfaces and Implementation for Template check
-
-
Constructor Summary
Constructors Constructor Description MTreeBelowSGCachedImpl(IStorageGroupMNode storageGroupMNode, int schemaRegionId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckIsTemplateCompatibleWithChild(IMNode node, Template template)IMNodecheckTemplateAlignmentWithMountedNode(IMNode mountedNode, Template template)Check route 1: If template has no direct measurement, just pass the check.voidcheckTemplateInUseOnLowerNode(IMNode node)voidcheckTemplateOnPath(org.apache.iotdb.commons.path.PartialPath path)check whether there is template on given path and the subTree has template return true, otherwise falsevoidclear()java.util.List<IMeasurementMNode>createAlignedTimeseries(org.apache.iotdb.commons.path.PartialPath devicePath, 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, java.util.List<java.lang.String> aliasList)Create aligned timeseries with full paths from root to one leaf node.IMeasurementMNodecreateTimeseries(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, java.lang.String alias)IMeasurementMNodecreateTimeseriesWithPinnedReturn(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, java.lang.String alias)Create a timeseries with a full path from root to leaf node.org.apache.iotdb.tsfile.utils.Pair<org.apache.iotdb.commons.path.PartialPath,IMeasurementMNode>deleteTimeseriesAndReturnEmptyStorageGroup(org.apache.iotdb.commons.path.PartialPath path)Delete path.java.util.List<IMeasurementMNode>getAllMeasurementMNode()org.apache.iotdb.tsfile.utils.Pair<java.util.List<org.apache.iotdb.tsfile.utils.Pair<org.apache.iotdb.commons.path.PartialPath,java.lang.String[]>>,java.lang.Integer>getAllMeasurementSchema(ShowTimeSeriesPlan plan, QueryContext queryContext)Get all measurement schema matching the given path patternintgetAllTimeseriesCount(org.apache.iotdb.commons.path.PartialPath pathPattern)Get the count of timeseries matching the given path.intgetAllTimeseriesCount(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch)Get the count of timeseries matching the given path.intgetAllTimeseriesCount(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch, java.util.List<java.lang.String> timeseries, boolean hasTag)Get the count of timeseries matching the given path by tag.IMNodegetChildFromPinnedMNode(IMNode parent, java.lang.String measurement)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.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.IMNodegetDeviceNodeWithAutoCreating(org.apache.iotdb.commons.path.PartialPath deviceId)Add an interval path to MTree.java.util.Set<org.apache.iotdb.commons.path.PartialPath>getDevices(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch)Get all devices matching the given path pattern.org.apache.iotdb.tsfile.utils.Pair<java.util.List<ShowDevicesResult>,java.lang.Integer>getDevices(ShowDevicesPlan plan)java.util.Set<org.apache.iotdb.commons.path.PartialPath>getDevicesByTimeseries(org.apache.iotdb.commons.path.PartialPath timeseries)intgetDevicesNum(org.apache.iotdb.commons.path.PartialPath pathPattern)Get the count of devices matching the given path.intgetDevicesNum(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch)Get the count of devices matching the given path.java.util.Map<org.apache.iotdb.commons.path.PartialPath,java.lang.Integer>getMeasurementCountGroupByLevel(org.apache.iotdb.commons.path.PartialPath pathPattern, int level, boolean isPrefixMatch)java.util.Map<org.apache.iotdb.commons.path.PartialPath,java.lang.Integer>getMeasurementCountGroupByLevel(org.apache.iotdb.commons.path.PartialPath pathPattern, int level, boolean isPrefixMatch, java.util.List<java.lang.String> timeseries, boolean hasTag)IMeasurementMNodegetMeasurementMNode(org.apache.iotdb.commons.path.PartialPath path)java.util.List<MeasurementPath>getMeasurementPaths(org.apache.iotdb.commons.path.PartialPath pathPattern)Get all measurement paths matching the given path patternjava.util.List<MeasurementPath>getMeasurementPaths(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch)Get all measurement paths matching the given path pattern.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)Get all measurement paths matching the given path pattern If using prefix match, the path pattern is used to match prefix path.intgetMountedNodeIndexOnMeasurementPath(org.apache.iotdb.commons.path.PartialPath devicePath, java.lang.String[] measurements)Check measurement path and return the mounted node index on path.IMNodegetNodeByPath(org.apache.iotdb.commons.path.PartialPath path)Get node by the pathintgetNodesCountInGivenLevel(org.apache.iotdb.commons.path.PartialPath pathPattern, int level, boolean isPrefixMatch)Get the count of nodes in the given level matching the given path.java.util.List<org.apache.iotdb.commons.path.PartialPath>getNodesListInGivenLevel(org.apache.iotdb.commons.path.PartialPath pathPattern, int nodeLevel, boolean isPrefixMatch, LocalSchemaProcessor.StorageGroupFilter filter)Get all paths from root to the given leveljava.util.List<java.lang.String>getPathsSetOnTemplate(java.lang.String templateName)java.util.List<java.lang.String>getPathsUsingTemplate(java.lang.String templateName)java.lang.StringgetTemplateOnPath(org.apache.iotdb.commons.path.PartialPath path)Get template name on give path if any node of it has been set a templatebooleanisEmptyInternalMNode(IMNode node)booleanisPathExist(org.apache.iotdb.commons.path.PartialPath path)Check whether the given path exists.booleanisPathExistsWithinTemplate(org.apache.iotdb.commons.path.PartialPath path)Note that template and MTree cannot have overlap paths.booleanisTemplateAppendable(Template tarTemplate, java.util.List<java.lang.String> appendMeasurements)Check that each node set with tarTemplate and its descendants have overlapping nodes with appending measurementsvoidpinMNode(IMNode node)Currently, this method is only used for pin node get from mNodeCachevoidsetAlias(IMeasurementMNode measurementMNode, java.lang.String alias)IEntityMNodesetToEntity(IMNode node)voidunPinMNode(IMNode node)voidupdateMNode(IMNode node)
-
-
-
Constructor Detail
-
MTreeBelowSGCachedImpl
public MTreeBelowSGCachedImpl(IStorageGroupMNode storageGroupMNode, int schemaRegionId) throws org.apache.iotdb.commons.exception.MetadataException, java.io.IOException
- Throws:
org.apache.iotdb.commons.exception.MetadataExceptionjava.io.IOException
-
-
Method Detail
-
clear
public void clear()
- Specified by:
clearin interfaceIMTreeBelowSG
-
createTimeseries
public IMeasurementMNode 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, java.lang.String alias) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
createTimeseriesin interfaceIMTreeBelowSG- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
createTimeseriesWithPinnedReturn
public IMeasurementMNode createTimeseriesWithPinnedReturn(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, java.lang.String alias) throws org.apache.iotdb.commons.exception.MetadataException
Create a timeseries with a full path from root to leaf node. Before creating a timeseries, the storage group should be set first, throw exception otherwise- Parameters:
path- timeseries pathdataType- data typeencoding- encodingcompressor- compressorprops- propsalias- alias of measurement- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
createAlignedTimeseries
public java.util.List<IMeasurementMNode> createAlignedTimeseries(org.apache.iotdb.commons.path.PartialPath devicePath, 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, java.util.List<java.lang.String> aliasList) throws org.apache.iotdb.commons.exception.MetadataException
Create aligned timeseries with full paths from root to one leaf node. Before creating timeseries, the * storage group should be set first, throw exception otherwise- Specified by:
createAlignedTimeseriesin interfaceIMTreeBelowSG- Parameters:
devicePath- device pathmeasurements- measurements listdataTypes- data types listencodings- encodings listcompressors- compressor- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
deleteTimeseriesAndReturnEmptyStorageGroup
public org.apache.iotdb.tsfile.utils.Pair<org.apache.iotdb.commons.path.PartialPath,IMeasurementMNode> deleteTimeseriesAndReturnEmptyStorageGroup(org.apache.iotdb.commons.path.PartialPath path) throws org.apache.iotdb.commons.exception.MetadataException
Delete path. The path should be a full path from root to leaf node- Specified by:
deleteTimeseriesAndReturnEmptyStorageGroupin interfaceIMTreeBelowSG- Parameters:
path- Format: root.node(.node)+- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
isEmptyInternalMNode
public boolean isEmptyInternalMNode(IMNode node) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
isEmptyInternalMNodein interfaceIMTreeBelowSG- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
setAlias
public void setAlias(IMeasurementMNode measurementMNode, java.lang.String alias) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
setAliasin interfaceIMTreeBelowSG- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getDeviceNodeWithAutoCreating
public IMNode getDeviceNodeWithAutoCreating(org.apache.iotdb.commons.path.PartialPath deviceId) throws org.apache.iotdb.commons.exception.MetadataException
Add an interval path to MTree. This is only used for automatically creating schemae.g., get root.sg.d1, get or create all internal nodes and return the node of d1
- Specified by:
getDeviceNodeWithAutoCreatingin interfaceIMTreeBelowSG- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
setToEntity
public IEntityMNode setToEntity(IMNode node) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
setToEntityin interfaceIMTreeBelowSG- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
isPathExist
public boolean isPathExist(org.apache.iotdb.commons.path.PartialPath path) throws org.apache.iotdb.commons.exception.MetadataExceptionCheck whether the given path exists.- Specified by:
isPathExistin interfaceIMTreeBelowSG- Parameters:
path- a full path or a prefix path- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getDevices
public java.util.Set<org.apache.iotdb.commons.path.PartialPath> getDevices(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch) throws org.apache.iotdb.commons.exception.MetadataExceptionGet all devices matching the given path pattern. If isPrefixMatch, then the devices under the paths matching given path pattern will be collected too.- Specified by:
getDevicesin interfaceIMTreeBelowSG- Returns:
- a list contains all distinct devices names
- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getDevices
public org.apache.iotdb.tsfile.utils.Pair<java.util.List<ShowDevicesResult>,java.lang.Integer> getDevices(ShowDevicesPlan plan) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
getDevicesin interfaceIMTreeBelowSG- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getDevicesByTimeseries
public java.util.Set<org.apache.iotdb.commons.path.PartialPath> getDevicesByTimeseries(org.apache.iotdb.commons.path.PartialPath timeseries) throws org.apache.iotdb.commons.exception.MetadataException- Specified by:
getDevicesByTimeseriesin interfaceIMTreeBelowSG- 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
Get all measurement paths matching the 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 and return.- Specified by:
getMeasurementPathsin interfaceIMTreeBelowSG- Parameters:
pathPattern- a path pattern or a full path, may contain wildcard.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
Get all measurement paths matching the given path pattern- Specified by:
getMeasurementPathsin interfaceIMTreeBelowSG- Parameters:
pathPattern- a path pattern or a full path, may contain wildcard.- 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
Get all measurement paths matching the 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 and return.- Specified by:
getMeasurementPathsWithAliasin interfaceIMTreeBelowSG- Parameters:
pathPattern- a path pattern or a full path, may contain wildcardisPrefixMatch- if true, the path pattern is used to match prefix path- Returns:
- Pair.left contains all the satisfied paths Pair.right means the current offset or zero if we don't set offset.
- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getAllMeasurementSchema
public org.apache.iotdb.tsfile.utils.Pair<java.util.List<org.apache.iotdb.tsfile.utils.Pair<org.apache.iotdb.commons.path.PartialPath,java.lang.String[]>>,java.lang.Integer> getAllMeasurementSchema(ShowTimeSeriesPlan plan, QueryContext queryContext) throws org.apache.iotdb.commons.exception.MetadataException
Get all measurement schema matching the given path patternresult: [name, alias, storage group, dataType, encoding, compression, offset] and the current offset
- Specified by:
getAllMeasurementSchemain interfaceIMTreeBelowSG- 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.MetadataExceptionGet 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]
- Specified by:
getChildNodePathInNextLevelin interfaceIMTreeBelowSG- 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.MetadataExceptionGet child node in the next level of the given path.e.g., MTree has [root.sg1.d1.s1, root.sg1.d1.s2, root.sg1.d2.s1] given path = root.sg1, return [d1, d2]
e.g., MTree has [root.sg1.d1.s1, root.sg1.d1.s2, root.sg1.d2.s1] given path = root.sg1.d1 return [s1, s2]
- Specified by:
getChildNodeNameInNextLevelin interfaceIMTreeBelowSG- Parameters:
pathPattern- Path- Returns:
- All child nodes' seriesPath(s) of given seriesPath.
- 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, boolean isPrefixMatch, LocalSchemaProcessor.StorageGroupFilter filter) throws org.apache.iotdb.commons.exception.MetadataExceptionGet all paths from root to the given level- Specified by:
getNodesListInGivenLevelin interfaceIMTreeBelowSG- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getAllTimeseriesCount
public int getAllTimeseriesCount(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch) throws org.apache.iotdb.commons.exception.MetadataExceptionGet the count of timeseries matching the given path.- Specified by:
getAllTimeseriesCountin interfaceIMTreeBelowSG- Parameters:
pathPattern- a path pattern or a full path, may contain wildcard- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getAllTimeseriesCount
public int getAllTimeseriesCount(org.apache.iotdb.commons.path.PartialPath pathPattern) throws org.apache.iotdb.commons.exception.MetadataExceptionGet the count of timeseries matching the given path.- Specified by:
getAllTimeseriesCountin interfaceIMTreeBelowSG- Parameters:
pathPattern- a path pattern or a full path, may contain wildcard- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getAllTimeseriesCount
public int getAllTimeseriesCount(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch, java.util.List<java.lang.String> timeseries, boolean hasTag) throws org.apache.iotdb.commons.exception.MetadataExceptionDescription copied from interface:IMTreeBelowSGGet the count of timeseries matching the given path by tag.- Specified by:
getAllTimeseriesCountin interfaceIMTreeBelowSG- Parameters:
pathPattern- a path pattern or 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.MetadataExceptionGet the count of devices matching the given path. If using prefix match, the path pattern is used to match prefix path. All timeseries start with the matched prefix path will be counted.- Specified by:
getDevicesNumin interfaceIMTreeBelowSG- Parameters:
pathPattern- a path pattern or a full path, may contain wildcardisPrefixMatch- if true, the path pattern is used to match prefix path- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getDevicesNum
public int getDevicesNum(org.apache.iotdb.commons.path.PartialPath pathPattern) throws org.apache.iotdb.commons.exception.MetadataExceptionGet the count of devices matching the given path.- Specified by:
getDevicesNumin interfaceIMTreeBelowSG- Parameters:
pathPattern- a path pattern or a full path, may contain wildcard- 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.MetadataExceptionGet the count of nodes in the given level matching the given path. If using prefix match, the path pattern is used to match prefix path. All timeseries start with the matched prefix path will be counted.- Specified by:
getNodesCountInGivenLevelin interfaceIMTreeBelowSG- 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- Specified by:
getMeasurementCountGroupByLevelin interfaceIMTreeBelowSG- 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, java.util.List<java.lang.String> timeseries, boolean hasTag) throws org.apache.iotdb.commons.exception.MetadataException- Specified by:
getMeasurementCountGroupByLevelin interfaceIMTreeBelowSG- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getNodeByPath
public IMNode getNodeByPath(org.apache.iotdb.commons.path.PartialPath path) throws org.apache.iotdb.commons.exception.MetadataException
Get node by the path- Specified by:
getNodeByPathin interfaceIMTreeBelowSG- Returns:
- last node in given seriesPath
- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getMeasurementMNode
public IMeasurementMNode getMeasurementMNode(org.apache.iotdb.commons.path.PartialPath path) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
getMeasurementMNodein interfaceIMTreeBelowSG- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getAllMeasurementMNode
public java.util.List<IMeasurementMNode> getAllMeasurementMNode() throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
getAllMeasurementMNodein interfaceIMTreeBelowSG- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
checkTemplateOnPath
public void checkTemplateOnPath(org.apache.iotdb.commons.path.PartialPath path) throws org.apache.iotdb.commons.exception.MetadataExceptioncheck whether there is template on given path and the subTree has template return true, otherwise false- Specified by:
checkTemplateOnPathin interfaceIMTreeBelowSG- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
checkTemplateAlignmentWithMountedNode
public IMNode checkTemplateAlignmentWithMountedNode(IMNode mountedNode, Template template) throws org.apache.iotdb.commons.exception.MetadataException
Check route 1: If template has no direct measurement, just pass the check.Check route 2: If template has direct measurement and mounted node is Internal, it should be set to Entity.
Check route 3: If template has direct measurement and mounted node is Entity,
route 3.1: mounted node has no measurement child, then its alignment will be set as the template.
route 3.2: mounted node has measurement child, then alignment of it and template should be identical, otherwise cast a exception.
- Specified by:
checkTemplateAlignmentWithMountedNodein interfaceIMTreeBelowSG- Returns:
- return the node competent to be mounted.
- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
checkIsTemplateCompatibleWithChild
public void checkIsTemplateCompatibleWithChild(IMNode node, Template template) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
checkIsTemplateCompatibleWithChildin interfaceIMTreeBelowSG- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
checkTemplateInUseOnLowerNode
public void checkTemplateInUseOnLowerNode(IMNode node) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
checkTemplateInUseOnLowerNodein interfaceIMTreeBelowSG- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
isTemplateAppendable
public boolean isTemplateAppendable(Template tarTemplate, java.util.List<java.lang.String> appendMeasurements) throws org.apache.iotdb.commons.exception.MetadataException
Check that each node set with tarTemplate and its descendants have overlapping nodes with appending measurements- Specified by:
isTemplateAppendablein interfaceIMTreeBelowSG- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
isPathExistsWithinTemplate
public boolean isPathExistsWithinTemplate(org.apache.iotdb.commons.path.PartialPath path) throws org.apache.iotdb.commons.exception.MetadataExceptionNote that template and MTree cannot have overlap paths.- Specified by:
isPathExistsWithinTemplatein interfaceIMTreeBelowSG- Returns:
- true iff path corresponding to a measurement inside a template, whether using or not.
- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getMountedNodeIndexOnMeasurementPath
public int getMountedNodeIndexOnMeasurementPath(org.apache.iotdb.commons.path.PartialPath devicePath, java.lang.String[] measurements) throws org.apache.iotdb.commons.exception.MetadataExceptionCheck measurement path and return the mounted node index on path. The node could have not created yet. The result is used for getDeviceNodeWithAutoCreate, which return corresponding IMNode on MTree.- Specified by:
getMountedNodeIndexOnMeasurementPathin interfaceIMTreeBelowSG- Returns:
- index on full path of the node which matches all measurements path with its upperTemplate.
- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getPathsSetOnTemplate
public java.util.List<java.lang.String> getPathsSetOnTemplate(java.lang.String templateName) throws org.apache.iotdb.commons.exception.MetadataException- Specified by:
getPathsSetOnTemplatein interfaceIMTreeBelowSG- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getPathsUsingTemplate
public java.util.List<java.lang.String> getPathsUsingTemplate(java.lang.String templateName) throws org.apache.iotdb.commons.exception.MetadataException- Specified by:
getPathsUsingTemplatein interfaceIMTreeBelowSG- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getTemplateOnPath
public java.lang.String getTemplateOnPath(org.apache.iotdb.commons.path.PartialPath path) throws org.apache.iotdb.commons.exception.MetadataExceptionGet template name on give path if any node of it has been set a template- Specified by:
getTemplateOnPathin interfaceIMTreeBelowSG- Returns:
- null if no template has been set on path
- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
pinMNode
public void pinMNode(IMNode node) throws org.apache.iotdb.commons.exception.MetadataException
Currently, this method is only used for pin node get from mNodeCache- Parameters:
node-- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
unPinMNode
public void unPinMNode(IMNode node)
-
updateMNode
public void updateMNode(IMNode node) throws org.apache.iotdb.commons.exception.MetadataException
- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
-