Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
3b5ec860
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,发现更多精彩内容 >>
提交
3b5ec860
编写于
7月 14, 2014
作者:
M
Márton Balassi
提交者:
Stephan Ewen
8月 18, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[streaming] StreamRecord documentation update1
上级
e2a2a49f
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
332 addition
and
150 deletion
+332
-150
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/streamcomponent/StreamComponentHelper.java
.../streaming/api/streamcomponent/StreamComponentHelper.java
+2
-2
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/streamrecord/NoSuchTupleException.java
...here/streaming/api/streamrecord/NoSuchTupleException.java
+1
-1
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/streamrecord/StreamRecord.java
...stratosphere/streaming/api/streamrecord/StreamRecord.java
+316
-134
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/streamrecord/TupleSizeMismatchException.java
...treaming/api/streamrecord/TupleSizeMismatchException.java
+1
-1
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/examples/batch/wordcount/BatchWordCountSplitter.java
...ming/examples/batch/wordcount/BatchWordCountSplitter.java
+1
-1
flink-addons/flink-streaming/src/test/java/eu/stratosphere/streaming/api/streamrecord/StreamRecordTest.java
...tosphere/streaming/api/streamrecord/StreamRecordTest.java
+11
-11
未找到文件。
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/streamcomponent/StreamComponentHelper.java
浏览文件 @
3b5ec860
...
...
@@ -33,7 +33,7 @@ import eu.stratosphere.streaming.api.invokable.DefaultSinkInvokable;
import
eu.stratosphere.streaming.api.invokable.DefaultTaskInvokable
;
import
eu.stratosphere.streaming.api.invokable.RecordInvokable
;
import
eu.stratosphere.streaming.api.invokable.UserSinkInvokable
;
import
eu.stratosphere.streaming.api.streamrecord.
Record
SizeMismatchException
;
import
eu.stratosphere.streaming.api.streamrecord.
Tuple
SizeMismatchException
;
import
eu.stratosphere.streaming.api.streamrecord.StreamRecord
;
import
eu.stratosphere.streaming.faulttolerance.AckEvent
;
import
eu.stratosphere.streaming.faulttolerance.AckEventListener
;
...
...
@@ -201,7 +201,7 @@ public final class StreamComponentHelper<T extends AbstractInvokable> {
threadSafePublish
(
new
AckEvent
(
id
),
input
);
log
.
debug
(
"ACK: "
+
id
+
" -- "
+
name
);
// TODO: write an exception class to throw forward
}
catch
(
Record
SizeMismatchException
e
)
{
}
catch
(
Tuple
SizeMismatchException
e
)
{
throw
(
e
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/streamrecord/NoSuch
Record
Exception.java
→
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/streamrecord/NoSuch
Tuple
Exception.java
浏览文件 @
3b5ec860
...
...
@@ -15,7 +15,7 @@
package
eu.stratosphere.streaming.api.streamrecord
;
public
class
NoSuch
Record
Exception
extends
StreamRecordException
{
public
class
NoSuch
Tuple
Exception
extends
StreamRecordException
{
private
static
final
long
serialVersionUID
=
4935457355434561574L
;
...
...
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/streamrecord/StreamRecord.java
浏览文件 @
3b5ec860
此差异已折叠。
点击以展开。
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/streamrecord/
Record
SizeMismatchException.java
→
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/api/streamrecord/
Tuple
SizeMismatchException.java
浏览文件 @
3b5ec860
...
...
@@ -13,7 +13,7 @@
package
eu.stratosphere.streaming.api.streamrecord
;
public
class
Record
SizeMismatchException
extends
StreamRecordException
{
public
class
Tuple
SizeMismatchException
extends
StreamRecordException
{
/**
* Serial version UID for serialization interoperability.
...
...
flink-addons/flink-streaming/src/main/java/eu/stratosphere/streaming/examples/batch/wordcount/BatchWordCountSplitter.java
浏览文件 @
3b5ec860
...
...
@@ -31,7 +31,7 @@ public class BatchWordCountSplitter extends UserTaskInvokable {
@Override
public
void
invoke
(
StreamRecord
record
)
throws
Exception
{
int
numberOfRecords
=
record
.
getNumOf
Record
s
();
int
numberOfRecords
=
record
.
getNumOf
Tuple
s
();
for
(
int
i
=
0
;
i
<
numberOfRecords
;
++
i
)
{
words
=
record
.
getString
(
0
).
split
(
" "
);
timestamp
=
record
.
getLong
(
1
);
...
...
flink-addons/flink-streaming/src/test/java/eu/stratosphere/streaming/api/streamrecord/StreamRecordTest.java
浏览文件 @
3b5ec860
...
...
@@ -38,7 +38,7 @@ public class StreamRecordTest {
StreamRecord
record
=
new
StreamRecord
(
new
Tuple2
<
String
,
Integer
>(
"Stratosphere"
,
1
));
assertEquals
(
2
,
record
.
getNumOfFields
());
assertEquals
(
1
,
record
.
getNumOf
Record
s
());
assertEquals
(
1
,
record
.
getNumOf
Tuple
s
());
assertEquals
(
"Stratosphere"
,
record
.
getString
(
0
));
assertEquals
((
Integer
)
1
,
record
.
getInteger
(
1
));
...
...
@@ -47,17 +47,17 @@ public class StreamRecordTest {
record
.
setRecord
(
new
Tuple2
<
String
,
Long
>(
"Big Data looks tiny from here."
,
2L
));
assertEquals
(
2
,
record
.
getNumOfFields
());
assertEquals
(
1
,
record
.
getNumOf
Record
s
());
assertEquals
(
1
,
record
.
getNumOf
Tuple
s
());
assertEquals
((
Long
)
2L
,
record
.
getLong
(
1
));
record
.
setRecord
(
new
Tuple2
<
String
,
Boolean
>(
"Big Data looks tiny from here."
,
true
));
assertEquals
(
2
,
record
.
getNumOfFields
());
assertEquals
(
1
,
record
.
getNumOf
Record
s
());
assertEquals
(
1
,
record
.
getNumOf
Tuple
s
());
assertEquals
(
true
,
record
.
getBoolean
(
1
));
record
.
setRecord
(
new
Tuple2
<
String
,
Double
>(
"Big Data looks tiny from here."
,
2.5
));
assertEquals
(
2
,
record
.
getNumOfFields
());
assertEquals
(
1
,
record
.
getNumOf
Record
s
());
assertEquals
(
1
,
record
.
getNumOf
Tuple
s
());
assertEquals
((
Double
)
2.5
,
record
.
getDouble
(
1
));
Tuple2
<
String
,
Double
>
tuple
=
new
Tuple2
<
String
,
Double
>();
...
...
@@ -80,11 +80,11 @@ public class StreamRecordTest {
try
{
record
.
addRecord
(
new
Tuple1
<
String
>(
"4"
));
fail
();
}
catch
(
Record
SizeMismatchException
e
)
{
}
catch
(
Tuple
SizeMismatchException
e
)
{
}
assertEquals
(
2
,
record
.
getNumOfFields
());
assertEquals
(
2
,
record
.
getNumOf
Record
s
());
assertEquals
(
2
,
record
.
getNumOf
Tuple
s
());
assertEquals
((
Integer
)
1
,
record
.
getInteger
(
0
,
0
));
assertEquals
((
Integer
)
2
,
record
.
getInteger
(
1
,
1
));
...
...
@@ -92,7 +92,7 @@ public class StreamRecordTest {
assertEquals
(-
1
,
record
.
getField
(
1
,
0
));
assertEquals
(
2
,
record
.
getNumOfFields
());
assertEquals
(
2
,
record
.
getNumOf
Record
s
());
assertEquals
(
2
,
record
.
getNumOf
Tuple
s
());
}
@Test
...
...
@@ -115,20 +115,20 @@ public class StreamRecordTest {
try
{
a
.
setRecord
(
4
,
new
Tuple1
<
String
>(
"Data"
));
fail
();
}
catch
(
NoSuch
Record
Exception
e
)
{
}
catch
(
NoSuch
Tuple
Exception
e
)
{
}
try
{
a
.
setRecord
(
new
Tuple2
<
String
,
String
>(
"Data"
,
"Stratosphere"
));
fail
();
}
catch
(
Record
SizeMismatchException
e
)
{
}
catch
(
Tuple
SizeMismatchException
e
)
{
}
StreamRecord
b
=
new
StreamRecord
();
try
{
b
.
addRecord
(
new
Tuple2
<
String
,
String
>(
"Data"
,
"Stratosphere"
));
fail
();
}
catch
(
Record
SizeMismatchException
e
)
{
}
catch
(
Tuple
SizeMismatchException
e
)
{
}
try
{
...
...
@@ -153,7 +153,7 @@ public class StreamRecordTest {
StreamRecord
newRec
=
new
StreamRecord
();
newRec
.
read
(
in
);
Tuple2
<
Integer
,
String
>
tupleOut
=
(
Tuple2
<
Integer
,
String
>)
newRec
.
get
Record
(
0
);
Tuple2
<
Integer
,
String
>
tupleOut
=
(
Tuple2
<
Integer
,
String
>)
newRec
.
get
Tuple
(
0
);
assertEquals
(
tupleOut
.
getField
(
0
),
42
);
}
catch
(
IOException
e
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录