Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Iotdb
提交
d2da0365
I
Iotdb
项目概览
apache
/
Iotdb
8 个月 前同步成功
通知
25
Star
3344
Fork
916
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
Iotdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
d2da0365
编写于
9月 06, 2023
作者:
C
CritasWang
提交者:
GitHub
9月 06, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change display nums of client to fixed 1000
上级
c9315c75
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
2 addition
and
130 deletion
+2
-130
integration-test/src/test/java/org/apache/iotdb/cli/it/StartClientScriptIT.java
...est/java/org/apache/iotdb/cli/it/StartClientScriptIT.java
+0
-32
iotdb-client/cli/src/assembly/resources/sbin/start-cli.sh
iotdb-client/cli/src/assembly/resources/sbin/start-cli.sh
+1
-1
iotdb-client/cli/src/main/java/org/apache/iotdb/cli/AbstractCli.java
...t/cli/src/main/java/org/apache/iotdb/cli/AbstractCli.java
+1
-55
iotdb-client/cli/src/main/java/org/apache/iotdb/cli/Cli.java
iotdb-client/cli/src/main/java/org/apache/iotdb/cli/Cli.java
+0
-3
iotdb-client/cli/src/test/java/org/apache/iotdb/cli/AbstractCliIT.java
...cli/src/test/java/org/apache/iotdb/cli/AbstractCliIT.java
+0
-39
未找到文件。
integration-test/src/test/java/org/apache/iotdb/cli/it/StartClientScriptIT.java
浏览文件 @
d2da0365
...
...
@@ -103,8 +103,6 @@ public class StartClientScriptIT extends AbstractScript {
ip
,
"-p"
,
port
,
"-maxPRC"
,
"0"
,
"-e"
,
"\"flush\""
,
"&"
,
...
...
@@ -112,22 +110,6 @@ public class StartClientScriptIT extends AbstractScript {
"%^errorlevel%"
);
builder2
.
environment
().
put
(
"CLASSPATH"
,
libPath
);
testOutput
(
builder2
,
output2
,
0
);
final
String
[]
output3
=
{
"Error: error format of max print row count, it should be an integer number"
};
ProcessBuilder
builder3
=
new
ProcessBuilder
(
"cmd.exe"
,
"/c"
,
sbinPath
+
File
.
separator
+
"start-cli.bat"
,
"-maxPRC"
,
"-1111111111111111111111111111"
,
"&"
,
"exit"
,
"%^errorlevel%"
);
builder3
.
environment
().
put
(
"CLASSPATH"
,
libPath
);
testOutput
(
builder3
,
output3
,
1
);
}
@Override
...
...
@@ -159,23 +141,9 @@ public class StartClientScriptIT extends AbstractScript {
ip
,
"-p"
,
port
,
"-maxPRC"
,
"0"
,
"-e"
,
"\"flush\""
);
builder2
.
environment
().
put
(
"CLASSPATH"
,
libPath
);
testOutput
(
builder2
,
output2
,
0
);
final
String
[]
output3
=
{
"Error: error format of max print row count, it should be an integer number"
};
ProcessBuilder
builder3
=
new
ProcessBuilder
(
"sh"
,
sbinPath
+
File
.
separator
+
"start-cli.sh"
,
"-maxPRC"
,
"-1111111111111111111111111111"
);
builder3
.
environment
().
put
(
"CLASSPATH"
,
libPath
);
testOutput
(
builder3
,
output3
,
1
);
}
}
iotdb-client/cli/src/assembly/resources/sbin/start-cli.sh
浏览文件 @
d2da0365
...
...
@@ -78,7 +78,7 @@ while true; do
shift
2
;;
--help
)
echo
"Usage:
$0
[-h <ip>] [-p <port>] [-u <username>] [-pw <password>] [-D <name=value>] [-c] [-e sql]
[-maxPRC <PRC size>]
"
echo
"Usage:
$0
[-h <ip>] [-p <port>] [-u <username>] [-pw <password>] [-D <name=value>] [-c] [-e sql]"
exit
0
;;
""
)
...
...
iotdb-client/cli/src/main/java/org/apache/iotdb/cli/AbstractCli.java
浏览文件 @
d2da0365
...
...
@@ -78,13 +78,10 @@ public abstract class AbstractCli {
static
final
String
ISO8601_ARGS
=
"disableISO8601"
;
static
final
List
<
String
>
AGGREGRATE_TIME_LIST
=
new
ArrayList
<>();
static
final
String
MAX_PRINT_ROW_COUNT_ARGS
=
"maxPRC"
;
private
static
final
String
MAX_PRINT_ROW_COUNT_NAME
=
"maxPrintRowCount"
;
static
final
String
RPC_COMPRESS_ARGS
=
"c"
;
private
static
final
String
RPC_COMPRESS_NAME
=
"rpcCompressed"
;
static
final
String
TIMEOUT_ARGS
=
"timeout"
;
private
static
final
String
TIMEOUT_NAME
=
"queryTimeout"
;
static
final
String
SET_MAX_DISPLAY_NUM
=
"set max_display_num"
;
static
final
String
SET_TIMESTAMP_DISPLAY
=
"set time_display_type"
;
static
final
String
SHOW_TIMESTAMP_DISPLAY
=
"show time_display_type"
;
static
final
String
SET_TIME_ZONE
=
"set time_zone"
;
...
...
@@ -135,7 +132,6 @@ public abstract class AbstractCli {
keywordSet
.
add
(
"-"
+
USERNAME_ARGS
);
keywordSet
.
add
(
"-"
+
EXECUTE_ARGS
);
keywordSet
.
add
(
"-"
+
ISO8601_ARGS
);
keywordSet
.
add
(
"-"
+
MAX_PRINT_ROW_COUNT_ARGS
);
keywordSet
.
add
(
"-"
+
RPC_COMPRESS_ARGS
);
}
...
...
@@ -186,14 +182,6 @@ public abstract class AbstractCli {
.
build
();
options
.
addOption
(
execute
);
Option
maxPrintCount
=
Option
.
builder
(
MAX_PRINT_ROW_COUNT_ARGS
)
.
argName
(
MAX_PRINT_ROW_COUNT_NAME
)
.
hasArg
()
.
desc
(
"Maximum number of rows displayed (optional)"
)
.
build
();
options
.
addOption
(
maxPrintCount
);
Option
isRpcCompressed
=
Option
.
builder
(
RPC_COMPRESS_ARGS
)
.
argName
(
RPC_COMPRESS_NAME
)
...
...
@@ -261,17 +249,6 @@ public abstract class AbstractCli {
return
CODE_OK
;
}
static
void
setMaxDisplayNumber
(
String
maxDisplayNum
)
{
long
tmp
=
Long
.
parseLong
(
maxDisplayNum
.
trim
());
if
(
tmp
>
Integer
.
MAX_VALUE
)
{
throw
new
NumberFormatException
();
}
else
if
(
tmp
<=
0
)
{
continuePrint
=
true
;
}
else
{
maxPrintRowCount
=
Integer
.
parseInt
(
maxDisplayNum
.
trim
());
}
}
static
void
setQueryTimeout
(
String
timeoutString
)
{
long
timeout
=
Long
.
parseLong
(
timeoutString
.
trim
());
if
(
timeout
>
Integer
.
MAX_VALUE
||
timeout
<
0
)
{
...
...
@@ -389,11 +366,6 @@ public abstract class AbstractCli {
return
OperationResult
.
CONTINUE_OPER
;
}
if
(
specialCmd
.
startsWith
(
SET_MAX_DISPLAY_NUM
))
{
lastProcessStatus
=
setMaxDisplayNum
(
specialCmd
,
cmd
);
return
OperationResult
.
CONTINUE_OPER
;
}
if
(
specialCmd
.
startsWith
(
SHOW_TIMEZONE
))
{
lastProcessStatus
=
showTimeZone
(
connection
);
return
OperationResult
.
CONTINUE_OPER
;
...
...
@@ -431,10 +403,6 @@ public abstract class AbstractCli {
String
.
format
(
" %s=xxx\t\t set fetch size when querying data from server."
,
SET_FETCH_SIZE
));
println
(
String
.
format
(
" %s\t\t show fetch size"
,
SHOW_FETCH_SIZE
));
println
(
String
.
format
(
" %s=xxx\t eg. set max lines for cli to ouput, -1 equals to unlimited."
,
SET_MAX_DISPLAY_NUM
));
}
private
static
int
setTimestampDisplay
(
String
specialCmd
,
String
cmd
)
{
...
...
@@ -480,25 +448,6 @@ public abstract class AbstractCli {
return
CODE_OK
;
}
private
static
int
setMaxDisplayNum
(
String
specialCmd
,
String
cmd
)
{
String
[]
values
=
specialCmd
.
split
(
"="
);
if
(
values
.
length
!=
2
)
{
println
(
String
.
format
(
"Max display number format error, please input like %s = 10000"
,
SET_MAX_DISPLAY_NUM
));
return
CODE_ERROR
;
}
try
{
setMaxDisplayNumber
(
cmd
.
split
(
"="
)[
1
]);
}
catch
(
Exception
e
)
{
println
(
String
.
format
(
"Max display number format error, %s"
,
e
.
getMessage
()));
return
CODE_ERROR
;
}
println
(
"Max display number has set to "
+
values
[
1
].
trim
());
return
CODE_OK
;
}
private
static
int
showTimeZone
(
IoTDBConnection
connection
)
{
try
{
println
(
"Current time zone: "
+
connection
.
getTimeZone
());
...
...
@@ -558,10 +507,7 @@ public abstract class AbstractCli {
output
(
lists
,
maxSizeList
);
continue
;
}
println
(
String
.
format
(
"Reach the max_display_num = %s. Press ENTER to show more, input 'q' to quit."
,
maxPrintRowCount
));
println
(
"This display 1000 rows. Press ENTER to show more, input 'q' to quit."
);
BufferedReader
br
=
new
BufferedReader
(
new
InputStreamReader
(
System
.
in
));
try
{
if
(
""
.
equals
(
br
.
readLine
()))
{
...
...
iotdb-client/cli/src/main/java/org/apache/iotdb/cli/Cli.java
浏览文件 @
d2da0365
...
...
@@ -108,9 +108,6 @@ public class Cli extends AbstractCli {
if
(
commandLine
.
hasOption
(
ISO8601_ARGS
))
{
timeFormat
=
RpcUtils
.
setTimeFormat
(
"long"
);
}
if
(
commandLine
.
hasOption
(
MAX_PRINT_ROW_COUNT_ARGS
))
{
setMaxDisplayNumber
(
commandLine
.
getOptionValue
(
MAX_PRINT_ROW_COUNT_ARGS
));
}
if
(
commandLine
.
hasOption
(
TIMEOUT_ARGS
))
{
setQueryTimeout
(
commandLine
.
getOptionValue
(
TIMEOUT_ARGS
));
}
...
...
iotdb-client/cli/src/test/java/org/apache/iotdb/cli/AbstractCliIT.java
浏览文件 @
d2da0365
...
...
@@ -67,7 +67,6 @@ public class AbstractCliIT {
AbstractCli
.
PW_ARGS
,
AbstractCli
.
USERNAME_ARGS
,
AbstractCli
.
ISO8601_ARGS
,
AbstractCli
.
MAX_PRINT_ROW_COUNT_ARGS
,
};
for
(
String
keyword
:
keywords
)
{
if
(!
AbstractCli
.
keywordSet
.
contains
(
"-"
+
keyword
))
{
...
...
@@ -168,20 +167,6 @@ public class AbstractCliIT {
AbstractCli
.
handleInputCmd
(
String
.
format
(
"%s=default"
,
AbstractCli
.
SET_TIMESTAMP_DISPLAY
),
connection
));
assertEquals
(
OperationResult
.
CONTINUE_OPER
,
AbstractCli
.
handleInputCmd
(
String
.
format
(
"%s="
,
AbstractCli
.
SET_MAX_DISPLAY_NUM
),
connection
));
assertEquals
(
OperationResult
.
CONTINUE_OPER
,
AbstractCli
.
handleInputCmd
(
String
.
format
(
"%s=xxx"
,
AbstractCli
.
SET_MAX_DISPLAY_NUM
),
connection
));
assertEquals
(
OperationResult
.
CONTINUE_OPER
,
AbstractCli
.
handleInputCmd
(
String
.
format
(
"%s=1"
,
AbstractCli
.
SET_MAX_DISPLAY_NUM
),
connection
));
testSetMaxDisplayNumber
();
assertEquals
(
OperationResult
.
CONTINUE_OPER
,
AbstractCli
.
handleInputCmd
(
AbstractCli
.
SHOW_TIMEZONE
,
connection
));
...
...
@@ -209,28 +194,4 @@ public class AbstractCliIT {
AbstractCli
.
handleInputCmd
(
String
.
format
(
"%s=111"
,
AbstractCli
.
SET_FETCH_SIZE
),
connection
));
}
private
void
testSetMaxDisplayNumber
()
{
try
{
AbstractCli
.
setMaxDisplayNumber
(
"10"
);
}
catch
(
NumberFormatException
e
)
{
fail
();
}
try
{
AbstractCli
.
setMaxDisplayNumber
(
"111111111111111"
);
fail
();
}
catch
(
NumberFormatException
ignored
)
{
}
try
{
AbstractCli
.
setMaxDisplayNumber
(
"-10"
);
}
catch
(
NumberFormatException
ignored
)
{
}
try
{
AbstractCli
.
setMaxDisplayNumber
(
"0"
);
}
catch
(
NumberFormatException
ignored
)
{
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录