我是hadoop的新手.我有一个MapReduce作业,应该从Hdfs获取输入并将reducer的输出写入Hbase.我没有找到任何好的例子.
这是代码,运行此示例的错误是map中的Type mismatch,期望ImmutableBytesWritable收到IntWritable.
映射器类
public static class AddValueMapper extends Mapper < LongWritable,
Text, ImmutableBytesWritable, IntWritable > {
/* input <key, line number : value, full line>
* output <key, log key : value >*/
public void map(LongWritable key, Text value,
Context context)throws IOException,
InterruptedException {
byte[] key;
int value, pos = 0;
String line = value.toString();
String p1 , p2 = null;
pos = line.indexOf("=");
//Key part
p1 = line.substring(0, pos);
p1 = p1.trim();
key = Bytes.toBytes(p1);
//Value part
p2 …Run Code Online (Sandbox Code Playgroud) 我正在尝试在Magento中创建一个自定义帮助程序模块,但是当我从页面调用它时出现以下错误:
Warning: include(Mage/SEO/Helper/Data.php) [function.include]: failed to open stream: No such file or directory in /home/strailco/1stclassholidays.com/html/lib/Varien/Autoload.php on line 93
Run Code Online (Sandbox Code Playgroud)
从模板我使用以下来调用帮助程序模块:
<?php echo Mage::helper('SEO')->getFullProductUrl($product); ?>
Run Code Online (Sandbox Code Playgroud)
辅助模块设置在:
/app/code/local/SEO/Fullurl/Helper/Data.php
/app/code/local/SEO/Fullurl/etc/config.xml
Run Code Online (Sandbox Code Playgroud)
Data.php调用函数:
<?php
class getFullProductUrl {
public function getFullProductUrl( $product )
{
}
Run Code Online (Sandbox Code Playgroud)
我的config.xml设置如下:
<?xml version="1.0"?>
<config>
<global>
<helpers>
<SEO>
<class>getFullProductUrl</class>
</SEO>
</helpers>
</global>
</config>
Run Code Online (Sandbox Code Playgroud)
我认为问题是我设置config.xml的方式,但我正在努力找出正确的方法.
我会非常感谢你能给予的任何帮助.我已经在这方面工作了几天但是无法让它工作.
非常感谢
贾森