提交 24b981ed 编写于 作者: X xiangdong huang

remove System.out.println() to reduce output on console.

上级 edb150c9
...@@ -36,9 +36,11 @@ import org.junit.Before; ...@@ -36,9 +36,11 @@ import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.mockito.Mock; import org.mockito.Mock;
import org.mockito.MockitoAnnotations; import org.mockito.MockitoAnnotations;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class AbstractClientIT { public class AbstractClientIT {
private static Logger logger = LoggerFactory.getLogger(AbstractClientIT.class);
@Mock @Mock
private IoTDBConnection connection; private IoTDBConnection connection;
...@@ -66,7 +68,7 @@ public class AbstractClientIT { ...@@ -66,7 +68,7 @@ public class AbstractClientIT {
AbstractClient.MAX_PRINT_ROW_COUNT_ARGS,}; AbstractClient.MAX_PRINT_ROW_COUNT_ARGS,};
for (String keyword : keywords) { for (String keyword : keywords) {
if (!AbstractClient.keywordSet.contains("-" + keyword)) { if (!AbstractClient.keywordSet.contains("-" + keyword)) {
System.out.println(keyword); logger.error(keyword);
fail(); fail();
} }
} }
......
...@@ -64,7 +64,6 @@ public class StartClientScriptIT extends AbstractScript { ...@@ -64,7 +64,6 @@ public class StartClientScriptIT extends AbstractScript {
"---------------------", "---------------------",
"IoTDB> Connection Error, please check whether the network is available or the server has started. Host is 127.0.0.1, port is 6668."}; "IoTDB> Connection Error, please check whether the network is available or the server has started. Host is 127.0.0.1, port is 6668."};
String dir = getCurrentPath("pwd"); String dir = getCurrentPath("pwd");
System.out.println(dir);
ProcessBuilder builder = new ProcessBuilder("sh", ProcessBuilder builder = new ProcessBuilder("sh",
dir + File.separator + "cli" + File.separator + "bin" + File.separator + "start-client.sh", dir + File.separator + "cli" + File.separator + "bin" + File.separator + "start-client.sh",
"-h", "-h",
......
...@@ -61,9 +61,9 @@ public class IoTDBConfigDynamicAdapterTest { ...@@ -61,9 +61,9 @@ public class IoTDBConfigDynamicAdapterTest {
@Test @Test
public void addOrDeleteStorageGroup() throws ConfigAdjusterException { public void addOrDeleteStorageGroup() throws ConfigAdjusterException {
System.out.println( // System.out.println(
"System total memory : " + Runtime.getRuntime().maxMemory() / IoTDBConstant.MB // "System total memory : " + Runtime.getRuntime().maxMemory() / IoTDBConstant.MB
+ "MB"); // + "MB");
int memTableNum = IoTDBConfigDynamicAdapter.MEM_TABLE_AVERAGE_QUEUE_LEN; int memTableNum = IoTDBConfigDynamicAdapter.MEM_TABLE_AVERAGE_QUEUE_LEN;
for (int i = 1; i < 100; i++) { for (int i = 1; i < 100; i++) {
IoTDBConfigDynamicAdapter.getInstance().addOrDeleteTimeSeries(1); IoTDBConfigDynamicAdapter.getInstance().addOrDeleteTimeSeries(1);
...@@ -78,7 +78,7 @@ public class IoTDBConfigDynamicAdapterTest { ...@@ -78,7 +78,7 @@ public class IoTDBConfigDynamicAdapterTest {
assertEquals(CONFIG.getMaxMemtableNumber(), memTableNum); assertEquals(CONFIG.getMaxMemtableNumber(), memTableNum);
} catch (ConfigAdjusterException e) { } catch (ConfigAdjusterException e) {
assertEquals("The IoTDB system load is too large to create storage group.", e.getMessage()); assertEquals("The IoTDB system load is too large to create storage group.", e.getMessage());
System.out.println("it has created " + i + " storage groups."); //System.out.println("it has created " + i + " storage groups.");
assertEquals(CONFIG.getMaxMemtableNumber(), memTableNum); assertEquals(CONFIG.getMaxMemtableNumber(), memTableNum);
break; break;
} }
...@@ -109,7 +109,7 @@ public class IoTDBConfigDynamicAdapterTest { ...@@ -109,7 +109,7 @@ public class IoTDBConfigDynamicAdapterTest {
totalTimeseries); totalTimeseries);
} catch (ConfigAdjusterException e) { } catch (ConfigAdjusterException e) {
assertEquals("The IoTDB system load is too large to add timeseries.", e.getMessage()); assertEquals("The IoTDB system load is too large to add timeseries.", e.getMessage());
System.out.println("it has added " + i + " timeseries."); //System.out.println("it has added " + i + " timeseries.");
assertEquals(IoTDBConfigDynamicAdapter.getInstance().getTotalTimeseries(), assertEquals(IoTDBConfigDynamicAdapter.getInstance().getTotalTimeseries(),
totalTimeseries); totalTimeseries);
break; break;
...@@ -130,7 +130,6 @@ public class IoTDBConfigDynamicAdapterTest { ...@@ -130,7 +130,6 @@ public class IoTDBConfigDynamicAdapterTest {
MManager.getInstance().setMaxSeriesNumberAmongStorageGroup(i / 30 + 1); MManager.getInstance().setMaxSeriesNumberAmongStorageGroup(i / 30 + 1);
} }
} catch (ConfigAdjusterException e) { } catch (ConfigAdjusterException e) {
System.out.println(i);
assertEquals("The IoTDB system load is too large to add timeseries.", e.getMessage()); assertEquals("The IoTDB system load is too large to add timeseries.", e.getMessage());
} }
int j =0; int j =0;
...@@ -141,7 +140,6 @@ public class IoTDBConfigDynamicAdapterTest { ...@@ -141,7 +140,6 @@ public class IoTDBConfigDynamicAdapterTest {
MManager.getInstance().setMaxSeriesNumberAmongStorageGroup(MManager.getInstance().getMaximalSeriesNumberAmongStorageGroups() + 1); MManager.getInstance().setMaxSeriesNumberAmongStorageGroup(MManager.getInstance().getMaximalSeriesNumberAmongStorageGroups() + 1);
} }
} catch (ConfigAdjusterException e ) { } catch (ConfigAdjusterException e ) {
System.out.println(j);
assertEquals("The IoTDB system load is too large to add timeseries.", e.getMessage()); assertEquals("The IoTDB system load is too large to add timeseries.", e.getMessage());
} }
} }
......
...@@ -41,7 +41,6 @@ public class MemTablePoolTest { ...@@ -41,7 +41,6 @@ public class MemTablePoolTest {
public void tearDown() throws Exception { public void tearDown() throws Exception {
isFinished = true; isFinished = true;
thread.join(); thread.join();
System.out.println(MemTablePool.getInstance().getSize());
} }
@Test @Test
...@@ -55,7 +54,7 @@ public class MemTablePoolTest { ...@@ -55,7 +54,7 @@ public class MemTablePoolTest {
System.out.println("memtable pool use deque and synchronized consume:" + time); System.out.println("memtable pool use deque and synchronized consume:" + time);
} }
@Test //@Test
public void testSort() { public void testSort() {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
TreeMap<Long, Long> treeMap = new TreeMap<>(); TreeMap<Long, Long> treeMap = new TreeMap<>();
...@@ -63,7 +62,7 @@ public class MemTablePoolTest { ...@@ -63,7 +62,7 @@ public class MemTablePoolTest {
treeMap.put((long) i, (long) i); treeMap.put((long) i, (long) i);
} }
start = System.currentTimeMillis() - start; start = System.currentTimeMillis() - start;
System.out.println("time cost: " + start); System.out.println("time cost of sort: " + start);
} }
......
...@@ -59,7 +59,6 @@ public class StorageGroupProcessorTest { ...@@ -59,7 +59,6 @@ public class StorageGroupProcessorTest {
@Test @Test
public void testSequenceSyncClose() { public void testSequenceSyncClose() {
for (int j = 1; j <= 10; j++) { for (int j = 1; j <= 10; j++) {
System.out.println(j);
TSRecord record = new TSRecord(j, deviceId); TSRecord record = new TSRecord(j, deviceId);
record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j))); record.addTuple(DataPoint.getDataPoint(TSDataType.INT32, measurementId, String.valueOf(j)));
processor.insert(new InsertPlan(record)); processor.insert(new InsertPlan(record));
......
...@@ -142,7 +142,6 @@ public class IOTDBFillIT { ...@@ -142,7 +142,6 @@ public class IOTDBFillIT {
while (resultSet.next()) { while (resultSet.next()) {
String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet.getString(TEMPERATURE_STR) String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet.getString(TEMPERATURE_STR)
+ "," + resultSet.getString(STATUS_STR) + "," + resultSet.getString(HARDWARE_STR); + "," + resultSet.getString(STATUS_STR) + "," + resultSet.getString(HARDWARE_STR);
System.out.println(ans);
Assert.assertEquals(retArray1[cnt], ans); Assert.assertEquals(retArray1[cnt], ans);
cnt++; cnt++;
} }
...@@ -160,7 +159,6 @@ public class IOTDBFillIT { ...@@ -160,7 +159,6 @@ public class IOTDBFillIT {
+ "," + resultSet.getString(STATUS_STR) + "," + resultSet.getString(HARDWARE_STR); + "," + resultSet.getString(STATUS_STR) + "," + resultSet.getString(HARDWARE_STR);
Assert.assertEquals(retArray1[cnt], ans); Assert.assertEquals(retArray1[cnt], ans);
cnt++; cnt++;
System.out.println(ans);
} }
statement.close(); statement.close();
...@@ -176,7 +174,6 @@ public class IOTDBFillIT { ...@@ -176,7 +174,6 @@ public class IOTDBFillIT {
+ "," + resultSet.getString(STATUS_STR) + "," + resultSet.getString(HARDWARE_STR); + "," + resultSet.getString(STATUS_STR) + "," + resultSet.getString(HARDWARE_STR);
Assert.assertEquals(retArray1[cnt], ans); Assert.assertEquals(retArray1[cnt], ans);
cnt++; cnt++;
System.out.println(ans);
} }
statement.close(); statement.close();
...@@ -190,7 +187,6 @@ public class IOTDBFillIT { ...@@ -190,7 +187,6 @@ public class IOTDBFillIT {
while (resultSet.next()) { while (resultSet.next()) {
String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet.getString(TEMPERATURE_STR) String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet.getString(TEMPERATURE_STR)
+ "," + resultSet.getString(STATUS_STR) + "," + resultSet.getString(HARDWARE_STR); + "," + resultSet.getString(STATUS_STR) + "," + resultSet.getString(HARDWARE_STR);
System.out.println(cnt + " " + ans);
Assert.assertEquals(retArray1[cnt], ans); Assert.assertEquals(retArray1[cnt], ans);
cnt++; cnt++;
} }
...@@ -244,7 +240,6 @@ public class IOTDBFillIT { ...@@ -244,7 +240,6 @@ public class IOTDBFillIT {
+ "," + resultSet.getString(STATUS_STR) + "," + resultSet.getString(HARDWARE_STR); + "," + resultSet.getString(STATUS_STR) + "," + resultSet.getString(HARDWARE_STR);
Assert.assertEquals(retArray1[cnt], ans); Assert.assertEquals(retArray1[cnt], ans);
cnt++; cnt++;
System.out.println(ans);
} }
statement.close(); statement.close();
...@@ -260,7 +255,6 @@ public class IOTDBFillIT { ...@@ -260,7 +255,6 @@ public class IOTDBFillIT {
+ "," + resultSet.getString(STATUS_STR) + "," + resultSet.getString(HARDWARE_STR); + "," + resultSet.getString(STATUS_STR) + "," + resultSet.getString(HARDWARE_STR);
Assert.assertEquals(retArray1[cnt], ans); Assert.assertEquals(retArray1[cnt], ans);
cnt++; cnt++;
System.out.println(ans);
} }
statement.close(); statement.close();
Assert.assertEquals(retArray1.length, cnt); Assert.assertEquals(retArray1.length, cnt);
...@@ -312,7 +306,6 @@ public class IOTDBFillIT { ...@@ -312,7 +306,6 @@ public class IOTDBFillIT {
+ "," + resultSet.getString(STATUS_STR) + "," + resultSet.getString(HARDWARE_STR); + "," + resultSet.getString(STATUS_STR) + "," + resultSet.getString(HARDWARE_STR);
Assert.assertEquals(retArray1[cnt], ans); Assert.assertEquals(retArray1[cnt], ans);
cnt++; cnt++;
System.out.println(ans);
} }
statement.close(); statement.close();
......
...@@ -274,7 +274,6 @@ public class IOTDBGroupByIT { ...@@ -274,7 +274,6 @@ public class IOTDBGroupByIT {
+ "," + resultSet.getString(min_time("root.ln.wf01.wt01.temperature")); + "," + resultSet.getString(min_time("root.ln.wf01.wt01.temperature"));
Assert.assertEquals(retArray2[cnt], ans); Assert.assertEquals(retArray2[cnt], ans);
cnt++; cnt++;
//System.out.println(ans);
} }
Assert.assertEquals(retArray2.length, cnt); Assert.assertEquals(retArray2.length, cnt);
statement.close(); statement.close();
...@@ -331,7 +330,6 @@ public class IOTDBGroupByIT { ...@@ -331,7 +330,6 @@ public class IOTDBGroupByIT {
String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet
.getString(last("root.ln.wf01.wt01.temperature")) .getString(last("root.ln.wf01.wt01.temperature"))
+ "," + resultSet.getString(first("root.ln.wf01.wt01.temperature")); + "," + resultSet.getString(first("root.ln.wf01.wt01.temperature"));
System.out.println(ans);
Assert.assertEquals(retArray1[cnt], ans); Assert.assertEquals(retArray1[cnt], ans);
cnt++; cnt++;
} }
...@@ -351,7 +349,6 @@ public class IOTDBGroupByIT { ...@@ -351,7 +349,6 @@ public class IOTDBGroupByIT {
String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet String ans = resultSet.getString(TIMESTAMP_STR) + "," + resultSet
.getString(last("root.ln.wf01.wt01.temperature")) .getString(last("root.ln.wf01.wt01.temperature"))
+ "," + resultSet.getString(first("root.ln.wf01.wt01.temperature")); + "," + resultSet.getString(first("root.ln.wf01.wt01.temperature"));
System.out.println(ans);
Assert.assertEquals(retArray2[cnt], ans); Assert.assertEquals(retArray2[cnt], ans);
cnt++; cnt++;
} }
...@@ -423,7 +420,6 @@ public class IOTDBGroupByIT { ...@@ -423,7 +420,6 @@ public class IOTDBGroupByIT {
+ "," + resultSet.getString(min_time("root.ln.wf01.wt01.temperature")); + "," + resultSet.getString(min_time("root.ln.wf01.wt01.temperature"));
Assert.assertEquals(retArray2[cnt], ans); Assert.assertEquals(retArray2[cnt], ans);
cnt++; cnt++;
//System.out.println(ans);
} }
Assert.assertEquals(retArray2.length, cnt); Assert.assertEquals(retArray2.length, cnt);
statement.close(); statement.close();
...@@ -468,7 +464,6 @@ public class IOTDBGroupByIT { ...@@ -468,7 +464,6 @@ public class IOTDBGroupByIT {
.getString(last("root.ln.wf01.wt01.temperature")) .getString(last("root.ln.wf01.wt01.temperature"))
+ "," + resultSet.getString(first("root.ln.wf01.wt01.temperature")) + "," + "," + resultSet.getString(first("root.ln.wf01.wt01.temperature")) + ","
+ resultSet.getString(sum("root.ln.wf01.wt01.temperature")); + resultSet.getString(sum("root.ln.wf01.wt01.temperature"));
System.out.println(ans);
Assert.assertEquals(retArray1[cnt], ans); Assert.assertEquals(retArray1[cnt], ans);
cnt++; cnt++;
} }
...@@ -489,7 +484,6 @@ public class IOTDBGroupByIT { ...@@ -489,7 +484,6 @@ public class IOTDBGroupByIT {
.getString(last("root.ln.wf01.wt01.temperature")) .getString(last("root.ln.wf01.wt01.temperature"))
+ "," + resultSet.getString(first("root.ln.wf01.wt01.temperature")) + "," + "," + resultSet.getString(first("root.ln.wf01.wt01.temperature")) + ","
+ resultSet.getString(sum("root.ln.wf01.wt01.temperature")); + resultSet.getString(sum("root.ln.wf01.wt01.temperature"));
System.out.println(ans);
Assert.assertEquals(retArray2[cnt], ans); Assert.assertEquals(retArray2[cnt], ans);
cnt++; cnt++;
} }
......
...@@ -853,7 +853,6 @@ public class IoTDBAggregationLargeDataIT { ...@@ -853,7 +853,6 @@ public class IoTDBAggregationLargeDataIT {
} }
statement.execute("flush"); statement.execute("flush");
System.out.println("cnt = " + cnt);
// insert large amount of data // insert large amount of data
for (int time = 3700; time < 4000; time++) { for (int time = 3700; time < 4000; time++) {
...@@ -878,10 +877,6 @@ public class IoTDBAggregationLargeDataIT { ...@@ -878,10 +877,6 @@ public class IoTDBAggregationLargeDataIT {
} }
// statement.execute("merge"); // statement.execute("merge");
System.out.println("large insert cnt = " + cnt);
System.out
.println("d0s0sum = " + d0s0sum + "; d0s1sum = " + d0s1sum + "; d0s2sum = " + d0s2sum);
for (String sql : insertSql) { for (String sql : insertSql) {
statement.execute(sql); statement.execute(sql);
} }
......
...@@ -34,12 +34,15 @@ import org.junit.After; ...@@ -34,12 +34,15 @@ import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* Notice that, all test begins with "IoTDB" is integration test. All test which will start the IoTDB server should be * Notice that, all test begins with "IoTDB" is integration test. All test which will start the IoTDB server should be
* defined as integration test. * defined as integration test.
*/ */
public class IoTDBAuthorizationIT { public class IoTDBAuthorizationIT {
private static Logger logger = LoggerFactory.getLogger(IoTDBAuthorizationIT.class);
private IoTDB daemon; private IoTDB daemon;
...@@ -626,9 +629,10 @@ public class IoTDBAuthorizationIT { ...@@ -626,9 +629,10 @@ public class IoTDBAuthorizationIT {
userStmt.executeBatch(); userStmt.executeBatch();
userStmt.clearBatch(); userStmt.clearBatch();
} }
System.out.println( if (logger.isDebugEnabled()) {
"User inserted " + insertCnt + " data points used " + (System.currentTimeMillis() - time) logger.debug("User inserted {} data points used {} ms with {} privileges.", insertCnt,
+ " ms with " + privilegeCnt + " privileges"); System.currentTimeMillis() - time, privilegeCnt);
}
time = System.currentTimeMillis(); time = System.currentTimeMillis();
for (int i = 0; i < insertCnt; ) { for (int i = 0; i < insertCnt; ) {
...@@ -639,10 +643,10 @@ public class IoTDBAuthorizationIT { ...@@ -639,10 +643,10 @@ public class IoTDBAuthorizationIT {
adminStmt.executeBatch(); adminStmt.executeBatch();
adminStmt.clearBatch(); adminStmt.clearBatch();
} }
System.out.println( if (logger.isDebugEnabled()) {
"admin inserted " + insertCnt + " data points used " + (System.currentTimeMillis() - time) logger.debug("User inserted {} data points used {} ms with {} privileges.", insertCnt,
+ " ms with " + privilegeCnt + " privileges"); System.currentTimeMillis() - time, privilegeCnt);
}
adminCon.close(); adminCon.close();
userCon.close(); userCon.close();
} }
......
...@@ -190,7 +190,7 @@ public class IoTDBEngineTimeGeneratorIT { ...@@ -190,7 +190,7 @@ public class IoTDBEngineTimeGeneratorIT {
*/ */
@Test @Test
public void testOneSeriesWithValueAndTimeFilter() throws IOException, StorageEngineException { public void testOneSeriesWithValueAndTimeFilter() throws IOException, StorageEngineException {
System.out.println("Test >>> root.vehicle.d0.s0 >= 14 && time > 500"); //System.out.println("Test >>> root.vehicle.d0.s0 >= 14 && time > 500");
Path pd0s0 = new Path(Constant.d0s0); Path pd0s0 = new Path(Constant.d0s0);
ValueFilter.ValueGtEq valueGtEq = ValueFilter.gtEq(14); ValueFilter.ValueGtEq valueGtEq = ValueFilter.gtEq(14);
...@@ -216,7 +216,7 @@ public class IoTDBEngineTimeGeneratorIT { ...@@ -216,7 +216,7 @@ public class IoTDBEngineTimeGeneratorIT {
*/ */
@Test @Test
public void testEmptySeriesWithValueFilter() throws IOException, StorageEngineException { public void testEmptySeriesWithValueFilter() throws IOException, StorageEngineException {
System.out.println("Test >>> root.vehicle.d1.s0 >= 5"); //System.out.println("Test >>> root.vehicle.d1.s0 >= 5");
Path pd1s0 = new Path(Constant.d1s0); Path pd1s0 = new Path(Constant.d1s0);
ValueFilter.ValueGtEq valueGtEq = ValueFilter.gtEq(5); ValueFilter.ValueGtEq valueGtEq = ValueFilter.gtEq(5);
......
...@@ -241,7 +241,7 @@ public class IoTDBSeriesReaderIT { ...@@ -241,7 +241,7 @@ public class IoTDBSeriesReaderIT {
@Test @Test
public void selectAllTest() throws IOException, StorageEngineException { public void selectAllTest() throws IOException, StorageEngineException {
String selectSql = "select * from root"; String selectSql = "select * from root";
System.out.println("Test >>> " + selectSql); //System.out.println("Test >>> " + selectSql);
EngineQueryRouter engineExecutor = new EngineQueryRouter(); EngineQueryRouter engineExecutor = new EngineQueryRouter();
QueryExpression queryExpression = QueryExpression.create(); QueryExpression queryExpression = QueryExpression.create();
...@@ -273,7 +273,7 @@ public class IoTDBSeriesReaderIT { ...@@ -273,7 +273,7 @@ public class IoTDBSeriesReaderIT {
public void selectOneSeriesWithValueFilterTest() throws IOException, StorageEngineException { public void selectOneSeriesWithValueFilterTest() throws IOException, StorageEngineException {
String selectSql = "select s0 from root.vehicle.d0 where s0 >= 20"; String selectSql = "select s0 from root.vehicle.d0 where s0 >= 20";
System.out.println("Test >>> " + selectSql); //System.out.println("Test >>> " + selectSql);
EngineQueryRouter engineExecutor = new EngineQueryRouter(); EngineQueryRouter engineExecutor = new EngineQueryRouter();
QueryExpression queryExpression = QueryExpression.create(); QueryExpression queryExpression = QueryExpression.create();
...@@ -302,7 +302,7 @@ public class IoTDBSeriesReaderIT { ...@@ -302,7 +302,7 @@ public class IoTDBSeriesReaderIT {
@Test @Test
public void seriesTimeDigestReadTest() throws IOException, StorageEngineException { public void seriesTimeDigestReadTest() throws IOException, StorageEngineException {
String selectSql = "select s0 from root.vehicle.d0 where time >= 22987"; String selectSql = "select s0 from root.vehicle.d0 where time >= 22987";
System.out.println("Test >>> " + selectSql); //System.out.println("Test >>> " + selectSql);
EngineQueryRouter engineExecutor = new EngineQueryRouter(); EngineQueryRouter engineExecutor = new EngineQueryRouter();
QueryExpression queryExpression = QueryExpression.create(); QueryExpression queryExpression = QueryExpression.create();
...@@ -329,7 +329,7 @@ public class IoTDBSeriesReaderIT { ...@@ -329,7 +329,7 @@ public class IoTDBSeriesReaderIT {
@Test @Test
public void crossSeriesReadUpdateTest() throws IOException, StorageEngineException { public void crossSeriesReadUpdateTest() throws IOException, StorageEngineException {
System.out.println("Test >>> select s1 from root.vehicle.d0 where s0 < 111"); //System.out.println("Test >>> select s1 from root.vehicle.d0 where s0 < 111");
EngineQueryRouter engineExecutor = new EngineQueryRouter(); EngineQueryRouter engineExecutor = new EngineQueryRouter();
QueryExpression queryExpression = QueryExpression.create(); QueryExpression queryExpression = QueryExpression.create();
Path path1 = new Path(Constant.d0s0); Path path1 = new Path(Constant.d0s0);
......
...@@ -32,8 +32,11 @@ import org.apache.iotdb.tsfile.read.common.Path; ...@@ -32,8 +32,11 @@ import org.apache.iotdb.tsfile.read.common.Path;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class MManagerImproveTest { public class MManagerImproveTest {
private static Logger logger = LoggerFactory.getLogger(MManagerImproveTest.class);
private static final int TIMESERIES_NUM = 1000; private static final int TIMESERIES_NUM = 1000;
private static final int DEVICE_NUM = 10; private static final int DEVICE_NUM = 10;
...@@ -120,11 +123,11 @@ public class MManagerImproveTest { ...@@ -120,11 +123,11 @@ public class MManagerImproveTest {
endTime = System.currentTimeMillis(); endTime = System.currentTimeMillis();
get_seriestype += endTime - startTime; get_seriestype += endTime - startTime;
System.out.println("string combine:\t" + string_combine); logger.debug("string combine:\t" + string_combine);
System.out.println("seriesPath exist:\t" + path_exist); logger.debug("seriesPath exist:\t" + path_exist);
System.out.println("list init:\t" + list_init); logger.debug("list init:\t" + list_init);
System.out.println("check file level:\t" + check_filelevel); logger.debug("check file level:\t" + check_filelevel);
System.out.println("get series type:\t" + get_seriestype); logger.debug("get series type:\t" + get_seriestype);
} }
public void doOriginTest(String deviceId, List<String> measurementList) public void doOriginTest(String deviceId, List<String> measurementList)
...@@ -239,42 +242,42 @@ public class MManagerImproveTest { ...@@ -239,42 +242,42 @@ public class MManagerImproveTest {
doOriginTest(deviceId, measurementList); doOriginTest(deviceId, measurementList);
} }
endTime = System.currentTimeMillis(); endTime = System.currentTimeMillis();
System.out.println("origin:\t" + (endTime - startTime)); logger.debug("origin:\t" + (endTime - startTime));
startTime = System.currentTimeMillis(); startTime = System.currentTimeMillis();
for (String deviceId : deviceIdList) { for (String deviceId : deviceIdList) {
doPathLoopOnceTest(deviceId, measurementList); doPathLoopOnceTest(deviceId, measurementList);
} }
endTime = System.currentTimeMillis(); endTime = System.currentTimeMillis();
System.out.println("seriesPath loop once:\t" + (endTime - startTime)); logger.debug("seriesPath loop once:\t" + (endTime - startTime));
startTime = System.currentTimeMillis(); startTime = System.currentTimeMillis();
for (String deviceId : deviceIdList) { for (String deviceId : deviceIdList) {
doDealdeviceIdOnceTest(deviceId, measurementList); doDealdeviceIdOnceTest(deviceId, measurementList);
} }
endTime = System.currentTimeMillis(); endTime = System.currentTimeMillis();
System.out.println("deal deviceId once:\t" + (endTime - startTime)); logger.debug("deal deviceId once:\t" + (endTime - startTime));
startTime = System.currentTimeMillis(); startTime = System.currentTimeMillis();
for (String deviceId : deviceIdList) { for (String deviceId : deviceIdList) {
doRemoveListTest(deviceId, measurementList); doRemoveListTest(deviceId, measurementList);
} }
endTime = System.currentTimeMillis(); endTime = System.currentTimeMillis();
System.out.println("remove list:\t" + (endTime - startTime)); logger.debug("remove list:\t" + (endTime - startTime));
startTime = System.currentTimeMillis(); startTime = System.currentTimeMillis();
for (String deviceId : deviceIdList) { for (String deviceId : deviceIdList) {
doAllImproveTest(deviceId, measurementList); doAllImproveTest(deviceId, measurementList);
} }
endTime = System.currentTimeMillis(); endTime = System.currentTimeMillis();
System.out.println("improve all:\t" + (endTime - startTime)); logger.debug("improve all:\t" + (endTime - startTime));
startTime = System.currentTimeMillis(); startTime = System.currentTimeMillis();
for (String deviceId : deviceIdList) { for (String deviceId : deviceIdList) {
doCacheTest(deviceId, measurementList); doCacheTest(deviceId, measurementList);
} }
endTime = System.currentTimeMillis(); endTime = System.currentTimeMillis();
System.out.println("add cache:\t" + (endTime - startTime)); logger.debug("add cache:\t" + (endTime - startTime));
} }
@After @After
......
...@@ -117,7 +117,6 @@ public class MTreeTest { ...@@ -117,7 +117,6 @@ public class MTreeTest {
assertEquals("root.a.d1.s0", result.get("root.a.d1").get(0)); assertEquals("root.a.d1.s0", result.get("root.a.d1").get(0));
assertTrue(result.containsKey("root.a.d0")); assertTrue(result.containsKey("root.a.d0"));
assertEquals("root.a.d0.s0", result.get("root.a.d0").get(0)); assertEquals("root.a.d0.s0", result.get("root.a.d0").get(0));
System.out.println(result);
result = root.getAllPath("root.a.*.*.s0"); result = root.getAllPath("root.a.*.*.s0");
assertTrue(result.containsKey("root.a.b.d0")); assertTrue(result.containsKey("root.a.b.d0"));
......
...@@ -93,7 +93,6 @@ public class PhysicalPlanTest { ...@@ -93,7 +93,6 @@ public class PhysicalPlanTest {
String sql = "grant role xm privileges 'SET_STORAGE_GROUP','DELETE_TIMESERIES' on root.vehicle.d1.s1"; String sql = "grant role xm privileges 'SET_STORAGE_GROUP','DELETE_TIMESERIES' on root.vehicle.d1.s1";
QueryProcessor processor = new QueryProcessor(new MemIntQpExecutor()); QueryProcessor processor = new QueryProcessor(new MemIntQpExecutor());
AuthorPlan plan = (AuthorPlan) processor.parseSQLToPhysicalPlan(sql); AuthorPlan plan = (AuthorPlan) processor.parseSQLToPhysicalPlan(sql);
System.out.println(plan.toString());
assertEquals( assertEquals(
"userName: null\n" + "roleName: xm\n" + "password: null\n" + "newPassword: null\n" "userName: null\n" + "roleName: xm\n" + "password: null\n" + "newPassword: null\n"
+ "permissions: [0, 5]\n" + "nodeName: root.vehicle.d1.s1\n" + "authorType: GRANT_ROLE", + "permissions: [0, 5]\n" + "nodeName: root.vehicle.d1.s1\n" + "authorType: GRANT_ROLE",
......
...@@ -105,7 +105,7 @@ public class IoTDBLogFileSizeTest { ...@@ -105,7 +105,7 @@ public class IoTDBLogFileSizeTest {
Statement statement = connection.createStatement(); Statement statement = connection.createStatement();
while (true) { while (true) {
if (Thread.interrupted()) { if (Thread.interrupted()) {
System.out.println("Exit after " + cnt + " insertion"); //System.out.println("Exit after " + cnt + " insertion");
break; break;
} }
String sql = String.format( String sql = String.format(
...@@ -139,9 +139,6 @@ public class IoTDBLogFileSizeTest { ...@@ -139,9 +139,6 @@ public class IoTDBLogFileSizeTest {
while (writeThread.isAlive()) { while (writeThread.isAlive()) {
} }
System.out.println(
"Max size of seq wal is " + MemUtils.bytesCntToStr(maxLength[0]) + " after "
+ runtime + "ms continuous writing");
} }
@Test @Test
...@@ -165,7 +162,7 @@ public class IoTDBLogFileSizeTest { ...@@ -165,7 +162,7 @@ public class IoTDBLogFileSizeTest {
Statement statement = connection.createStatement(); Statement statement = connection.createStatement();
while (true) { while (true) {
if (Thread.interrupted()) { if (Thread.interrupted()) {
System.out.println("Exit after " + cnt + " insertion"); //System.out.println("Exit after " + cnt + " insertion");
break; break;
} }
String sql = String String sql = String
...@@ -199,9 +196,6 @@ public class IoTDBLogFileSizeTest { ...@@ -199,9 +196,6 @@ public class IoTDBLogFileSizeTest {
while (writeThread.isAlive()) { while (writeThread.isAlive()) {
} }
System.out.println(
"Max size of unsequence wal is " + MemUtils.bytesCntToStr(maxLength[0]) + " after " + runtime
+ "ms continuous writing");
} }
private void executeSQL(String[] sqls) throws ClassNotFoundException, SQLException { private void executeSQL(String[] sqls) throws ClassNotFoundException, SQLException {
......
...@@ -95,7 +95,7 @@ public class PerformanceTest { ...@@ -95,7 +95,7 @@ public class PerformanceTest {
logNode.write(deletePlan); logNode.write(deletePlan);
} }
logNode.forceSync(); logNode.forceSync();
System.out.println("forceWalPeriodInMs = " + config.getForceWalPeriodInMs());
System.out.println( System.out.println(
3000000 + " logs use " + (System.currentTimeMillis() - time) + " ms at batch size " 3000000 + " logs use " + (System.currentTimeMillis() - time) + " ms at batch size "
+ config.getFlushWalThreshold()); + config.getFlushWalThreshold());
......
...@@ -79,7 +79,6 @@ public class SnappyTest { ...@@ -79,7 +79,6 @@ public class SnappyTest {
.allocateDirect(Snappy.uncompressedLength(compressed) + 1); .allocateDirect(Snappy.uncompressedLength(compressed) + 1);
Snappy.uncompress(compressed, uncompressedByteBuffer); Snappy.uncompress(compressed, uncompressedByteBuffer);
System.out.println("decompression time cost:" + (System.currentTimeMillis() - time)); System.out.println("decompression time cost:" + (System.currentTimeMillis() - time));
System.out.println(uncompressedByteBuffer.remaining());
assert input.equals(ReadWriteIOUtils.readStringFromDirectByteBuffer(uncompressedByteBuffer)); assert input.equals(ReadWriteIOUtils.readStringFromDirectByteBuffer(uncompressedByteBuffer));
} }
......
...@@ -46,7 +46,6 @@ public class DeltaBinaryEncoderIntegerTest { ...@@ -46,7 +46,6 @@ public class DeltaBinaryEncoderIntegerTest {
@Test @Test
public void testBasic() throws IOException { public void testBasic() throws IOException {
System.out.println("write basic");
int data[] = new int[ROW_NUM]; int data[] = new int[ROW_NUM];
for (int i = 0; i < ROW_NUM; i++) { for (int i = 0; i < ROW_NUM; i++) {
data[i] = i * i; data[i] = i * i;
...@@ -56,7 +55,6 @@ public class DeltaBinaryEncoderIntegerTest { ...@@ -56,7 +55,6 @@ public class DeltaBinaryEncoderIntegerTest {
@Test @Test
public void testBoundInt() throws IOException { public void testBoundInt() throws IOException {
System.out.println("write bounded int");
int data[] = new int[ROW_NUM]; int data[] = new int[ROW_NUM];
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
boundInt(i, data); boundInt(i, data);
...@@ -64,7 +62,6 @@ public class DeltaBinaryEncoderIntegerTest { ...@@ -64,7 +62,6 @@ public class DeltaBinaryEncoderIntegerTest {
} }
private void boundInt(int power, int[] data) throws IOException { private void boundInt(int power, int[] data) throws IOException {
System.out.println("the bound of 2 power:" + power);
for (int i = 0; i < ROW_NUM; i++) { for (int i = 0; i < ROW_NUM; i++) {
data[i] = ran.nextInt((int) Math.pow(2, power)); data[i] = ran.nextInt((int) Math.pow(2, power));
} }
...@@ -73,7 +70,6 @@ public class DeltaBinaryEncoderIntegerTest { ...@@ -73,7 +70,6 @@ public class DeltaBinaryEncoderIntegerTest {
@Test @Test
public void testRandom() throws IOException { public void testRandom() throws IOException {
System.out.println("write random");
int data[] = new int[ROW_NUM]; int data[] = new int[ROW_NUM];
for (int i = 0; i < ROW_NUM; i++) { for (int i = 0; i < ROW_NUM; i++) {
data[i] = ran.nextInt(); data[i] = ran.nextInt();
...@@ -83,7 +79,6 @@ public class DeltaBinaryEncoderIntegerTest { ...@@ -83,7 +79,6 @@ public class DeltaBinaryEncoderIntegerTest {
@Test @Test
public void testMaxMin() throws IOException { public void testMaxMin() throws IOException {
System.out.println("write maxmin");
int data[] = new int[ROW_NUM]; int data[] = new int[ROW_NUM];
for (int i = 0; i < ROW_NUM; i++) { for (int i = 0; i < ROW_NUM; i++) {
data[i] = (i & 1) == 0 ? Integer.MAX_VALUE : Integer.MIN_VALUE; data[i] = (i & 1) == 0 ? Integer.MAX_VALUE : Integer.MIN_VALUE;
...@@ -99,11 +94,11 @@ public class DeltaBinaryEncoderIntegerTest { ...@@ -99,11 +94,11 @@ public class DeltaBinaryEncoderIntegerTest {
} }
private void shouldReadAndWrite(int[] data, int length) throws IOException { private void shouldReadAndWrite(int[] data, int length) throws IOException {
System.out.println("source data size:" + 4 * length + " byte"); //System.out.println("source data size:" + 4 * length + " byte");
out = new ByteArrayOutputStream(); out = new ByteArrayOutputStream();
writeData(data, length); writeData(data, length);
byte[] page = out.toByteArray(); byte[] page = out.toByteArray();
System.out.println("encoding data size:" + page.length + " byte"); //System.out.println("encoding data size:" + page.length + " byte");
buffer = ByteBuffer.wrap(page); buffer = ByteBuffer.wrap(page);
int i = 0; int i = 0;
while (reader.hasNext(buffer)) { while (reader.hasNext(buffer)) {
......
...@@ -284,7 +284,6 @@ public class BytesUtilsTest { ...@@ -284,7 +284,6 @@ public class BytesUtilsTest {
@Test @Test
public void testLongToBytesWithWidth() { public void testLongToBytesWithWidth() {
System.out.println();
int bitLen = 42; int bitLen = 42;
long basic = (1 << 30) * 2l; long basic = (1 << 30) * 2l;
long b1 = (1 << (bitLen % 32)) * basic + r.nextInt(); long b1 = (1 << (bitLen % 32)) * basic + r.nextInt();
......
...@@ -222,7 +222,6 @@ public class WriteTest { ...@@ -222,7 +222,6 @@ public class WriteTest {
strings = getNextRecord(lineCount, stageState); strings = getNextRecord(lineCount, stageState);
for (String str : strings) { for (String str : strings) {
TSRecord record = RecordUtils.parseSimpleTupleRecord(str, schema); TSRecord record = RecordUtils.parseSimpleTupleRecord(str, schema);
System.out.println(str);
tsFileWriter.write(record); tsFileWriter.write(record);
} }
lineCount++; lineCount++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册