FAQ
Over on HBASE-2099 I'm making good progress with a potential Mavenization of the Hbase ecosystem (feel free to join in the discussion).

Just a question about the contrib/stargate module. As I read it, it's designed to be both a standalone WAR _and_ JAR artifact? Is that correct? I can do that (probably not without a directory move), but I'm scratching my head to work out what the conf/jetty.xml is used for, because it doesn't appear in the ivy generated 'binary' output (maybe it's just missing).

If someone could comment on where the jetty.xml should end up in a stargate binary (and indeed, where it should appear in a general hbase binary tar ball) I would appreciate it. I'm guessing it's designed to be used with Jetty to kickstart a simple app server, and assume that the generated stargate WAR is supposed to live somewhere relative (ie. 'webapps') to be launched under the /api/ context.

Any knowledgeable folk able to comment on how this gets used?

cheers,

Paul

Search Discussions

  • Stack at Feb 6, 2010 at 10:28 pm
    On Sat, Feb 6, 2010 at 3:03 AM, Paul Smith wrote:
    >
    If someone could comment on where the jetty.xml should end up in a stargate binary (and indeed, where it should appear in a general hbase binary tar ball) I would appreciate it.    I'm guessing it's designed to be used with Jetty to kickstart a simple app server, and assume that the generated stargate WAR is supposed to live somewhere relative (ie. 'webapps') to be launched under the /api/ context.
    WAR and JAR seems a bit odd. If the JAR is for command-line tools,
    can't you do "java -cp X.war Command" as you would "java -cp X.jar
    Command"?

    If WAR is the target, the jetty.xml is just a convenience for case
    where the WAR is deployed on a jetty container?

    It'd be grand if the WAR could be deployed to any container --
    shouldn't be a tough target to achieve if not there already (I can
    help w/ latter).

    St.Ack
  • Andrew Purtell at Feb 8, 2010 at 1:23 am
    The Stargate WAR is meant for deployment into some totally seperate servlet
    container -- Jetty, Tomcat, Glassfish, etc. The provided jetty.xml is just an
    example and maybe should be named jetty.xml.template to clarify. We could use
    examples for other servlet containers besides Jetty.

    The Stargate JAR embeds a Jetty servlet container so one can run Stargate as a
    standalone daemon, either in the background as is typically done with other
    HBase daemons:

    sh ./bin/hbase-daemon.sh start org.apache.hadoop.hbase.stargate.Main

    or in the foreground for debugging

    ./bin/hbase org.apache.hadoop.hbase.stargate.Main

    ... with optional argument "-p <port>" to change the listening port.

    - Andy


    ----- Original Message ----
    From: Paul Smith
    To: hbase-dev@hadoop.apache.org
    Sent: Sat, February 6, 2010 7:03:10 PM
    Subject: Stargate War - jetty.xml and dependencies

    Just a question about the contrib/stargate module. As I read it, it's designed
    to be both a standalone WAR _and_ JAR artifact? Is that correct? I can do that
    (probably not without a directory move), but I'm scratching my head to work out
    what the conf/jetty.xml is used for, because it doesn't appear in the ivy
    generated 'binary' output (maybe it's just missing).

    If someone could comment on where the jetty.xml should end up in a stargate
    binary (and indeed, where it should appear in a general hbase binary tar ball) I
    would appreciate it. I'm guessing it's designed to be used with Jetty to
    kickstart a simple app server, and assume that the generated stargate WAR is
    supposed to live somewhere relative (ie. 'webapps') to be launched under the
    /api/ context.

    Any knowledgeable folk able to comment on how this gets used?

    cheers,

    Paul
  • Stack at Feb 9, 2010 at 12:57 am
    The WAR has everything under WEB-INF (class files, etc.). The jar has
    it all at top-level. It looks like a WAR can't be used as a JAR as I
    suggested in my previous mail so, yeah, stargate contrib would seem to
    have WAR and JAR targets (unless someone knows better).

    St.Ack
    On Sun, Feb 7, 2010 at 5:23 PM, Andrew Purtell wrote:
    The Stargate WAR is meant for deployment into some totally seperate servlet
    container -- Jetty, Tomcat, Glassfish, etc. The provided jetty.xml is just an
    example and maybe should be named jetty.xml.template to clarify. We could use
    examples for other servlet containers besides Jetty.

    The Stargate JAR embeds a Jetty servlet container so one can run Stargate as a
    standalone daemon, either in the background as is typically done with other
    HBase daemons:

    sh ./bin/hbase-daemon.sh start org.apache.hadoop.hbase.stargate.Main

    or in the foreground for debugging

    ./bin/hbase org.apache.hadoop.hbase.stargate.Main

    ... with optional argument "-p <port>" to change the listening port.

    - Andy


    ----- Original Message ----
    From: Paul Smith
    To: hbase-dev@hadoop.apache.org
    Sent: Sat, February 6, 2010 7:03:10 PM
    Subject: Stargate War - jetty.xml and dependencies

    Just a question about the contrib/stargate module.  As I read it, it's designed
    to be both a standalone WAR _and_ JAR artifact?  Is that correct? I can do that
    (probably not without a directory move), but I'm scratching my head to work out
    what the conf/jetty.xml is used for, because it doesn't appear in the ivy
    generated 'binary' output (maybe it's just missing).

    If someone could comment on where the jetty.xml should end up in a stargate
    binary (and indeed, where it should appear in a general hbase binary tar ball) I
    would appreciate it.    I'm guessing it's designed to be used with Jetty to
    kickstart a simple app server, and assume that the generated stargate WAR is
    supposed to live somewhere relative (ie. 'webapps') to be launched under the
    /api/ context.

    Any knowledgeable folk able to comment on how this gets used?

    cheers,

    Paul



  • Paul Smith at Feb 9, 2010 at 2:06 am

    On 09/02/2010, at 11:56 AM, Stack wrote:

    The WAR has everything under WEB-INF (class files, etc.). The jar has
    it all at top-level. It looks like a WAR can't be used as a JAR as I
    suggested in my previous mail so, yeah, stargate contrib would seem to
    have WAR and JAR targets (unless someone knows better).
    What I propose is then a directory structure change to stargate

    hbase/
    contrib/
    stargate/
    web
    service (or something)

    and move the WEB-INF related stuff into the 'web' area, and move the java side under 'service'.

    that way we can have 2 artifacts produced, one a jar file (service), and one a war file (web) automatically.

    There's also no reason we can't also have a 3rd artifact, say, 'standalone' that is a bundled up version of jetty, with a Main class that just launches Jetty with the jetty.xml (simple using the appassembler Maven plugin). Although the confusion from my newbie HBase side is one AndrewP mentioned about running the stargate bit through the hbase daemons.sh script. I'm not really sure what that means, does that farm the stargate stuff out to all datanodes or something?

    cheers,

    Paul
  • Stack at Feb 9, 2010 at 4:49 am

    On Mon, Feb 8, 2010 at 6:05 PM, Paul Smith wrote:
    ...
    What I propose is then a directory structure change to stargate

    hbase/
    contrib/
    stargate/
    web
    service (or something)

    and move the WEB-INF related stuff into the 'web' area, and move the java side under 'service'.
    Sounds good.

    that way we can have 2 artifacts produced, one a jar file (service), and one a war file (web) automatically.
    Can the web depend on the service? The web would bundle under its lib
    dir the service jar rather than include all stargate classes under
    WEB-INF? I think that'll work.

    There's also no reason we can't also have a 3rd artifact, say, 'standalone' that is a bundled up version of jetty, with a Main class that just launches Jetty with the jetty.xml (simple using the appassembler Maven plugin). Although the confusion from my newbie HBase side is one AndrewP mentioned about running the stargate bit through the hbase daemons.sh script.  I'm not really sure what that means, does that farm the stargate stuff out to all datanodes or something?
    No. Run bin/hbase. See how it emits usage. See how one of the
    options to bin/hbase is 'rest'. When you do bin/hbase rest, it starts
    up a jetty that has the stargate webapp in it.

    Good stuff,
    St.Ack
  • Psmith at Feb 9, 2010 at 8:43 am

    On 09/02/2010, at 15:49, Stack wrote:
    On Mon, Feb 8, 2010 at 6:05 PM, Paul Smith wrote:

    ...
    What I propose is then a directory structure change to stargate

    hbase/
    contrib/
    stargate/
    web
    service (or something)

    and move the WEB-INF related stuff into the 'web' area, and move
    the java side under 'service'.
    Sounds good.

    that way we can have 2 artifacts produced, one a jar file
    (service), and one a war file (web) automatically.
    Can the web depend on the service? The web would bundle under its lib
    dir the service jar rather than include all stargate classes under
    WEB-INF? I think that'll work.

    Absolutely. That's exactly how it will work.
    There's also no reason we can't also have a 3rd artifact, say,
    'standalone' that is a bundled up version of jetty, with a Main
    class that just launches Jetty with the jetty.xml (simple using the
    appassembler Maven plugin). Although the confusion from my newbie
    HBase side is one AndrewP mentioned about running the stargate bit
    through the hbase daemons.sh script. I'm not really sure what that
    means, does that farm the stargate stuff out to all datanodes or
    something?
    No. Run bin/hbase. See how it emits usage. See how one of the
    options to bin/hbase is 'rest'. When you do bin/hbase rest, it starts
    up a jetty that has the stargate webapp in it.
    Will look into that more. That sounds like stargate depends on hbase
    and hbase 'might' depend on stargate which is a cyclic dependency (not
    good). If the hbase.sh is just a launcher script to start a standalone
    process with an embedded jetty+stargate it would seem better for that
    script to live with stargate? The maven appassembler plugin will help
    automate that I think.

    Maybe we can chat further on irc.
    Good stuff,
    St.Ack
  • Andrew Purtell at Feb 9, 2010 at 5:29 pm

    No. Run bin/hbase. See how it emits usage. See how one of the
    options to bin/hbase is 'rest'. When you do bin/hbase rest, it starts
    up a jetty that has the stargate webapp in it.
    In 0.21? I didn't know that change had happened already, or maybe saw it
    on the list but it slipped my mind...

    Not in 0.20.



    - Andy
  • Andrew Purtell at Feb 9, 2010 at 5:27 pm

    What I propose is then a directory structure change to stargate

    hbase/
    contrib/
    stargate/
    web
    service (or something)
    I'm not opposed to that if someone produces the appropriate patch...

    I think there would only need to be two targets. May I recommend as names
    "servlet", which produces a war, and and "embedded", which produces a jar?
    Much of the source is shared so there would be a layout something like
    this I expect:

    hbase/
    contrib/
    stargate/
    src/
    embedded/
    main/
    servlet/

    and then some ant-fu.

    There's no need for that jetty.xml for embedded. Have a look at
    o.a.h.h.stargate.Main. Jetty is started and configured in the Main
    class.
    Although the confusion from my newbie HBase side is one AndrewP
    mentioned about running the stargate bit through the hbase daemons.sh
    script.
    This:

    ./bin/hbase-daemon.sh start org.apache.hadoop.hbase.stargate.Main

    starts up Stargate via embedded Jetty in the background with logger
    redirection, like how the Master and RegionServers are typically
    started.

    This:

    ./bin/hbase-daemons.sh start org.apache.hadoop.hbase.stargate.Main

    (note daemon versions daemon_s_)

    would start Stargate in the background ... like how the Master and
    RegionServers are typically started ... on all the hosts listed in
    conf/regionservers. Although you can do that, that was not what I
    was suggesting.

    - Andy


    ----- Original Message ----
    From: Paul Smith <psmith@aconex.com>
    To: hbase-dev@hadoop.apache.org
    Sent: Mon, February 8, 2010 6:05:38 PM
    Subject: Re: Stargate War - jetty.xml and dependencies

    On 09/02/2010, at 11:56 AM, Stack wrote:

    The WAR has everything under WEB-INF (class files, etc.). The jar has
    it all at top-level. It looks like a WAR can't be used as a JAR as I
    suggested in my previous mail so, yeah, stargate contrib would seem to
    have WAR and JAR targets (unless someone knows better).
    What I propose is then a directory structure change to stargate

    hbase/
    contrib/
    stargate/
    web
    service (or something)

    and move the WEB-INF related stuff into the 'web' area, and move the java side
    under 'service'.

    that way we can have 2 artifacts produced, one a jar file (service), and one a
    war file (web) automatically.

    There's also no reason we can't also have a 3rd artifact, say, 'standalone' that
    is a bundled up version of jetty, with a Main class that just launches Jetty
    with the jetty.xml (simple using the appassembler Maven plugin). Although the
    confusion from my newbie HBase side is one AndrewP mentioned about running the
    stargate bit through the hbase daemons.sh script. I'm not really sure what that
    means, does that farm the stargate stuff out to all datanodes or something?

    cheers,

    Paul
  • Andrew Purtell at Feb 9, 2010 at 5:31 pm
    Forgot to mention that a layout like this:


    hbase/
    contrib/
    stargate/
    src/
    embedded/
    main/
    servlet/

    would only be for 0.20.4, assuming we have one. In 0.21, Stargate is
    getting merged back into core.

    So this is why I haven't done something like the above. Is it worth
    the time?

    - Andy

    ----- Original Message ----
    From: Andrew Purtell <apurtell@apache.org>
    To: hbase-dev@hadoop.apache.org
    Sent: Tue, February 9, 2010 9:27:12 AM
    Subject: Re: Stargate War - jetty.xml and dependencies
    What I propose is then a directory structure change to stargate

    hbase/
    contrib/
    stargate/
    web
    service (or something)
    I'm not opposed to that if someone produces the appropriate patch...

    I think there would only need to be two targets. May I recommend as names
    "servlet", which produces a war, and and "embedded", which produces a jar?
    Much of the source is shared so there would be a layout something like
    this I expect:

    hbase/
    contrib/
    stargate/
    src/
    embedded/
    main/
    servlet/

    and then some ant-fu.

    There's no need for that jetty.xml for embedded. Have a look at
    o.a.h.h.stargate.Main. Jetty is started and configured in the Main
    class.
    Although the confusion from my newbie HBase side is one AndrewP
    mentioned about running the stargate bit through the hbase daemons.sh
    script.
    This:

    ./bin/hbase-daemon.sh start org.apache.hadoop.hbase.stargate.Main

    starts up Stargate via embedded Jetty in the background with logger
    redirection, like how the Master and RegionServers are typically
    started.

    This:

    ./bin/hbase-daemons.sh start org.apache.hadoop.hbase.stargate.Main

    (note daemon versions daemon_s_)

    would start Stargate in the background ... like how the Master and
    RegionServers are typically started ... on all the hosts listed in
    conf/regionservers. Although you can do that, that was not what I
    was suggesting.

    - Andy


    ----- Original Message ----
    From: Paul Smith
    To: hbase-dev@hadoop.apache.org
    Sent: Mon, February 8, 2010 6:05:38 PM
    Subject: Re: Stargate War - jetty.xml and dependencies

    On 09/02/2010, at 11:56 AM, Stack wrote:

    The WAR has everything under WEB-INF (class files, etc.). The jar has
    it all at top-level. It looks like a WAR can't be used as a JAR as I
    suggested in my previous mail so, yeah, stargate contrib would seem to
    have WAR and JAR targets (unless someone knows better).
    What I propose is then a directory structure change to stargate

    hbase/
    contrib/
    stargate/
    web
    service (or something)

    and move the WEB-INF related stuff into the 'web' area, and move the java side
    under 'service'.

    that way we can have 2 artifacts produced, one a jar file (service), and one a
    war file (web) automatically.

    There's also no reason we can't also have a 3rd artifact, say, 'standalone' that
    is a bundled up version of jetty, with a Main class that just launches Jetty
    with the jetty.xml (simple using the appassembler Maven plugin). Although the
    confusion from my newbie HBase side is one AndrewP mentioned about running the
    stargate bit through the hbase daemons.sh script. I'm not really sure what that
    means, does that farm the stargate stuff out to all datanodes or something?

    cheers,

    Paul
  • Stack at Feb 9, 2010 at 7:10 pm

    On Tue, Feb 9, 2010 at 9:31 AM, Andrew Purtell wrote:
    Stargate is
    getting merged back into core.

    So this is why I haven't done something like the above. Is it worth
    the time?
    You are right Andy. Stargate going up into core for 0.21 means the
    above contrib work is not needed.

    The WAR product would be a nice to have though?

    St.Ack
  • Paul Smith at Feb 10, 2010 at 1:46 am

    On 10/02/2010, at 4:31 AM, Andrew Purtell wrote:

    Forgot to mention that a layout like this:


    hbase/
    contrib/
    stargate/
    src/
    embedded/
    main/
    servlet/

    would only be for 0.20.4, assuming we have one. In 0.21, Stargate is
    getting merged back into core.

    So this is why I haven't done something like the above. Is it worth
    the time?
    oh. pardon my ignorance, when is 0.21 targetted then? I'm just basing my plans off trunk at the moment, and stargate is still showing as a contrib module? Is there a different branch I should be looking at ? Or is it just planning stage? maybe I should not concentrate much effort in stargate until the merge into core.

    if stargate has (or will) been moved to the core, this will probably simplify things anyway. If we still wish to have a standalone packaged WAR file, we can still do that, it could sit as a top-level hbase module, depend on hbase-core (which now contains stargate) and just package up the web.xml that is needed. A separate standalone sh-launched-jetty appassembler bundle is also easily doable too as an extension to that.

    so, in directory speak, something like:

    hbase/
    core
    stargate/
    servlet (or something like that)
    standalone
    contrib/
    ec2
    transaction
    ...etc...

    'embedded' would not be needed, because hbase-core would just contain the stuff you need (if I'm reading what you're saying correctly).

    thanks muchly for the response!

    Paul

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categorieshbase, hadoop
postedFeb 6, '10 at 11:03a
activeFeb 10, '10 at 1:46a
posts12
users3
websitehbase.apache.org

People

Translate

site design / logo © 2022 Grokbase