• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

apache / iotdb / #9917

24 Aug 2023 04:16PM UTC coverage: 47.861% (+0.009%) from 47.852%
#9917

push

travis_ci

web-flow
Feature/streamlined grafana plugin profile (#10907)

80245 of 167662 relevant lines covered (47.86%)

0.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

52.94
/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/SchemaConstant.java
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one
3
 * or more contributor license agreements.  See the NOTICE file
4
 * distributed with this work for additional information
5
 * regarding copyright ownership.  The ASF licenses this file
6
 * to you under the Apache License, Version 2.0 (the
7
 * "License"); you may not use this file except in compliance
8
 * with the License.  You may obtain a copy of the License at
9
 *
10
 *     http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing,
13
 * software distributed under the License is distributed on an
14
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
 * KIND, either express or implied.  See the License for the
16
 * specific language governing permissions and limitations
17
 * under the License.
18
 */
19
package org.apache.iotdb.commons.schema;
20

21
import org.apache.iotdb.commons.conf.IoTDBConstant;
22
import org.apache.iotdb.commons.path.PartialPath;
23
import org.apache.iotdb.commons.path.PathPatternTree;
24
import org.apache.iotdb.commons.path.fa.dfa.PatternDFA;
25

26
public class SchemaConstant {
27

28
  private SchemaConstant() {
29
    // allowed to do nothing
30
  }
31

32
  public static final String MTREE_PREFIX = "mtree";
33
  private static final String MTREE_VERSION = "1";
34
  public static final String MTREE_TXT_SNAPSHOT_OLD_VERSION =
35
      MTREE_PREFIX + IoTDBConstant.FILE_NAME_SEPARATOR + MTREE_VERSION + ".snapshot";
36
  public static final String MTREE_SNAPSHOT_OLD_VERSION =
37
      MTREE_PREFIX + IoTDBConstant.FILE_NAME_SEPARATOR + MTREE_VERSION + ".snapshot.bin";
38
  public static final String MTREE_SNAPSHOT_TMP_OLDVERSION =
39
      MTREE_PREFIX + IoTDBConstant.FILE_NAME_SEPARATOR + MTREE_VERSION + ".snapshot.bin.tmp";
40

41
  public static final String ROOT = "root";
42
  public static final String METADATA_TXT_LOG = "mlog.txt";
43
  public static final String METADATA_LOG = "mlog.bin";
44
  public static final String METADATA_LOG_DESCRIPTION = "mlog.description";
45
  public static final String TAG_LOG = "tlog.txt";
46
  public static final String TEMPLATE_FILE = "template_log.bin";
47
  public static final String STORAGE_GROUP_LOG = "storage_group_log.bin";
48
  public static final String PBTREE_FILE_NAME = "pbtree.pst";
49
  public static final String PBTREE_LOG_FILE_NAME = "pbtree_log.bin";
50

51
  public static final String PBTREE_SNAPSHOT = "pbtree.pst.snapshot";
52
  public static final String TAG_LOG_SNAPSHOT = "tlog.txt.snapshot";
53
  public static final String TAG_LOG_SNAPSHOT_TMP = "tlog.txt.snapshot.tmp";
54
  public static final String MTREE_SNAPSHOT = "mtree.snapshot";
55
  public static final String MTREE_SNAPSHOT_TMP = "mtree.snapshot.tmp";
56
  public static final String SYSTEM_DATABASE = "root.__system";
57

58
  public static final String[] ALL_RESULT_NODES = new String[] {"root", "**"};
1✔
59
  public static final PartialPath ALL_MATCH_PATTERN = new PartialPath(ALL_RESULT_NODES);
1✔
60
  public static final PathPatternTree ALL_MATCH_PATTERN_TREE = new PathPatternTree();
1✔
61

62
  static {
63
    ALL_MATCH_PATTERN_TREE.appendPathPattern(ALL_MATCH_PATTERN);
1✔
64
    ALL_MATCH_PATTERN_TREE.constructTree();
1✔
65
  }
66

67
  public static final PatternDFA ALL_MATCH_DFA = new PatternDFA(ALL_MATCH_PATTERN, false);
1✔
68
  public static final PartialPath SYSTEM_DATABASE_PATTERN =
1✔
69
      new PartialPath(SYSTEM_DATABASE.split("\\."));
1✔
70

71
  public static final int NON_TEMPLATE = -1;
72
  public static final int ALL_TEMPLATE = -2;
73

74
  public static final byte INTERNAL_MNODE_TYPE = 0;
75
  public static final byte STORAGE_GROUP_MNODE_TYPE = 1;
76
  public static final byte MEASUREMENT_MNODE_TYPE = 2;
77
  public static final byte ENTITY_MNODE_TYPE = 3;
78
  public static final byte STORAGE_GROUP_ENTITY_MNODE_TYPE = 4;
79

80
  public static final byte LOGICAL_VIEW_MNODE_TYPE = 5;
81

82
  public static final String INTERNAL_MNODE_TYPE_NAME = "InternalMNode";
83
  public static final String STORAGE_GROUP_MNODE_TYPE_NAME = "StorageGroupMNode";
84
  public static final String MEASUREMENT_MNODE_TYPE_NAME = "MeasurementMNode";
85
  public static final String ENTITY_MNODE_TYPE_NAME = "EntityMNode";
86
  public static final String STORAGE_GROUP_ENTITY_MNODE_TYPE_NAME = "StorageGroupEntityMNode";
87

88
  public static final String LOGICAL_VIEW_MNODE_TYPE_NAME = "LogicalViewMNode";
89

90
  public static final String SCHEMA_REGION_METRIC_NAME = "schema_region";
91
  public static final String SCHEMA_ENGINE_METRIC_NAME = "pbtree";
92

93
  public static final String DEFAULT_SCHEMA_ENGINE_MODE = "Memory";
94
  public static final String DEFAULT_MNODE_FACTORY_ENV = "IoTDB";
95

96
  public static String getMNodeTypeName(byte type) {
97
    switch (type) {
×
98
      case INTERNAL_MNODE_TYPE:
99
        return INTERNAL_MNODE_TYPE_NAME;
×
100
      case STORAGE_GROUP_MNODE_TYPE:
101
        return STORAGE_GROUP_MNODE_TYPE_NAME;
×
102
      case MEASUREMENT_MNODE_TYPE:
103
        return MEASUREMENT_MNODE_TYPE_NAME;
×
104
      case ENTITY_MNODE_TYPE:
105
        return ENTITY_MNODE_TYPE_NAME;
×
106
      case STORAGE_GROUP_ENTITY_MNODE_TYPE:
107
        return STORAGE_GROUP_ENTITY_MNODE_TYPE_NAME;
×
108
      case LOGICAL_VIEW_MNODE_TYPE:
109
        return LOGICAL_VIEW_MNODE_TYPE_NAME;
×
110
      default:
111
        throw new RuntimeException("Undefined MNode type " + type);
×
112
    }
113
  }
114

115
  public static boolean isStorageGroupType(byte type) {
116
    return type == STORAGE_GROUP_MNODE_TYPE || type == STORAGE_GROUP_ENTITY_MNODE_TYPE;
1✔
117
  }
118
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc