Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
586f8181
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,发现更多精彩内容 >>
提交
586f8181
编写于
1月 18, 2017
作者:
U
Ufuk Celebi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "[FLINK-2608] Updated Twitter Chill version."
This reverts commit
0d3ff88b
.
上级
8fddae8d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
216 deletion
+16
-216
flink-runtime/pom.xml
flink-runtime/pom.xml
+0
-13
flink-tests/src/test/java/org/apache/flink/test/javaApiOperators/util/CollectionDataSets.java
.../flink/test/javaApiOperators/util/CollectionDataSets.java
+15
-17
flink-tests/src/test/java/org/apache/flink/test/runtime/kryo/KryoCollectionsSerializerTest.java
...link/test/runtime/kryo/KryoCollectionsSerializerTest.java
+0
-185
pom.xml
pom.xml
+1
-1
未找到文件。
flink-runtime/pom.xml
浏览文件 @
586f8181
...
...
@@ -154,19 +154,6 @@ under the License.
<groupId>
com.twitter
</groupId>
<artifactId>
chill_${scala.binary.version}
</artifactId>
<version>
${chill.version}
</version>
<exclusions>
<!-- Exclude Kryo dependency from Chill -->
<exclusion>
<groupId>
com.esotericsoftware
</groupId>
<artifactId>
kryo-shaded
</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Include our own version of Kryo -->
<dependency>
<groupId>
com.esotericsoftware.kryo
</groupId>
<artifactId>
kryo
</artifactId>
</dependency>
<dependency>
...
...
flink-tests/src/test/java/org/apache/flink/test/javaApiOperators/util/CollectionDataSets.java
浏览文件 @
586f8181
...
...
@@ -23,8 +23,6 @@ import java.io.Serializable;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.Date
;
...
...
@@ -48,10 +46,10 @@ import scala.math.BigInt;
/**
* #######################################################################################################
*
* BE AWARE THAT OTHER TESTS DEPEND ON THIS TEST DATA.
*
* BE AWARE THAT OTHER TESTS DEPEND ON THIS TEST DATA.
* IF YOU MODIFY THE DATA MAKE SURE YOU CHECK THAT ALL TESTS ARE STILL WORKING!
*
*
* #######################################################################################################
*/
public
class
CollectionDataSets
{
...
...
@@ -203,7 +201,7 @@ public class CollectionDataSets {
return
env
.
fromCollection
(
data
,
type
);
}
public
static
DataSet
<
Tuple2
<
byte
[],
Integer
>>
getTuple2WithByteArrayDataSet
(
ExecutionEnvironment
env
)
{
List
<
Tuple2
<
byte
[],
Integer
>>
data
=
new
ArrayList
<>();
data
.
add
(
new
Tuple2
<>(
new
byte
[]{
0
,
4
},
1
));
...
...
@@ -212,12 +210,12 @@ public class CollectionDataSets {
data
.
add
(
new
Tuple2
<>(
new
byte
[]{
2
,
1
},
3
));
data
.
add
(
new
Tuple2
<>(
new
byte
[]{
0
},
0
));
data
.
add
(
new
Tuple2
<>(
new
byte
[]{
2
,
0
},
1
));
TupleTypeInfo
<
Tuple2
<
byte
[],
Integer
>>
type
=
new
TupleTypeInfo
<>(
PrimitiveArrayTypeInfo
.
BYTE_PRIMITIVE_ARRAY_TYPE_INFO
,
BasicTypeInfo
.
INT_TYPE_INFO
);
return
env
.
fromCollection
(
data
,
type
);
}
...
...
@@ -349,13 +347,13 @@ public class CollectionDataSets {
data
.
add
(
new
Tuple7
<>(
3
,
"Third"
,
30
,
300
,
3000L
,
"Three"
,
30000L
));
return
env
.
fromCollection
(
data
);
}
public
static
DataSet
<
Tuple7
<
Long
,
Integer
,
Integer
,
Long
,
String
,
Integer
,
String
>>
getSmallTuplebasedDataSetMatchingPojo
(
ExecutionEnvironment
env
)
{
List
<
Tuple7
<
Long
,
Integer
,
Integer
,
Long
,
String
,
Integer
,
String
>>
data
=
new
ArrayList
<>();
data
.
add
(
new
Tuple7
<>(
10000L
,
10
,
100
,
1000L
,
"One"
,
1
,
"First"
));
data
.
add
(
new
Tuple7
<>(
20000L
,
20
,
200
,
2000L
,
"Two"
,
2
,
"Second"
));
data
.
add
(
new
Tuple7
<>(
30000L
,
30
,
300
,
3000L
,
"Three"
,
3
,
"Third"
));
return
env
.
fromCollection
(
data
);
}
...
...
@@ -612,22 +610,22 @@ public class CollectionDataSets {
public
Date
date
;
public
Category
cat
;
}
public
static
DataSet
<
PojoWithDateAndEnum
>
getPojoWithDateAndEnum
(
ExecutionEnvironment
env
)
{
List
<
PojoWithDateAndEnum
>
data
=
new
ArrayList
<>();
PojoWithDateAndEnum
one
=
new
PojoWithDateAndEnum
();
one
.
group
=
"a"
;
one
.
date
=
new
Date
(
666
);
one
.
cat
=
Category
.
CAT_A
;
data
.
add
(
one
);
PojoWithDateAndEnum
two
=
new
PojoWithDateAndEnum
();
two
.
group
=
"a"
;
two
.
date
=
new
Date
(
666
);
two
.
cat
=
Category
.
CAT_A
;
data
.
add
(
two
);
PojoWithDateAndEnum
three
=
new
PojoWithDateAndEnum
();
three
.
group
=
"b"
;
three
.
date
=
new
Date
(
666
);
three
.
cat
=
Category
.
CAT_B
;
data
.
add
(
three
);
return
env
.
fromCollection
(
data
);
}
...
...
@@ -695,7 +693,7 @@ public class CollectionDataSets {
pwc1
.
bigInt
=
BigInteger
.
valueOf
(
Long
.
MAX_VALUE
).
multiply
(
BigInteger
.
TEN
);
pwc1
.
scalaBigInt
=
BigInt
.
int2bigInt
(
10
);
pwc1
.
bigDecimalKeepItNull
=
null
;
// use calendar to make it stable across time zones
GregorianCalendar
gcl1
=
new
GregorianCalendar
(
2033
,
4
,
18
);
pwc1
.
sqlDate
=
new
java
.
sql
.
Date
(
gcl1
.
getTimeInMillis
());
...
...
@@ -712,7 +710,7 @@ public class CollectionDataSets {
pwc2
.
bigInt
=
BigInteger
.
valueOf
(
Long
.
MAX_VALUE
).
multiply
(
BigInteger
.
TEN
);
pwc2
.
scalaBigInt
=
BigInt
.
int2bigInt
(
31104000
);
pwc2
.
bigDecimalKeepItNull
=
null
;
GregorianCalendar
gcl2
=
new
GregorianCalendar
(
1976
,
4
,
3
);
pwc2
.
sqlDate
=
new
java
.
sql
.
Date
(
gcl2
.
getTimeInMillis
());
// 1976
...
...
flink-tests/src/test/java/org/apache/flink/test/runtime/kryo/KryoCollectionsSerializerTest.java
已删除
100644 → 0
浏览文件 @
8fddae8d
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.flink.test.runtime.kryo
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
static
org
.
junit
.
Assert
.
fail
;
import
com.esotericsoftware.kryo.Kryo
;
import
org.apache.flink.api.common.ExecutionConfig
;
import
org.apache.flink.api.common.typeutils.ComparatorTestBase
;
import
org.apache.flink.api.common.typeutils.TypeSerializer
;
import
org.apache.flink.api.java.typeutils.runtime.AbstractGenericTypeSerializerTest
;
import
org.apache.flink.api.java.typeutils.runtime.TestDataOutputSerializer
;
import
org.apache.flink.api.java.typeutils.runtime.kryo.KryoSerializer
;
import
org.junit.Test
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.HashSet
;
import
java.util.LinkedList
;
import
java.util.Random
;
import
java.util.Set
;
@SuppressWarnings
(
"unchecked"
)
public
class
KryoCollectionsSerializerTest
extends
AbstractGenericTypeSerializerTest
{
private
ExecutionConfig
ec
=
new
ExecutionConfig
();
@Test
public
void
testJavaList
(){
Collection
<
Integer
>
a
=
new
ArrayList
<>();
fillCollection
(
a
);
runTests
(
a
);
}
@Test
public
void
testJavaSet
(){
Collection
<
Integer
>
b
=
new
HashSet
<>();
fillCollection
(
b
);
runTests
(
b
);
}
@Test
public
void
testJavaDequeue
(){
Collection
<
Integer
>
c
=
new
LinkedList
<>();
fillCollection
(
c
);
runTests
(
c
);
}
@Test
public
void
testJavaArraysAsList
(){
Collection
<
Integer
>
a
=
Arrays
.
asList
(
42
,
1337
,
49
,
1
);
runTests
(
a
);
}
@Test
public
void
testJavaUnmodifiableSet
(){
Set
<
Integer
>
b
=
new
HashSet
<>();
fillCollection
(
b
);
runTests
(
Collections
.
unmodifiableSet
(
b
));
}
@Test
public
void
testJavaSingletonList
(){
Collection
<
Integer
>
c
=
Collections
.
singletonList
(
42
);
runTests
(
c
);
}
private
void
fillCollection
(
Collection
<
Integer
>
coll
)
{
coll
.
add
(
42
);
coll
.
add
(
1337
);
coll
.
add
(
49
);
coll
.
add
(
1
);
}
@Override
protected
<
T
>
TypeSerializer
<
T
>
createSerializer
(
Class
<
T
>
type
)
{
return
new
KryoSerializer
<
T
>(
type
,
ec
);
}
/**
* Make sure that the kryo serializer forwards EOF exceptions properly when serializing
*/
@Test
public
void
testForwardEOFExceptionWhileSerializing
()
{
try
{
// construct a long string
String
str
;
{
char
[]
charData
=
new
char
[
40000
];
Random
rnd
=
new
Random
();
for
(
int
i
=
0
;
i
<
charData
.
length
;
i
++)
{
charData
[
i
]
=
(
char
)
rnd
.
nextInt
(
10000
);
}
str
=
new
String
(
charData
);
}
// construct a memory target that is too small for the string
TestDataOutputSerializer
target
=
new
TestDataOutputSerializer
(
10000
,
30000
);
KryoSerializer
<
String
>
serializer
=
new
KryoSerializer
<
String
>(
String
.
class
,
new
ExecutionConfig
());
try
{
serializer
.
serialize
(
str
,
target
);
fail
(
"should throw a java.io.EOFException"
);
}
catch
(
java
.
io
.
EOFException
e
)
{
// that is how we like it
}
catch
(
Exception
e
)
{
fail
(
"throws wrong exception: should throw a java.io.EOFException, has thrown a "
+
e
.
getClass
().
getName
());
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
fail
(
e
.
getMessage
());
}
}
/**
* Make sure that the kryo serializer forwards EOF exceptions properly when serializing
*/
@Test
public
void
testForwardEOFExceptionWhileDeserializing
()
{
try
{
int
numElements
=
100
;
// construct a memory target that is too small for the string
TestDataOutputSerializer
target
=
new
TestDataOutputSerializer
(
5
*
numElements
,
5
*
numElements
);
KryoSerializer
<
Integer
>
serializer
=
new
KryoSerializer
<>(
Integer
.
class
,
new
ExecutionConfig
());
for
(
int
i
=
0
;
i
<
numElements
;
i
++){
serializer
.
serialize
(
i
,
target
);
}
ComparatorTestBase
.
TestInputView
source
=
new
ComparatorTestBase
.
TestInputView
(
target
.
copyByteBuffer
());
for
(
int
i
=
0
;
i
<
numElements
;
i
++){
int
value
=
serializer
.
deserialize
(
source
);
assertEquals
(
i
,
value
);
}
try
{
serializer
.
deserialize
(
source
);
fail
(
"should throw a java.io.EOFException"
);
}
catch
(
java
.
io
.
EOFException
e
)
{
// that is how we like it :-)
}
catch
(
Exception
e
)
{
fail
(
"throws wrong exception: should throw a java.io.EOFException, has thrown a "
+
e
.
getClass
().
getName
());
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
fail
(
e
.
getMessage
());
}
}
@Test
public
void
validateReferenceMappingEnabled
()
{
KryoSerializer
<
String
>
serializer
=
new
KryoSerializer
<>(
String
.
class
,
new
ExecutionConfig
());
Kryo
kryo
=
serializer
.
getKryo
();
assertTrue
(
kryo
.
getReferences
());
}
}
pom.xml
浏览文件 @
586f8181
...
...
@@ -98,7 +98,7 @@ under the License.
<!-- Default scala versions, may be overwritten by build profiles -->
<scala.version>
2.10.4
</scala.version>
<scala.binary.version>
2.10
</scala.binary.version>
<chill.version>
0.
8.1
</chill.version>
<chill.version>
0.
7.4
</chill.version>
<asm.version>
5.0.4
</asm.version>
<zookeeper.version>
3.4.6
</zookeeper.version>
<curator.version>
2.8.0
</curator.version>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录