本文整理汇总了Java中org.apache.hadoop.hbase.avro.generated.AColumnValue类的典型用法代码示例。如果您正苦于以下问题:Java AColumnValue类的具体用法?Java AColumnValue怎么用?Java AColumnValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AColumnValue类属于org.apache.hadoop.hbase.avro.generated包,在下文中一共展示了AColumnValue类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: aputToPut
import org.apache.hadoop.hbase.avro.generated.AColumnValue; //导入依赖的package包/类
static public Put aputToPut(APut aput) throws IOException {
Put put = new Put(Bytes.toBytes(aput.row));
for (AColumnValue acv : aput.columnValues) {
if (acv.timestamp != null) {
put.add(Bytes.toBytes(acv.family),
Bytes.toBytes(acv.qualifier),
acv.timestamp,
Bytes.toBytes(acv.value));
} else {
put.add(Bytes.toBytes(acv.family),
Bytes.toBytes(acv.qualifier),
Bytes.toBytes(acv.value));
}
}
return put;
}
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:17,代码来源:AvroUtil.java
示例2: testDML
import org.apache.hadoop.hbase.avro.generated.AColumnValue; //导入依赖的package包/类
/**
* Tests for adding, reading, and deleting data.
*
* @throws Exception
*/
@Test
public void testDML() throws Exception {
AvroServer.HBaseImpl impl =
new AvroServer.HBaseImpl(TEST_UTIL.getConfiguration());
ATableDescriptor tableA = new ATableDescriptor();
tableA.name = tableAname;
AFamilyDescriptor familyA = new AFamilyDescriptor();
familyA.name = familyAname;
Schema familyArraySchema = Schema.createArray(AFamilyDescriptor.SCHEMA$);
GenericArray<AFamilyDescriptor> families = new GenericData.Array<AFamilyDescriptor>(1, familyArraySchema);
families.add(familyA);
tableA.families = families;
impl.createTable(tableA);
assertEquals(impl.describeTable(tableAname).families.size(), 1);
AGet getA = new AGet();
getA.row = rowAname;
Schema columnsSchema = Schema.createArray(AColumn.SCHEMA$);
GenericArray<AColumn> columns = new GenericData.Array<AColumn>(1, columnsSchema);
AColumn column = new AColumn();
column.family = familyAname;
column.qualifier = qualifierAname;
columns.add(column);
getA.columns = columns;
assertFalse(impl.exists(tableAname, getA));
APut putA = new APut();
putA.row = rowAname;
Schema columnValuesSchema = Schema.createArray(AColumnValue.SCHEMA$);
GenericArray<AColumnValue> columnValues = new GenericData.Array<AColumnValue>(1, columnValuesSchema);
AColumnValue acv = new AColumnValue();
acv.family = familyAname;
acv.qualifier = qualifierAname;
acv.value = valueA;
columnValues.add(acv);
putA.columnValues = columnValues;
impl.put(tableAname, putA);
assertTrue(impl.exists(tableAname, getA));
assertEquals(impl.get(tableAname, getA).entries.size(), 1);
impl.disableTable(tableAname);
impl.deleteTable(tableAname);
}
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:53,代码来源:TestAvroServer.java
注:本文中的org.apache.hadoop.hbase.avro.generated.AColumnValue类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论