Examples of HBaseException


Examples of org.apache.hadoop.hbase.exceptions.HBaseException

      List<UserPermission> namespacePermissions = AccessControlClient.getUserPermissions(conf,
      AccessControlLists.toNamespaceEntry(namespace));
      assertTrue(namespacePermissions != null);
      assertTrue(namespacePermissions.size() == 1);
    } catch (Throwable thw) {
      throw new HBaseException(thw);
    }
    TEST_UTIL.getMiniHBaseCluster().getMaster().deleteNamespace(namespace);
  }
View Full Code Here

Examples of org.hbase.async.HBaseException

  public void getNameWithErrorDuringHBaseLookup() {
    uid = new UniqueId(client, table, kind, 3);
    final byte[] id = { 0, 'a', 0x42 };
    final byte[] byte_name = { 'f', 'o', 'o' };

    HBaseException hbe = mock(HBaseException.class);

    ArrayList<KeyValue> kvs = new ArrayList<KeyValue>(1);
    kvs.add(new KeyValue(id, ID, kind_array, byte_name));
    when(client.get(anyGet()))
      .thenThrow(hbe)
View Full Code Here

Examples of org.hbase.async.HBaseException

    when(client.get(anyGet()))      // null  =>  ID doesn't exist.
      .thenReturn(Deferred.<ArrayList<KeyValue>>fromResult(null));
    // Watch this! ______,^   I'm writing C++ in Java!

    HBaseException hbe = fakeHBaseException();
    when(client.atomicIncrement(incrementForRow(MAXID)))
      .thenThrow(hbe);
    PowerMockito.doNothing().when(Thread.class); Thread.sleep(anyInt());

    try {
View Full Code Here

Examples of org.hbase.async.HBaseException

    when(client.get(anyGet()))      // null  =>  ID doesn't exist.
      .thenReturn(Deferred.<ArrayList<KeyValue>>fromResult(null));
    // Watch this! ______,^   I'm writing C++ in Java!

    // Update once HBASE-2292 is fixed:
    HBaseException hbe = fakeHBaseException();
    when(client.atomicIncrement(incrementForRow(MAXID)))
      .thenReturn(Deferred.<Long>fromError(hbe))
      .thenReturn(Deferred.fromResult(5L));

    when(client.compareAndSet(anyPut(), emptyArray()))
View Full Code Here

Examples of org.hbase.async.HBaseException

      }
    });
  }

  private static HBaseException fakeHBaseException() {
    final HBaseException hbe = mock(HBaseException.class);
    when(hbe.getStackTrace())
      // Truncate the stack trace because otherwise it's gigantic.
      .thenReturn(Arrays.copyOf(new RuntimeException().getStackTrace(), 3));
    when(hbe.getMessage())
      .thenReturn("fake exception");
    return hbe;
  }
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.