This is an automated email from the ASF dual-hosted git repository. xuekaifeng pushed a commit to branch remove-print-in-test in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 7d39c0fc1bb5557717215839b169d49a1a4f5a1d Author: 151250176 <[email protected]> AuthorDate: Fri Jan 29 21:15:48 2021 +0800 remove print in some tests --- .../iotdb/db/sync/receiver/load/FileLoaderTest.java | 3 --- .../java/org/apache/iotdb/tsfile/compress/GZIPTest.java | 13 +------------ .../tsfile/encoding/decoder/LongRleDecoderTest.java | 17 +++++++---------- .../decoder/regular/RegularDataEncoderIntegerTest.java | 2 -- .../decoder/regular/RegularDataEncoderLongTest.java | 2 -- .../tsfile/read/query/executor/QueryExecutorTest.java | 17 +++++------------ .../apache/iotdb/tsfile/read/reader/PageReaderTest.java | 5 ----- .../org/apache/iotdb/tsfile/utils/BytesUtilsTest.java | 13 +------------ 8 files changed, 14 insertions(+), 58 deletions(-) diff --git a/server/src/test/java/org/apache/iotdb/db/sync/receiver/load/FileLoaderTest.java b/server/src/test/java/org/apache/iotdb/db/sync/receiver/load/FileLoaderTest.java index c9c7c74..1cf86fb 100644 --- a/server/src/test/java/org/apache/iotdb/db/sync/receiver/load/FileLoaderTest.java +++ b/server/src/test/java/org/apache/iotdb/db/sync/receiver/load/FileLoaderTest.java @@ -152,7 +152,6 @@ public class FileLoaderTest { for (List<File> set : allFileList.values()) { for (File newTsFile : set) { if (!newTsFile.getName().endsWith(TsFileResource.RESOURCE_SUFFIX)) { - LOGGER.error("sync file name is" + newTsFile.getAbsolutePath()); fileLoader.addTsfile(newTsFile); } } @@ -213,7 +212,6 @@ public class FileLoaderTest { + File.separator + "0" + File.separator + (time + i * 100 + j) + IoTDBConstant.FILE_NAME_SEPARATOR + rand + IoTDBConstant.FILE_NAME_SEPARATOR + "0.tsfile"; - LOGGER.error("file name is" + fileName); File syncFile = new File(fileName); File dataFile = new File( @@ -257,7 +255,6 @@ public class FileLoaderTest { for (List<File> set : allFileList.values()) { for (File newTsFile : set) { if (!newTsFile.getName().endsWith(TsFileResource.RESOURCE_SUFFIX)) { - LOGGER.error("sync file name is" + newTsFile.getAbsolutePath()); fileLoader.addTsfile(newTsFile); } } diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/compress/GZIPTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/compress/GZIPTest.java index 5547613..18ad062 100644 --- a/tsfile/src/test/java/org/apache/iotdb/tsfile/compress/GZIPTest.java +++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/compress/GZIPTest.java @@ -57,13 +57,8 @@ public class GZIPTest { int n = 500000; String input = randomString(n); byte[] uncom = input.getBytes(StandardCharsets.UTF_8); - long time = System.nanoTime(); byte[] compressed = ICompressor.GZIPCompress.compress(uncom); - System.out.println("compression time cost:" + ((System.nanoTime() - time)) / 1000 / 1000); - System.out.println("ratio: " + (double) compressed.length / uncom.length); - time = System.nanoTime(); byte[] uncompressed = ICompressor.GZIPCompress.uncompress(compressed); - System.out.println("decompression time cost:" + ((System.nanoTime() - time)) / 1000 / 1000); Assert.assertArrayEquals(uncom, uncompressed); } @@ -72,24 +67,18 @@ public class GZIPTest { public void testByteBuffer() throws IOException { for (int i = 1; i < 500000; i+= 1000) { String input = randomString(i); - //String input = "this is test"; ByteBuffer source = ByteBuffer.allocateDirect(input.getBytes().length); source.put(input.getBytes()); source.flip(); ICompressor.GZIPCompressor compressor = new ICompressor.GZIPCompressor(); - long time = System.currentTimeMillis(); ByteBuffer compressed = ByteBuffer.allocateDirect(Math.max(source.remaining() * 3 + 1, 28 + source.remaining())); - int compressSize = compressor.compress(source, compressed); - System.out.println("compression time cost:" + (System.currentTimeMillis() - time)); - System.out.println("ratio: " + (double) compressSize / i); + compressor.compress(source, compressed); IUnCompressor.GZIPUnCompressor unCompressor = new IUnCompressor.GZIPUnCompressor(); - time = System.currentTimeMillis(); ByteBuffer uncompressedByteBuffer = ByteBuffer.allocateDirect(compressed.remaining() + 28 * 2); compressed.flip(); unCompressor.uncompress(compressed, uncompressedByteBuffer); - System.out.println("decompression time cost:" + (System.currentTimeMillis() - time)); uncompressedByteBuffer.flip(); String afterDecode = ReadWriteIOUtils.readStringFromDirectByteBuffer(uncompressedByteBuffer); diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/LongRleDecoderTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/LongRleDecoderTest.java index 153112d..c059983 100644 --- a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/LongRleDecoderTest.java +++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/LongRleDecoderTest.java @@ -111,16 +111,16 @@ public class LongRleDecoderTest { list.add(i); } int width = ReadWriteForEncodingUtils.getLongMaxBitWidth(list); - testLength(list, width, false, 1); + testLength(list, false, 1); for (int i = 1; i < 10; i++) { - testLength(list, width, false, i); + testLength(list, false, i); } } @Test public void testRleReadLong() throws IOException { for (int i = 1; i < 2; i++) { - testLength(rleList, rleBitWidth, false, i); + testLength(rleList, false, i); } } @@ -142,24 +142,21 @@ public class LongRleDecoderTest { } int bitWidth = ReadWriteForEncodingUtils.getLongMaxBitWidth(repeatList); for (int i = 1; i < 10; i++) { - testLength(repeatList, bitWidth, false, i); + testLength(repeatList, false, i); } } @Test public void testBitPackingReadLong() throws IOException { for (int i = 1; i < 10; i++) { - testLength(bpList, bpBitWidth, false, i); + testLength(bpList, false, i); } } @Test public void testHybridReadLong() throws IOException { for (int i = 1; i < 10; i++) { - long start = System.currentTimeMillis(); - testLength(hybridList, hybridWidth, false, i); - long end = System.currentTimeMillis(); - System.out.println(String.format("Turn %d use time %d ms", i, end - start)); + testLength(hybridList, false, i); } } @@ -198,7 +195,7 @@ public class LongRleDecoderTest { } } - public void testLength(List<Long> list, int bitWidth, boolean isDebug, int repeatCount) + public void testLength(List<Long> list, boolean isDebug, int repeatCount) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); RleEncoder<Long> encoder = new LongRleEncoder(); diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java index cbf6ac6..205314f 100644 --- a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java +++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderIntegerTest.java @@ -132,11 +132,9 @@ public class RegularDataEncoderIntegerTest { } private void shouldReadAndWrite(int[] data, int length) throws IOException { - System.out.println("source data size:" + 8 * length + " byte"); out = new ByteArrayOutputStream(); writeData(data, length); byte[] page = out.toByteArray(); - System.out.println("encoding data size:" + page.length + " byte"); buffer = ByteBuffer.wrap(page); int i = 0; while (regularDataDecoder.hasNext(buffer)) { diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java index 143cd30..132491e 100644 --- a/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java +++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/encoding/decoder/regular/RegularDataEncoderLongTest.java @@ -203,11 +203,9 @@ public class RegularDataEncoderLongTest { } private void shouldReadAndWrite(long[] data, int length) throws IOException { - System.out.println("source data size:" + 8 * length + " byte"); out = new ByteArrayOutputStream(); writeData(data, length); byte[] page = out.toByteArray(); - System.out.println("encoding data size:" + page.length + " byte"); buffer = ByteBuffer.wrap(page); int i = 0; while (regularDataDecoder.hasNext(buffer)) { diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/read/query/executor/QueryExecutorTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/read/query/executor/QueryExecutorTest.java index 6d9b7b7..dcdb43b 100644 --- a/tsfile/src/test/java/org/apache/iotdb/tsfile/read/query/executor/QueryExecutorTest.java +++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/read/query/executor/QueryExecutorTest.java @@ -19,19 +19,13 @@ package org.apache.iotdb.tsfile.read.query.executor; import java.io.IOException; - -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor; import org.apache.iotdb.tsfile.exception.write.WriteProcessException; import org.apache.iotdb.tsfile.read.TsFileSequenceReader; import org.apache.iotdb.tsfile.read.common.Path; import org.apache.iotdb.tsfile.read.common.RowRecord; -import org.apache.iotdb.tsfile.read.controller.IChunkLoader; import org.apache.iotdb.tsfile.read.controller.CachedChunkLoaderImpl; +import org.apache.iotdb.tsfile.read.controller.IChunkLoader; import org.apache.iotdb.tsfile.read.controller.MetadataQuerierByFileImpl; import org.apache.iotdb.tsfile.read.expression.IExpression; import org.apache.iotdb.tsfile.read.expression.QueryExpression; @@ -43,10 +37,12 @@ import org.apache.iotdb.tsfile.read.filter.ValueFilter; import org.apache.iotdb.tsfile.read.filter.basic.Filter; import org.apache.iotdb.tsfile.read.filter.factory.FilterFactory; import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet; -import org.apache.iotdb.tsfile.read.query.executor.QueryExecutor; -import org.apache.iotdb.tsfile.read.query.executor.TsFileExecutor; import org.apache.iotdb.tsfile.utils.Binary; import org.apache.iotdb.tsfile.utils.TsFileGeneratorForTest; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; public class QueryExecutorTest { @@ -93,7 +89,6 @@ public class QueryExecutorTest { aimedTimestamp += 8; } long endTimestamp = System.currentTimeMillis(); - System.out.println("[Query]:" + queryExpression + "\n[Time]: " + (endTimestamp - startTimestamp) + "ms"); } @Test @@ -116,7 +111,6 @@ public class QueryExecutorTest { } Assert.assertEquals(rowCount, count); long endTimestamp = System.currentTimeMillis(); - System.out.println("[Query]:" + queryExpression + "\n[Time]: " + (endTimestamp - startTimestamp) + "ms"); } @Test @@ -141,6 +135,5 @@ public class QueryExecutorTest { } Assert.assertEquals(100, count); long endTimestamp = System.currentTimeMillis(); - System.out.println("[Query]:" + queryExpression + "\n[Time]: " + (endTimestamp - startTimestamp) + "ms"); } } diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/read/reader/PageReaderTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/read/reader/PageReaderTest.java index 4f4a681..3a9f4c2 100644 --- a/tsfile/src/test/java/org/apache/iotdb/tsfile/read/reader/PageReaderTest.java +++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/read/reader/PageReaderTest.java @@ -175,7 +175,6 @@ public class PageReaderTest { new DeltaBinaryDecoder.LongDeltaDecoder(), null); int index = 0; - long startTimestamp = System.currentTimeMillis(); BatchData data = pageReader.getAllSatisfiedPageData(); Assert.assertNotNull(data); @@ -185,10 +184,6 @@ public class PageReaderTest { data.next(); index++; } - long endTimestamp = System.currentTimeMillis(); - System.out - .println("TestName: [" + name + "]\n\tTSDataType: " + dataType + "\tRead-Count:" + count - + "\tTime-used:" + (endTimestamp - startTimestamp) + "ms"); Assert.assertEquals(count, index); } catch (IOException e) { e.printStackTrace(); diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/utils/BytesUtilsTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/utils/BytesUtilsTest.java index 3bcf900..f084d0e 100644 --- a/tsfile/src/test/java/org/apache/iotdb/tsfile/utils/BytesUtilsTest.java +++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/utils/BytesUtilsTest.java @@ -27,11 +27,8 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.List; import java.util.Random; - -import org.junit.Test; - -import org.apache.iotdb.tsfile.utils.BytesUtils; import org.apache.iotdb.tsfile.constant.TestConstant; +import org.junit.Test; public class BytesUtilsTest { @@ -276,10 +273,6 @@ public class BytesUtilsTest { int rb2 = BytesUtils.bytesToInt(ret, 24, 24); int rb3 = BytesUtils.bytesToInt(ret, 48, 24); int rb4 = BytesUtils.bytesToInt(ret, 72, 24); - intToBinaryShowForTest(b1); - byteArrayToBinaryShowForTest(ret); - intToBinaryShowForTest(b2); - byteArrayToBinaryShowForTest(ret); assertEquals("testIntToBytesWithWidth1", b1, rb1); assertEquals("testIntToBytesWithWidth2", b2, rb2); assertEquals("testIntToBytesWithWidth3", b3, rb3); @@ -294,10 +287,6 @@ public class BytesUtilsTest { long b2 = (1 << (bitLen % 32)) * basic + r.nextInt(); long b3 = (1 << (bitLen % 32)) * basic + r.nextInt(); long b4 = (1 << (bitLen % 32)) * basic + r.nextInt(); - longToBinaryShowForTest(b1); - longToBinaryShowForTest(b2); - longToBinaryShowForTest(b3); - longToBinaryShowForTest(b4); byte[] ret = new byte[(int) Math.ceil(bitLen * 4.0 / 8.0)]; BytesUtils.longToBytes(b1, ret, bitLen * 0, bitLen); BytesUtils.longToBytes(b2, ret, bitLen * 1, bitLen);
