HBase
  1. HBase
  2. HBASE-9266

Javadoc: Document that HBaseAdmin.flush(...) is synchronous

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.94.12
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Currently the Javadoc in HBaseAdmin.flush(...) says that this is an asynchronous operation. Looking at the, however, it is in fact not.

      Having this as a synchronous operation open ups some use cases we're interested in. For example doing some ingest via the high level API with WAL disabled and then issue a flush through the HBaseAdmin. When the flush succeeded we know the data is securely in HBase.
      (This should work even with intermediary splits, as they also force a flush, but that needs to be verified as well.

      So this is just for a trivial Javadoc change.

      1. 9266.txt
        0.8 kB
        Lars Hofhansl

        Activity

        Hide
        Lars Hofhansl added a comment -

        Note: It is fine to promise an asynchronous API and then actually perform the action synchronously. The reverse is not true.

        With that in mind I could a new method to HBaseAdmin: syncFlush(...) which guarantees synchronous operation. That way we can make flush() asynchronous in the future, without breaking any expectation in the caller.

        Thoughts?

        Show
        Lars Hofhansl added a comment - Note: It is fine to promise an asynchronous API and then actually perform the action synchronously. The reverse is not true. With that in mind I could a new method to HBaseAdmin: syncFlush(...) which guarantees synchronous operation. That way we can make flush() asynchronous in the future, without breaking any expectation in the caller. Thoughts?
        Hide
        Jean-Daniel Cryans added a comment -

        Wasn't that fixed in HBASE-6835?

        And I had this on my wishlist for a while now HBASE-4198.

        Show
        Jean-Daniel Cryans added a comment - Wasn't that fixed in HBASE-6835 ? And I had this on my wishlist for a while now HBASE-4198 .
        Hide
        Lars Hofhansl added a comment -

        Ah, didn't know about HBASE-6835. Will just "backport" that then. In the future we can always add a asyncFlush when needed.

        Show
        Lars Hofhansl added a comment - Ah, didn't know about HBASE-6835 . Will just "backport" that then. In the future we can always add a asyncFlush when needed.
        Hide
        Lars Hofhansl added a comment -

        Here's a breathtakingly beautiful and complex patch, changing the javadoc.

        As for HBASE-4198. Yeah, definitely need:

        1. issue the flushes in parallel
        2. offer a asynchronous version
        Show
        Lars Hofhansl added a comment - Here's a breathtakingly beautiful and complex patch, changing the javadoc. As for HBASE-4198 . Yeah, definitely need: issue the flushes in parallel offer a asynchronous version
        Hide
        Lars Hofhansl added a comment -

        Will commit this soon unless I hear objections (as we have done the same change in trunk anyway)

        Show
        Lars Hofhansl added a comment - Will commit this soon unless I hear objections (as we have done the same change in trunk anyway)
        Hide
        Jean-Daniel Cryans added a comment -

        Your patch breaks everything... not sure if I can agree with you... but I'll +1 it

        Show
        Jean-Daniel Cryans added a comment - Your patch breaks everything... not sure if I can agree with you... but I'll +1 it
        Hide
        stack added a comment -

        +1

        Show
        stack added a comment - +1
        Hide
        Lars Hofhansl added a comment -

        Committed to 0.94 (in 0.95+ already)

        Show
        Lars Hofhansl added a comment - Committed to 0.94 (in 0.95+ already)
        Hide
        Lars Hofhansl added a comment -

        HBASE-5783 is also related.

        Show
        Lars Hofhansl added a comment - HBASE-5783 is also related.
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in HBase-0.94-security #263 (See https://builds.apache.org/job/HBase-0.94-security/263/)
        HBASE-9266 Javadoc: Document that HBaseAdmin.flush(...) is synchronous (larsh: rev 1515676)

        • /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
        Show
        Hudson added a comment - SUCCESS: Integrated in HBase-0.94-security #263 (See https://builds.apache.org/job/HBase-0.94-security/263/ ) HBASE-9266 Javadoc: Document that HBaseAdmin.flush(...) is synchronous (larsh: rev 1515676) /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in HBase-0.94 #1117 (See https://builds.apache.org/job/HBase-0.94/1117/)
        HBASE-9266 Javadoc: Document that HBaseAdmin.flush(...) is synchronous (larsh: rev 1515676)

        • /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
        Show
        Hudson added a comment - SUCCESS: Integrated in HBase-0.94 #1117 (See https://builds.apache.org/job/HBase-0.94/1117/ ) HBASE-9266 Javadoc: Document that HBaseAdmin.flush(...) is synchronous (larsh: rev 1515676) /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java

          People

          • Assignee:
            Lars Hofhansl
            Reporter:
            Lars Hofhansl
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development