Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
7d87160e
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,发现更多精彩内容 >>
提交
7d87160e
编写于
7月 14, 2014
作者:
M
Márton Balassi
提交者:
Stephan Ewen
8月 18, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[streaming] Javadoc fix
上级
45e38710
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
47 addition
and
12 deletion
+47
-12
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/JobGraphBuilder.java
...n/java/eu/stratosphere/streaming/api/JobGraphBuilder.java
+7
-1
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/streamrecord/StreamRecord.java
...stratosphere/streaming/api/streamrecord/StreamRecord.java
+40
-11
未找到文件。
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/JobGraphBuilder.java
浏览文件 @
7d87160e
...
...
@@ -97,6 +97,8 @@ public class JobGraphBuilder {
* User defined class describing the source
* @param parallelism
* Number of task instances of this type to run in parallel
* @param subtasksPerInstance
* Number of subtasks allocated to a machine
*/
public
void
setSource
(
String
sourceName
,
final
Class
<?
extends
UserSourceInvokable
>
InvokableClass
,
int
parallelism
,
...
...
@@ -128,6 +130,8 @@ public class JobGraphBuilder {
* User defined class describing the task
* @param parallelism
* Number of task instances of this type to run in parallel
* @param subtasksPerInstance
* Number of subtasks allocated to a machine
*/
public
void
setTask
(
String
taskName
,
final
Class
<?
extends
UserTaskInvokable
>
InvokableClass
,
int
parallelism
,
int
subtasksPerInstance
)
{
...
...
@@ -158,6 +162,8 @@ public class JobGraphBuilder {
* User defined class describing the sink
* @param parallelism
* Number of task instances of this type to run in parallel
* @param subtasksPerInstance
* Number of subtasks allocated to a machine
*/
public
void
setSink
(
String
sinkName
,
final
Class
<?
extends
UserSinkInvokable
>
InvokableClass
,
int
parallelism
,
int
subtasksPerInstance
)
{
...
...
@@ -223,7 +229,7 @@ public class JobGraphBuilder {
public
void
setInstanceSharing
(
String
component1
,
String
component2
)
{
AbstractJobVertex
c1
=
components
.
get
(
component1
);
AbstractJobVertex
c2
=
components
.
get
(
component2
);
c1
.
setVertexToShareInstancesWith
(
c2
);
}
...
...
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/streamrecord/StreamRecord.java
浏览文件 @
7d87160e
...
...
@@ -83,7 +83,8 @@ public class StreamRecord implements IOReadableWritable, Serializable {
/**
* Creates a new empty instance for read
*/
public
StreamRecord
()
{}
public
StreamRecord
()
{
}
/**
* Creates empty StreamRecord with number of fields set
...
...
@@ -111,7 +112,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
this
.
batchSize
=
batchSize
;
tupleBatch
=
new
ArrayList
<
Tuple
>(
batchSize
);
}
public
StreamRecord
(
StreamRecord
record
)
{
this
.
numOfFields
=
record
.
getNumOfFields
();
this
.
numOfTuples
=
0
;
...
...
@@ -150,10 +151,10 @@ public class StreamRecord implements IOReadableWritable, Serializable {
this
(
tuple
,
1
);
}
public
boolean
isEmpty
(){
return
(
this
.
numOfTuples
==
0
);
public
boolean
isEmpty
()
{
return
(
this
.
numOfTuples
==
0
);
}
/**
* @return Number of fields in the tuples
*/
...
...
@@ -508,6 +509,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param o
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setField
(
int
fieldNumber
,
Object
o
)
throws
NoSuchFieldException
{
setField
(
0
,
fieldNumber
,
o
);
...
...
@@ -523,6 +525,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param o
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
// TODO: consider no such tuple exception and interaction with batch size
public
void
setField
(
int
tupleNumber
,
int
fieldNumber
,
Object
o
)
throws
NoSuchFieldException
{
...
...
@@ -542,6 +545,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param b
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setBoolean
(
int
fieldNumber
,
Boolean
b
)
throws
NoSuchFieldException
{
setBoolean
(
0
,
fieldNumber
,
b
);
...
...
@@ -558,6 +562,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param b
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setBoolean
(
int
tupleNumber
,
int
fieldNumber
,
Boolean
b
)
throws
NoSuchFieldException
{
setField
(
tupleNumber
,
fieldNumber
,
b
);
...
...
@@ -571,6 +576,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param b
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setByte
(
int
fieldNumber
,
Byte
b
)
throws
NoSuchFieldException
{
setByte
(
0
,
fieldNumber
,
b
);
...
...
@@ -586,6 +592,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param b
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setByte
(
int
tupleNumber
,
int
fieldNumber
,
Byte
b
)
throws
NoSuchFieldException
{
setField
(
tupleNumber
,
fieldNumber
,
b
);
...
...
@@ -600,6 +607,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param c
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setCharacter
(
int
fieldNumber
,
Character
c
)
throws
NoSuchFieldException
{
setCharacter
(
0
,
fieldNumber
,
c
);
...
...
@@ -616,6 +624,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param c
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setCharacter
(
int
tupleNumber
,
int
fieldNumber
,
Character
c
)
throws
NoSuchFieldException
{
...
...
@@ -630,6 +639,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param d
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setDouble
(
int
fieldNumber
,
Double
d
)
throws
NoSuchFieldException
{
setDouble
(
0
,
fieldNumber
,
d
);
...
...
@@ -646,6 +656,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param d
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setDouble
(
int
tupleNumber
,
int
fieldNumber
,
Double
d
)
throws
NoSuchFieldException
{
setField
(
tupleNumber
,
fieldNumber
,
d
);
...
...
@@ -659,6 +670,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param f
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setFloat
(
int
fieldNumber
,
Float
f
)
throws
NoSuchFieldException
{
setFloat
(
0
,
fieldNumber
,
f
);
...
...
@@ -675,6 +687,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param f
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setFloat
(
int
tupleNumber
,
int
fieldNumber
,
Float
f
)
throws
NoSuchFieldException
{
setField
(
tupleNumber
,
fieldNumber
,
f
);
...
...
@@ -689,6 +702,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param i
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setInteger
(
int
fieldNumber
,
Integer
i
)
throws
NoSuchFieldException
{
setInteger
(
0
,
fieldNumber
,
i
);
...
...
@@ -705,6 +719,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param i
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setInteger
(
int
tupleNumber
,
int
fieldNumber
,
Integer
i
)
throws
NoSuchFieldException
{
setField
(
tupleNumber
,
fieldNumber
,
i
);
...
...
@@ -718,6 +733,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param l
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setLong
(
int
fieldNumber
,
Long
l
)
throws
NoSuchFieldException
{
setLong
(
0
,
fieldNumber
,
l
);
...
...
@@ -733,6 +749,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param l
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setLong
(
int
tupleNumber
,
int
fieldNumber
,
Long
l
)
throws
NoSuchFieldException
{
setField
(
tupleNumber
,
fieldNumber
,
l
);
...
...
@@ -746,6 +763,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param s
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setShort
(
int
fieldNumber
,
Short
s
)
throws
NoSuchFieldException
{
setShort
(
0
,
fieldNumber
,
s
);
...
...
@@ -761,6 +779,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param s
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setShort
(
int
tupleNumber
,
int
fieldNumber
,
Short
s
)
throws
NoSuchFieldException
{
setField
(
tupleNumber
,
fieldNumber
,
s
);
...
...
@@ -774,6 +793,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param str
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setString
(
int
fieldNumber
,
String
str
)
throws
NoSuchFieldException
{
setField
(
0
,
fieldNumber
,
str
);
...
...
@@ -790,6 +810,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param str
* New value
* @throws NoSuchFieldException
* the Tuple does not have this many fields
*/
public
void
setString
(
int
tupleNumber
,
int
fieldNumber
,
String
str
)
throws
NoSuchFieldException
{
setField
(
tupleNumber
,
fieldNumber
,
str
);
...
...
@@ -798,6 +819,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
/**
* @return First tuple of the batch
* @throws NoSuchTupleException
* the StreamRecord does not have this many tuples
*/
public
Tuple
getTuple
()
throws
NoSuchTupleException
{
return
getTuple
(
0
);
...
...
@@ -808,6 +830,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* Position of the record in the batch
* @return Chosen tuple
* @throws NoSuchTupleException
* the Tuple does not have this many fields
*/
public
Tuple
getTuple
(
int
tupleNumber
)
throws
NoSuchTupleException
{
try
{
...
...
@@ -864,7 +887,8 @@ public class StreamRecord implements IOReadableWritable, Serializable {
*
* @param tuple
* Tuple to set
* @throws TupleSizeMismatchException
* @throws NoSuchTupleException
* , TupleSizeMismatchException
*/
public
void
setTuple
(
Tuple
tuple
)
throws
NoSuchTupleException
,
TupleSizeMismatchException
{
setTuple
(
0
,
tuple
);
...
...
@@ -899,6 +923,8 @@ public class StreamRecord implements IOReadableWritable, Serializable {
*
* @param tuple
* Tuple to be added as the next record of the batch
* @throws TupleSizeMismatchException
* Tuple specified has illegal size
*/
public
void
addTuple
(
Tuple
tuple
)
throws
TupleSizeMismatchException
{
addTuple
(
numOfTuples
,
tuple
);
...
...
@@ -912,6 +938,8 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* Position of the added tuple
* @param tuple
* Tuple to be added as the next record of the batch
* @throws TupleSizeMismatchException
* Tuple specified has illegal size
*/
public
void
addTuple
(
int
index
,
Tuple
tuple
)
throws
TupleSizeMismatchException
{
if
(
tuple
.
getArity
()
==
numOfFields
)
{
...
...
@@ -929,6 +957,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* Index of tuple to remove
* @return Removed tuple
* @throws TupleSizeMismatchException
* Tuple specified has illegal size
*/
public
Tuple
removeTuple
(
int
index
)
throws
TupleSizeMismatchException
{
if
(
index
<
numOfTuples
)
{
...
...
@@ -945,6 +974,7 @@ public class StreamRecord implements IOReadableWritable, Serializable {
*
* @return copy of the StreamRecord
* @throws IOException
* Write or read failed
*/
public
StreamRecord
copySerialized
()
throws
IOException
{
ByteArrayOutputStream
buff
=
new
ByteArrayOutputStream
();
...
...
@@ -981,8 +1011,6 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* @param tuple
* Tuple to copy
* @return Copy of the tuple
* @throws IllegalAccessException
* @throws InstantiationException
*/
public
static
Tuple
copyTuple
(
Tuple
tuple
)
{
// TODO: implement deep copy for arrays
...
...
@@ -1041,13 +1069,14 @@ public class StreamRecord implements IOReadableWritable, Serializable {
* copy tuples from the given record and append them to the end.
*
* @param record
* record to be appended
*/
public
void
appendRecord
(
StreamRecord
record
){
for
(
int
i
=
0
;
i
<
record
.
getNumOfTuples
();
++
i
)
{
public
void
appendRecord
(
StreamRecord
record
)
{
for
(
int
i
=
0
;
i
<
record
.
getNumOfTuples
();
++
i
)
{
this
.
addTuple
(
record
.
getTuple
(
i
));
}
}
/**
* Converts tuple field types to a byte array
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录