0

我正在开发一个hadoop应用程序。现在我想将它迁移到一个 spring-hadoop 项目中。事情在我的 mapreduce 工作中。我正在使用 HCatalog API 中的 MultiOutputFormat,因为我想将信息存储在多个表上。而且我找不到任何示例或文档说明如何在 Spring hadoop 中进行配置。

谁能告诉我该怎么做或给我一些参考资料?太谢谢了。

我正在开发一个hadoop应用程序。现在我想将它迁移到一个 spring-hadoop 项目中。事情在我的 mapreduce 工作中。我正在使用 HCatalog API 中的 MultiOutputFormat,因为我想将信息存储在多个表上。而且我找不到任何示例或文档说明如何在 Spring hadoop 中进行配置。

谁能告诉我该怎么做或给我一些参考资料?太谢谢了。

@Thomas Risberg 嗨,Thomas,感谢您的回复。我知道在spring hadoop中我们只需要在相应的xml文件中进行作业配置即可。目前,在我的应用程序中,在设置工作时,我有如下代码:

ArrayList<OutputJobInfo> tableList = new ArrayList<OutputJobInfo>();
tableList.add(OutputJobInfo.create("database", "request",
partitionValuesRequest));
tableList.add(OutputJobInfo.create("database", "requestdetail",
                partitionValues));
tableList.add(OutputJobInfo.create("database", "jobInfo",
                partitionValues));

List<HCatFieldSchema> requestSchemaList = new ArrayList<HCatFieldSchema>();
requestSchemaList .add(new HCatFieldSchema("type", Type.STRING,
                null));
requestSchemaList .add(new HCatFieldSchema("samplesize",
                Type.INT, null));
requestSchemaList .add(new HCatFieldSchema("userid",
                Type.SMALLINT, null));
configurer.addOutputFormat("request", HCatOutputFormat.class,
                BytesWritable.class, HCatRecord.class);
HCatOutputFormat.setOutput(configurer.getJob("request"),
                tableList.get(0));
HCatOutputFormat.setSchema(configurer.getJob("request"),
                new HCatSchema(requestSchemaList));
......
configurer.configure();

这是为了让我将信息存储在减速器内的相关表中。所以我的问题是如何在 Spring-hadoop 中为 MultiOutputFormat 做相应的配置?我检查了 spring-hadoop.xsd。找不到任何相关的标签。

4

0 回答 0