Class ClusterSchemaTree
- java.lang.Object
-
- org.apache.iotdb.db.mpp.common.schematree.ClusterSchemaTree
-
- All Implemented Interfaces:
ISchemaTree
public class ClusterSchemaTree extends java.lang.Object implements ISchemaTree
-
-
Constructor Summary
Constructors Constructor Description ClusterSchemaTree()ClusterSchemaTree(SchemaNode root)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendMeasurementPaths(java.util.List<MeasurementPath> measurementPathList)voidappendSingleMeasurement(org.apache.iotdb.commons.path.PartialPath path, org.apache.iotdb.tsfile.write.schema.MeasurementSchema schema, java.lang.String alias, boolean isAligned)static ClusterSchemaTreedeserialize(java.io.InputStream inputStream)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()voidmergeSchemaTree(ClusterSchemaTree 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.voidserialize(java.io.OutputStream outputStream)voidsetStorageGroups(java.util.List<java.lang.String> storageGroups)
-
-
-
Constructor Detail
-
ClusterSchemaTree
public ClusterSchemaTree()
-
ClusterSchemaTree
public ClusterSchemaTree(SchemaNode root)
-
-
Method Detail
-
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)
Return 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)
Get 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
-
searchDeviceSchemaInfo
public DeviceSchemaInfo searchDeviceSchemaInfo(org.apache.iotdb.commons.path.PartialPath devicePath, java.util.List<java.lang.String> measurements)
- Specified by:
searchDeviceSchemaInfoin interfaceISchemaTree
-
appendMeasurementPaths
public void appendMeasurementPaths(java.util.List<MeasurementPath> measurementPathList)
-
appendSingleMeasurement
public void appendSingleMeasurement(org.apache.iotdb.commons.path.PartialPath path, org.apache.iotdb.tsfile.write.schema.MeasurementSchema schema, java.lang.String alias, boolean isAligned)
-
mergeSchemaTree
public void mergeSchemaTree(ClusterSchemaTree schemaTree)
-
serialize
public void serialize(java.io.OutputStream outputStream) throws java.io.IOException- Throws:
java.io.IOException
-
deserialize
public static ClusterSchemaTree deserialize(java.io.InputStream inputStream) throws java.io.IOException
- Throws:
java.io.IOException
-
getBelongedStorageGroup
public java.lang.String getBelongedStorageGroup(java.lang.String pathName)
Get 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
-
setStorageGroups
public void setStorageGroups(java.util.List<java.lang.String> storageGroups)
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceISchemaTree
-
-