Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
634f82d0
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
634f82d0
编写于
6月 10, 2019
作者:
V
Vladimir Chebotarev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minor fix.
上级
ff691129
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
5 addition
and
6 deletion
+5
-6
dbms/src/IO/WriteBufferFromS3.cpp
dbms/src/IO/WriteBufferFromS3.cpp
+5
-3
dbms/src/IO/WriteBufferFromS3.h
dbms/src/IO/WriteBufferFromS3.h
+0
-3
未找到文件。
dbms/src/IO/WriteBufferFromS3.cpp
浏览文件 @
634f82d0
...
...
@@ -15,7 +15,6 @@ WriteBufferFromS3::WriteBufferFromS3(
,
uri
{
uri_
}
,
timeouts
{
timeouts_
}
,
credentials
{
credentials_
}
,
session
{
makeHTTPSession
(
uri_
,
timeouts_
)}
{
ostr
=
&
temporary_stream
;
}
...
...
@@ -24,9 +23,13 @@ void WriteBufferFromS3::finalize()
{
const
std
::
string
&
data
=
temporary_stream
.
str
();
Poco
::
Net
::
HTTPResponse
response
;
std
::
unique_ptr
<
Poco
::
Net
::
HTTPRequest
>
request
;
HTTPSessionPtr
session
;
std
::
istream
*
istr
;
/// owned by session
for
(
int
i
=
0
;
i
<
DEFAULT_S3_MAX_FOLLOW_PUT_REDIRECT
;
++
i
)
{
session
=
makeHTTPSession
(
uri
,
timeouts
);
request
=
std
::
make_unique
<
Poco
::
Net
::
HTTPRequest
>
(
Poco
::
Net
::
HTTPRequest
::
HTTP_PUT
,
uri
.
getPathAndQuery
(),
Poco
::
Net
::
HTTPRequest
::
HTTP_1_1
);
request
->
setHost
(
uri
.
getHost
());
// use original, not resolved host name in header
...
...
@@ -44,7 +47,7 @@ void WriteBufferFromS3::finalize()
LOG_TRACE
((
&
Logger
::
get
(
"WriteBufferFromS3"
)),
"Sending request to "
<<
uri
.
toString
());
ostr
=
&
session
->
sendRequest
(
*
request
);
if
(
session
->
peekResponse
(
response
))
//
if (session->peekResponse(response))
{
// Received 100-continue.
*
ostr
<<
data
;
...
...
@@ -60,7 +63,6 @@ void WriteBufferFromS3::finalize()
break
;
uri
=
location_iterator
->
second
;
session
=
makeHTTPSession
(
uri
,
timeouts
);
}
assertResponseIsOk
(
*
request
,
response
,
istr
);
}
...
...
dbms/src/IO/WriteBufferFromS3.h
浏览文件 @
634f82d0
...
...
@@ -31,9 +31,6 @@ private:
Poco
::
URI
uri
;
ConnectionTimeouts
timeouts
;
const
Poco
::
Net
::
HTTPBasicCredentials
&
credentials
;
HTTPSessionPtr
session
;
std
::
istream
*
istr
;
/// owned by session
Poco
::
Net
::
HTTPResponse
response
;
std
::
ostringstream
temporary_stream
;
/// Maybe one shall use some DB:: buffer.
public:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录