Class DeviceGroupSchemaTree
- java.lang.Object
-
- org.apache.iotdb.db.mpp.common.schematree.DeviceGroupSchemaTree
-
- All Implemented Interfaces:
ISchemaTree
public class DeviceGroupSchemaTree extends java.lang.Object implements ISchemaTree
This class is specifically for standalone schema validation during data insertion. Since the schema fetch is mainly based on device path, the schema is directly grouped by device rater than organized as a trie.
-
-
Constructor Summary
Constructors Constructor Description DeviceGroupSchemaTree()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDeviceInfo(DeviceSchemaInfo deviceSchemaInfo)java.util.List<MeasurementPath>getAllMeasurement()java.lang.StringgetBelongedStorageGroup(java.lang.String pathName)Get storage group name by pathjava.lang.StringgetBelongedStorageGroup(org.apache.iotdb.commons.path.PartialPath path)java.util.List<DeviceSchemaInfo>getMatchedDevices(org.apache.iotdb.commons.path.PartialPath pathPattern)java.util.List<DeviceSchemaInfo>getMatchedDevices(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch)Get all device matching the path pattern.java.util.List<java.lang.String>getStorageGroups()booleanisEmpty()voidmerge(DeviceGroupSchemaTree schemaTree)DeviceSchemaInfosearchDeviceSchemaInfo(org.apache.iotdb.commons.path.PartialPath devicePath, java.util.List<java.lang.String> measurements)org.apache.iotdb.tsfile.utils.Pair<java.util.List<MeasurementPath>,java.lang.Integer>searchMeasurementPaths(org.apache.iotdb.commons.path.PartialPath pathPattern)org.apache.iotdb.tsfile.utils.Pair<java.util.List<MeasurementPath>,java.lang.Integer>searchMeasurementPaths(org.apache.iotdb.commons.path.PartialPath pathPattern, int slimit, int soffset, boolean isPrefixMatch)Return all measurement paths for given path pattern and filter the result by slimit and offset.
-
-
-
Method Detail
-
searchDeviceSchemaInfo
public DeviceSchemaInfo searchDeviceSchemaInfo(org.apache.iotdb.commons.path.PartialPath devicePath, java.util.List<java.lang.String> measurements)
- Specified by:
searchDeviceSchemaInfoin interfaceISchemaTree
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceISchemaTree
-
addDeviceInfo
public void addDeviceInfo(DeviceSchemaInfo deviceSchemaInfo)
-
merge
public void merge(DeviceGroupSchemaTree schemaTree)
-
searchMeasurementPaths
public org.apache.iotdb.tsfile.utils.Pair<java.util.List<MeasurementPath>,java.lang.Integer> searchMeasurementPaths(org.apache.iotdb.commons.path.PartialPath pathPattern, int slimit, int soffset, boolean isPrefixMatch)
Description copied from interface:ISchemaTreeReturn all measurement paths for given path pattern and filter the result by slimit and offset.- Specified by:
searchMeasurementPathsin interfaceISchemaTree- Parameters:
pathPattern- can be a pattern or a full path of timeseries.isPrefixMatch- if true, the path pattern is used to match prefix path- Returns:
- Left: all measurement paths; Right: remaining series offset
-
searchMeasurementPaths
public org.apache.iotdb.tsfile.utils.Pair<java.util.List<MeasurementPath>,java.lang.Integer> searchMeasurementPaths(org.apache.iotdb.commons.path.PartialPath pathPattern)
- Specified by:
searchMeasurementPathsin interfaceISchemaTree
-
getAllMeasurement
public java.util.List<MeasurementPath> getAllMeasurement()
- Specified by:
getAllMeasurementin interfaceISchemaTree
-
getMatchedDevices
public java.util.List<DeviceSchemaInfo> getMatchedDevices(org.apache.iotdb.commons.path.PartialPath pathPattern, boolean isPrefixMatch)
Description copied from interface:ISchemaTreeGet all device matching the path pattern.- Specified by:
getMatchedDevicesin interfaceISchemaTree- Parameters:
pathPattern- the pattern of the target devices.- Returns:
- A HashSet instance which stores info of the devices matching the given path pattern.
-
getMatchedDevices
public java.util.List<DeviceSchemaInfo> getMatchedDevices(org.apache.iotdb.commons.path.PartialPath pathPattern)
- Specified by:
getMatchedDevicesin interfaceISchemaTree
-
getBelongedStorageGroup
public java.lang.String getBelongedStorageGroup(java.lang.String pathName)
Description copied from interface:ISchemaTreeGet storage group name by pathe.g., root.sg1 is a storage group and path = root.sg1.d1, return root.sg1
- Specified by:
getBelongedStorageGroupin interfaceISchemaTree- Parameters:
pathName- only full path, cannot be path pattern- Returns:
- storage group in the given path
-
getBelongedStorageGroup
public java.lang.String getBelongedStorageGroup(org.apache.iotdb.commons.path.PartialPath path)
- Specified by:
getBelongedStorageGroupin interfaceISchemaTree
-
getStorageGroups
public java.util.List<java.lang.String> getStorageGroups()
- Specified by:
getStorageGroupsin interfaceISchemaTree
-
-