public class MManager extends Object
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:
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
MManager.StorageGroupFilter
StorageGroupFilter filters unsatisfied storage groups in metadata queries to speed up and
deduplicate.
|
| 限定符和类型 | 字段和说明 |
|---|---|
protected static IoTDBConfig |
config |
static String |
TIME_SERIES_TREE_HEADER |
| 限定符 | 构造器和说明 |
|---|---|
protected |
MManager() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addAttributes(Map<String,String> attributesMap,
PartialPath fullPath)
add new attributes key-value for the timeseries
|
void |
addTags(Map<String,String> tagsMap,
PartialPath fullPath)
add new tags key-value for the timeseries
|
void |
appendSchemaTemplate(AppendTemplatePlan plan) |
void |
cacheMeta(PartialPath path,
IMeasurementMNode measurementMNode,
boolean needSetFullPath)
if the path is in local mtree, nothing needed to do (because mtree is in the memory); Otherwise
cache the path to mRemoteSchemaCache
|
void |
changeAlias(PartialPath path,
String alias) |
void |
changeOffset(PartialPath path,
long offset)
Check whether the given path contains a storage group change or set the new offset of a
timeseries
|
boolean |
checkStorageGroupByPath(PartialPath path)
Check whether the given path contains a storage group
|
void |
checkTTLOnLastCache() |
void |
clear()
function for clearing MTree
|
void |
collectMeasurementSchema(PartialPath prefixPath,
List<IMeasurementSchema> measurementSchemas)
Collect the timeseries schemas as IMeasurementSchema under "prefixPath".
|
void |
collectTimeseriesSchema(PartialPath prefixPath,
Collection<TimeseriesSchema> timeseriesSchemas)
Collect the timeseries schemas as TimeseriesSchema under "prefixPath".
|
int |
countMeasurementsInTemplate(String templateName) |
void |
createAlignedTimeSeries(CreateAlignedTimeSeriesPlan plan)
create aligned timeseries
|
void |
createAlignedTimeSeries(PartialPath prefixPath,
List<String> measurements,
List<TSDataType> dataTypes,
List<TSEncoding> encodings,
List<CompressionType> compressors) |
void |
createMTreeSnapshot() |
void |
createSchemaTemplate(CreateTemplatePlan plan) |
void |
createTimeseries(CreateTimeSeriesPlan plan) |
void |
createTimeseries(CreateTimeSeriesPlan plan,
long offset) |
void |
createTimeseries(PartialPath path,
TSDataType dataType,
TSEncoding encoding,
CompressionType compressor,
Map<String,String> props)
Add one timeseries to metadata tree, if the timeseries already exists, throw exception
|
void |
deactivateSchemaTemplate(DeactivateTemplatePlan plan) |
void |
deleteLastCacheByDevice(PartialPath deviceId)
delete all the last cache value of any timeseries or aligned timeseries under the device
Invoking scenario (1) after upload tsfile
|
void |
deleteLastCacheByDevice(PartialPath deviceId,
PartialPath originalPath,
long startTime,
long endTime)
delete the last cache value of timeseries or subMeasurement of some aligned timeseries, which
is under the device and matching the originalPath
Invoking scenario (1) delete timeseries
|
void |
deleteStorageGroups(List<PartialPath> storageGroups)
Delete storage groups of given paths from MTree.
|
String |
deleteTimeseries(PartialPath pathPattern)
Delete all timeseries matching the given path pattern, may cross different storage group
|
String |
deleteTimeseries(PartialPath pathPattern,
boolean isPrefixMatch)
Delete all timeseries matching the given path pattern, may cross different storage group.
|
void |
dropSchemaTemplate(DropTemplatePlan plan) |
void |
dropTagsOrAttributes(Set<String> keySet,
PartialPath fullPath)
drop tags or attributes of the timeseries
|
void |
flushAllMlogForTest() |
List<MeasurementPath> |
getAllMeasurementByDevicePath(PartialPath devicePath) |
Map<PartialPath,IMeasurementSchema> |
getAllMeasurementSchemaByPrefix(PartialPath prefixPath) |
List<IStorageGroupMNode> |
getAllStorageGroupNodes()
Get all storage group MNodes
|
List<PartialPath> |
getAllStorageGroupPaths()
Get all storage group paths
|
Set<String> |
getAllTemplates() |
int |
getAllTimeseriesCount(PartialPath pathPattern)
To calculate the count of timeseries matching given path.
|
int |
getAllTimeseriesCount(PartialPath pathPattern,
boolean isPrefixMatch)
To calculate the count of timeseries matching given path.
|
Set<PartialPath> |
getBelongedDevices(PartialPath timeseries)
Get all devices that one of the timeseries, matching the given timeseries path pattern, belongs
to.
|
PartialPath |
getBelongedStorageGroup(PartialPath path)
Get storage group name by path
e.g., root.sg1 is a storage group and path = root.sg1.d1, return root.sg1
|
List<PartialPath> |
getBelongedStorageGroups(PartialPath pathPattern)
Get the storage group that given path pattern matches or belongs to.
|
Set<String> |
getChildNodeNameInNextLevel(PartialPath pathPattern)
Get child node in the next level of the given path pattern.
|
Set<String> |
getChildNodeNameInNextLevel(PartialPath pathPattern,
int limit,
int offset) |
Set<String> |
getChildNodePathInNextLevel(PartialPath pathPattern)
Get child node path in the next level of the given path pattern.
|
Set<String> |
getChildNodePathInNextLevel(PartialPath pathPattern,
int limit,
int offset) |
String |
getDeviceId(PartialPath devicePath)
To reduce the String number in memory, use the deviceId from MManager instead of the deviceId
read from disk
|
IMNode |
getDeviceNode(PartialPath path) |
protected IMNode |
getDeviceNodeWithAutoCreate(PartialPath path) |
protected IMNode |
getDeviceNodeWithAutoCreate(PartialPath path,
boolean autoCreateSchema,
boolean allowCreateSg,
int sgLevel)
get device node, if the storage group is not set, create it when autoCreateSchema is true
(we develop this method as we need to get the node's lock after we get the lock.writeLock())
|
int |
getDevicesNum(PartialPath pathPattern)
To calculate the count of devices for given path pattern.
|
int |
getDevicesNum(PartialPath pathPattern,
boolean isPrefixMatch)
To calculate the count of devices for given path pattern.
|
static MManager |
getInstance()
we should not use this function in other place, but only in IoTDB class
|
TimeValuePair |
getLastCache(IMeasurementMNode node)
Get the last cache value in given MeasurementMNode.
|
TimeValuePair |
getLastCache(PartialPath seriesPath)
Get the last cache value of time series of given seriesPath.
|
Set<PartialPath> |
getMatchedDevices(PartialPath pathPattern,
boolean isPrefixMatch)
Get all device paths matching the path pattern.
|
List<ShowDevicesResult> |
getMatchedDevices(ShowDevicesPlan plan)
Get all device paths and according storage group paths as ShowDevicesResult.
|
List<PartialPath> |
getMatchedStorageGroups(PartialPath pathPattern,
boolean isPrefixMatch)
Get all storage group matching given path pattern.
|
Map<PartialPath,Integer> |
getMeasurementCountGroupByLevel(PartialPath pathPattern,
int level,
boolean isPrefixMatch) |
protected IMeasurementMNode |
getMeasurementMNode(IMNode deviceMNode,
String measurementName)
Invoked during insertPlan process.
|
IMeasurementMNode |
getMeasurementMNode(PartialPath fullPath) |
IMeasurementMNode[] |
getMeasurementMNodes(PartialPath deviceId,
String[] measurements) |
List<MeasurementPath> |
getMeasurementPaths(PartialPath pathPattern)
Return all measurement paths for given path if the path is abstract.
|
List<MeasurementPath> |
getMeasurementPaths(PartialPath pathPattern,
boolean isPrefixMatch)
Return all measurement paths for given path if the path is abstract.
|
Pair<List<MeasurementPath>,Integer> |
getMeasurementPathsWithAlias(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.
|
List<String> |
getMeasurementsInTemplate(String templateName,
String path) |
String |
getMetadataInString()
Get metadata in string
|
int |
getNodesCountInGivenLevel(PartialPath pathPattern,
int level)
To calculate the count of nodes in the given level for given path pattern.
|
int |
getNodesCountInGivenLevel(PartialPath pathPattern,
int level,
boolean isPrefixMatch)
To calculate the count of nodes in the given level for given path pattern.
|
List<PartialPath> |
getNodesListInGivenLevel(PartialPath pathPattern,
int nodeLevel)
Get all nodes matching the given path pattern in the given level.
|
List<PartialPath> |
getNodesListInGivenLevel(PartialPath pathPattern,
int nodeLevel,
MManager.StorageGroupFilter filter) |
Set<String> |
getPathsSetTemplate(String templateName)
Get all paths set designated template
|
Set<String> |
getPathsUsingTemplate(String templateName)
A shortcut mainly for viewing paths using template.
|
Set<PartialPath> |
getPathsUsingTemplateUnderPrefix(String templateName,
String prefix,
boolean prefixMatch)
Complete filter of paths using template, detail at
MTree.getPathsUsingTemplateUnderPrefix(org.apache.iotdb.db.metadata.template.Template, org.apache.iotdb.db.metadata.path.PartialPath, boolean) |
List<Pair<String,IMeasurementSchema>> |
getSchemasInTemplate(String templateName,
String path) |
IMeasurementSchema |
getSeriesSchema(PartialPath fullPath)
Get schema of paritialPath
|
IMNode |
getSeriesSchemasAndReadLockDevice(InsertPlan plan)
get schema for device.
|
TSDataType |
getSeriesType(PartialPath fullPath)
Get series type for given seriesPath.
|
IStorageGroupMNode |
getStorageGroupNodeByPath(PartialPath path)
Get storage group node by path. the give path don't need to be storage group path.
|
IStorageGroupMNode |
getStorageGroupNodeByStorageGroupPath(PartialPath path)
E.g., root.sg is storage group given [root, sg], return the MNode of root.sg given [root, sg,
device], return the MNode of root.sg Get storage group node by path.
|
int |
getStorageGroupNum(PartialPath pathPattern,
boolean isPrefixMatch)
To calculate the count of storage group for given path pattern.
|
Map<PartialPath,Long> |
getStorageGroupsTTL()
get all storageGroups ttl
|
Template |
getTemplate(String templateName) |
long |
getTotalNormalSeriesNumber() |
long |
getTotalTemplateSeriesNumber() |
Map<String,List<PartialPath>> |
groupPathByStorageGroup(PartialPath path)
For a path, infer all storage groups it may belong to.
|
void |
init() |
void |
initForMultiMManagerTest()
Attention!!!!!
|
boolean |
isMeasurementInTemplate(String templateName,
String path) |
boolean |
isPathExist(PartialPath path)
Check whether the path exists.
|
boolean |
isPathExistsInTemplate(String templateName,
String path) |
boolean |
isStorageGroup(PartialPath path)
Check if the given path is storage group or not.
|
void |
operation(PhysicalPlan plan) |
void |
pruneSchemaTemplate(PruneTemplatePlan plan) |
void |
renameTagOrAttributeKey(String oldKey,
String newKey,
PartialPath fullPath)
rename the tag or attribute's key of the timeseries
|
void |
resetLastCache(PartialPath seriesPath)
Reset the last cache value of time series of given seriesPath.
|
void |
setSchemaTemplate(SetTemplatePlan plan) |
void |
setSeriesNumerMonitor(ISeriesNumerMonitor seriesNumerMonitor) |
void |
setStorageGroup(PartialPath storageGroup)
Set storage group of the given path to MTree.
|
void |
setTagsOrAttributesValue(Map<String,String> alterMap,
PartialPath fullPath)
set/change the values of tags or attributes
|
void |
setTTL(PartialPath storageGroup,
long dataTTL) |
void |
setUsingSchemaTemplate(ActivateTemplatePlan plan) |
List<ShowTimeSeriesResult> |
showTimeseries(ShowTimeSeriesPlan plan,
QueryContext context) |
void |
unsetSchemaTemplate(UnsetTemplatePlan plan) |
void |
updateLastCache(IMeasurementMNode node,
TimeValuePair timeValuePair,
boolean highPriorityUpdate,
Long latestFlushedTime)
Update the last cache value in given MeasurementMNode. work.
|
void |
updateLastCache(PartialPath seriesPath,
TimeValuePair timeValuePair,
boolean highPriorityUpdate,
Long latestFlushedTime)
Update the last cache value of time series of given seriesPath.
|
void |
upsertTagsAndAttributes(String alias,
Map<String,String> tagsMap,
Map<String,String> attributesMap,
PartialPath fullPath)
upsert tags and attributes key-value for the timeseries if the key has existed, just use the
new value to update it.
|
protected static IoTDBConfig config
public void setSeriesNumerMonitor(ISeriesNumerMonitor seriesNumerMonitor)
public static MManager getInstance()
public void init()
public void createMTreeSnapshot()
public void clear()
public void operation(PhysicalPlan plan) throws IOException, MetadataException
public void createTimeseries(CreateTimeSeriesPlan plan) throws MetadataException
public void createTimeseries(CreateTimeSeriesPlan plan, long offset) throws MetadataException
public void createTimeseries(PartialPath path, TSDataType dataType, TSEncoding encoding, CompressionType compressor, Map<String,String> props) throws MetadataException
path - the timeseries pathdataType - the dateType DataType of the timeseriesencoding - the encoding function Encoding of the timeseriescompressor - the compressor function Compressor of the time seriesMetadataExceptionpublic void createAlignedTimeSeries(PartialPath prefixPath, List<String> measurements, List<TSDataType> dataTypes, List<TSEncoding> encodings, List<CompressionType> compressors) throws MetadataException
public void createAlignedTimeSeries(CreateAlignedTimeSeriesPlan plan) throws MetadataException
plan - CreateAlignedTimeSeriesPlanMetadataExceptionpublic String deleteTimeseries(PartialPath pathPattern, boolean isPrefixMatch) throws MetadataException
pathPattern - path to be deletedisPrefixMatch - if true, the path pattern is used to match prefix pathMetadataExceptionpublic String deleteTimeseries(PartialPath pathPattern) throws MetadataException
pathPattern - path to be deletedMetadataExceptionpublic void setStorageGroup(PartialPath storageGroup) throws MetadataException
storageGroup - root.node.(node)*MetadataExceptionpublic void deleteStorageGroups(List<PartialPath> storageGroups) throws MetadataException
storageGroups - list of paths to be deleted. Format: root.nodeMetadataExceptionpublic void setTTL(PartialPath storageGroup, long dataTTL) throws MetadataException, IOException
protected IMNode getDeviceNodeWithAutoCreate(PartialPath path, boolean autoCreateSchema, boolean allowCreateSg, int sgLevel) throws IOException, MetadataException
(we develop this method as we need to get the node's lock after we get the lock.writeLock())
path - pathallowCreateSg - The stand-alone version can create an sg at will, but the cluster version
needs to make the Meta group aware of the creation of an SG, so an exception needs to be
thrown hereIOExceptionMetadataExceptionprotected IMNode getDeviceNodeWithAutoCreate(PartialPath path) throws MetadataException, IOException
public boolean isPathExist(PartialPath path)
path - a full path or a prefix pathpublic String getMetadataInString()
public long getTotalNormalSeriesNumber()
public long getTotalTemplateSeriesNumber()
public int getAllTimeseriesCount(PartialPath pathPattern, boolean isPrefixMatch) throws MetadataException
public int getAllTimeseriesCount(PartialPath pathPattern) throws MetadataException
public int getDevicesNum(PartialPath pathPattern, boolean isPrefixMatch) throws MetadataException
public int getDevicesNum(PartialPath pathPattern) throws MetadataException
public int getStorageGroupNum(PartialPath pathPattern, boolean isPrefixMatch) throws MetadataException
public int getNodesCountInGivenLevel(PartialPath pathPattern, int level, boolean isPrefixMatch) throws MetadataException
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 pathMetadataExceptionpublic int getNodesCountInGivenLevel(PartialPath pathPattern, int level) throws MetadataException
pathPattern - a path pattern or a full pathlevel - the level should match the level of the pathMetadataExceptionpublic Map<PartialPath,Integer> getMeasurementCountGroupByLevel(PartialPath pathPattern, int level, boolean isPrefixMatch) throws MetadataException
public List<PartialPath> getNodesListInGivenLevel(PartialPath pathPattern, int nodeLevel) throws MetadataException
pathPattern - can be a pattern of a full path.nodeLevel - the level should match the level of the pathMetadataExceptionpublic List<PartialPath> getNodesListInGivenLevel(PartialPath pathPattern, int nodeLevel, MManager.StorageGroupFilter filter) throws MetadataException
public Set<String> getChildNodePathInNextLevel(PartialPath pathPattern) throws MetadataException
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]
pathPattern - The given pathMetadataExceptionpublic Set<String> getChildNodePathInNextLevel(PartialPath pathPattern, int limit, int offset) throws MetadataException
public Set<String> getChildNodeNameInNextLevel(PartialPath pathPattern) throws MetadataException
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]
MetadataExceptionpublic Set<String> getChildNodeNameInNextLevel(PartialPath pathPattern, int limit, int offset) throws MetadataException
public boolean isStorageGroup(PartialPath path)
path - Format: root.node.(node)*public boolean checkStorageGroupByPath(PartialPath path)
public PartialPath getBelongedStorageGroup(PartialPath path) throws StorageGroupNotSetException
e.g., root.sg1 is a storage group and path = root.sg1.d1, return root.sg1
path - only full path, cannot be path patternStorageGroupNotSetExceptionpublic List<PartialPath> getBelongedStorageGroups(PartialPath pathPattern) throws MetadataException
Suppose we have (root.sg1.d1.s1, root.sg2.d2.s2), refer the following cases: 1. given path "root.sg1", ("root.sg1") will be returned. 2. given path "root.*", ("root.sg1", "root.sg2") will be returned. 3. given path "root.*.d1.s1", ("root.sg1", "root.sg2") will be returned.
pathPattern - a path pattern or a full pathMetadataExceptionpublic List<PartialPath> getMatchedStorageGroups(PartialPath pathPattern, boolean isPrefixMatch) throws MetadataException
pathPattern - a pattern of a full pathisPrefixMatch - if true, the path pattern is used to match prefix pathMetadataExceptionpublic List<PartialPath> getAllStorageGroupPaths()
public Map<PartialPath,Long> getStorageGroupsTTL()
public Set<PartialPath> getBelongedDevices(PartialPath timeseries) throws MetadataException
timeseries - a path pattern of the target timeseriesMetadataExceptionpublic Set<PartialPath> getMatchedDevices(PartialPath pathPattern, boolean isPrefixMatch) throws MetadataException
pathPattern - the pattern of the target devices.isPrefixMatch - if true, the path pattern is used to match prefix path.MetadataExceptionpublic List<ShowDevicesResult> getMatchedDevices(ShowDevicesPlan plan) throws MetadataException
plan - ShowDevicesPlan which contains the path pattern and restriction params.MetadataExceptionpublic List<MeasurementPath> getMeasurementPaths(PartialPath pathPattern, boolean isPrefixMatch) throws MetadataException
pathPattern - can be a pattern or a full path of timeseries.isPrefixMatch - if true, the path pattern is used to match prefix pathMetadataExceptionpublic List<MeasurementPath> getMeasurementPaths(PartialPath pathPattern) throws MetadataException
pathPattern - can be a pattern or a full path of timeseries.MetadataExceptionpublic Pair<List<MeasurementPath>,Integer> getMeasurementPathsWithAlias(PartialPath pathPattern, int limit, int offset, boolean isPrefixMatch) throws MetadataException
isPrefixMatch - if true, the path pattern is used to match prefix pathMetadataExceptionpublic List<ShowTimeSeriesResult> showTimeseries(ShowTimeSeriesPlan plan, QueryContext context) throws MetadataException
public TSDataType getSeriesType(PartialPath fullPath) throws MetadataException
fullPath - full pathMetadataExceptionpublic IMeasurementSchema getSeriesSchema(PartialPath fullPath) throws MetadataException
fullPath - (may be ParitialPath or AlignedPath)MetadataExceptionpublic List<MeasurementPath> getAllMeasurementByDevicePath(PartialPath devicePath) throws PathNotExistException
public Map<PartialPath,IMeasurementSchema> getAllMeasurementSchemaByPrefix(PartialPath prefixPath) throws MetadataException
public IStorageGroupMNode getStorageGroupNodeByStorageGroupPath(PartialPath path) throws MetadataException
public IStorageGroupMNode getStorageGroupNodeByPath(PartialPath path) throws MetadataException
public List<IStorageGroupMNode> getAllStorageGroupNodes()
public IMNode getDeviceNode(PartialPath path) throws MetadataException
public IMeasurementMNode[] getMeasurementMNodes(PartialPath deviceId, String[] measurements) throws MetadataException
public IMeasurementMNode getMeasurementMNode(PartialPath fullPath) throws MetadataException
protected IMeasurementMNode getMeasurementMNode(IMNode deviceMNode, String measurementName) throws PathAlreadyExistException
public void changeOffset(PartialPath path, long offset) throws MetadataException, IOException
path - timeseriesoffset - offset in the tag fileMetadataExceptionIOExceptionpublic void changeAlias(PartialPath path, String alias) throws MetadataException
public void upsertTagsAndAttributes(String alias, Map<String,String> tagsMap, Map<String,String> attributesMap, PartialPath fullPath) throws MetadataException, IOException
alias - newly added aliastagsMap - newly added tags mapattributesMap - newly added attributes mapfullPath - timeseriesMetadataExceptionIOExceptionpublic void addAttributes(Map<String,String> attributesMap, PartialPath fullPath) throws MetadataException, IOException
attributesMap - newly added attributes mapfullPath - timeseriesMetadataExceptionIOExceptionpublic void addTags(Map<String,String> tagsMap, PartialPath fullPath) throws MetadataException, IOException
tagsMap - newly added tags mapfullPath - timeseriesMetadataExceptionIOExceptionpublic void dropTagsOrAttributes(Set<String> keySet, PartialPath fullPath) throws MetadataException, IOException
keySet - tags key or attributes keyfullPath - timeseries pathMetadataExceptionIOExceptionpublic void setTagsOrAttributesValue(Map<String,String> alterMap, PartialPath fullPath) throws MetadataException, IOException
alterMap - the new tags or attributes key-valuefullPath - timeseriesMetadataExceptionIOExceptionpublic void renameTagOrAttributeKey(String oldKey, String newKey, PartialPath fullPath) throws MetadataException, IOException
oldKey - old key of tag or attributenewKey - new key of tag or attributefullPath - timeseriesMetadataExceptionIOExceptionpublic void collectMeasurementSchema(PartialPath prefixPath, List<IMeasurementSchema> measurementSchemas)
public void collectTimeseriesSchema(PartialPath prefixPath, Collection<TimeseriesSchema> timeseriesSchemas)
public Map<String,List<PartialPath>> groupPathByStorageGroup(PartialPath path) throws MetadataException
Consider the path into two parts: (1) the sub path which can not contain a storage group name and (2) the sub path which is substring that begin after the storage group name.
(1) Suppose the part of the path can not contain a storage group name (e.g., "root".contains("root.sg") == false), then: For each one level wildcard *, only one level will be inferred and the wildcard will be removed. For each multi level wildcard **, then the inference will go on until the storage groups are found and the wildcard will be kept. (2) Suppose the part of the path is a substring that begin after the storage group name. (e.g., For "root.*.sg1.a.*.b.*" and "root.x.sg1" is a storage group, then this part is "a.*.b.*"). For this part, keep what it is.
Assuming we have three SGs: root.group1, root.group2, root.area1.group3 Eg1: for input "root.**", returns ("root.group1", "root.group1.**"), ("root.group2", "root.group2.**") ("root.area1.group3", "root.area1.group3.**") Eg2: for input "root.*.s1", returns ("root.group1", "root.group1.s1"), ("root.group2", "root.group2.s1")
Eg3: for input "root.area1.**", returns ("root.area1.group3", "root.area1.group3.**")
path - can be a path pattern or a full path.MetadataExceptionpublic void cacheMeta(PartialPath path, IMeasurementMNode measurementMNode, boolean needSetFullPath)
public void updateLastCache(PartialPath seriesPath, TimeValuePair timeValuePair, boolean highPriorityUpdate, Long latestFlushedTime)
MManager will use the seriesPath to search the node first and then process the lastCache in the MeasurementMNode
Invoking scenario: (1) after executing insertPlan (2) after reading last value from file during last Query
seriesPath - the PartialPath of full path from root to MeasurementtimeValuePair - the latest point valuehighPriorityUpdate - the last value from insertPlan is high prioritylatestFlushedTime - latest flushed timepublic void updateLastCache(IMeasurementMNode node, TimeValuePair timeValuePair, boolean highPriorityUpdate, Long latestFlushedTime)
Invoking scenario: (1) after executing insertPlan (2) after reading last value from file during last Query
node - the measurementMNode holding the lastCachetimeValuePair - the latest point valuehighPriorityUpdate - the last value from insertPlan is high prioritylatestFlushedTime - latest flushed timepublic TimeValuePair getLastCache(PartialPath seriesPath)
Invoking scenario: last cache read during last Query
seriesPath - the PartialPath of full path from root to Measurementpublic TimeValuePair getLastCache(IMeasurementMNode node)
Invoking scenario: last cache read during last Query
node - the measurementMNode holding the lastCachepublic void resetLastCache(PartialPath seriesPath)
seriesPath - the PartialPath of full path from root to Measurementpublic void deleteLastCacheByDevice(PartialPath deviceId) throws MetadataException
Invoking scenario (1) after upload tsfile
deviceId - path of deviceMetadataExceptionpublic void deleteLastCacheByDevice(PartialPath deviceId, PartialPath originalPath, long startTime, long endTime) throws MetadataException
Invoking scenario (1) delete timeseries
deviceId - path of deviceoriginalPath - origin timeseries pathstartTime - startTimeendTime - endTimeMetadataExceptionpublic void checkTTLOnLastCache()
public IMNode getSeriesSchemasAndReadLockDevice(InsertPlan plan) throws MetadataException, IOException
public void createSchemaTemplate(CreateTemplatePlan plan) throws MetadataException
public void appendSchemaTemplate(AppendTemplatePlan plan) throws MetadataException
public void pruneSchemaTemplate(PruneTemplatePlan plan) throws MetadataException
public int countMeasurementsInTemplate(String templateName) throws MetadataException
public boolean isMeasurementInTemplate(String templateName, String path) throws MetadataException
templateName - name of template to checkpath - full path to checkMetadataExceptionpublic boolean isPathExistsInTemplate(String templateName, String path) throws MetadataException
public List<String> getMeasurementsInTemplate(String templateName, String path) throws MetadataException
public List<Pair<String,IMeasurementSchema>> getSchemasInTemplate(String templateName, String path) throws MetadataException
public Set<String> getPathsSetTemplate(String templateName) throws MetadataException
templateName - designated template name, blank string for any template existsMetadataExceptionpublic Set<String> getPathsUsingTemplate(String templateName) throws MetadataException
public Set<PartialPath> getPathsUsingTemplateUnderPrefix(String templateName, String prefix, boolean prefixMatch) throws MetadataException
MTree.getPathsUsingTemplateUnderPrefix(org.apache.iotdb.db.metadata.template.Template, org.apache.iotdb.db.metadata.path.PartialPath, boolean)public void dropSchemaTemplate(DropTemplatePlan plan) throws MetadataException
public void setSchemaTemplate(SetTemplatePlan plan) throws MetadataException
public void unsetSchemaTemplate(UnsetTemplatePlan plan) throws MetadataException
public void setUsingSchemaTemplate(ActivateTemplatePlan plan) throws MetadataException
public void deactivateSchemaTemplate(DeactivateTemplatePlan plan) throws MetadataException
public String getDeviceId(PartialPath devicePath)
devicePath - read from diskpublic void initForMultiMManagerTest()
public void flushAllMlogForTest()
throws IOException
IOExceptionpublic Template getTemplate(String templateName) throws MetadataException
Copyright © 2022 The Apache Software Foundation. All rights reserved.