LeiRui commented on a change in pull request #34: fix sonar
URL: https://github.com/apache/incubator-iotdb/pull/34#discussion_r252163235
##########
File path:
tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/encoder/TSEncodingBuilder.java
##########
@@ -105,24 +101,51 @@ public Encoder getEncoder(TSDataType type) {
public void initFromProps(Map<String, String> props) {
// set max error from initialized map or default value if not set
if (props == null || !props.containsKey(Encoder.MAX_STRING_LENGTH)) {
- maxStringLength = conf.maxStringLength;
+ maxStringLength = TSFileConfig.maxStringLength;
} else {
maxStringLength =
Integer.valueOf(props.get(Encoder.MAX_STRING_LENGTH));
if (maxStringLength < 0) {
- maxStringLength = conf.maxStringLength;
+ maxStringLength = TSFileConfig.maxStringLength;
LOG.warn("cannot set max string length to negative value, replaced
with default value:{}",
maxStringLength);
}
}
}
}
+ private static abstract class rleAndTs2diffCommon extends TSEncodingBuilder {
+
+ protected int maxPointNumber;
+
+ @Override
+ /**
+ * Both RLE and TS_2DIFF could specify <b>max_point_number</b> in given
JSON Object, which means the maximum
+ * decimal digits for float or double data.
+ */
+ public void initFromProps(Map<String, String> props) {
+ // set max error from initialized map or default value if not set
+ if (props == null || !props.containsKey(Encoder.MAX_POINT_NUMBER)) {
+ maxPointNumber = TSFileConfig.floatPrecision;
+ } else {
+ maxPointNumber = Integer.valueOf(props.get(Encoder.MAX_POINT_NUMBER));
+ if (maxPointNumber < 0) {
+ maxPointNumber = TSFileConfig.floatPrecision;
+ LOG.warn("cannot set max point number to negative value, replaced
with default value:{}",
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