Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.HTable.coprocessorExec()


    verifyRegionResults(table, results, ROW_C);

    Batch.Call<PingProtocol,String> helloCall =
      Batch.forMethod(PingProtocol.class, "hello", "NAME");
    results =
        table.coprocessorExec(PingProtocol.class, ROW_A, ROW_C, helloCall);


    verifyRegionResults(table, results, "Hello, NAME", ROW_A);
    verifyRegionResults(table, results, "Hello, NAME", ROW_B);
    verifyRegionResults(table, results, "Hello, NAME", ROW_C);
View Full Code Here


  @Test
  public void testRowRange() throws Throwable {
    HTable table = new HTable(util.getConfiguration(), TEST_TABLE);

    // test empty range
    Map<byte[],String> results = table.coprocessorExec(PingProtocol.class,
        null, null, new Batch.Call<PingProtocol,String>() {
          public String call(PingProtocol instance) {
            return instance.ping();
          }
        });
View Full Code Here

    verifyRegionResults(table, results, ROW_A);
    verifyRegionResults(table, results, ROW_B);
    verifyRegionResults(table, results, ROW_C);

    // test start row + empty end
    results = table.coprocessorExec(PingProtocol.class, ROW_BC, null,
        new Batch.Call<PingProtocol,String>() {
          public String call(PingProtocol instance) {
            return instance.ping();
          }
        });
View Full Code Here

        results.get(loc.getRegionInfo().getRegionName()));
    verifyRegionResults(table, results, ROW_B);
    verifyRegionResults(table, results, ROW_C);

    // test empty start + end
    results = table.coprocessorExec(PingProtocol.class, null, ROW_BC,
        new Batch.Call<PingProtocol,String>() {
          public String call(PingProtocol instance) {
            return instance.ping();
          }
        });
View Full Code Here

    loc = table.getRegionLocation(ROW_C);
    assertNull("Should be missing region for row ccc (past stop row)",
        results.get(loc.getRegionInfo().getRegionName()));

    // test explicit start + end
    results = table.coprocessorExec(PingProtocol.class, ROW_AB, ROW_BC,
        new Batch.Call<PingProtocol,String>() {
          public String call(PingProtocol instance) {
            return instance.ping();
          }
        });
View Full Code Here

    loc = table.getRegionLocation(ROW_C);
    assertNull("Should be missing region for row ccc (past stop row)",
        results.get(loc.getRegionInfo().getRegionName()));

    // test single region
    results = table.coprocessorExec(PingProtocol.class, ROW_B, ROW_BC,
        new Batch.Call<PingProtocol,String>() {
          public String call(PingProtocol instance) {
            return instance.ping();
          }
        });
View Full Code Here

  @Test
  public void testCompountCall() throws Throwable {
    HTable table = new HTable(util.getConfiguration(), TEST_TABLE);

    Map<byte[],String> results = table.coprocessorExec(PingProtocol.class,
        ROW_A, ROW_C,
        new Batch.Call<PingProtocol,String>() {
          public String call(PingProtocol instance) {
            return instance.hello(instance.ping());
          }
View Full Code Here

  @Test
  public void testNullCall() throws Throwable {
    HTable table = new HTable(util.getConfiguration(), TEST_TABLE);

    Map<byte[],String> results = table.coprocessorExec(PingProtocol.class,
        ROW_A, ROW_C,
        new Batch.Call<PingProtocol,String>() {
          public String call(PingProtocol instance) {
            return instance.hello(null);
          }
View Full Code Here

  @Test
  public void testNullReturn() throws Throwable {
    HTable table = new HTable(util.getConfiguration(), TEST_TABLE);

    Map<byte[],String> results = table.coprocessorExec(PingProtocol.class,
        ROW_A, ROW_C,
        new Batch.Call<PingProtocol,String>(){
          public String call(PingProtocol instance) {
            return instance.hello("nobody");
          }
View Full Code Here

  @Test
  public void testVoidReturnType() throws Throwable {
    HTable table = new HTable(util.getConfiguration(), TEST_TABLE);

    Map<byte[],Object> results = table.coprocessorExec(PingProtocol.class,
        ROW_A, ROW_C,
        new Batch.Call<PingProtocol,Object>(){
          public Object call(PingProtocol instance) {
            instance.noop();
            return null;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.