HBase
  1. HBase
  2. HBASE-5534

HBase shell's return value is almost always 0

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: shell
    • Labels:
      None

      Description

      So I was trying to write some simple scripts to verify client connections to HBase using the shell and I noticed that the HBase shell always returns 0 even when it can't connect to an HBase server. I'm not sure if this is the best option. What would be neat is if you had some capability to run commands like

      hbase shell --command='disable table;\ndrop table;' and it would error out if any of the commands fail to succeed. echo "disable table" | hbase shell could continue to work as it does now.

        Issue Links

          Activity

          Hide
          stack added a comment -

          You should be able to do:

          hbase shell script.rb
          

          ... if thats of any help Alex (may still have the issue w/ exit code).

          Show
          stack added a comment - You should be able to do: hbase shell script.rb ... if thats of any help Alex (may still have the issue w/ exit code).
          Hide
          Oren Held added a comment -

          There should be one and only behavior for the CLI: return code != 0 if any error had occurred. That's the convention with all CLI tools on all platforms.
          (I believe that creating a special --command flag, as suggested in the description, is redundant and confusing)

          Imho, this issue should be referred to as a bug.

          Show
          Oren Held added a comment - There should be one and only behavior for the CLI: return code != 0 if any error had occurred. That's the convention with all CLI tools on all platforms. (I believe that creating a special --command flag, as suggested in the description, is redundant and confusing) Imho, this issue should be referred to as a bug.
          Hide
          Ted Yu added a comment -

          I agree that this is a bug.

          Show
          Ted Yu added a comment - I agree that this is a bug.

            People

            • Assignee:
              Unassigned
              Reporter:
              Alex Newman
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Development