This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch pipeline_flush_task
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/pipeline_flush_task by this 
push:
     new b42fdb2  fix
b42fdb2 is described below

commit b42fdb2b662c61da2aa5e802395c6e5870da7a14
Author: JackieTien97 <[email protected]>
AuthorDate: Tue Jan 26 22:32:50 2021 +0800

    fix
---
 example/session/pom.xml                            | 30 ++++++++++++++++++++++
 example/session/src/assembly/session-example.xml   |  8 +-----
 .../main/java/org/apache/iotdb/SessionExample.java | 10 ++++----
 3 files changed, 36 insertions(+), 12 deletions(-)

diff --git a/example/session/pom.xml b/example/session/pom.xml
index 6fd056b..2c4d4d1 100644
--- a/example/session/pom.xml
+++ b/example/session/pom.xml
@@ -40,4 +40,34 @@
             <version>${project.version}</version>
         </dependency>
     </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <version>${maven.assembly.version}</version>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <addClasspath>true</addClasspath>
+                            
<mainClass>org.apache.iotdb.SessionExample</mainClass>
+                        </manifest>
+                    </archive>
+                    <descriptorRefs>
+                        <descriptorRef>jar-with-dependencies</descriptorRef>
+                    </descriptorRefs>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>make-assembly</id>
+                        <!-- this is used for inheritance merges -->
+                        <phase>package</phase>
+                        <!-- bind to the packaging phase -->
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/example/session/src/assembly/session-example.xml 
b/example/session/src/assembly/session-example.xml
index 4db5225..a44e522 100644
--- a/example/session/src/assembly/session-example.xml
+++ b/example/session/src/assembly/session-example.xml
@@ -20,7 +20,7 @@
 
 -->
 <assembly>
-    <id>server</id>
+    <id>session-example</id>
     <formats>
         <format>dir</format>
         <format>zip</format>
@@ -31,10 +31,4 @@
             <outputDirectory>lib</outputDirectory>
         </dependencySet>
     </dependencySets>
-    <fileSets>
-        <fileSet>
-            <directory>src/assembly/resources</directory>
-            <outputDirectory>${file.separator}</outputDirectory>
-        </fileSet>
-    </fileSets>
 </assembly>
diff --git a/example/session/src/main/java/org/apache/iotdb/SessionExample.java 
b/example/session/src/main/java/org/apache/iotdb/SessionExample.java
index 9518584..916374c 100644
--- a/example/session/src/main/java/org/apache/iotdb/SessionExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/SessionExample.java
@@ -48,7 +48,7 @@ public class SessionExample {
 
   public static void main(String[] args)
       throws IoTDBConnectionException, StatementExecutionException {
-    session = new Session("192.168.130.36", 6667, "root", "root");
+    session = new Session("127.0.0.1", 6667, "root", "root");
     session.open(false);
 
     //set session fetchSize
@@ -64,7 +64,9 @@ public class SessionExample {
 //    createTimeseries();
 //    createMultiTimeseries();
 //    insertRecord();
-    insertTablet();
+    long MAX_ROW_NUM = Long.parseLong(args[0]);
+    System.out.println("MAX_ROW_NUM: " + MAX_ROW_NUM);
+    insertTablet(MAX_ROW_NUM);
 //    insertTablets();
 //    insertRecords();
 //    nonQuery();
@@ -261,7 +263,7 @@ public class SessionExample {
    *
    * Users need to control the count of Tablet and write a batch when it 
reaches the maxBatchSize
    */
-  private static void insertTablet() throws IoTDBConnectionException, 
StatementExecutionException {
+  private static void insertTablet(long MAX_ROW_NUM) throws 
IoTDBConnectionException, StatementExecutionException {
     // The schema of measurements of one device
     // only measurementId and data type in MeasurementSchema take effects in 
Tablet
     List<MeasurementSchema> schemaList = new ArrayList<>();
@@ -274,8 +276,6 @@ public class SessionExample {
     //Method 1 to add tablet data
     long timestamp = System.currentTimeMillis();
 
-    long MAX_ROW_NUM = 1000L;
-
     for (long row = 0; row < MAX_ROW_NUM; row++) {
       int rowIndex = tablet.rowSize++;
       tablet.addTimestamp(rowIndex, timestamp);

Reply via email to