public boolean exists(Get get) throws Exception { try { return table.exists(get); } catch (Exception e) { LOG.warn("Could not perform HBASE existence check.", e); throw e; } }
@Override public boolean[] exists(List<Get> gets) throws IOException { if (gets.isEmpty()) return new boolean[]{}; if (gets.size() == 1) return new boolean[]{exists(gets.get(0))}; ArrayList<Get> exists = new ArrayList<>(gets.size()); for (Get g: gets){ Get ge = new Get(g); ge.setCheckExistenceOnly(true); exists.add(ge); } Object[] r1= new Object[exists.size()]; try { batch(exists, r1, readRpcTimeoutMs); } catch (InterruptedException e) { throw (InterruptedIOException)new InterruptedIOException().initCause(e); } // translate. boolean[] results = new boolean[r1.length]; int i = 0; for (Object o : r1) { // batch ensures if there is a failure we get an exception instead results[i++] = ((Result)o).getExists(); } return results; }
@Override public boolean[] exists(List<Get> gets) throws IOException { if (gets.isEmpty()) return new boolean[]{}; if (gets.size() == 1) return new boolean[]{exists(gets.get(0))}; ArrayList<Get> exists = new ArrayList<>(gets.size()); for (Get g: gets){ Get ge = new Get(g); ge.setCheckExistenceOnly(true); exists.add(ge); } Object[] r1= new Object[exists.size()]; try { batch(exists, r1, readRpcTimeoutMs); } catch (InterruptedException e) { throw (InterruptedIOException)new InterruptedIOException().initCause(e); } // translate. boolean[] results = new boolean[r1.length]; int i = 0; for (Object o : r1) { // batch ensures if there is a failure we get an exception instead results[i++] = ((Result)o).getExists(); } return results; }
public boolean exists(Get get) throws IOException { return table.exists(get); }
public Boolean call() throws IOException { return normalHTable.exists(get); } });
public boolean exists(Get get) throws Exception { try { return table.exists(get); } catch (Exception e) { LOG.warn("Could not perform HBASE existence check.", e); throw e; } }
/** * Is exist get in hbase table. * * @param gets a batch of hbase get. * @return existence returns true, otherwise returns false. */ public Boolean[] existGet(List<Get> gets) throws IOException { return getTable().exists(gets); }
/** * Is exist get in hbase table. * * @param get hbase get. * @return existence returns true, otherwise returns false. */ public Boolean existGet(Get get) throws IOException { return getTable().exists(get); }
@Override public boolean exists(Get get) throws IOException { return getTable().exists(get); }
@Override public boolean[] exists(List<Get> gets) throws IOException { if (gets.isEmpty()) return new boolean[]{}; if (gets.size() == 1) return new boolean[]{exists(gets.get(0))}; ArrayList<Get> exists = new ArrayList<>(gets.size()); for (Get g: gets){ Get ge = new Get(g); ge.setCheckExistenceOnly(true); exists.add(ge); } Object[] r1= new Object[exists.size()]; try { batch(exists, r1, readRpcTimeoutMs); } catch (InterruptedException e) { throw (InterruptedIOException)new InterruptedIOException().initCause(e); } // translate. boolean[] results = new boolean[r1.length]; int i = 0; for (Object o : r1) { // batch ensures if there is a failure we get an exception instead results[i++] = ((Result)o).getExists(); } return results; }
/** * {@inheritDoc} */ @Override public boolean[] existsAll(final List<Get> gets) throws IOException { if (gets.isEmpty()) return new boolean[]{}; if (gets.size() == 1) return new boolean[]{exists(gets.get(0))}; ArrayList<Get> exists = new ArrayList<Get>(gets.size()); for (Get g: gets){ Get ge = new Get(g); ge.setCheckExistenceOnly(true); exists.add(ge); } Object[] r1; try { r1 = batch(exists); } catch (InterruptedException e) { throw (InterruptedIOException)new InterruptedIOException().initCause(e); } // translate. boolean[] results = new boolean[r1.length]; int i = 0; for (Object o : r1) { // batch ensures if there is a failure we get an exception instead results[i++] = ((Result)o).getExists(); } return results; }