hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aditya Acharya (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HBASE-2921) HBase shell should have a --force-tty option.
Date Mon, 23 Aug 2010 22:56:16 GMT

     [ https://issues.apache.org/jira/browse/HBASE-2921?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Aditya Acharya updated HBASE-2921:
----------------------------------

        Summary: HBase shell should have a --force-tty option.  (was: HBase shell prompt is
not configured when used as a subprocess)
     Issue Type: Improvement  (was: Bug)
    Description: 
When you start the HBase shell from bash, you see the following prompt:

hbase(main):001:0>

And typing in "conf" as the command yields the following prompt-related information:

conf.prompt_c="%N(%m):%03n:%i* "
conf.prompt_i="%N(%m):%03n:%i> "
conf.prompt_mode=:DEFAULT
conf.prompt_n="%N(%m):%03n:%i> "
conf.prompt_s="%N(%m):%03n:%i%l "

On the other hand, opening the HBase shell as python subprocess yields an empty string as
the prompt string. Furthermore, sending it the "conf" command through a pipe yields the following
output:

conf.prompt_c=nil
conf.prompt_i=nil
conf.prompt_mode=:NULL
conf.prompt_n=nil
conf.prompt_s=nil

This occurs because irb checks if stdout is a tty and changes the prompt configuration in
case it is.  It would be very useful for the hbase shell to have a --force-tty option that
overrides this check.

  was:
When you start the HBase shell from bash, you see the following prompt:

hbase(main):001:0>

And typing in "conf" as the command yields the following prompt-related information:

conf.prompt_c="%N(%m):%03n:%i* "
conf.prompt_i="%N(%m):%03n:%i> "
conf.prompt_mode=:DEFAULT
conf.prompt_n="%N(%m):%03n:%i> "
conf.prompt_s="%N(%m):%03n:%i%l "

On the other hand, opening the HBase shell as python subprocess yields an empty string as
the prompt string. Furthermore, sending it the "conf" command through a pipe yields the following
output:

conf.prompt_c=nil
conf.prompt_i=nil
conf.prompt_mode=:NULL
conf.prompt_n=nil
conf.prompt_s=nil

I think this is a bug in the HBase shell. I'm not sure where it occurs, but I have found that
it can be easily patched up by hard-coding the prompt information into bin/hirb.rb. This seems
like the most appropriate fix, as bin/hirb.rb already modifies the conf for the interpreter.


> HBase shell should have a --force-tty option.
> ---------------------------------------------
>
>                 Key: HBASE-2921
>                 URL: https://issues.apache.org/jira/browse/HBASE-2921
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 0.89.20100621
>            Reporter: Aditya Acharya
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> When you start the HBase shell from bash, you see the following prompt:
> hbase(main):001:0>
> And typing in "conf" as the command yields the following prompt-related information:
> conf.prompt_c="%N(%m):%03n:%i* "
> conf.prompt_i="%N(%m):%03n:%i> "
> conf.prompt_mode=:DEFAULT
> conf.prompt_n="%N(%m):%03n:%i> "
> conf.prompt_s="%N(%m):%03n:%i%l "
> On the other hand, opening the HBase shell as python subprocess yields an empty string
as the prompt string. Furthermore, sending it the "conf" command through a pipe yields the
following output:
> conf.prompt_c=nil
> conf.prompt_i=nil
> conf.prompt_mode=:NULL
> conf.prompt_n=nil
> conf.prompt_s=nil
> This occurs because irb checks if stdout is a tty and changes the prompt configuration
in case it is.  It would be very useful for the hbase shell to have a --force-tty option that
overrides this check.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message