LeiRui commented on a change in pull request #34: fix sonar 
URL: https://github.com/apache/incubator-iotdb/pull/34#discussion_r252152062
 
 

 ##########
 File path: 
tsfile/src/main/java/org/apache/iotdb/tsfile/common/conf/TSFileDescriptor.java
 ##########
 @@ -105,39 +101,48 @@ private void loadProps() {
     Properties properties = new Properties();
     try {
       properties.load(inputStream);
-      conf.groupSizeInByte = Integer
-          .parseInt(properties.getProperty("group_size_in_byte", 
conf.groupSizeInByte + ""));
-      conf.pageSizeInByte = Integer
-          .parseInt(properties.getProperty("page_size_in_byte", 
conf.pageSizeInByte + ""));
-      conf.maxNumberOfPointsInPage = Integer.parseInt(
+      TSFileConfig.groupSizeInByte = Integer
+          .parseInt(
+              properties.getProperty("group_size_in_byte", 
TSFileConfig.groupSizeInByte + ""));
+      TSFileConfig.pageSizeInByte = Integer
+          .parseInt(properties.getProperty("page_size_in_byte", 
TSFileConfig.pageSizeInByte + ""));
+      TSFileConfig.maxNumberOfPointsInPage = Integer.parseInt(
           properties
-              .getProperty("max_number_of_points_in_page", 
conf.maxNumberOfPointsInPage + ""));
-      conf.timeSeriesDataType = properties
-          .getProperty("time_series_data_type", conf.timeSeriesDataType);
-      conf.maxStringLength = Integer
-          .parseInt(properties.getProperty("max_string_length", 
conf.maxStringLength + ""));
-      conf.floatPrecision = Integer
-          .parseInt(properties.getProperty("float_precision", 
conf.floatPrecision + ""));
-      conf.timeSeriesEncoder = properties
-          .getProperty("time_series_encoder", conf.timeSeriesEncoder);
-      conf.valueEncoder = properties.getProperty("value_encoder", 
conf.valueEncoder);
-      conf.compressor = properties.getProperty("compressor", conf.compressor);
+              .getProperty("max_number_of_points_in_page",
+                  TSFileConfig.maxNumberOfPointsInPage + ""));
+      TSFileConfig.timeSeriesDataType = properties
+          .getProperty("time_series_data_type", 
TSFileConfig.timeSeriesDataType);
+      TSFileConfig.maxStringLength = Integer
+          .parseInt(properties
+              .getProperty("max_string_length", 
Integer.toString(TSFileConfig.maxStringLength)));
+      TSFileConfig.floatPrecision = Integer
+          .parseInt(properties
+              .getProperty("float_precision", 
Integer.toString(TSFileConfig.floatPrecision)));
+      TSFileConfig.timeSeriesEncoder = properties
+          .getProperty("time_series_encoder", TSFileConfig.timeSeriesEncoder);
+      TSFileConfig.valueEncoder = properties
+          .getProperty("value_encoder", TSFileConfig.valueEncoder);
+      TSFileConfig.compressor = properties.getProperty("compressor", 
TSFileConfig.compressor);
     } catch (IOException e) {
       LOGGER.warn("Cannot load config file because {}, use default 
configuration", e.getMessage());
     } catch (Exception e) {
-      LOGGER.error("Loading settings {} failed because {}", url, 
e.getMessage());
+      LOGGER.error("Loading settings {} failed because {}", url, e);
 
 Review comment:
   ok

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to