[hibernate-dev] Re: Pushing indexes through JGroups

Emmanuel Bernard emmanuel at hibernate.org
Sun Jun 14 11:41:35 EDT 2009


Looks good :)

I have a few comments on top of Sanne's

o JGroupsBackendQueueProcessorFactory
Should the channel name have a default name? Could answer yes or no, I  
am just wondering.
Empty cfg when you are done using it, or even better don't keep it  
around and pass it as parameters


o JGroupsAbstractMessageReceiver
getState / setState. What's that?
why those unimplemented methods? Is that expected?
Generally speaking add comments where the code is not obvious

o Tests
I haven't tested nor ahve looked long at the tests
Why do you use plain SQL in one test to creste the object? wouldn't  
Hibernate work?
in SearchTestCase protected static File indexDir; => better to expose  
a protected getter I guess


o Configuration for JGroups
I'm surprised there is no config on the JGroups side
Is there some recommendation wrt guaranteed delivery etc?
Could we somehow extract two or three default profiles (as well as a  
custom one?)

o point #4
I agree with Sanne, the configuration is too opaque and fragile. I  
would create:
  - MasterJGroupsBackendQueueProcessorFactory
  - SlaveJGroupsBackendQueueProcessorFactory
The code will be cleaner.

o point #5
I dont' think that can work easily but we can explore. Maybe by  
providing the JNDI name of either the EMF or the SessionFactory we can  
have a configuration only approach.

o point #6
I agree Producers and Receivers is confusing for an Hibernate Search  
user, let's mask these notions and replace them with master and slaves.

o docs and logs
Generally speaking the code is simple enough that it's reasable but a  
few comments were things are surprising will help
logs (debug / trace level) can be of help.

On  Jun 9, 2009, at 19:02, Łukasz Moreń wrote:

> Hi,
>
> I've finished task concerning JMS replacement with JGroups. The  
> patch is attached. The general idea of pushing indexes through JG is  
> assured, however there are issues to improve (i.e. flexible JG  
> protocol stack configuration). Any review or advices would be  
> welcome to make sure that I am not going into blind alley.
>
> Thanks,
> Lukasz
>
> 2009/5/27 Emmanuel Bernard <emmanuel at hibernate.org>
> Lukasz,
> I have been discussing with Manik on #3 and we think that JBoss  
> Cache / Infinispan are probably a better fit than plain JGroups for  
> that as all the plumbing will be configured for you.
> When you reach this problem, let's revive this discussion.
>
>
> On  May 25, 2009, at 11:07, Hardy Ferentschik wrote:
>
> Hi,
>
> I talked with Łukasz about this last wekk. Definitely, #1 and #3.
> #2 I don't like either.
>
> The befefit of #3 would also be that one could drop the requirement of
> having a shared file system (NFS, NAS, ...) #3 should be quite easy to
> implement. Maybe easy to get started with.
>
> --Hardy
>
> On Mon, 25 May 2009 10:55:52 +0200, Emmanuel Bernard <emmanuel at hibernate.org 
> > wrote:
>
> Hello
> I am not sure this is where we should go, or at least, it depends.  
> here are three scenarii
>
>
> #1 JMS replacement
> If you want to use JGroups as a replacement for the JMS backend,  
> then I think you should write a jgroups backend. Check  
> org.hibernate.search.backend.impl.jms
> In this case all changes are sent via JGroups to a "master". The  
> master could be voted by the cluster possibly dynamically but that's  
> not necessary for the first version.
>
> #2 apply indexing on all nodes
> JGroups could send the work queue to all nodes and each node could  
> apply the change.
> for various reasons I am not fan of this solution as it creates  
> overhead in CPU / memory usage and does nto scale very well from a  
> theoretical PoV.
>
> #3 Index copy
> this is what you are describing, copying the index using JGroups  
> instead of my file system approach. This might have merits esp as we  
> could diminish network traffic using multicast but it also require  
> to rethink the master / slave modus operandi.
> Today the master copy on a regular basis a clean index to a shared  
> directory
> On a regular basis, the slave go and copy the clean index from the  
> shared directory.
> In your approach, the master would send changes to the slaves and  
> slaves would have to apply them "right away" (on their passive  
> version)
>
> I think #1 is more interesting than #3, we probably should start  
> with that. #3 might be interesting too, thoughts?
>
> Emmanuel
>
> PS: refactoring is a fact of life, so feel free to do so. Just don't  
> break public contracts.
>
> On  May 21, 2009, at 22:14, Łukasz Moreń wrote:
>
> Hi,
>
> I have few questions that concern using JGroups to copy index files.  
> I think to create sender(for master) and receiver(slave) directory  
> providers.
> Sender class mainly based on existing FSMasterDirectoryProvider,  
> first create local index copy and send later to slave nodes
> (or send without copying, but that may cause lower performance?).
> To avoid code redundancy it would be good to refactor a little  
> FSMasterDirectoryProvider class, so then I can use copying  
> functionality in new DirectoryProvider and add sending one; or  
> rather I should work around it?
>
> I do not understand completely how does the multithreading access to  
> index file work. Does FileChannel class assure that, when index is  
> copied and new Lucene works are pushed?
>
>
>
>
>
> < 
> JGroups_Backend_draft_10 
> -06-2009.patch>_______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-dev/attachments/20090614/a6c34ff5/attachment.html 


More information about the hibernate-dev mailing list