You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by Kay Kay <ka...@gmail.com> on 2009/04/13 17:23:17 UTC

SOLR-1106 - Custom Admin Action handler

For one of our projects - we need custom admin monitoring hooks that gets
access to multiple cores for a given solr web app (through the CoreContainer
interface).

There are common admin handler commands with the actions - register / swap /
load etc. that seem to be available by default.

I have submitted a patch to add custom admin handlers , against custom
actions  ( that also refactors the existing action handlers that are
available by default as well ).

This would be useful to extend the handlers that need access to multiple
cores.  Just curious if this is something that could be looked into .
Thanks.

Re: SOLR-1106 - Custom Admin Action handler

Posted by Kay Kay <ka...@gmail.com>.
 I have attached the revised patch for the same in the jira - SOLR-1106 .
Can you please have a look at the same .



2009/4/15 Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>

> On Mon, Apr 13, 2009 at 10:03 PM, Kay Kay <ka...@gmail.com> wrote:
> > These custom action handlers need not be residing in solr . Hence I
> needed a
> > hook ( listener ) that they can register themselves with and be loaded by
> > the SolrResourceLoader ( ./lib/*.jar ) .  Also I believe the default
> > handlers are very useful , necessary and mandatory and hence ported them
> to
> > the listener for consistency purposes.
> >
> > Also - if we have a protected method called invokeCommand() - how do we
> > inject that type as the admin handler ( as opposed to CoreAdminHandler) .
> > Right now - the type information seems hardcoded in CoreContainer though.
>
> There is no mean to inject that currently, But that can be made
> possible by an extra attribute in the <cores> tag . say <core
> adminHandler="foo.FooHandler">
>
> We will have to refactor the code a bit so that you may be able to
> extend the default core admin handler
> >
> >  // ---------------- Multicore self related methods ---------------
> >  /**
> >   * Creates a CoreAdminHandler for this MultiCore.
> >   * @return a CoreAdminHandler
> >   */
> >  protected CoreAdminHandler createMultiCoreHandler() {
> >    return new CoreAdminHandler() {
> >      @Override
> >      public CoreContainer getCoreContainer() {
> >        return CoreContainer.this;
> >      }
> >    };
> >  }
> >
> >
> > 2009/4/13 Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>
> >
> >> Hi Kay,
> >>
> >> The idea of one handler per command looks like an overkill. How about
> >> having a protected methods for all the known commands and have a
> >> separate method invokeCommand() which can choose to implement any
> >> extra commands if need be. This way the changes needed would be
> >> minimal.
> >>
> >> On Mon, Apr 13, 2009 at 8:53 PM, Kay Kay <ka...@gmail.com>
> wrote:
> >> > For one of our projects - we need custom admin monitoring hooks that
> gets
> >> > access to multiple cores for a given solr web app (through the
> >> CoreContainer
> >> > interface).
> >> >
> >> > There are common admin handler commands with the actions - register /
> >> swap /
> >> > load etc. that seem to be available by default.
> >> >
> >> > I have submitted a patch to add custom admin handlers , against custom
> >> > actions  ( that also refactors the existing action handlers that are
> >> > available by default as well ).
> >> >
> >> > This would be useful to extend the handlers that need access to
> multiple
> >> > cores.  Just curious if this is something that could be looked into .
> >> > Thanks.
> >> >
> >>
> >>
> >>
> >> --
> >> --Noble Paul
> >>
> >
>
>
>
> --
> --Noble Paul
>

Re: SOLR-1106 - Custom Admin Action handler

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
On Mon, Apr 13, 2009 at 10:03 PM, Kay Kay <ka...@gmail.com> wrote:
> These custom action handlers need not be residing in solr . Hence I needed a
> hook ( listener ) that they can register themselves with and be loaded by
> the SolrResourceLoader ( ./lib/*.jar ) .  Also I believe the default
> handlers are very useful , necessary and mandatory and hence ported them to
> the listener for consistency purposes.
>
> Also - if we have a protected method called invokeCommand() - how do we
> inject that type as the admin handler ( as opposed to CoreAdminHandler) .
> Right now - the type information seems hardcoded in CoreContainer though.

There is no mean to inject that currently, But that can be made
possible by an extra attribute in the <cores> tag . say <core
adminHandler="foo.FooHandler">

We will have to refactor the code a bit so that you may be able to
extend the default core admin handler
>
>  // ---------------- Multicore self related methods ---------------
>  /**
>   * Creates a CoreAdminHandler for this MultiCore.
>   * @return a CoreAdminHandler
>   */
>  protected CoreAdminHandler createMultiCoreHandler() {
>    return new CoreAdminHandler() {
>      @Override
>      public CoreContainer getCoreContainer() {
>        return CoreContainer.this;
>      }
>    };
>  }
>
>
> 2009/4/13 Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>
>
>> Hi Kay,
>>
>> The idea of one handler per command looks like an overkill. How about
>> having a protected methods for all the known commands and have a
>> separate method invokeCommand() which can choose to implement any
>> extra commands if need be. This way the changes needed would be
>> minimal.
>>
>> On Mon, Apr 13, 2009 at 8:53 PM, Kay Kay <ka...@gmail.com> wrote:
>> > For one of our projects - we need custom admin monitoring hooks that gets
>> > access to multiple cores for a given solr web app (through the
>> CoreContainer
>> > interface).
>> >
>> > There are common admin handler commands with the actions - register /
>> swap /
>> > load etc. that seem to be available by default.
>> >
>> > I have submitted a patch to add custom admin handlers , against custom
>> > actions  ( that also refactors the existing action handlers that are
>> > available by default as well ).
>> >
>> > This would be useful to extend the handlers that need access to multiple
>> > cores.  Just curious if this is something that could be looked into .
>> > Thanks.
>> >
>>
>>
>>
>> --
>> --Noble Paul
>>
>



-- 
--Noble Paul

Re: SOLR-1106 - Custom Admin Action handler

Posted by Kay Kay <ka...@gmail.com>.
These custom action handlers need not be residing in solr . Hence I needed a
hook ( listener ) that they can register themselves with and be loaded by
the SolrResourceLoader ( ./lib/*.jar ) .  Also I believe the default
handlers are very useful , necessary and mandatory and hence ported them to
the listener for consistency purposes.

Also - if we have a protected method called invokeCommand() - how do we
inject that type as the admin handler ( as opposed to CoreAdminHandler) .
Right now - the type information seems hardcoded in CoreContainer though.

  // ---------------- Multicore self related methods ---------------
  /**
   * Creates a CoreAdminHandler for this MultiCore.
   * @return a CoreAdminHandler
   */
  protected CoreAdminHandler createMultiCoreHandler() {
    return new CoreAdminHandler() {
      @Override
      public CoreContainer getCoreContainer() {
        return CoreContainer.this;
      }
    };
  }


2009/4/13 Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>

> Hi Kay,
>
> The idea of one handler per command looks like an overkill. How about
> having a protected methods for all the known commands and have a
> separate method invokeCommand() which can choose to implement any
> extra commands if need be. This way the changes needed would be
> minimal.
>
> On Mon, Apr 13, 2009 at 8:53 PM, Kay Kay <ka...@gmail.com> wrote:
> > For one of our projects - we need custom admin monitoring hooks that gets
> > access to multiple cores for a given solr web app (through the
> CoreContainer
> > interface).
> >
> > There are common admin handler commands with the actions - register /
> swap /
> > load etc. that seem to be available by default.
> >
> > I have submitted a patch to add custom admin handlers , against custom
> > actions  ( that also refactors the existing action handlers that are
> > available by default as well ).
> >
> > This would be useful to extend the handlers that need access to multiple
> > cores.  Just curious if this is something that could be looked into .
> > Thanks.
> >
>
>
>
> --
> --Noble Paul
>

Re: SOLR-1106 - Custom Admin Action handler

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
Hi Kay,

The idea of one handler per command looks like an overkill. How about
having a protected methods for all the known commands and have a
separate method invokeCommand() which can choose to implement any
extra commands if need be. This way the changes needed would be
minimal.

On Mon, Apr 13, 2009 at 8:53 PM, Kay Kay <ka...@gmail.com> wrote:
> For one of our projects - we need custom admin monitoring hooks that gets
> access to multiple cores for a given solr web app (through the CoreContainer
> interface).
>
> There are common admin handler commands with the actions - register / swap /
> load etc. that seem to be available by default.
>
> I have submitted a patch to add custom admin handlers , against custom
> actions  ( that also refactors the existing action handlers that are
> available by default as well ).
>
> This would be useful to extend the handlers that need access to multiple
> cores.  Just curious if this is something that could be looked into .
> Thanks.
>



-- 
--Noble Paul

Re: SOLR-1106 - Custom Admin Action handler

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
hi hoss .I am adding the responses to the issue

https://issues.apache.org/jira/browse/SOLR-1106

On Sat, Apr 18, 2009 at 3:25 AM, Chris Hostetter
<ho...@fucit.org> wrote:
>
> : For one of our projects - we need custom admin monitoring hooks that gets
> : access to multiple cores for a given solr web app (through the CoreContainer
> : interface).
>
> i've only skimed the back and forth in this thread (and in the issue
> comments) but i'm wondering why/if this specificaly needs to be done as
> extensions to the CoreAdminHandler?
>
> Any Core can get access to the CoreContainer (via
> core.getCoreDescriptor().getCoreContainer()) and all of the SolrCores it
> is managing, so couldn't these new hooks you need be implented in regular
> RequestHandler?
>
> I ask this from the "how to achieve a niche goal with the minimal number
> of invasive changes" standpoint -- mainly because i don't really
> understand what new types of "monitoring hooks" you're thinking of.  if
> they seem like something that would be generally useful to lots of people,
> why not add them to CoreAdminHandler?  if they *pattern* of adding them
> seems like something that will come up for lots of people *then* i would
> worry about making CoreAdminHandler more extensible.
>
>
>
> -Hoss
>
>



-- 
--Noble Paul

Re: SOLR-1106 - Custom Admin Action handler

Posted by Chris Hostetter <ho...@fucit.org>.
: For one of our projects - we need custom admin monitoring hooks that gets
: access to multiple cores for a given solr web app (through the CoreContainer
: interface).

i've only skimed the back and forth in this thread (and in the issue 
comments) but i'm wondering why/if this specificaly needs to be done as 
extensions to the CoreAdminHandler?

Any Core can get access to the CoreContainer (via 
core.getCoreDescriptor().getCoreContainer()) and all of the SolrCores it 
is managing, so couldn't these new hooks you need be implented in regular 
RequestHandler?

I ask this from the "how to achieve a niche goal with the minimal number 
of invasive changes" standpoint -- mainly because i don't really 
understand what new types of "monitoring hooks" you're thinking of.  if 
they seem like something that would be generally useful to lots of people, 
why not add them to CoreAdminHandler?  if they *pattern* of adding them 
seems like something that will come up for lots of people *then* i would 
worry about making CoreAdminHandler more extensible.



-Hoss