Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Forever310
druid
提交
728f1e8e
D
druid
项目概览
Forever310
/
druid
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
druid
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
728f1e8e
编写于
5月 01, 2014
作者:
N
nishantmonu51
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix exists check with compression
上级
01e84f10
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
7 deletion
+20
-7
indexing-hadoop/src/main/java/io/druid/indexer/DetermineHashedPartitionsJob.java
...n/java/io/druid/indexer/DetermineHashedPartitionsJob.java
+2
-2
indexing-hadoop/src/main/java/io/druid/indexer/DeterminePartitionsJob.java
...rc/main/java/io/druid/indexer/DeterminePartitionsJob.java
+1
-1
indexing-hadoop/src/main/java/io/druid/indexer/Utils.java
indexing-hadoop/src/main/java/io/druid/indexer/Utils.java
+17
-4
未找到文件。
indexing-hadoop/src/main/java/io/druid/indexer/DetermineHashedPartitionsJob.java
浏览文件 @
728f1e8e
...
...
@@ -128,7 +128,7 @@ public class DetermineHashedPartitionsJob implements Jobby
if
(!
config
.
getSegmentGranularIntervals
().
isPresent
())
{
final
Path
intervalInfoPath
=
config
.
makeIntervalInfoPath
();
fileSystem
=
intervalInfoPath
.
getFileSystem
(
groupByJob
.
getConfiguration
());
if
(!
fileSystem
.
exists
(
intervalInfoPath
))
{
if
(!
Utils
.
exists
(
groupByJob
,
fileSystem
,
intervalInfoPath
))
{
throw
new
ISE
(
"Path[%s] didn't exist!?"
,
intervalInfoPath
);
}
List
<
Interval
>
intervals
=
config
.
jsonMapper
.
readValue
(
...
...
@@ -148,7 +148,7 @@ public class DetermineHashedPartitionsJob implements Jobby
if
(
fileSystem
==
null
)
{
fileSystem
=
partitionInfoPath
.
getFileSystem
(
groupByJob
.
getConfiguration
());
}
if
(
fileSystem
.
exists
(
partitionInfoPath
))
{
if
(
Utils
.
exists
(
groupByJob
,
fileSystem
,
partitionInfoPath
))
{
Long
cardinality
=
config
.
jsonMapper
.
readValue
(
Utils
.
openInputStream
(
groupByJob
,
partitionInfoPath
),
new
TypeReference
<
Long
>()
{
...
...
indexing-hadoop/src/main/java/io/druid/indexer/DeterminePartitionsJob.java
浏览文件 @
728f1e8e
...
...
@@ -215,7 +215,7 @@ public class DeterminePartitionsJob implements Jobby
if
(
fileSystem
==
null
)
{
fileSystem
=
partitionInfoPath
.
getFileSystem
(
dimSelectionJob
.
getConfiguration
());
}
if
(
fileSystem
.
exists
(
partitionInfoPath
))
{
if
(
Utils
.
exists
(
dimSelectionJob
,
fileSystem
,
partitionInfoPath
))
{
List
<
ShardSpec
>
specs
=
config
.
jsonMapper
.
readValue
(
Utils
.
openInputStream
(
dimSelectionJob
,
partitionInfoPath
),
new
TypeReference
<
List
<
ShardSpec
>>()
{
...
...
indexing-hadoop/src/main/java/io/druid/indexer/Utils.java
浏览文件 @
728f1e8e
...
...
@@ -65,7 +65,8 @@ public class Utils
return
retVal
;
}
public
static
OutputStream
makePathAndOutputStream
(
JobContext
job
,
Path
outputPath
,
boolean
deleteExisting
)
throws
IOException
public
static
OutputStream
makePathAndOutputStream
(
JobContext
job
,
Path
outputPath
,
boolean
deleteExisting
)
throws
IOException
{
OutputStream
retVal
;
FileSystem
fs
=
outputPath
.
getFileSystem
(
job
.
getConfiguration
());
...
...
@@ -73,8 +74,7 @@ public class Utils
if
(
fs
.
exists
(
outputPath
))
{
if
(
deleteExisting
)
{
fs
.
delete
(
outputPath
,
false
);
}
else
{
}
else
{
throw
new
ISE
(
"outputPath[%s] must not exist."
,
outputPath
);
}
}
...
...
@@ -97,6 +97,17 @@ public class Utils
return
openInputStream
(
inputPath
,
inputPath
.
getFileSystem
(
job
.
getConfiguration
()));
}
public
static
boolean
exists
(
JobContext
job
,
FileSystem
fs
,
Path
inputPath
)
throws
IOException
{
if
(!
FileOutputFormat
.
getCompressOutput
(
job
))
{
return
fs
.
exists
(
inputPath
);
}
else
{
Class
<?
extends
CompressionCodec
>
codecClass
=
FileOutputFormat
.
getOutputCompressorClass
(
job
,
GzipCodec
.
class
);
CompressionCodec
codec
=
ReflectionUtils
.
newInstance
(
codecClass
,
job
.
getConfiguration
());
return
fs
.
exists
(
new
Path
(
inputPath
.
toString
()
+
codec
.
getDefaultExtension
()));
}
}
public
static
InputStream
openInputStream
(
Path
inputPath
,
final
FileSystem
fileSystem
)
throws
IOException
{
return
fileSystem
.
open
(
inputPath
);
...
...
@@ -109,7 +120,9 @@ public class Utils
return
jsonMapper
.
readValue
(
fs
.
open
(
statsPath
),
new
TypeReference
<
Map
<
String
,
Object
>>(){}
new
TypeReference
<
Map
<
String
,
Object
>>()
{
}
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录