>rcc
Usage: rcc --language [java|c++] ddl-files
>vim stud.ddl
module com.xschao.bean {
class Stud{
ustring name;
long id;
int age;
ustring time;
}
}
"\"byte\"",
"\"boolean\"",
"\"int\"",
"\"long\"",
"\"float\"",
"\"double\"",
"\"ustring\"",
"\"buffer\"",
"\"vector\"",
"\"map\"",
> rcc --language java stud.ddl
>tree
.
|-- com
| `-- xschao
| `-- bean
| `-- Stud.java
|-- command_example.sh
`-- stud.ddl
3 directories, 3 files
// File generated by hadoop record compiler. Do not edit.
package com.xschao.bean;
public class Stud extends org.apache.hadoop.record.Record {
private static final org.apache.hadoop.record.meta.RecordTypeInfo _rio_recTypeInfo;
private static org.apache.hadoop.record.meta.RecordTypeInfo _rio_rtiFilter;
private static int[] _rio_rtiFilterFields;
static {
_rio_recTypeInfo = new org.apache.hadoop.record.meta.RecordTypeInfo("Stud");
_rio_recTypeInfo.addField("name", org.apache.hadoop.record.meta.TypeID.StringTypeID);
_rio_recTypeInfo.addField("id", org.apache.hadoop.record.meta.TypeID.LongTypeID);
_rio_recTypeInfo.addField("age", org.apache.hadoop.record.meta.TypeID.IntTypeID);
_rio_recTypeInfo.addField("time", org.apache.hadoop.record.meta.TypeID.StringTypeID);
}
private String name;
private long id;
private int age;
private String time;
public Stud() { }
public Stud(
final String name,
final long id,
final int age,
final String time) {
this.name = name;
this.id = id;
this.age = age;
this.time = time;
}
。。。。。。。。。。。。。。。。。。。。。
利用hadoop命令rcc生成Record 一种简单的方式实现自定义的writable对象
原文地址:http://blog.csdn.net/uniquechao/article/details/40864965