| 15 | import org.hbase.async.HBaseException; |
| 16 | |
| 17 | public abstract class AbstractQuery implements Query { |
| 18 | /** |
| 19 | * Runs this query. |
| 20 | * |
| 21 | * @return The data points matched by this query. |
| 22 | * <p> |
| 23 | * Each element in the non-{@code null} but possibly empty array returned |
| 24 | * corresponds to one time series for which some data points have been |
| 25 | * matched by the query. |
| 26 | * @throws HBaseException if there was a problem communicating with HBase to |
| 27 | * perform the search. |
| 28 | */ |
| 29 | @Override |
| 30 | public DataPoints[] run() throws HBaseException { |
| 31 | try { |
| 32 | return runAsync().joinUninterruptibly(); |
| 33 | } catch (RuntimeException e) { |
| 34 | throw e; |
| 35 | } catch (Exception e) { |
| 36 | throw new RuntimeException("Should never be here", e); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Runs this query. |
| 42 | * |
| 43 | * @return The data points matched by this query and applied with percentile calculation |
| 44 | * <p> |
| 45 | * Each element in the non-{@code null} but possibly empty array returned |
| 46 | * corresponds to one time series for which some data points have been |
| 47 | * matched by the query. |
| 48 | * @throws HBaseException if there was a problem communicating with HBase to |
| 49 | * perform the search. |
| 50 | * @throws IllegalStateException if the query is not a histogram query |
| 51 | */ |
| 52 | @Override |
| 53 | public DataPoints[] runHistogram() throws HBaseException { |
| 54 | if (!isHistogramQuery()) { |
| 55 | throw new RuntimeException("Should never be here"); |
| 56 | } |
| 57 | |
| 58 | try { |
| 59 | return runHistogramAsync().joinUninterruptibly(); |
| 60 | } catch (RuntimeException e) { |
| 61 | throw e; |
| 62 | } catch (Exception e) { |
| 63 | throw new RuntimeException("Should never be here", e); |
| 64 | } |
| 65 | } |
| 66 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…