if (session == null) { try { options = BigtableOptionsFactory.fromConfiguration(CONFIG); session = new BigtableSession(options);
/** * {@inheritDoc} * * Being a Mutation. This method will block if either of the following are true: * 1) There are more than {@code maxInflightRpcs} RPCs in flight * 2) There are more than {@link #getWriteBufferSize()} bytes pending */ @Override public void mutate(Mutation mutation) throws IOException { handleExceptions(); addCallback(helper.mutate(mutation), mutation); }
/** {@inheritDoc} */ @Override public void flush() throws IOException { helper.flush(); handleExceptions(); }
/** * <p>connect.</p> * * @param projectId a {@link java.lang.String} object. * @param instanceId a {@link java.lang.String} object. * @param appProfileId a {@link java.lang.String} object. * @return a {@link org.apache.hadoop.hbase.client.Connection} object. */ public static Connection connect(String projectId, String instanceId, String appProfileId) { return connect(configure(projectId, instanceId, appProfileId)); }
protected void deleteTable(TableName tableName) { try{ if (isTableEnabled(tableName)) { disableTable(tableName); } adminDeleteTable(tableName); } catch (Throwable t) { // logger the error and ignore it. logger.warn("Error cleaning up the table", t); } }
/** {@inheritDoc} */ @Override public void close() throws IOException { helper.close(); handleExceptions(); }
/** {@inheritDoc} */ @Override public boolean checkAndPut(byte[] row, byte[] family, byte[] qualifier, byte[] value, Put put) throws IOException { return checkAndPut(row, family, qualifier, CompareFilter.CompareOp.EQUAL, value, put); }
/** {@inheritDoc} */ @Override public Configuration getConfiguration() { return helper.getConfiguration(); }
/** {@inheritDoc} */ @Override public TableName getName() { return helper.getName(); }
/** {@inheritDoc} */ @Override public long getWriteBufferSize() { return helper.getWriteBufferSize(); }
/** * <p>hasInflightRequests.</p> * * @return a boolean. */ public boolean hasInflightRequests() { return helper.hasInflightRequests(); } }
/** * Sets a reference to a {@link Credentials} in a {@link Configuration} object. * * @param conf a {@link org.apache.hadoop.conf.Configuration} object to configure. * @param credentials a {@link Credentials} object; * @return */ public static Configuration withCredentials(Configuration conf, Credentials credentials) { return new BigtableExtendedConfiguration(conf, credentials); }
/** {@inheritDoc} */ @Override public List<HRegionLocation> getAllRegionLocations() throws IOException { return getRegions(false); }
/** {@inheritDoc} */ @Override public void flush() { helper.sendUnsent(); }
/** * {@inheritDoc} */ @Override public TableDescriptor getDescriptor() throws IOException { return super.getTableDescriptor(); }
/** * {@inheritDoc} * * Being a Mutation. This method will block if either of the following are true: * 1) There are more than {@code maxInflightRpcs} RPCs in flight * 2) There are more than {@link #getWriteBufferSize()} bytes pending */ @Override public void mutate(Mutation mutation) throws IOException { handleExceptions(); addCallback(helper.mutate(mutation), mutation); }
/** {@inheritDoc} */ @Override public void flush() throws IOException { helper.flush(); handleExceptions(); }
/** {@inheritDoc} */ @Override public void close() throws IOException { helper.close(); handleExceptions(); }
/** {@inheritDoc} */ @Override public boolean checkAndPut(byte[] row, byte[] family, byte[] qualifier, byte[] value, Put put) throws IOException { return checkAndPut(row, family, qualifier, CompareFilter.CompareOp.EQUAL, value, put); }
/** {@inheritDoc} */ @Override public Configuration getConfiguration() { return helper.getConfiguration(); }