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

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

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