Class SpaceQuotaHelperForTests.SpaceQuotaSnapshotPredicate

java.lang.Object
org.apache.hadoop.hbase.quotas.SpaceQuotaHelperForTests.SpaceQuotaSnapshotPredicate
All Implemented Interfaces:
Waiter.Predicate<Exception>
Enclosing class:
SpaceQuotaHelperForTests

Abstraction to simplify the case where a test needs to verify a certain state on a SpaceQuotaSnapshot. This class fails-fast when there is no such snapshot obtained from the Master. As such, it is not useful to verify the lack of a snapshot.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final org.apache.hadoop.hbase.client.Connection
     
    private final String
     
    private final org.apache.hadoop.hbase.TableName
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpaceQuotaSnapshotPredicate(org.apache.hadoop.hbase.client.Connection conn, String ns)
     
    SpaceQuotaSnapshotPredicate(org.apache.hadoop.hbase.client.Connection conn, org.apache.hadoop.hbase.TableName tn)
     
    SpaceQuotaSnapshotPredicate(org.apache.hadoop.hbase.client.Connection conn, org.apache.hadoop.hbase.TableName tn, String ns)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Perform a predicate evaluation.
    (package private) abstract boolean
    evaluate(org.apache.hadoop.hbase.quotas.SpaceQuotaSnapshot snapshot)
    Must determine if the given SpaceQuotaSnapshot meets some criteria.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • conn

      private final org.apache.hadoop.hbase.client.Connection conn
    • tn

      private final org.apache.hadoop.hbase.TableName tn
    • ns

      private final String ns
  • Constructor Details

  • Method Details

    • evaluate

      public boolean evaluate() throws Exception
      Description copied from interface: Waiter.Predicate
      Perform a predicate evaluation.
      Specified by:
      evaluate in interface Waiter.Predicate<Exception>
      Returns:
      the boolean result of the evaluation.
      Throws:
      Exception
    • evaluate

      abstract boolean evaluate(org.apache.hadoop.hbase.quotas.SpaceQuotaSnapshot snapshot) throws Exception
      Must determine if the given SpaceQuotaSnapshot meets some criteria.
      Parameters:
      snapshot - a non-null snapshot obtained from the HBase Master
      Returns:
      true if the criteria is met, false otherwise
      Throws:
      Exception