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

 ##########
 File path: 
tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/decoder/LongRleDecoder.java
 ##########
 @@ -1,100 +1,42 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements.  See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership.  The ASF licenses this file to you under the Apache 
License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with the 
License.  You may obtain
+ * a copy of the License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied.  See the License for the specific language governing 
permissions and limitations
  * under the License.
  */
 package org.apache.iotdb.tsfile.encoding.decoder;
 
 import java.io.IOException;
-import java.nio.ByteBuffer;
+import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
 import org.apache.iotdb.tsfile.encoding.bitpacking.LongPacker;
 import org.apache.iotdb.tsfile.encoding.common.EndianType;
-import org.apache.iotdb.tsfile.exception.encoding.TsFileDecodingException;
 import org.apache.iotdb.tsfile.utils.ReadWriteForEncodingUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
  * Decoder for long value using rle or bit-packing.
  */
-public class LongRleDecoder extends RleDecoder {
+public class LongRleDecoder extends RleDecoder<Long> {
 
   private static final Logger LOGGER = 
LoggerFactory.getLogger(LongRleDecoder.class);
 
-  /**
-   * current value for rle repeated value.
-   */
-  private long currentValue;
-
-  /**
-   * buffer to save all values in group using bit-packing.
-   */
-  private long[] currentBuffer;
-
   /**
    * packer for unpacking long value.
    */
   private LongPacker packer;
 
   public LongRleDecoder(EndianType endianType) {
     super(endianType);
-    currentValue = 0;
-  }
-
-  /**
-   * read a long value from InputStream.
-   *
-   * @param buffer - InputStream
-   * @return value - current valid value
-   */
-  @Override
-  public long readLong(ByteBuffer buffer) {
-    if (!isLengthAndBitWidthReaded) {
 
 Review comment:
   These kinds of modifications will be revoked.

----------------------------------------------------------------
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