lming created IOTDB-999:
---------------------------

             Summary: insert record into the database use session.insertRecord 
,there is no error tip in log and no record be inserted.
                 Key: IOTDB-999
                 URL: https://issues.apache.org/jira/browse/IOTDB-999
             Project: Apache IoTDB
          Issue Type: Bug
            Reporter: lming


                if(exeType.equals("IRS1")){ //
                        System.out.println("插入一个 Record,一个 Record 
是一个设备一个时间戳下多个测点的数据。");
                        List<String> measurements = new ArrayList<String>();
                        List<String> values = new ArrayList<String>();
                        ArrayList<String> lineList = new ArrayList<String>();
                        try {
                                lineList = lf.fetchLine(args[2]);//load the 
case file,storage the content into ArrayList by line,the case formate in line 
is like this ch1==ch2==ch3==ch4_'1'=='2'=='3'=='4',the left of '_' is sensor 
and the right of it is value,between sensor is '==',like the value.
                                
                                } catch (IOException e) {
                                e.printStackTrace();
                        }
                        for(int i=0;i<lineList.size();i++){
                                String[] tag_attribute = 
lineList.get(i).split("_");//split the lineList and storage into a string array.
                                        String[] senName = 
tag_attribute[0].split("==");
                                        for(int j=0;j<senName.length;j++){      
                        
                                                measurements.add(senName[j]);
                                        }
                                        String[] val = 
tag_attribute[1].split("==");
                                        for(int j=0;j<val.length;j++){
                                                values.add(val[j]);
                                        }
                        }
                        cit.insert1("root."+args[3], measurements, values); 
//arg[3]是设备ID,不加root.的部分。
                }
                
                
                
                /**
                 * 插入一个 Record,一个 Record 是一个设备一个时间戳下多个测点的数据。服务器需要做类型推断,可能会有额外耗时
                 * @param deviceId
                 * @param time
                 * @param measurements
                 * @param values
                 */
                public void insert1(String deviceId,List<String> measurements, 
List<String> values) {
                        Date dt= new Date();
                        long timeseries = dt.getTime();
                        try {
                                System.out.println("begin session.insertRecord 
写入");
                                session.insertRecord(deviceId, timeseries, 
measurements, values);//there is no error tip in log and no record be inserted.
                                System.out.println("end session.insertRecord 
写入");
                        } catch (IoTDBConnectionException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        } catch (StatementExecutionException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                        }
                   }
                   
                                   
                   //问题:日志没有报错,没有内容写入。



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to