Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Iotdb
提交
59e2af7a
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,发现更多精彩内容 >>
未验证
提交
59e2af7a
编写于
3月 29, 2019
作者:
X
Xiangdong Huang
提交者:
GitHub
3月 29, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #120 from apache/fix_70_71
[IOTDB-70][IOTDB-71]fix jira issue 70 71
上级
30c89ff4
693841f5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
27 addition
and
17 deletion
+27
-17
iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowResource.java
.../apache/iotdb/db/engine/overflow/io/OverflowResource.java
+20
-16
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBConnection.java
.../src/main/java/org/apache/iotdb/jdbc/IoTDBConnection.java
+7
-1
未找到文件。
iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowResource.java
浏览文件 @
59e2af7a
...
...
@@ -106,31 +106,35 @@ public class OverflowResource {
modificationFile
=
new
ModificationFile
(
insertFilePath
+
ModificationFile
.
FILE_SUFFIX
);
}
private
Pair
<
Long
,
Long
>
readPositionInfo
()
{
try
(
FileInputStream
inputStream
=
new
FileInputStream
(
positionFilePath
))
{
byte
[]
insertPositionData
=
new
byte
[
8
];
byte
[]
updatePositionData
=
new
byte
[
8
];
int
byteRead
=
inputStream
.
read
(
insertPositionData
);
if
(
byteRead
!=
8
)
{
throw
new
IOException
(
"Not enough bytes for insertPositionData"
);
}
byteRead
=
inputStream
.
read
(
updatePositionData
);
if
(
byteRead
!=
8
)
{
throw
new
IOException
(
"Not enough bytes for updatePositionData"
);
private
Pair
<
Long
,
Long
>
readPositionInfo
()
throws
IOException
{
File
positionFile
=
new
File
(
positionFilePath
);
if
(
positionFile
.
exists
())
{
try
(
FileInputStream
inputStream
=
new
FileInputStream
(
positionFile
))
{
byte
[]
insertPositionData
=
new
byte
[
8
];
byte
[]
updatePositionData
=
new
byte
[
8
];
int
byteRead
=
inputStream
.
read
(
insertPositionData
);
if
(
byteRead
!=
8
)
{
throw
new
IOException
(
"Not enough bytes for insertPositionData"
);
}
byteRead
=
inputStream
.
read
(
updatePositionData
);
if
(
byteRead
!=
8
)
{
throw
new
IOException
(
"Not enough bytes for updatePositionData"
);
}
long
lastInsertPosition
=
BytesUtils
.
bytesToLong
(
insertPositionData
);
long
lastUpdatePosition
=
BytesUtils
.
bytesToLong
(
updatePositionData
);
return
new
Pair
<>(
lastInsertPosition
,
lastUpdatePosition
);
}
long
lastInsertPosition
=
BytesUtils
.
bytesToLong
(
insertPositionData
);
long
lastUpdatePosition
=
BytesUtils
.
bytesToLong
(
updatePositionData
);
return
new
Pair
<>(
lastInsertPosition
,
lastUpdatePosition
);
}
catch
(
IOException
e
)
{
}
else
{
LOGGER
.
debug
(
"No position info, returning a default value"
);
long
left
=
0
;
long
right
=
0
;
File
insertTempFile
=
new
File
(
insertFilePath
);
if
(
insertTempFile
.
exists
())
{
left
=
insertTempFile
.
length
();
}
LOGGER
.
warn
(
"Cannot read position info, returning a default value"
,
e
);
return
new
Pair
<>(
left
,
right
);
}
}
private
void
writePositionInfo
(
long
lastInsertPosition
,
long
lastUpdatePosition
)
...
...
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBConnection.java
浏览文件 @
59e2af7a
...
...
@@ -427,7 +427,13 @@ public class IoTDBConnection implements Connection {
TSOpenSessionResp
openResp
=
client
.
openSession
(
openReq
);
// validate connection
Utils
.
verifySuccess
(
openResp
.
getStatus
());
try
{
Utils
.
verifySuccess
(
openResp
.
getStatus
());
}
catch
(
IoTDBSQLException
e
)
{
// failed to connect, disconnect from the server
transport
.
close
();
throw
e
;
}
if
(!
supportedProtocols
.
contains
(
openResp
.
getServerProtocolVersion
()))
{
throw
new
TException
(
"Unsupported TsFile protocol"
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录