本文整理汇总了Java中org.apache.hadoop.hbase.avro.generated.AGet类的典型用法代码示例。如果您正苦于以下问题:Java AGet类的具体用法?Java AGet怎么用?Java AGet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AGet类属于org.apache.hadoop.hbase.avro.generated包,在下文中一共展示了AGet类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: agetToGet
import org.apache.hadoop.hbase.avro.generated.AGet; //导入依赖的package包/类
static public Get agetToGet(AGet aget) throws IOException {
Get get = new Get(Bytes.toBytes(aget.row));
if (aget.columns != null) {
for (AColumn acolumn : aget.columns) {
if (acolumn.qualifier != null) {
get.addColumn(Bytes.toBytes(acolumn.family), Bytes.toBytes(acolumn.qualifier));
} else {
get.addFamily(Bytes.toBytes(acolumn.family));
}
}
}
if (aget.timestamp != null) {
get.setTimeStamp(aget.timestamp);
}
if (aget.timerange != null) {
get.setTimeRange(aget.timerange.minStamp, aget.timerange.maxStamp);
}
if (aget.maxVersions != null) {
get.setMaxVersions(aget.maxVersions);
}
return get;
}
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:23,代码来源:AvroUtil.java
示例2: testDML
import org.apache.hadoop.hbase.avro.generated.AGet; //导入依赖的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.AGet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论