You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@iotdb.apache.org by GitBox <gi...@apache.org> on 2019/01/23 02:39:57 UTC

[GitHub] wujysh commented on a change in pull request #18: add english doc

wujysh commented on a change in pull request #18: add english doc
URL: https://github.com/apache/incubator-iotdb/pull/18#discussion_r250038439
 
 

 ##########
 File path: docs/Documentation/UserGuideV0.7/3-Operation Manual.md
 ##########
 @@ -0,0 +1,797 @@
+# Chapter 3: Operation Manual
+
+## Sample Data
+
+To make this manual more practical, we will use a specific scenario example to illustrate how to operate IoTDB databases at all stages of use. See [this page](Material-SampleData) for a look. For your convenience, we also provide you with a sample data file in real scenario to import into the IoTDB system for trial and operation.
+
+Download file: [IoTDB-SampleData.txt](sampledata文件下载链接).
+
+## Data Model Selection
+
+Before importing data to IoTDB, we first select the appropriate data storage model according to the [sample data](Material-SampleData), and then create the storage group and timeseries using [SET STORAGE GROUP](Chapter5,setstoragegroup) statement and [CREATE TIMESERIES](Chapter5,createtimeseries) statement respectively.
+
+### Storage Model Selection
+According to the data attribute layers described in [sample data](Material-SampleData), we can express it as an attribute hierarchy structure based on the coverage of attributes and the subordinate relationship between them, as shown in Figure 3.1 below. Its hierarchical relationship is: power group layer - power plant layer - device layer - sensor layer. ROOT is the root node, and each node of sensor layer is called a leaf node. In the process of using IoTDB, you can directly connect the attributes on the path from ROOT node to each leaf node with ".", thus forming the name of a timeseries in IoTDB. For example, The left-most path in Figure 3.1 can generate a timeseries named `ROOT.ln.wf01.wt01.status`.
+
+<center><img style="width:80%" src="./fig/Detail-1.jpg">
+
+**Figure 3.1 Attribute hierarchy structure**</center>
+
+After getting the name of the timeseries, we need to set up the storage group according to the actual scenario and scale of the data. Because in the scenario of this chapter data is usually arrived in the unit of groups (i.e., data may be across electric fields and devices), in order to avoid frequent switching of IO when writing data, and to meet the user's requirement of physical isolation of data in the unit of  groups, we set the storage group at the group layer.
+
+### Storage Group Creation
+After selecting the storage model, according to which we can set up the corresponding storage group. The SQL statements for creating storage groups are as follows:
+
+```
+IoTDB > set storage group to root.ln
+IoTDB > set storage group to root.sgcc
+```
+
+We can thus create two storage groups using the above two SQL statements.
+
+It is worth noting that when the path itself or the parent/child layer of the path is already set as a storage group, the path is then not allowed to be set as a storage group. For example, it is not feasible to set `root.ln.wf01` as a storage group when there exist two storage groups `root.ln` and `root.sgcc`. The system will give the corresponding error prompt as shown below:
+
+```
+IoTDB> set storage group to root.ln.wf01
+error: The prefix of root.ln.wf01 has been set to the storage group.
+```
+
+### Show Storage Group
+After the storage group is created, we can use the [SHOW STORAGE GROUP](Chapter5,showstoragegroup) statement to view all the storage groups. The SQL statement is as follows:
+
+```
+IoTDB> show storage group
+```
+
+The result is as follows:
+<center><img style="width:80%" src="./fig/Detail-2.jpg"></center>
+
+### Timeseries Creation
+According to the storage model selected before, we can create corresponding timeseries in the two storage groups respectively. The SQL statements for creating timeseries are as follows:
+
+```
+IoTDB > create timeseries root.ln.wf01.wt01.status with datatype=BOOLEAN,encoding=PLAIN
+IoTDB > create timeseries root.ln.wf01.wt01.temperature with datatype=FLOAT,encoding=RLE
+IoTDB > create timeseries root.ln.wf02.wt02.hardware with datatype=TEXT,encoding=PLAIN
+IoTDB > create timeseries root.ln.wf02.wt02.status with datatype=BOOLEAN,encoding=PLAIN
+IoTDB > create timeseries root.sgcc.wf03.wt01.status with datatype=BOOLEAN,encoding=PLAIN
+IoTDB > create timeseries root.sgcc.wf03.wt01.temperature with datatype=FLOAT,encoding=RLE
+```
+
+It is worth noting that when in the CRATE TIMESERIES statement the encoding method conflicts with the data type, the system will give the corresponding error prompt as shown below:
+
+```
+IoTDB> create timeseries root.ln.wf02.wt02.status WITH DATATYPE=BOOLEAN, ENCODING=TS_2DIFF
+error: encoding TS_2DIFF does not support BOOLEAN
+```
+
+Please refer to [Encoding](Chapter2,encoding) for correspondence between data type and encoding.
+
+### Show Timeseries
+
+Currently, IoTDB supports two ways of viewing timeseries:
+
+* SHOW TIMESERIES statement presents all timeseries information in JSON form 
+* SHOW TIMESERIES <`Path`> statement returns all timeseries information and the total number of timeseries under the given <`Path`>  in tabular form. timeseries information includes: timeseries path, storage group it belongs to, data type, encoding type.  <`Path`> needs to be a prefix path or a path with star or a timeseries path. SQL statements are as follows:
+
+```
+IoTDB> show timeseries root
+IoTDB> show timeseries root.ln
+```
+
+The results are shown below respectly:
+
+<center><img style="width:80%" src="./fig/Detail-3.jpg"></center>
 
 Review comment:
   I think we should just paste the result as plain text in code block to the documentation. These screenshots will cause the documentation hard to maintain and that is also not elegant in style (font. size and background color, etc.)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services