本文整理汇总了Java中org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler类的典型用法代码示例。如果您正苦于以下问题:Java HBaseHandler类的具体用法?Java HBaseHandler怎么用?Java HBaseHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HBaseHandler类属于org.apache.hadoop.hbase.thrift.ThriftServerRunner包,在下文中一共展示了HBaseHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: doTestCheckAndPut
import org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler; //导入依赖的package包/类
/**
* Check that checkAndPut fails if the cell does not exist, then put in the cell, then check that
* the checkAndPut succeeds.
*
* @throws Exception
*/
public static void doTestCheckAndPut() throws Exception {
ThriftServerRunner.HBaseHandler handler =
new ThriftServerRunner.HBaseHandler(UTIL.getConfiguration(),
UserProvider.instantiate(UTIL.getConfiguration()));
handler.createTable(tableAname, getColumnDescriptors());
try {
List<Mutation> mutations = new ArrayList<Mutation>(1);
mutations.add(new Mutation(false, columnAname, valueAname, true));
Mutation putB = (new Mutation(false, columnBname, valueBname, true));
assertFalse(handler.checkAndPut(tableAname, rowAname, columnAname, valueAname, putB, null));
handler.mutateRow(tableAname, rowAname, mutations, null);
assertTrue(handler.checkAndPut(tableAname, rowAname, columnAname, valueAname, putB, null));
TRowResult rowResult = handler.getRow(tableAname, rowAname, null).get(0);
assertEquals(rowAname, rowResult.row);
assertEquals(valueBname, rowResult.columns.get(columnBname).value);
} finally {
handler.disableTable(tableAname);
handler.deleteTable(tableAname);
}
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:31,代码来源:TestThriftServer.java
示例2: doTestCheckAndPut
import org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler; //导入依赖的package包/类
/**
* Check that checkAndPut fails if the cell does not exist, then put in the cell, then check that
* the checkAndPut succeeds.
*/
public static void doTestCheckAndPut() throws Exception {
ThriftServerRunner.HBaseHandler handler =
new ThriftServerRunner.HBaseHandler(UTIL.getConfiguration(),
UserProvider.instantiate(UTIL.getConfiguration()));
handler.createTable(tableAname, getColumnDescriptors());
try {
List<Mutation> mutations = new ArrayList<>(1);
mutations.add(new Mutation(false, columnAname, valueAname, true));
Mutation putB = (new Mutation(false, columnBname, valueBname, true));
assertFalse(handler.checkAndPut(tableAname, rowAname, columnAname, valueAname, putB, null));
handler.mutateRow(tableAname, rowAname, mutations, null);
assertTrue(handler.checkAndPut(tableAname, rowAname, columnAname, valueAname, putB, null));
TRowResult rowResult = handler.getRow(tableAname, rowAname, null).get(0);
assertEquals(rowAname, rowResult.row);
assertEquals(valueBname, rowResult.columns.get(columnBname).value);
} finally {
handler.disableTable(tableAname);
handler.deleteTable(tableAname);
}
}
开发者ID:apache,项目名称:hbase,代码行数:29,代码来源:TestThriftServer.java
示例3: doTestCheckAndPut
import org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler; //导入依赖的package包/类
/**
* Check that checkAndPut fails if the cell does not exist, then put in the cell, then check that
* the checkAndPut succeeds.
*
* @throws Exception
*/
public static void doTestCheckAndPut() throws Exception {
ThriftServerRunner.HBaseHandler handler =
new ThriftServerRunner.HBaseHandler(UTIL.getConfiguration());
handler.createTable(tableAname, getColumnDescriptors());
try {
List<Mutation> mutations = new ArrayList<Mutation>(1);
mutations.add(new Mutation(false, columnAname, valueAname, true));
Mutation putB = (new Mutation(false, columnBname, valueBname, true));
assertFalse(handler.checkAndPut(tableAname, rowAname, columnAname, valueAname, putB, null));
handler.mutateRow(tableAname, rowAname, mutations, null);
assertTrue(handler.checkAndPut(tableAname, rowAname, columnAname, valueAname, putB, null));
TRowResult rowResult = handler.getRow(tableAname, rowAname, null).get(0);
assertEquals(rowAname, rowResult.row);
assertEquals(valueBname, rowResult.columns.get(columnBname).value);
} finally {
handler.disableTable(tableAname);
handler.deleteTable(tableAname);
}
}
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:30,代码来源:TestThriftServer.java
示例4: IncrementCoalescer
import org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public IncrementCoalescer(HBaseHandler hand) {
this.handler = hand;
LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>();
pool =
new ThreadPoolExecutor(CORE_POOL_SIZE, CORE_POOL_SIZE, 50, TimeUnit.MILLISECONDS, queue,
Threads.newDaemonThreadFactory("IncrementCoalescer"));
MBeanUtil.registerMBean("thrift", "Thrift", this);
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:IncrementCoalescer.java
示例5: doTestIncrements
import org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler; //导入依赖的package包/类
public void doTestIncrements() throws Exception {
ThriftServerRunner.HBaseHandler handler =
new ThriftServerRunner.HBaseHandler(UTIL.getConfiguration(),
UserProvider.instantiate(UTIL.getConfiguration()));
createTestTables(handler);
doTestIncrements(handler);
dropTestTables(handler);
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:9,代码来源:TestThriftServer.java
示例6: doTestGetTableRegions
import org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler; //导入依赖的package包/类
/**
* For HBASE-2556
* Tests for GetTableRegions
*
* @throws Exception
*/
public void doTestGetTableRegions() throws Exception {
ThriftServerRunner.HBaseHandler handler =
new ThriftServerRunner.HBaseHandler(UTIL.getConfiguration(),
UserProvider.instantiate(UTIL.getConfiguration()));
doTestGetTableRegions(handler);
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:13,代码来源:TestThriftServer.java
示例7: doTestAppend
import org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler; //导入依赖的package包/类
/**
* Appends the value to a cell and checks that the cell value is updated properly.
*
* @throws Exception
*/
public static void doTestAppend() throws Exception {
ThriftServerRunner.HBaseHandler handler =
new ThriftServerRunner.HBaseHandler(UTIL.getConfiguration(),
UserProvider.instantiate(UTIL.getConfiguration()));
handler.createTable(tableAname, getColumnDescriptors());
try {
List<Mutation> mutations = new ArrayList<Mutation>(1);
mutations.add(new Mutation(false, columnAname, valueAname, true));
handler.mutateRow(tableAname, rowAname, mutations, null);
List<ByteBuffer> columnList = new ArrayList<ByteBuffer>();
columnList.add(columnAname);
List<ByteBuffer> valueList = new ArrayList<ByteBuffer>();
valueList.add(valueBname);
TAppend append = new TAppend(tableAname, rowAname, columnList, valueList);
handler.append(append);
TRowResult rowResult = handler.getRow(tableAname, rowAname, null).get(0);
assertEquals(rowAname, rowResult.row);
assertArrayEquals(Bytes.add(valueAname.array(), valueBname.array()),
rowResult.columns.get(columnAname).value.array());
} finally {
handler.disableTable(tableAname);
handler.deleteTable(tableAname);
}
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:33,代码来源:TestThriftServer.java
示例8: IncrementCoalescer
import org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public IncrementCoalescer(HBaseHandler hand) {
this.handler = hand;
LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>();
pool =
new ThreadPoolExecutor(CORE_POOL_SIZE, CORE_POOL_SIZE, 50, TimeUnit.MILLISECONDS, queue,
new DaemonThreadFactory());
MBeanUtil.registerMBean("thrift", "Thrift", this);
}
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:11,代码来源:IncrementCoalescer.java
示例9: doTestIncrements
import org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler; //导入依赖的package包/类
public void doTestIncrements() throws Exception {
ThriftServerRunner.HBaseHandler handler =
new ThriftServerRunner.HBaseHandler(UTIL.getConfiguration());
createTestTables(handler);
doTestIncrements(handler);
dropTestTables(handler);
}
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:8,代码来源:TestThriftServer.java
示例10: IncrementCoalescer
import org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public IncrementCoalescer(HBaseHandler hand) {
this.handler = hand;
LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<>();
pool =
new ThreadPoolExecutor(CORE_POOL_SIZE, CORE_POOL_SIZE, 50, TimeUnit.MILLISECONDS, queue,
Threads.newDaemonThreadFactory("IncrementCoalescer"));
MBeans.register("thrift", "Thrift", this);
}
开发者ID:apache,项目名称:hbase,代码行数:11,代码来源:IncrementCoalescer.java
示例11: doTestTableCreateDrop
import org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler; //导入依赖的package包/类
/**
* Tests for creating, enabling, disabling, and deleting tables. Also
* tests that creating a table with an invalid column name yields an
* IllegalArgument exception.
*/
public void doTestTableCreateDrop() throws Exception {
ThriftServerRunner.HBaseHandler handler =
new ThriftServerRunner.HBaseHandler(UTIL.getConfiguration(),
UserProvider.instantiate(UTIL.getConfiguration()));
doTestTableCreateDrop(handler);
}
开发者ID:apache,项目名称:hbase,代码行数:12,代码来源:TestThriftServer.java
示例12: doTestTableMutations
import org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler; //导入依赖的package包/类
/**
* Tests adding a series of Mutations and BatchMutations, including a
* delete mutation. Also tests data retrieval, and getting back multiple
* versions.
*/
public void doTestTableMutations() throws Exception {
ThriftServerRunner.HBaseHandler handler =
new ThriftServerRunner.HBaseHandler(UTIL.getConfiguration(),
UserProvider.instantiate(UTIL.getConfiguration()));
doTestTableMutations(handler);
}
开发者ID:apache,项目名称:hbase,代码行数:12,代码来源:TestThriftServer.java
示例13: doTestGetTableRegions
import org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler; //导入依赖的package包/类
/**
* For HBASE-2556
* Tests for GetTableRegions
*/
public void doTestGetTableRegions() throws Exception {
ThriftServerRunner.HBaseHandler handler =
new ThriftServerRunner.HBaseHandler(UTIL.getConfiguration(),
UserProvider.instantiate(UTIL.getConfiguration()));
doTestGetTableRegions(handler);
}
开发者ID:apache,项目名称:hbase,代码行数:11,代码来源:TestThriftServer.java
示例14: doTestAppend
import org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler; //导入依赖的package包/类
/**
* Appends the value to a cell and checks that the cell value is updated properly.
*/
public static void doTestAppend() throws Exception {
ThriftServerRunner.HBaseHandler handler =
new ThriftServerRunner.HBaseHandler(UTIL.getConfiguration(),
UserProvider.instantiate(UTIL.getConfiguration()));
handler.createTable(tableAname, getColumnDescriptors());
try {
List<Mutation> mutations = new ArrayList<>(1);
mutations.add(new Mutation(false, columnAname, valueAname, true));
handler.mutateRow(tableAname, rowAname, mutations, null);
List<ByteBuffer> columnList = new ArrayList<>(1);
columnList.add(columnAname);
List<ByteBuffer> valueList = new ArrayList<>(1);
valueList.add(valueBname);
TAppend append = new TAppend(tableAname, rowAname, columnList, valueList);
handler.append(append);
TRowResult rowResult = handler.getRow(tableAname, rowAname, null).get(0);
assertEquals(rowAname, rowResult.row);
assertArrayEquals(Bytes.add(valueAname.array(), valueBname.array()),
rowResult.columns.get(columnAname).value.array());
} finally {
handler.disableTable(tableAname);
handler.deleteTable(tableAname);
}
}
开发者ID:apache,项目名称:hbase,代码行数:31,代码来源:TestThriftServer.java
示例15: doTestAppend
import org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler; //导入依赖的package包/类
/**
* Appends the value to a cell and checks that the cell value is updated properly.
*
* @throws Exception
*/
public static void doTestAppend() throws Exception {
ThriftServerRunner.HBaseHandler handler =
new ThriftServerRunner.HBaseHandler(UTIL.getConfiguration());
handler.createTable(tableAname, getColumnDescriptors());
try {
List<Mutation> mutations = new ArrayList<Mutation>(1);
mutations.add(new Mutation(false, columnAname, valueAname, true));
handler.mutateRow(tableAname, rowAname, mutations, null);
List<ByteBuffer> columnList = new ArrayList<ByteBuffer>();
columnList.add(columnAname);
List<ByteBuffer> valueList = new ArrayList<ByteBuffer>();
valueList.add(valueBname);
TAppend append = new TAppend(tableAname, rowAname, columnList, valueList);
handler.append(append);
TRowResult rowResult = handler.getRow(tableAname, rowAname, null).get(0);
assertEquals(rowAname, rowResult.row);
assertArrayEquals(Bytes.add(valueAname.array(), valueBname.array()),
rowResult.columns.get(columnAname).value.array());
} finally {
handler.disableTable(tableAname);
handler.deleteTable(tableAname);
}
}
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:32,代码来源:TestThriftServer.java
注:本文中的org.apache.hadoop.hbase.thrift.ThriftServerRunner.HBaseHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论