Package org.apache.iotdb.commons.utils
Class PathUtils
- java.lang.Object
-
- org.apache.iotdb.commons.utils.PathUtils
-
public class PathUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description PathUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringcheckAndReturnSingleMeasurement(java.lang.String measurement)check a measurement and update it if needed to.static java.util.List<java.util.List<java.lang.String>>checkIsLegalMeasurementListsAndUpdate(java.util.List<java.util.List<java.lang.String>> measurementLists)check whether measurement is legal according to syntax convention measurement could be like a.b (more than one node name), in template?static java.util.List<java.lang.String>checkIsLegalMeasurementsAndUpdate(java.util.List<java.lang.String> measurements)check whether measurement is legal according to syntax convention measurement could be like a.b (more than one node name), in template?static java.util.List<java.util.List<java.lang.String>>checkIsLegalSingleMeasurementListsAndUpdate(java.util.List<java.util.List<java.lang.String>> measurementLists)check whether measurement is legal according to syntax convention.static java.util.List<java.lang.String>checkIsLegalSingleMeasurementsAndUpdate(java.util.List<java.lang.String> measurements)check whether measurement is legal according to syntax convention.static java.util.List<java.lang.String>checkLegalSingleMeasurementsAndSkipDuplicate(java.util.List<java.lang.String> measurements, java.util.Map<java.lang.String,java.lang.String> checkedMeasurements)check whether measurement is legal according to syntax convention.static java.lang.String[]isLegalPath(java.lang.String path)static booleanisRealNumber(java.lang.String str)Return true if the str is a real number.static booleanisStartWith(java.lang.String deviceName, java.lang.String storageGroup)static java.lang.StringremoveBackQuotesIfNecessary(java.lang.String measurement)Remove the back quotes of a measurement if necessarystatic java.lang.String[]splitPathToDetachedNodes(java.lang.String path)
-
-
-
Method Detail
-
splitPathToDetachedNodes
public static java.lang.String[] splitPathToDetachedNodes(java.lang.String path) throws IllegalPathException- Parameters:
path- the path will split. ex, root.ln.- Returns:
- string array. ex, [root, ln]
- Throws:
IllegalPathException- if path isn't correct, the exception will throw
-
isLegalPath
public static java.lang.String[] isLegalPath(java.lang.String path) throws IllegalPathException- Throws:
IllegalPathException
-
checkIsLegalSingleMeasurementListsAndUpdate
public static java.util.List<java.util.List<java.lang.String>> checkIsLegalSingleMeasurementListsAndUpdate(java.util.List<java.util.List<java.lang.String>> measurementLists) throws MetadataExceptioncheck whether measurement is legal according to syntax convention. Measurement can only be a single node name. The returned list is updated, could be different from the original list.- Throws:
MetadataException
-
checkLegalSingleMeasurementsAndSkipDuplicate
public static java.util.List<java.lang.String> checkLegalSingleMeasurementsAndSkipDuplicate(java.util.List<java.lang.String> measurements, java.util.Map<java.lang.String,java.lang.String> checkedMeasurements) throws MetadataExceptioncheck whether measurement is legal according to syntax convention. Measurement can only be a single node name, use set to skip checking duplicated measurements- Throws:
MetadataException
-
checkIsLegalSingleMeasurementsAndUpdate
public static java.util.List<java.lang.String> checkIsLegalSingleMeasurementsAndUpdate(java.util.List<java.lang.String> measurements) throws MetadataExceptioncheck whether measurement is legal according to syntax convention. Measurement can only be a single node name.- Throws:
MetadataException
-
checkIsLegalMeasurementListsAndUpdate
public static java.util.List<java.util.List<java.lang.String>> checkIsLegalMeasurementListsAndUpdate(java.util.List<java.util.List<java.lang.String>> measurementLists) throws IllegalPathExceptioncheck whether measurement is legal according to syntax convention measurement could be like a.b (more than one node name), in template?- Throws:
IllegalPathException
-
checkIsLegalMeasurementsAndUpdate
public static java.util.List<java.lang.String> checkIsLegalMeasurementsAndUpdate(java.util.List<java.lang.String> measurements) throws IllegalPathExceptioncheck whether measurement is legal according to syntax convention measurement could be like a.b (more than one node name), in template?- Throws:
IllegalPathException
-
checkAndReturnSingleMeasurement
public static java.lang.String checkAndReturnSingleMeasurement(java.lang.String measurement) throws IllegalPathExceptioncheck a measurement and update it if needed to. for example: `sd` -> sd- Throws:
IllegalPathException
-
isRealNumber
public static boolean isRealNumber(java.lang.String str)
Return true if the str is a real number. Examples: 1.0; +1.0; -1.0; 0011; 011e3; +23e-3
-
isStartWith
public static boolean isStartWith(java.lang.String deviceName, java.lang.String storageGroup)
-
removeBackQuotesIfNecessary
public static java.lang.String removeBackQuotesIfNecessary(java.lang.String measurement)
Remove the back quotes of a measurement if necessary
-
-