Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
52f9cf63
F
flink
项目概览
doujutun3207
/
flink
与 Fork 源项目一致
从无法访问的项目Fork
通知
24
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
flink
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
52f9cf63
编写于
7月 09, 2014
作者:
S
Stephan Ewen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
No explicit caching when hash table is cached
Add tests for explicit cache removal when hash table is cached
上级
a9b1daa1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
44 addition
and
10 deletion
+44
-10
stratosphere-compiler/src/main/java/eu/stratosphere/compiler/dag/TempMode.java
.../src/main/java/eu/stratosphere/compiler/dag/TempMode.java
+11
-0
stratosphere-compiler/src/main/java/eu/stratosphere/compiler/operators/HashJoinBuildFirstProperties.java
...here/compiler/operators/HashJoinBuildFirstProperties.java
+6
-0
stratosphere-compiler/src/main/java/eu/stratosphere/compiler/operators/HashJoinBuildSecondProperties.java
...ere/compiler/operators/HashJoinBuildSecondProperties.java
+8
-1
stratosphere-compiler/src/test/java/eu/stratosphere/pact/compiler/CachedMatchStrategyCompilerTest.java
...sphere/pact/compiler/CachedMatchStrategyCompilerTest.java
+19
-9
未找到文件。
stratosphere-compiler/src/main/java/eu/stratosphere/compiler/dag/TempMode.java
浏览文件 @
52f9cf63
...
...
@@ -63,4 +63,15 @@ public enum TempMode {
return
this
;
}
}
public
TempMode
makeNonCached
()
{
if
(
this
==
CACHED
)
{
return
NONE
;
}
else
if
(
this
==
CACHING_PIPELINE_BREAKER
)
{
return
PIPELINE_BREAKER
;
}
else
{
return
this
;
}
}
}
stratosphere-compiler/src/main/java/eu/stratosphere/compiler/operators/HashJoinBuildFirstProperties.java
浏览文件 @
52f9cf63
...
...
@@ -17,6 +17,7 @@ import java.util.Collections;
import
java.util.List
;
import
eu.stratosphere.api.common.operators.util.FieldList
;
import
eu.stratosphere.compiler.CompilerException
;
import
eu.stratosphere.compiler.dag.TwoInputNode
;
import
eu.stratosphere.compiler.dataproperties.LocalProperties
;
import
eu.stratosphere.compiler.dataproperties.RequestedLocalProperties
;
...
...
@@ -57,6 +58,11 @@ public class HashJoinBuildFirstProperties extends AbstractJoinDescriptor {
DriverStrategy
strategy
;
if
(!
in1
.
isOnDynamicPath
()
&&
in2
.
isOnDynamicPath
())
{
// sanity check that the first input is cached and remove that cache
if
(!
in1
.
getTempMode
().
isCached
())
{
throw
new
CompilerException
(
"No cache at point where static and dynamic parts meet."
);
}
in1
.
setTempMode
(
in1
.
getTempMode
().
makeNonCached
());
strategy
=
DriverStrategy
.
HYBRIDHASH_BUILD_FIRST_CACHED
;
}
else
{
...
...
stratosphere-compiler/src/main/java/eu/stratosphere/compiler/operators/HashJoinBuildSecondProperties.java
浏览文件 @
52f9cf63
...
...
@@ -17,6 +17,7 @@ import java.util.Collections;
import
java.util.List
;
import
eu.stratosphere.api.common.operators.util.FieldList
;
import
eu.stratosphere.compiler.CompilerException
;
import
eu.stratosphere.compiler.dag.TwoInputNode
;
import
eu.stratosphere.compiler.dataproperties.LocalProperties
;
import
eu.stratosphere.compiler.dataproperties.RequestedLocalProperties
;
...
...
@@ -53,7 +54,13 @@ public final class HashJoinBuildSecondProperties extends AbstractJoinDescriptor
public
DualInputPlanNode
instantiate
(
Channel
in1
,
Channel
in2
,
TwoInputNode
node
)
{
DriverStrategy
strategy
;
if
(!
in2
.
isOnDynamicPath
()
&&
in1
.
isOnDynamicPath
())
{
if
(!
in2
.
isOnDynamicPath
()
&&
in1
.
isOnDynamicPath
())
{
// sanity check that the first input is cached and remove that cache
if
(!
in2
.
getTempMode
().
isCached
())
{
throw
new
CompilerException
(
"No cache at point where static and dynamic parts meet."
);
}
in2
.
setTempMode
(
in2
.
getTempMode
().
makeNonCached
());
strategy
=
DriverStrategy
.
HYBRIDHASH_BUILD_SECOND_CACHED
;
}
else
{
...
...
stratosphere-compiler/src/test/java/eu/stratosphere/pact/compiler/CachedMatchStrategyCompilerTest.java
浏览文件 @
52f9cf63
...
...
@@ -28,6 +28,7 @@ import eu.stratosphere.api.java.IterativeDataSet;
import
eu.stratosphere.api.java.functions.JoinFunction
;
import
eu.stratosphere.api.java.tuple.Tuple3
;
import
eu.stratosphere.compiler.PactCompiler
;
import
eu.stratosphere.compiler.dag.TempMode
;
import
eu.stratosphere.compiler.plan.DualInputPlanNode
;
import
eu.stratosphere.compiler.plan.OptimizedPlan
;
import
eu.stratosphere.compiler.plantranslate.NepheleJobGraphGenerator
;
...
...
@@ -57,6 +58,8 @@ public class CachedMatchStrategyCompilerTest extends CompilerTestBase {
// verify correct join strategy
assertEquals
(
DriverStrategy
.
HYBRIDHASH_BUILD_SECOND_CACHED
,
innerJoin
.
getDriverStrategy
());
assertEquals
(
TempMode
.
NONE
,
innerJoin
.
getInput1
().
getTempMode
());
assertEquals
(
TempMode
.
NONE
,
innerJoin
.
getInput2
().
getTempMode
());
new
NepheleJobGraphGenerator
().
compileJobGraph
(
oPlan
);
}
...
...
@@ -83,6 +86,8 @@ public class CachedMatchStrategyCompilerTest extends CompilerTestBase {
// verify correct join strategy
assertEquals
(
DriverStrategy
.
HYBRIDHASH_BUILD_FIRST
,
innerJoin
.
getDriverStrategy
());
assertEquals
(
TempMode
.
NONE
,
innerJoin
.
getInput1
().
getTempMode
());
assertEquals
(
TempMode
.
CACHED
,
innerJoin
.
getInput2
().
getTempMode
());
new
NepheleJobGraphGenerator
().
compileJobGraph
(
oPlan
);
}
...
...
@@ -109,7 +114,9 @@ public class CachedMatchStrategyCompilerTest extends CompilerTestBase {
DualInputPlanNode
innerJoin
=
resolver
.
getNode
(
"DummyJoiner"
);
// verify correct join strategy
assertEquals
(
DriverStrategy
.
HYBRIDHASH_BUILD_FIRST_CACHED
,
innerJoin
.
getDriverStrategy
());
assertEquals
(
DriverStrategy
.
HYBRIDHASH_BUILD_FIRST_CACHED
,
innerJoin
.
getDriverStrategy
());
assertEquals
(
TempMode
.
NONE
,
innerJoin
.
getInput1
().
getTempMode
());
assertEquals
(
TempMode
.
NONE
,
innerJoin
.
getInput2
().
getTempMode
());
new
NepheleJobGraphGenerator
().
compileJobGraph
(
oPlan
);
}
...
...
@@ -135,7 +142,9 @@ public class CachedMatchStrategyCompilerTest extends CompilerTestBase {
DualInputPlanNode
innerJoin
=
resolver
.
getNode
(
"DummyJoiner"
);
// verify correct join strategy
assertEquals
(
DriverStrategy
.
HYBRIDHASH_BUILD_SECOND
,
innerJoin
.
getDriverStrategy
());
assertEquals
(
DriverStrategy
.
HYBRIDHASH_BUILD_SECOND
,
innerJoin
.
getDriverStrategy
());
assertEquals
(
TempMode
.
CACHED
,
innerJoin
.
getInput1
().
getTempMode
());
assertEquals
(
TempMode
.
NONE
,
innerJoin
.
getInput2
().
getTempMode
());
new
NepheleJobGraphGenerator
().
compileJobGraph
(
oPlan
);
}
...
...
@@ -169,13 +178,16 @@ public class CachedMatchStrategyCompilerTest extends CompilerTestBase {
}
}
OptimizedPlan
oPlan
=
compileNoStats
(
plan
);
OptimizerPlanNodeResolver
resolver
=
getOptimizerPlanNodeResolver
(
oPlan
);
DualInputPlanNode
innerJoin
=
resolver
.
getNode
(
"DummyJoiner"
);
// verify correct join strategy
assertEquals
(
DriverStrategy
.
HYBRIDHASH_BUILD_SECOND_CACHED
,
innerJoin
.
getDriverStrategy
());
assertEquals
(
DriverStrategy
.
HYBRIDHASH_BUILD_SECOND_CACHED
,
innerJoin
.
getDriverStrategy
());
assertEquals
(
TempMode
.
NONE
,
innerJoin
.
getInput1
().
getTempMode
());
assertEquals
(
TempMode
.
NONE
,
innerJoin
.
getInput2
().
getTempMode
());
new
NepheleJobGraphGenerator
().
compileJobGraph
(
oPlan
);
}
...
...
@@ -197,16 +209,14 @@ public class CachedMatchStrategyCompilerTest extends CompilerTestBase {
IterativeDataSet
<
Tuple3
<
Long
,
Long
,
Long
>>
iteration
=
bigInput
.
iterate
(
10
);
DataSet
<
Tuple3
<
Long
,
Long
,
Long
>>
inner
;
Configuration
joinStrategy
=
new
Configuration
();
joinStrategy
.
setString
(
PactCompiler
.
HINT_SHIP_STRATEGY
,
PactCompiler
.
HINT_SHIP_STRATEGY_REPARTITION_HASH
);
if
(
strategy
!=
""
)
{
Configuration
joinStrategy
=
new
Configuration
();
joinStrategy
.
setString
(
PactCompiler
.
HINT_LOCAL_STRATEGY
,
strategy
);
inner
=
iteration
.
join
(
smallInput
).
where
(
0
).
equalTo
(
0
).
with
(
new
DummyJoiner
()).
name
(
"DummyJoiner"
).
withParameters
(
joinStrategy
);
}
else
{
inner
=
iteration
.
join
(
smallInput
).
where
(
0
).
equalTo
(
0
).
with
(
new
DummyJoiner
()).
name
(
"DummyJoiner"
);
}
DataSet
<
Tuple3
<
Long
,
Long
,
Long
>>
inner
=
iteration
.
join
(
smallInput
).
where
(
0
).
equalTo
(
0
).
with
(
new
DummyJoiner
()).
name
(
"DummyJoiner"
).
withParameters
(
joinStrategy
);
DataSet
<
Tuple3
<
Long
,
Long
,
Long
>>
output
=
iteration
.
closeWith
(
inner
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录