Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
b59e9b53
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,发现更多精彩内容 >>
提交
b59e9b53
编写于
5月 06, 2014
作者:
S
StephanEwen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add modifications to hadoop compatibility package as required for parquet testing.
上级
0685ca1f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
6 deletion
+13
-6
stratosphere-addons/hadoop-compatibility/src/main/java/eu/stratosphere/hadoopcompatibility/HadoopInputSplitWrapper.java
...tosphere/hadoopcompatibility/HadoopInputSplitWrapper.java
+4
-2
stratosphere-addons/hadoop-compatibility/src/main/java/eu/stratosphere/hadoopcompatibility/datatypes/DefaultHadoopTypeConverter.java
...opcompatibility/datatypes/DefaultHadoopTypeConverter.java
+8
-4
stratosphere-addons/hadoop-compatibility/src/main/java/eu/stratosphere/hadoopcompatibility/datatypes/DefaultStratosphereTypeConverter.java
...atibility/datatypes/DefaultStratosphereTypeConverter.java
+1
-0
未找到文件。
stratosphere-addons/hadoop-compatibility/src/main/java/eu/stratosphere/hadoopcompatibility/HadoopInputSplitWrapper.java
浏览文件 @
b59e9b53
...
@@ -60,9 +60,11 @@ public class HadoopInputSplitWrapper implements InputSplit {
...
@@ -60,9 +60,11 @@ public class HadoopInputSplitWrapper implements InputSplit {
this
.
hadoopInputSplitTypeName
=
in
.
readUTF
();
this
.
hadoopInputSplitTypeName
=
in
.
readUTF
();
if
(
hadoopInputSplit
==
null
)
{
if
(
hadoopInputSplit
==
null
)
{
try
{
try
{
Class
inputSplit
=
Class
.
forName
(
hadoopInputSplitTypeName
);
Class
<?
extends
org
.
apache
.
hadoop
.
io
.
Writable
>
inputSplit
=
Class
.
forName
(
hadoopInputSplitTypeName
).
asSubclass
(
org
.
apache
.
hadoop
.
io
.
Writable
.
class
);
this
.
hadoopInputSplit
=
(
org
.
apache
.
hadoop
.
mapred
.
InputSplit
)
WritableFactories
.
newInstance
(
inputSplit
);
this
.
hadoopInputSplit
=
(
org
.
apache
.
hadoop
.
mapred
.
InputSplit
)
WritableFactories
.
newInstance
(
inputSplit
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"Unable to create InputSplit"
,
e
);
throw
new
RuntimeException
(
"Unable to create InputSplit"
,
e
);
}
}
}
}
...
...
stratosphere-addons/hadoop-compatibility/src/main/java/eu/stratosphere/hadoopcompatibility/datatypes/DefaultHadoopTypeConverter.java
浏览文件 @
b59e9b53
...
@@ -19,6 +19,7 @@ import org.apache.hadoop.io.DoubleWritable;
...
@@ -19,6 +19,7 @@ import org.apache.hadoop.io.DoubleWritable;
import
org.apache.hadoop.io.FloatWritable
;
import
org.apache.hadoop.io.FloatWritable
;
import
org.apache.hadoop.io.IntWritable
;
import
org.apache.hadoop.io.IntWritable
;
import
org.apache.hadoop.io.LongWritable
;
import
org.apache.hadoop.io.LongWritable
;
import
org.apache.hadoop.io.NullWritable
;
import
org.apache.hadoop.io.Text
;
import
org.apache.hadoop.io.Text
;
import
eu.stratosphere.types.BooleanValue
;
import
eu.stratosphere.types.BooleanValue
;
...
@@ -27,6 +28,7 @@ import eu.stratosphere.types.DoubleValue;
...
@@ -27,6 +28,7 @@ import eu.stratosphere.types.DoubleValue;
import
eu.stratosphere.types.FloatValue
;
import
eu.stratosphere.types.FloatValue
;
import
eu.stratosphere.types.IntValue
;
import
eu.stratosphere.types.IntValue
;
import
eu.stratosphere.types.LongValue
;
import
eu.stratosphere.types.LongValue
;
import
eu.stratosphere.types.NullValue
;
import
eu.stratosphere.types.Record
;
import
eu.stratosphere.types.Record
;
import
eu.stratosphere.types.StringValue
;
import
eu.stratosphere.types.StringValue
;
import
eu.stratosphere.types.Value
;
import
eu.stratosphere.types.Value
;
...
@@ -35,18 +37,17 @@ import eu.stratosphere.types.Value;
...
@@ -35,18 +37,17 @@ import eu.stratosphere.types.Value;
/**
/**
* Converter for the default hadoop writables.
* Converter for the default hadoop writables.
* Key will be in field 0, Value in field 1 of a Stratosphere Record.
* Key will be in field 0, Value in field 1 of a Stratosphere Record.
*
*/
*/
public
class
DefaultHadoopTypeConverter
<
K
,
V
>
implements
HadoopTypeConverter
<
K
,
V
>
{
public
class
DefaultHadoopTypeConverter
<
K
,
V
>
implements
HadoopTypeConverter
<
K
,
V
>
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@Override
@Override
public
void
convert
(
Record
stratosphereRecord
,
K
hadoopKey
,
V
hadoopValue
)
{
public
void
convert
(
Record
stratosphereRecord
,
K
hadoopKey
,
V
hadoopValue
)
{
stratosphereRecord
.
setField
(
0
,
convert
(
hadoopKey
));
stratosphereRecord
.
setField
(
0
,
convert
(
hadoopKey
));
stratosphereRecord
.
setField
(
1
,
convert
(
hadoopValue
));
stratosphereRecord
.
setField
(
1
,
convert
(
hadoopValue
));
}
}
pr
ivate
Value
convert
(
Object
hadoopType
)
{
pr
otected
Value
convert
(
Object
hadoopType
)
{
if
(
hadoopType
instanceof
org
.
apache
.
hadoop
.
io
.
LongWritable
)
{
if
(
hadoopType
instanceof
org
.
apache
.
hadoop
.
io
.
LongWritable
)
{
return
new
LongValue
(((
LongWritable
)
hadoopType
).
get
());
return
new
LongValue
(((
LongWritable
)
hadoopType
).
get
());
}
}
...
@@ -68,6 +69,9 @@ public class DefaultHadoopTypeConverter<K, V> implements HadoopTypeConverter<K,
...
@@ -68,6 +69,9 @@ public class DefaultHadoopTypeConverter<K, V> implements HadoopTypeConverter<K,
if
(
hadoopType
instanceof
org
.
apache
.
hadoop
.
io
.
ByteWritable
)
{
if
(
hadoopType
instanceof
org
.
apache
.
hadoop
.
io
.
ByteWritable
)
{
return
new
ByteValue
(((
ByteWritable
)
hadoopType
).
get
());
return
new
ByteValue
(((
ByteWritable
)
hadoopType
).
get
());
}
}
if
(
hadoopType
instanceof
NullWritable
)
{
return
NullValue
.
getInstance
();
}
throw
new
RuntimeException
(
"Unable to convert Hadoop type ("
+
hadoopType
.
getClass
().
getCanonicalName
()+
") to Stratosphere."
);
throw
new
RuntimeException
(
"Unable to convert Hadoop type ("
+
hadoopType
.
getClass
().
getCanonicalName
()+
") to Stratosphere."
);
}
}
...
...
stratosphere-addons/hadoop-compatibility/src/main/java/eu/stratosphere/hadoopcompatibility/datatypes/DefaultStratosphereTypeConverter.java
浏览文件 @
b59e9b53
...
@@ -54,6 +54,7 @@ public class DefaultStratosphereTypeConverter<K,V> implements StratosphereTypeCo
...
@@ -54,6 +54,7 @@ public class DefaultStratosphereTypeConverter<K,V> implements StratosphereTypeCo
return
convert
(
stratosphereRecord
,
1
,
this
.
valueClass
);
return
convert
(
stratosphereRecord
,
1
,
this
.
valueClass
);
}
}
@SuppressWarnings
(
"unchecked"
)
private
<
T
>
T
convert
(
Record
stratosphereType
,
int
pos
,
Class
<
T
>
hadoopType
)
{
private
<
T
>
T
convert
(
Record
stratosphereType
,
int
pos
,
Class
<
T
>
hadoopType
)
{
if
(
hadoopType
==
LongWritable
.
class
)
{
if
(
hadoopType
==
LongWritable
.
class
)
{
return
(
T
)
new
LongWritable
((
stratosphereType
.
getField
(
pos
,
LongValue
.
class
)).
getValue
());
return
(
T
)
new
LongWritable
((
stratosphereType
.
getField
(
pos
,
LongValue
.
class
)).
getValue
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录