diff --git .gitignore .gitignore index 4208d61..134eeaa 100644 --- .gitignore +++ .gitignore @@ -1,3 +1,4 @@ +/classes /.classpath /.externalToolBuilders /.project diff --git core/src/main/java/org/apache/hadoop/hbase/client/HTable.java core/src/main/java/org/apache/hadoop/hbase/client/HTable.java index 2d0edc1..30d868d 100644 --- core/src/main/java/org/apache/hadoop/hbase/client/HTable.java +++ core/src/main/java/org/apache/hadoop/hbase/client/HTable.java @@ -62,6 +62,8 @@ import java.util.concurrent.atomic.AtomicInteger; * row locking. */ public class HTable implements HTableInterface { + private static final Log LOG = LogFactory.getLog(HTable.class); + private final HConnection connection; private final byte [] tableName; protected final int scannerTimeout; @@ -482,36 +484,45 @@ public class HTable implements HTableInterface { /** * Commit a Put to the table. *
- * If autoFlush is false, the update is buffered. + * If autoFlush is false, the update is buffered and returning 'false' is ok. + * If autoFlush is true, and the method returns false, then the commit did not go through completely. * @param put data to put + * @return true, if the put has been marshalled successfully to the server. + * false, otherwise. * @throws IOException * @since 0.20.0 */ - public synchronized void put(final Put put) throws IOException { - doPut(Arrays.asList(put)); + public synchronized boolean put(final Put put) throws IOException { + return doPut(Arrays.asList(put)); } /** * Commit a List of Puts to the table. *
- * If autoFlush is false, the update is buffered.
+ * If autoFlush is false, the update is buffered and returning 'false' is ok.
+ * If autoFlush is true, and the method returns false, then the commit did not go through completely.
* @param puts list of puts
+ * @return true, if the put has been marshalled successfully to the server.
+ * false, otherwise.
* @throws IOException if a remote or network exception occurs
+ *
* @since 0.20.0
*/
- public synchronized void put(final List
- * If autoFlush is false, the update is buffered.
+ * If autoFlush is false, the update is buffered and returning 'false' is ok.
+ * If autoFlush is true, and the method returns false, then the commit did not go through.
*
* @param put data
* @throws IOException e
+ * @return true, if the put has been marshalled successfully to the server.
+ * false, otherwise.
*/
- void put(Put put) throws IOException;
+ boolean put(Put put) throws IOException;
/**
* Commit a List of Puts to the table.
*
- * If autoFlush is false, the update is buffered.
+ * If autoFlush is false, the update is buffered and returning 'false' is ok.
+ * If autoFlush is true, and the method returns false, then the commit did not go through completely.
*
* @param puts list of puts
* @throws IOException e
+ * @return true, if the put has been marshalled successfully to the server.
+ * false, otherwise.
*/
- void put(List