Win7中使用Eclipse连接虚拟机中的Ubuntu中的Hadoop2.4<3>
2020-12-13 02:20
标签:c style class blog code java Win7中使用Eclipse连接虚拟机中的Ubuntu中的Hadoop2.4<3>,搜素材,soscw.com Win7中使用Eclipse连接虚拟机中的Ubuntu中的Hadoop2.4<3> 标签:c style class blog code java 原文地址:http://www.cnblogs.com/mengfanrong/p/3763413.html
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.mapreduce.lib.db.DBWritable;
public class DBRecoder implements Writable, DBWritable{
String test;
int id;
@Override
public void write(DataOutput out) throws IOException {
out.writeUTF(test);
out.writeInt(id);
}
@Override
public void readFields(DataInput in) throws IOException {
test = in.readUTF();
id = in.readInt();
}
@Override
public void readFields(ResultSet arg0) throws SQLException {
test = arg0.getString("test");
id = arg0.getInt("id");
}
@Override
public void write(PreparedStatement arg0) throws SQLException {
arg0.setString(1, test);
arg0.setInt(2, id);
}
}
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.db.DBConfiguration;
import org.apache.hadoop.mapreduce.lib.db.DBInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.util.GenericOptionsParser;
public class DataCountTest {
public static class TokenizerMapper extends Mapper
--------------------------------------------------------------------------------------------------
上一篇:web.xml权限配置
下一篇:网站里有第三方效果信息
文章标题:Win7中使用Eclipse连接虚拟机中的Ubuntu中的Hadoop2.4&lt;3&gt;
文章链接:http://soscw.com/essay/25387.html