Class SchemaRegionSchemaFileImpl
- java.lang.Object
-
- org.apache.iotdb.db.metadata.schemaregion.SchemaRegionSchemaFileImpl
-
- All Implemented Interfaces:
ISchemaRegion
public class SchemaRegionSchemaFileImpl extends java.lang.Object implements ISchemaRegion
This class takes the responsibility of serialization of all the metadata info of one certain schema region and persistent it into files. This class contains the interfaces to modify the metadata in schema region for delta system. All the operations will be inserted into the logs temporary in case the downtime of the 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:
- Interfaces and Implementation for initialization、recover and clear
- Interfaces and Implementation for schema region Info query and operation
- Interfaces and Implementation for Timeseries operation
- Interfaces for auto create device
- Interfaces for metadata info Query
- Interfaces for metadata count
- Interfaces for level Node info Query
- Interfaces for Entity/Device info Query
- Interfaces for timeseries, measurement and schema info Query
- Interfaces and methods for MNode query
- Interfaces for alias and tag/attribute operations
- Interfaces and Implementation for InsertPlan process
- Interfaces and Implementation for Template operations
- Interfaces for Trigger
-
-
Field Summary
Fields Modifier and Type Field Description protected static IoTDBConfigconfig
-
Constructor Summary
Constructors Constructor Description SchemaRegionSchemaFileImpl(org.apache.iotdb.commons.path.PartialPath storageGroup, org.apache.iotdb.commons.consensus.SchemaRegionId schemaRegionId, IStorageGroupMNode storageGroupMNode, org.apache.iotdb.external.api.ISeriesNumerLimiter seriesNumerLimiter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateSchemaTemplate(ActivateTemplateInClusterPlan plan, Template template)voidaddAttributes(java.util.Map<java.lang.String,java.lang.String> attributesMap, org.apache.iotdb.commons.path.PartialPath fullPath)add new attributes key-value for the timeseriesvoidaddTags(java.util.Map<java.lang.String,java.lang.String> tagsMap, org.apache.iotdb.commons.path.PartialPath fullPath)add new tags key-value for the timeseriesvoidautoCreateDeviceMNode(AutoCreateDeviceMNodePlan plan)voidchangeAlias(org.apache.iotdb.commons.path.PartialPath path, java.lang.String alias)voidclear()function for clearing metadata components of one schema regionvoidcreateAlignedTimeSeries(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)voidcreateAlignedTimeSeries(CreateAlignedTimeSeriesPlan plan)create aligned timeseriesbooleancreateSnapshot(java.io.File snapshotDir)voidcreateTimeseries(CreateTimeSeriesPlan plan)voidcreateTimeseries(CreateTimeSeriesPlan plan, long offset)voiddeleteSchemaRegion()org.apache.iotdb.tsfile.utils.Pair<java.lang.Integer,java.util.Set<java.lang.String>>deleteTimeseries(org.apache.iotdb.commons.path.PartialPath pathPattern)Delete all timeseries matching the given path patternorg.apache.iotdb.tsfile.utils.Pair<java.lang.Integer,java.util.Set<java.lang.String>>deleteTimeseries(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch)Delete all timeseries matching the given path pattern.voiddropTagsOrAttributes(java.util.Set<java.lang.String> keySet, org.apache.iotdb.commons.path.PartialPath fullPath)drop tags or attributes of the timeseriesjava.util.List<MeasurementPath>fetchSchema(org.apache.iotdb.commons.path.PartialPath pathPattern, java.util.Map<java.lang.Integer,Template> templateMap)voidforceMlog()java.util.List<MeasurementPath>getAllMeasurementByDevicePath(org.apache.iotdb.commons.path.PartialPath devicePath)intgetAllTimeseriesCount(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch)To calculate the count of timeseries matching given path.intgetAllTimeseriesCount(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch, java.lang.String key, java.lang.String value, boolean isContains)intgetAllTimeseriesCount(org.apache.iotdb.commons.path.PartialPath pathPattern, java.util.Map<java.lang.Integer,Template> templateMap, boolean isPrefixMatch)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.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.IMNodegetDeviceNode(org.apache.iotdb.commons.path.PartialPath path)DeviceSchemaInfogetDeviceSchemaInfoWithAutoCreate(org.apache.iotdb.commons.path.PartialPath devicePath, java.lang.String[] measurements, java.util.function.Function<java.lang.Integer,org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> getDataType, boolean aligned)intgetDevicesNum(org.apache.iotdb.commons.path.PartialPath pathPattern)To calculate the count of devices for given path pattern.intgetDevicesNum(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch)To calculate the count of devices for given path pattern.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.org.apache.iotdb.tsfile.utils.Pair<java.util.List<ShowDevicesResult>,java.lang.Integer>getMatchedDevices(ShowDevicesPlan plan)Get all device paths and according storage group paths as ShowDevicesResult.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.lang.String key, java.lang.String value, boolean isContains)IMeasurementMNodegetMeasurementMNode(org.apache.iotdb.commons.path.PartialPath fullPath)protected IMeasurementMNodegetMeasurementMNode(IMNode deviceMNode, java.lang.String measurementName)Invoked during insertPlan process.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.IMNodegetMNodeForTrigger(org.apache.iotdb.commons.path.PartialPath fullPath)intgetNodesCountInGivenLevel(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, boolean isPrefixMatch, LocalSchemaProcessor.StorageGroupFilter filter)java.util.Set<java.lang.String>getPathsSetTemplate(java.lang.String templateName)Get all paths set designated templatejava.util.List<java.lang.String>getPathsUsingTemplate(int templateId)java.util.Set<java.lang.String>getPathsUsingTemplate(java.lang.String templateName)org.apache.iotdb.commons.consensus.SchemaRegionIdgetSchemaRegionId()org.apache.iotdb.tsfile.write.schema.IMeasurementSchemagetSeriesSchema(org.apache.iotdb.commons.path.PartialPath fullPath)Get schema of paritialPathIMNodegetSeriesSchemasAndReadLockDevice(InsertPlan plan)get schema for device.org.apache.iotdb.tsfile.file.metadata.enums.TSDataTypegetSeriesType(org.apache.iotdb.commons.path.PartialPath fullPath)Get series type for given seriesPath.java.lang.StringgetStorageGroupFullPath()voidinit()booleanisPathExist(org.apache.iotdb.commons.path.PartialPath path)Check whether the path exists.booleanisTemplateAppendable(Template template, java.util.List<java.lang.String> measurements)voidloadSnapshot(java.io.File latestSnapshotRootDir)voidrecoverAlignedTimeSeries(CreateAlignedTimeSeriesPlan plan)voidrecoverTimeseries(CreateTimeSeriesPlan plan, long offset)voidreleaseMNodeAfterDropTrigger(IMNode node)voidrenameTagOrAttributeKey(java.lang.String oldKey, java.lang.String newKey, org.apache.iotdb.commons.path.PartialPath fullPath)rename the tag or attribute's key of the timeseriesvoidsetSchemaTemplate(SetTemplatePlan plan)voidsetTagsOrAttributesValue(java.util.Map<java.lang.String,java.lang.String> alterMap, org.apache.iotdb.commons.path.PartialPath fullPath)set/change the values of tags or attributesIMNodesetUsingSchemaTemplate(IMNode node)voidsetUsingSchemaTemplate(ActivateTemplatePlan plan)org.apache.iotdb.tsfile.utils.Pair<java.util.List<ShowTimeSeriesResult>,java.lang.Integer>showTimeseries(ShowTimeSeriesPlan plan, QueryContext context)voidunsetSchemaTemplate(UnsetTemplatePlan plan)voidupsertTagsAndAttributes(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.
-
-
-
Field Detail
-
config
protected static IoTDBConfig config
-
-
Constructor Detail
-
SchemaRegionSchemaFileImpl
public SchemaRegionSchemaFileImpl(org.apache.iotdb.commons.path.PartialPath storageGroup, org.apache.iotdb.commons.consensus.SchemaRegionId schemaRegionId, IStorageGroupMNode storageGroupMNode, org.apache.iotdb.external.api.ISeriesNumerLimiter seriesNumerLimiter) throws org.apache.iotdb.commons.exception.MetadataException- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
-
Method Detail
-
init
public void init() throws org.apache.iotdb.commons.exception.MetadataException- Specified by:
initin interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
forceMlog
public void forceMlog()
- Specified by:
forceMlogin interfaceISchemaRegion
-
clear
public void clear()
function for clearing metadata components of one schema region- Specified by:
clearin interfaceISchemaRegion
-
getStorageGroupFullPath
public java.lang.String getStorageGroupFullPath()
- Specified by:
getStorageGroupFullPathin interfaceISchemaRegion
-
getSchemaRegionId
public org.apache.iotdb.commons.consensus.SchemaRegionId getSchemaRegionId()
- Specified by:
getSchemaRegionIdin interfaceISchemaRegion
-
deleteSchemaRegion
public void deleteSchemaRegion() throws org.apache.iotdb.commons.exception.MetadataException- Specified by:
deleteSchemaRegionin interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
createSnapshot
public boolean createSnapshot(java.io.File snapshotDir)
- Specified by:
createSnapshotin interfaceISchemaRegion
-
loadSnapshot
public void loadSnapshot(java.io.File latestSnapshotRootDir)
- Specified by:
loadSnapshotin interfaceISchemaRegion
-
createTimeseries
public void createTimeseries(CreateTimeSeriesPlan plan) throws org.apache.iotdb.commons.exception.MetadataException
- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
recoverTimeseries
public void recoverTimeseries(CreateTimeSeriesPlan plan, long offset) 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
- Specified by:
createTimeseriesin interfaceISchemaRegion- 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
-
recoverAlignedTimeSeries
public void recoverAlignedTimeSeries(CreateAlignedTimeSeriesPlan plan) 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- Specified by:
createAlignedTimeSeriesin interfaceISchemaRegion- Parameters:
plan- CreateAlignedTimeSeriesPlan- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
deleteTimeseries
public org.apache.iotdb.tsfile.utils.Pair<java.lang.Integer,java.util.Set<java.lang.String>> deleteTimeseries(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch) throws org.apache.iotdb.commons.exception.MetadataExceptionDelete all timeseries 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 deleted.- Specified by:
deleteTimeseriesin interfaceISchemaRegion- Parameters:
pathPattern- path to be deletedisPrefixMatch- if true, the path pattern is used to match prefix path- Returns:
- deletion failed Timeseries
- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
deleteTimeseries
public org.apache.iotdb.tsfile.utils.Pair<java.lang.Integer,java.util.Set<java.lang.String>> deleteTimeseries(org.apache.iotdb.commons.path.PartialPath pathPattern) throws org.apache.iotdb.commons.exception.MetadataExceptionDelete all timeseries matching the given path pattern- Parameters:
pathPattern- path to be deleted- Returns:
- deletion failed Timeseries
- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
autoCreateDeviceMNode
public void autoCreateDeviceMNode(AutoCreateDeviceMNodePlan plan) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
autoCreateDeviceMNodein interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
isPathExist
public boolean isPathExist(org.apache.iotdb.commons.path.PartialPath path)
Check whether the path exists.- Specified by:
isPathExistin interfaceISchemaRegion- Parameters:
path- a full path or a prefix path
-
getAllTimeseriesCount
public int getAllTimeseriesCount(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch) throws org.apache.iotdb.commons.exception.MetadataExceptionTo 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.- Specified by:
getAllTimeseriesCountin interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getAllTimeseriesCount
public int getAllTimeseriesCount(org.apache.iotdb.commons.path.PartialPath pathPattern, java.util.Map<java.lang.Integer,Template> templateMap, boolean isPrefixMatch) throws org.apache.iotdb.commons.exception.MetadataException- Specified by:
getAllTimeseriesCountin interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getAllTimeseriesCount
public int getAllTimeseriesCount(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch, java.lang.String key, java.lang.String value, boolean isContains) throws org.apache.iotdb.commons.exception.MetadataException- Specified by:
getAllTimeseriesCountin interfaceISchemaRegion- 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.MetadataExceptionTo 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.- Specified by:
getDevicesNumin interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getDevicesNum
public int getDevicesNum(org.apache.iotdb.commons.path.PartialPath pathPattern) throws org.apache.iotdb.commons.exception.MetadataExceptionTo calculate the count of devices for given path pattern.- 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.MetadataExceptionTo 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.- Specified by:
getNodesCountInGivenLevelin interfaceISchemaRegion- Parameters:
pathPattern- a path pattern or a full pathlevel- the level should match the level of the pathisPrefixMatch- if true, the path pattern is used to match prefix 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- Specified by:
getMeasurementCountGroupByLevelin interfaceISchemaRegion- 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.lang.String key, java.lang.String value, boolean isContains) throws org.apache.iotdb.commons.exception.MetadataException- Specified by:
getMeasurementCountGroupByLevelin interfaceISchemaRegion- 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.MetadataException- Specified by:
getNodesListInGivenLevelin interfaceISchemaRegion- 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 interfaceISchemaRegion- 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 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]
- Specified by:
getChildNodeNameInNextLevelin interfaceISchemaRegion- Returns:
- All child nodes of given seriesPath.
- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
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.MetadataExceptionGet all devices that one of the timeseries, matching the given timeseries path pattern, belongs to.- Specified by:
getBelongedDevicesin interfaceISchemaRegion- 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.MetadataExceptionGet 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.- Specified by:
getMatchedDevicesin interfaceISchemaRegion- 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 org.apache.iotdb.tsfile.utils.Pair<java.util.List<ShowDevicesResult>,java.lang.Integer> getMatchedDevices(ShowDevicesPlan plan) throws org.apache.iotdb.commons.exception.MetadataException
Get all device paths and according storage group paths as ShowDevicesResult.- Specified by:
getMatchedDevicesin interfaceISchemaRegion- Parameters:
plan- ShowDevicesPlan which contains the path pattern and restriction params.- Returns:
- ShowDevicesResult and the current offset of this region after traverse.
- 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.- Specified by:
getMeasurementPathsin interfaceISchemaRegion- 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
-
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.- Specified by:
getMeasurementPathsWithAliasin interfaceISchemaRegion- Parameters:
isPrefixMatch- if true, the path pattern is used to match prefix path- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
fetchSchema
public java.util.List<MeasurementPath> fetchSchema(org.apache.iotdb.commons.path.PartialPath pathPattern, java.util.Map<java.lang.Integer,Template> templateMap) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
fetchSchemain interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
showTimeseries
public org.apache.iotdb.tsfile.utils.Pair<java.util.List<ShowTimeSeriesResult>,java.lang.Integer> showTimeseries(ShowTimeSeriesPlan plan, QueryContext context) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
showTimeseriesin interfaceISchemaRegion- 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.MetadataExceptionGet 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.MetadataExceptionGet schema of paritialPath- Parameters:
fullPath- (may be ParitialPath or AlignedPath)- Returns:
- MeasurementSchema
- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getAllMeasurementByDevicePath
public java.util.List<MeasurementPath> getAllMeasurementByDevicePath(org.apache.iotdb.commons.path.PartialPath devicePath) throws PathNotExistException
- Specified by:
getAllMeasurementByDevicePathin interfaceISchemaRegion- Throws:
PathNotExistException
-
getDeviceNode
public IMNode getDeviceNode(org.apache.iotdb.commons.path.PartialPath path) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
getDeviceNodein interfaceISchemaRegion- 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
- Specified by:
getMeasurementMNodein interfaceISchemaRegion- 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- Specified by:
changeAliasin interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
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.IOExceptionupsert tags and attributes key-value for the timeseries if the key has existed, just use the new value to update it.- Specified by:
upsertTagsAndAttributesin interfaceISchemaRegion- Parameters:
alias- newly added aliastagsMap- newly added tags mapattributesMap- newly added attributes mapfullPath- timeseries- Throws:
org.apache.iotdb.commons.exception.MetadataExceptionjava.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.IOExceptionadd new attributes key-value for the timeseries- Specified by:
addAttributesin interfaceISchemaRegion- Parameters:
attributesMap- newly added attributes mapfullPath- timeseries- Throws:
org.apache.iotdb.commons.exception.MetadataExceptionjava.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.IOExceptionadd new tags key-value for the timeseries- Specified by:
addTagsin interfaceISchemaRegion- Parameters:
tagsMap- newly added tags mapfullPath- timeseries- Throws:
org.apache.iotdb.commons.exception.MetadataExceptionjava.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.IOExceptiondrop tags or attributes of the timeseries- Specified by:
dropTagsOrAttributesin interfaceISchemaRegion- Parameters:
keySet- tags key or attributes keyfullPath- timeseries path- Throws:
org.apache.iotdb.commons.exception.MetadataExceptionjava.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.IOExceptionset/change the values of tags or attributes- Specified by:
setTagsOrAttributesValuein interfaceISchemaRegion- Parameters:
alterMap- the new tags or attributes key-valuefullPath- timeseries- Throws:
org.apache.iotdb.commons.exception.MetadataExceptionjava.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.IOExceptionrename the tag or attribute's key of the timeseries- Specified by:
renameTagOrAttributeKeyin interfaceISchemaRegion- Parameters:
oldKey- old key of tag or attributenewKey- new key of tag or attributefullPath- timeseries- Throws:
org.apache.iotdb.commons.exception.MetadataExceptionjava.io.IOException
-
getSeriesSchemasAndReadLockDevice
public IMNode getSeriesSchemasAndReadLockDevice(InsertPlan plan) throws org.apache.iotdb.commons.exception.MetadataException, java.io.IOException
get schema for device. Attention!!! Only support insertPlan- Specified by:
getSeriesSchemasAndReadLockDevicein interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataExceptionjava.io.IOException
-
getDeviceSchemaInfoWithAutoCreate
public DeviceSchemaInfo getDeviceSchemaInfoWithAutoCreate(org.apache.iotdb.commons.path.PartialPath devicePath, java.lang.String[] measurements, java.util.function.Function<java.lang.Integer,org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> getDataType, boolean aligned) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
getDeviceSchemaInfoWithAutoCreatein interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getPathsSetTemplate
public java.util.Set<java.lang.String> getPathsSetTemplate(java.lang.String templateName) throws org.apache.iotdb.commons.exception.MetadataExceptionGet all paths set designated template- Specified by:
getPathsSetTemplatein interfaceISchemaRegion- 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- Specified by:
getPathsUsingTemplatein interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
isTemplateAppendable
public boolean isTemplateAppendable(Template template, java.util.List<java.lang.String> measurements) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
isTemplateAppendablein interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
setSchemaTemplate
public void setSchemaTemplate(SetTemplatePlan plan) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
setSchemaTemplatein interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
unsetSchemaTemplate
public void unsetSchemaTemplate(UnsetTemplatePlan plan) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
unsetSchemaTemplatein interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
setUsingSchemaTemplate
public void setUsingSchemaTemplate(ActivateTemplatePlan plan) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
setUsingSchemaTemplatein interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
activateSchemaTemplate
public void activateSchemaTemplate(ActivateTemplateInClusterPlan plan, Template template) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
activateSchemaTemplatein interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
getPathsUsingTemplate
public java.util.List<java.lang.String> getPathsUsingTemplate(int templateId) throws org.apache.iotdb.commons.exception.MetadataException- Specified by:
getPathsUsingTemplatein interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
setUsingSchemaTemplate
public IMNode setUsingSchemaTemplate(IMNode node) 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
- Specified by:
getMNodeForTriggerin interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
releaseMNodeAfterDropTrigger
public void releaseMNodeAfterDropTrigger(IMNode node) throws org.apache.iotdb.commons.exception.MetadataException
- Specified by:
releaseMNodeAfterDropTriggerin interfaceISchemaRegion- Throws:
org.apache.iotdb.commons.exception.MetadataException
-
-