Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Iotdb
提交
dd879eb8
I
Iotdb
项目概览
apache
/
Iotdb
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
dd879eb8
编写于
8月 25, 2019
作者:
Q
qiaojialin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix IT test, IoTDBRPCException -> IoTDBSQLException, default user/password
上级
6320a45b
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
88 addition
and
76 deletion
+88
-76
jdbc/src/main/java/org/apache/iotdb/jdbc/Config.java
jdbc/src/main/java/org/apache/iotdb/jdbc/Config.java
+4
-4
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBConnection.java
.../src/main/java/org/apache/iotdb/jdbc/IoTDBConnection.java
+1
-1
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBDatabaseMetadata.java
...ain/java/org/apache/iotdb/jdbc/IoTDBDatabaseMetadata.java
+24
-8
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBQueryResultSet.java
.../main/java/org/apache/iotdb/jdbc/IoTDBQueryResultSet.java
+6
-2
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBStatement.java
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBStatement.java
+2
-2
pom.xml
pom.xml
+1
-1
server/src/test/java/org/apache/iotdb/db/integration/IoTDBAggregationIT.java
...a/org/apache/iotdb/db/integration/IoTDBAggregationIT.java
+4
-4
session/pom.xml
session/pom.xml
+38
-45
session/src/main/java/org/apache/iotdb/session/Config.java
session/src/main/java/org/apache/iotdb/session/Config.java
+2
-3
session/src/main/java/org/apache/iotdb/session/IoTDBSessionException.java
.../java/org/apache/iotdb/session/IoTDBSessionException.java
+1
-1
session/src/main/java/org/apache/iotdb/session/Session.java
session/src/main/java/org/apache/iotdb/session/Session.java
+5
-5
未找到文件。
jdbc/src/main/java/org/apache/iotdb/jdbc/Config.java
浏览文件 @
dd879eb8
...
...
@@ -38,11 +38,11 @@ public class Config {
*/
public
static
final
String
DEFAULT_SERIES_NAME
=
"default"
;
public
static
final
String
AUTH_USER
=
"
root
"
;
public
static
final
String
DEFAULT_USER
=
"
root
"
;
public
static
final
String
AUTH_USER
=
"
user
"
;
public
static
final
String
DEFAULT_USER
=
"
user
"
;
public
static
final
String
AUTH_PASSWORD
=
"
root
"
;
public
static
final
String
DEFALUT_PASSWORD
=
"
root
"
;
public
static
final
String
AUTH_PASSWORD
=
"
password
"
;
public
static
final
String
DEFALUT_PASSWORD
=
"
password
"
;
public
static
final
int
RETRY_NUM
=
3
;
public
static
final
long
RETRY_INTERVAL
=
1000
;
...
...
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBConnection.java
浏览文件 @
dd879eb8
...
...
@@ -424,7 +424,7 @@ public class IoTDBConnection implements Connection {
}
catch
(
IoTDBRPCException
e
)
{
// failed to connect, disconnect from the server
transport
.
close
();
throw
new
SQLException
(
e
);
throw
new
IoTDB
SQLException
(
e
);
}
if
(
protocolVersion
.
getValue
()
!=
openResp
.
getServerProtocolVersion
().
getValue
())
{
throw
new
TException
(
String
...
...
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBDatabaseMetadata.java
浏览文件 @
dd879eb8
...
...
@@ -84,9 +84,13 @@ public class IoTDBDatabaseMetadata implements DatabaseMetaData {
req
.
setColumnPath
(
schemaPattern
);
try
{
TSFetchMetadataResp
resp
=
client
.
fetchMetadata
(
req
);
RpcUtils
.
verifySuccess
(
resp
.
getStatus
());
try
{
RpcUtils
.
verifySuccess
(
resp
.
getStatus
());
}
catch
(
IoTDBRPCException
e
)
{
throw
new
IoTDBSQLException
(
e
);
}
return
new
IoTDBMetadataResultSet
(
resp
.
getColumnsList
(),
null
,
null
);
}
catch
(
TException
|
IoTDBRPCException
e
)
{
}
catch
(
TException
e
)
{
throw
new
TException
(
"Conncetion error when fetching column metadata"
,
e
);
}
case
Constant
.
CATALOG_DEVICE
:
...
...
@@ -94,19 +98,27 @@ public class IoTDBDatabaseMetadata implements DatabaseMetaData {
req
.
setColumnPath
(
schemaPattern
);
try
{
TSFetchMetadataResp
resp
=
client
.
fetchMetadata
(
req
);
RpcUtils
.
verifySuccess
(
resp
.
getStatus
());
try
{
RpcUtils
.
verifySuccess
(
resp
.
getStatus
());
}
catch
(
IoTDBRPCException
e
)
{
throw
new
IoTDBSQLException
(
e
);
}
return
new
IoTDBMetadataResultSet
(
resp
.
getColumnsList
(),
null
,
null
);
}
catch
(
TException
|
IoTDBRPCException
e
)
{
}
catch
(
TException
e
)
{
throw
new
TException
(
"Conncetion error when fetching delta object metadata"
,
e
);
}
case
Constant
.
CATALOG_STORAGE_GROUP
:
req
=
new
TSFetchMetadataReq
(
Constant
.
GLOBAL_SHOW_STORAGE_GROUP_REQ
);
try
{
TSFetchMetadataResp
resp
=
client
.
fetchMetadata
(
req
);
RpcUtils
.
verifySuccess
(
resp
.
getStatus
());
try
{
RpcUtils
.
verifySuccess
(
resp
.
getStatus
());
}
catch
(
IoTDBRPCException
e
)
{
throw
new
IoTDBSQLException
(
e
);
}
Set
<
String
>
showStorageGroup
=
resp
.
getShowStorageGroups
();
return
new
IoTDBMetadataResultSet
(
null
,
showStorageGroup
,
null
);
}
catch
(
TException
|
IoTDBRPCException
e
)
{
}
catch
(
TException
e
)
{
throw
new
TException
(
"Conncetion error when fetching storage group metadata"
,
e
);
}
case
Constant
.
CATALOG_TIMESERIES
:
...
...
@@ -114,10 +126,14 @@ public class IoTDBDatabaseMetadata implements DatabaseMetaData {
req
.
setColumnPath
(
schemaPattern
);
try
{
TSFetchMetadataResp
resp
=
client
.
fetchMetadata
(
req
);
RpcUtils
.
verifySuccess
(
resp
.
getStatus
());
try
{
RpcUtils
.
verifySuccess
(
resp
.
getStatus
());
}
catch
(
IoTDBRPCException
e
)
{
throw
new
IoTDBSQLException
(
e
);
}
List
<
List
<
String
>>
showTimeseriesList
=
resp
.
getShowTimeseriesList
();
return
new
IoTDBMetadataResultSet
(
null
,
null
,
showTimeseriesList
);
}
catch
(
TException
|
IoTDBRPCException
e
)
{
}
catch
(
TException
e
)
{
throw
new
TException
(
"Conncetion error when fetching timeseries metadata"
,
e
);
}
default
:
...
...
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBQueryResultSet.java
浏览文件 @
dd879eb8
...
...
@@ -710,7 +710,11 @@ public class IoTDBQueryResultSet implements ResultSet {
try
{
TSFetchResultsResp
resp
=
client
.
fetchResults
(
req
);
RpcUtils
.
verifySuccess
(
resp
.
getStatus
());
try
{
RpcUtils
.
verifySuccess
(
resp
.
getStatus
());
}
catch
(
IoTDBRPCException
e
)
{
throw
new
IoTDBSQLException
(
e
);
}
if
(!
resp
.
hasResultSet
)
{
emptyResultSet
=
true
;
}
else
{
...
...
@@ -718,7 +722,7 @@ public class IoTDBQueryResultSet implements ResultSet {
List
<
RowRecord
>
records
=
Utils
.
convertRowRecords
(
tsQueryDataSet
);
recordItr
=
records
.
iterator
();
}
}
catch
(
TException
|
IoTDBRPCException
e
)
{
}
catch
(
TException
e
)
{
throw
new
SQLException
(
"Cannot fetch result from server, because of network connection: {} "
,
e
);
}
...
...
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBStatement.java
浏览文件 @
dd879eb8
...
...
@@ -251,7 +251,7 @@ public class IoTDBStatement implements Statement {
try
{
RpcUtils
.
verifySuccess
(
execResp
.
getStatus
());
}
catch
(
IoTDBRPCException
e
)
{
throw
new
SQLException
(
e
);
throw
new
IoTDB
SQLException
(
e
);
}
if
(
execResp
.
getOperationHandle
().
hasResultSet
)
{
IoTDBQueryResultSet
resSet
=
new
IoTDBQueryResultSet
(
this
,
...
...
@@ -355,7 +355,7 @@ public class IoTDBStatement implements Statement {
try
{
RpcUtils
.
verifySuccess
(
execResp
.
getStatus
());
}
catch
(
IoTDBRPCException
e
)
{
throw
new
SQLException
(
e
);
throw
new
IoTDB
SQLException
(
e
);
}
IoTDBQueryResultSet
resSet
=
new
IoTDBQueryResultSet
(
this
,
execResp
.
getColumns
(),
client
,
operationHandle
,
sql
,
execResp
.
getOperationType
(),
execResp
.
getDataTypeList
(),
...
...
pom.xml
浏览文件 @
dd879eb8
...
...
@@ -381,6 +381,7 @@
<module>
tsfile
</module>
<module>
service-rpc
</module>
<module>
jdbc
</module>
<module>
session
</module>
<module>
client
</module>
<module>
server
</module>
<module>
example
</module>
...
...
@@ -388,7 +389,6 @@
<module>
spark-tsfile
</module>
<!-- <module>hadoop</module> -->
<module>
distribution
</module>
<module>
session
</module>
</modules>
<build>
<pluginManagement>
...
...
server/src/test/java/org/apache/iotdb/db/integration/IoTDBAggregationIT.java
浏览文件 @
dd879eb8
...
...
@@ -510,7 +510,7 @@ public class IoTDBAggregationIT {
resultSet
.
next
();
fail
();
}
catch
(
Exception
e
)
{
Assert
.
assertEquals
(
"Unsupported data type in aggregation MEAN : TEXT"
,
e
.
getMessage
());
Assert
.
assertEquals
(
"
org.apache.iotdb.rpc.IoTDBRPCException:
Unsupported data type in aggregation MEAN : TEXT"
,
e
.
getMessage
());
}
statement
.
close
();
...
...
@@ -523,7 +523,7 @@ public class IoTDBAggregationIT {
resultSet
.
next
();
fail
();
}
catch
(
Exception
e
)
{
Assert
.
assertEquals
(
"Unsupported data type in aggregation SUM : TEXT"
,
e
.
getMessage
());
Assert
.
assertEquals
(
"
org.apache.iotdb.rpc.IoTDBRPCException:
Unsupported data type in aggregation SUM : TEXT"
,
e
.
getMessage
());
}
statement
.
close
();
...
...
@@ -536,7 +536,7 @@ public class IoTDBAggregationIT {
resultSet
.
next
();
fail
();
}
catch
(
Exception
e
)
{
Assert
.
assertEquals
(
"Unsupported data type in aggregation MEAN : BOOLEAN"
,
e
.
getMessage
());
Assert
.
assertEquals
(
"
org.apache.iotdb.rpc.IoTDBRPCException:
Unsupported data type in aggregation MEAN : BOOLEAN"
,
e
.
getMessage
());
}
statement
.
close
();
...
...
@@ -549,7 +549,7 @@ public class IoTDBAggregationIT {
resultSet
.
next
();
fail
();
}
catch
(
Exception
e
)
{
Assert
.
assertEquals
(
"Unsupported data type in aggregation SUM : BOOLEAN"
,
e
.
getMessage
());
Assert
.
assertEquals
(
"
org.apache.iotdb.rpc.IoTDBRPCException:
Unsupported data type in aggregation SUM : BOOLEAN"
,
e
.
getMessage
());
}
statement
.
close
();
}
catch
(
Exception
e
)
{
...
...
session/pom.xml
浏览文件 @
dd879eb8
...
...
@@ -19,49 +19,42 @@
under the License.
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
iotdb-parent
</artifactId>
<groupId>
org.apache.iotdb
</groupId>
<version>
0.9.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
iotdb-session
</artifactId>
<name>
IoTDB Session
</name>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<source>
8
</source>
<target>
8
</target>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven.compiler.source>
1.7
</maven.compiler.source>
<maven.compiler.target>
1.7
</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>
org.apache.iotdb
</groupId>
<artifactId>
service-rpc
</artifactId>
<version>
0.9.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.apache.iotdb
</groupId>
<artifactId>
tsfile
</artifactId>
<version>
0.9.0-SNAPSHOT
</version>
</dependency>
</dependencies>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
iotdb-parent
</artifactId>
<groupId>
org.apache.iotdb
</groupId>
<version>
0.9.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
iotdb-session
</artifactId>
<name>
IoTDB Session
</name>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<source>
8
</source>
<target>
8
</target>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven.compiler.source>
1.7
</maven.compiler.source>
<maven.compiler.target>
1.7
</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>
org.apache.iotdb
</groupId>
<artifactId>
service-rpc
</artifactId>
<version>
0.9.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.apache.iotdb
</groupId>
<artifactId>
tsfile
</artifactId>
<version>
0.9.0-SNAPSHOT
</version>
</dependency>
</dependencies>
</project>
session/src/main/java/org/apache/iotdb/session/Config.java
浏览文件 @
dd879eb8
...
...
@@ -20,8 +20,7 @@ package org.apache.iotdb.session;
public
class
Config
{
public
static
final
String
DEFAULT_USER
=
"root"
;
public
static
final
String
DEFALUT_PASSWORD
=
"root"
;
public
static
final
String
DEFAULT_USER
=
"user"
;
public
static
final
String
DEFALUT_PASSWORD
=
"password"
;
}
session/src/main/java/org/apache/iotdb/session/IoTDBSessionException.java
浏览文件 @
dd879eb8
...
...
@@ -18,7 +18,7 @@
*/
package
org.apache.iotdb.session
;
public
class
IoTDBSessionException
extends
Runtime
Exception
{
public
class
IoTDBSessionException
extends
Exception
{
private
static
final
long
serialVersionUID
=
2405104784097667293L
;
...
...
session/src/main/java/org/apache/iotdb/session/Session.java
浏览文件 @
dd879eb8
...
...
@@ -32,7 +32,6 @@ import org.apache.iotdb.service.rpc.thrift.TSProtocolVersion;
import
org.apache.iotdb.service.rpc.thrift.TSSetTimeZoneReq
;
import
org.apache.iotdb.service.rpc.thrift.TSSetTimeZoneResp
;
import
org.apache.iotdb.service.rpc.thrift.TS_SessionHandle
;
import
org.apache.iotdb.service.rpc.thrift.TS_StatusCode
;
import
org.apache.iotdb.tsfile.write.record.RowBatch
;
import
org.apache.iotdb.tsfile.write.schema.MeasurementSchema
;
import
org.apache.thrift.TException
;
...
...
@@ -72,11 +71,12 @@ public class Session {
this
.
password
=
password
;
}
public
void
open
()
{
public
void
open
()
throws
IoTDBSessionException
{
open
(
false
,
0
);
}
public
void
open
(
boolean
enableRPCCompression
,
int
connectionTimeoutInMs
)
{
public
void
open
(
boolean
enableRPCCompression
,
int
connectionTimeoutInMs
)
throws
IoTDBSessionException
{
transport
=
new
TSocket
(
host
,
port
,
connectionTimeoutInMs
);
if
(!
transport
.
isOpen
())
{
try
{
...
...
@@ -128,7 +128,7 @@ public class Session {
}
public
void
close
()
{
public
void
close
()
throws
IoTDBSessionException
{
if
(
isClosed
)
{
return
;
}
...
...
@@ -145,7 +145,7 @@ public class Session {
}
}
public
TSExecuteBatchStatementResp
insertBatch
(
RowBatch
rowBatch
)
{
public
TSExecuteBatchStatementResp
insertBatch
(
RowBatch
rowBatch
)
throws
IoTDBSessionException
{
TSBatchInsertionReq
request
=
new
TSBatchInsertionReq
();
request
.
deviceId
=
rowBatch
.
deviceId
;
for
(
MeasurementSchema
measurementSchema:
rowBatch
.
measurements
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录