Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
8676280d
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,发现更多精彩内容 >>
提交
8676280d
编写于
3月 16, 2014
作者:
M
mingliang
提交者:
Robert Metzger
4月 25, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change codestyles and clean up
上级
29c322d4
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
48 addition
and
33 deletion
+48
-33
stratosphere-compiler/src/main/java/eu/stratosphere/compiler/plantranslate/NepheleJobGraphGenerator.java
...here/compiler/plantranslate/NepheleJobGraphGenerator.java
+1
-1
stratosphere-core/src/main/java/eu/stratosphere/api/common/Plan.java
...e-core/src/main/java/eu/stratosphere/api/common/Plan.java
+9
-3
stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/Environment.java
...n/java/eu/stratosphere/nephele/execution/Environment.java
+1
-1
stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/RuntimeEnvironment.java
...eu/stratosphere/nephele/execution/RuntimeEnvironment.java
+11
-3
stratosphere-runtime/src/main/java/eu/stratosphere/nephele/taskmanager/TaskManager.java
...java/eu/stratosphere/nephele/taskmanager/TaskManager.java
+14
-2
stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/task/RegularPactTask.java
...va/eu/stratosphere/pact/runtime/task/RegularPactTask.java
+1
-1
stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/task/chaining/ChainedDriver.java
...tratosphere/pact/runtime/task/chaining/ChainedDriver.java
+1
-1
stratosphere-runtime/src/test/java/eu/stratosphere/pact/runtime/test/util/MockEnvironment.java
.../stratosphere/pact/runtime/test/util/MockEnvironment.java
+1
-1
stratosphere-tests/src/test/java/eu/stratosphere/test/distributedCache/DistributedCacheTest.java
...atosphere/test/distributedCache/DistributedCacheTest.java
+9
-20
未找到文件。
stratosphere-compiler/src/main/java/eu/stratosphere/compiler/plantranslate/NepheleJobGraphGenerator.java
浏览文件 @
8676280d
...
...
@@ -205,7 +205,7 @@ public class NepheleJobGraphGenerator implements Visitor<PlanNode> {
}
// add registered cache file into job configuration
for
(
Entry
<
String
,
String
>
e:
program
.
getOriginalPactPlan
().
getCachedFile
())
{
for
(
Entry
<
String
,
String
>
e:
program
.
getOriginalPactPlan
().
getCachedFile
s
())
{
DistributedCache
.
addCachedFile
(
e
.
getKey
(),
e
.
getValue
(),
this
.
jobGraph
.
getJobConfiguration
());
}
JobGraph
graph
=
this
.
jobGraph
;
...
...
stratosphere-core/src/main/java/eu/stratosphere/api/common/Plan.java
浏览文件 @
8676280d
...
...
@@ -57,6 +57,8 @@ public class Plan implements Visitable<Operator> {
*/
protected
int
maxNumberMachines
;
protected
HashMap
<
String
,
String
>
cacheFile
=
new
HashMap
<
String
,
String
>();
// ------------------------------------------------------------------------
/**
...
...
@@ -293,15 +295,19 @@ public class Plan implements Visitable<Operator> {
* @param filePath The files must be stored in a place that can be accessed from all workers (most commonly HDFS)
* @param name user defined name of that file
*/
public
void
registerCachedFile
(
String
filePath
,
String
name
)
{
this
.
cacheFile
.
put
(
name
,
filePath
);
public
void
registerCachedFile
(
String
filePath
,
String
name
)
throws
RuntimeException
{
if
(!
this
.
cacheFile
.
containsKey
(
name
))
{
this
.
cacheFile
.
put
(
name
,
filePath
);
}
else
{
throw
new
RuntimeException
(
"cache file "
+
name
+
"already exists!"
);
}
}
/**
* return the registered caches files
* @return Set of (name, filePath) pairs
*/
public
Set
<
Entry
<
String
,
String
>>
getCachedFile
()
{
public
Set
<
Entry
<
String
,
String
>>
getCachedFile
s
()
{
return
this
.
cacheFile
.
entrySet
();
}
}
stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/Environment.java
浏览文件 @
8676280d
...
...
@@ -256,5 +256,5 @@ public interface Environment {
*/
AccumulatorProtocol
getAccumulatorProtocolProxy
();
Map
<
String
,
FutureTask
<
Path
>>
getCopyTask
OfCacheFile
();
Map
<
String
,
FutureTask
<
Path
>>
getCopyTask
();
}
stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/RuntimeEnvironment.java
浏览文件 @
8676280d
...
...
@@ -14,7 +14,15 @@
package
eu.stratosphere.nephele.execution
;
import
java.io.IOException
;
import
java.util.*
;
import
java.util.ArrayDeque
;
import
java.util.Collections
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Queue
;
import
java.util.Set
;
import
java.util.Map
;
import
java.util.HashMap
;
import
java.util.concurrent.CopyOnWriteArrayList
;
import
java.util.concurrent.FutureTask
;
...
...
@@ -849,11 +857,11 @@ public class RuntimeEnvironment implements Environment, Runnable {
return
accumulatorProtocolProxy
;
}
public
void
setCopyTaskOf
CacheFile
(
String
name
,
FutureTask
<
Path
>
copyTask
)
{
public
void
addCopyTaskFor
CacheFile
(
String
name
,
FutureTask
<
Path
>
copyTask
)
{
this
.
cacheCopyTasks
.
put
(
name
,
copyTask
);
}
@Override
public
Map
<
String
,
FutureTask
<
Path
>>
getCopyTask
OfCacheFile
()
{
public
Map
<
String
,
FutureTask
<
Path
>>
getCopyTask
()
{
return
this
.
cacheCopyTasks
;
}
...
...
stratosphere-runtime/src/main/java/eu/stratosphere/nephele/taskmanager/TaskManager.java
浏览文件 @
8676280d
...
...
@@ -22,9 +22,21 @@ import java.net.ServerSocket;
import
java.net.Socket
;
import
java.net.SocketAddress
;
import
java.net.UnknownHostException
;
import
java.util.*
;
import
java.util.concurrent.*
;
import
java.util.ArrayList
;
import
java.util.Enumeration
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.HashMap
;
import
java.util.Map.Entry
;
import
java.util.Set
;
import
java.util.Timer
;
import
java.util.TimerTask
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.FutureTask
;
import
eu.stratosphere.api.common.cache.DistributedCache
;
import
eu.stratosphere.core.fs.Path
;
...
...
stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/task/RegularPactTask.java
浏览文件 @
8676280d
...
...
@@ -1035,7 +1035,7 @@ public class RegularPactTask<S extends Function, OT> extends AbstractTask implem
public
RuntimeUDFContext
createRuntimeContext
(
String
taskName
)
{
Environment
env
=
getEnvironment
();
return
new
RuntimeUDFContext
(
taskName
,
env
.
getCurrentNumberOfSubtasks
(),
env
.
getIndexInSubtaskGroup
(),
env
.
getCopyTask
OfCacheFile
());
return
new
RuntimeUDFContext
(
taskName
,
env
.
getCurrentNumberOfSubtasks
(),
env
.
getIndexInSubtaskGroup
(),
env
.
getCopyTask
());
}
// --------------------------------------------------------------------------------------------
...
...
stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/task/chaining/ChainedDriver.java
浏览文件 @
8676280d
...
...
@@ -53,7 +53,7 @@ public abstract class ChainedDriver<IT, OT> implements Collector<IT> {
this
.
udfContext
=
((
RegularPactTask
<?,
?>)
parent
).
createRuntimeContext
(
taskName
);
}
else
{
Environment
env
=
parent
.
getEnvironment
();
this
.
udfContext
=
new
RuntimeUDFContext
(
taskName
,
env
.
getCurrentNumberOfSubtasks
(),
env
.
getIndexInSubtaskGroup
(),
env
.
getCopyTask
OfCacheFile
());
this
.
udfContext
=
new
RuntimeUDFContext
(
taskName
,
env
.
getCurrentNumberOfSubtasks
(),
env
.
getIndexInSubtaskGroup
(),
env
.
getCopyTask
());
}
setup
(
parent
);
...
...
stratosphere-runtime/src/test/java/eu/stratosphere/pact/runtime/test/util/MockEnvironment.java
浏览文件 @
8676280d
...
...
@@ -275,7 +275,7 @@ public class MockEnvironment implements Environment {
}
@Override
public
Map
<
String
,
FutureTask
<
Path
>>
getCopyTask
OfCacheFile
()
{
public
Map
<
String
,
FutureTask
<
Path
>>
getCopyTask
()
{
return
null
;
}
...
...
stratosphere-tests/src/test/java/eu/stratosphere/test/distributedCache/
d
istributedCacheTest.java
→
stratosphere-tests/src/test/java/eu/stratosphere/test/distributedCache/
D
istributedCacheTest.java
浏览文件 @
8676280d
...
...
@@ -13,17 +13,20 @@ import eu.stratosphere.types.IntValue;
import
eu.stratosphere.types.Record
;
import
eu.stratosphere.types.StringValue
;
import
eu.stratosphere.util.Collector
;
import
org.apache.hadoop.conf.Configuration
;
import
org.apache.hadoop.fs.FileSystem
;
import
org.apache.hadoop.fs.Path
;
import
java.io.*
;
import
java.util.*
;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.FileNotFoundException
;
import
java.io.FileReader
;
import
java.util.HashSet
;
import
java.util.Set
;
/**
* Test the distributed cache via using the cache file to do a selection on the input
*/
public
class
d
istributedCacheTest
extends
TestBase2
{
public
class
D
istributedCacheTest
extends
TestBase2
{
public
static
final
String
cacheData
=
"machen\n"
+
"zeit\n"
+
"heerscharen\n"
+
"keiner\n"
+
"meine\n"
+
"fuehr\n"
+
"triumph\n"
+
"kommst\n"
+
"frei\n"
+
"schaffen\n"
+
"gesinde\n"
...
...
@@ -107,24 +110,10 @@ public class distributedCacheTest extends TestBase2 {
}
public
void
uploadToHDFS
(
String
localFile
)
throws
Exception
{
Configuration
conf
=
new
Configuration
();
conf
.
set
(
"fs.default.name"
,
"hdfs://192.168.2.102:54320"
);
FileSystem
hdfs
=
FileSystem
.
get
(
conf
);
Path
src
=
new
Path
(
localFile
);
Path
dst
=
new
Path
(
"/"
);
hdfs
.
copyFromLocalFile
(
src
,
dst
);
}
@Override
protected
void
preSubmit
()
throws
Exception
{
textPath
=
createTempFile
(
"count.txt"
,
WordCountData
.
COUNTS
);
cachePath
=
createTempFile
(
"cache.txt"
,
cacheData
);
// uploadToHDFS(cachePath);
resultPath
=
getTempDirPath
(
"result"
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录