Re: locks in solr

2009-11-25 Thread Chris Hostetter
:   Is there any article which explains the locks in solr??
: there is some info on solrconfig.txt which says that you can set the lock
: type to none(NoLockFactory), single(SingleInstanceLockFactory),
: NativeFSLockFactory and simple(SimpleFSLockFactory) which locks everytime we
: create a new file.

FYI: That's not at all what the SimpleFSLockFactory does.

Index locking is a pretty low level Level concept -- there isn't really 
anything Solr specific about it.  90% of all Solr users shouldn't need to 
worry about it, ever.  The only time it becomes an issue is if you are 
planning on doing something extremeley advanced dealing with the Lucene 
index files directly.

if that's the case: your best bet is to read the Locking code and APIs in 
Lucene, and ask your questions on the java-us...@lucene mailing list.



-Hoss



Re: locks in solr

2009-11-25 Thread Shalin Shekhar Mangar
On Wed, Nov 25, 2009 at 3:05 PM, Rakhi Khatwani  wrote:

> Hi,
>  Is there any article which explains the locks in solr??
> there is some info on solrconfig.txt which says that you can set the lock
> type to none(NoLockFactory), single(SingleInstanceLockFactory),
> NativeFSLockFactory and simple(SimpleFSLockFactory) which locks everytime
> we
> create a new file.
> suppose my index dir has the following files:
> _2s.fdt, _2t.fnm, _2u.nrm, _2v.tii, _2x.fdt, _2y.fnm, _2z.nrm, _30.tii,
> _2s.fdx, _2t.frq, _2u.prx, _2v.tis _2x.fdx, _2y.frq _2z.prx, _30.tis,
> _2s.fnm, _2t.nrm, _2u.tii, _2w.fdt _2x.fnm, _2y.nrm _2z.tii, segments_2s,
> _2s.frq, _2t.prx, _2u.tis, _2w.fdx _2x.frq, _2y.prx _2z.tis, segments.gen
>
> 1.)   I assume for each of these files there is a lock. please correct me
> if
> i am wrong.
>

No. The index directory has one lock. Individual files are not locked
separately.


> 2.) what are the different lock types in terms of read/write/updates?
>

Locks are only used for preventing more than one IndexWriters (or Solr
instances/cores) writing to the same index. They do not prevent reads. They
also do not prevent multiple writes from the same Solr core (there is some
synchronization but it has nothing to do with these locks)


> 3.) Can we have a document level locking scheme?
>

No. I think you have grossly misunderstood the purpose of locks in Solr.


> 4.) we would like to know the best way to handle multiple simulataneous
> writes to the index
>

With one Solr instance, you can do writes concurrently without a problem.

-- 
Regards,
Shalin Shekhar Mangar.


locks in solr

2009-11-25 Thread Rakhi Khatwani
Hi,
  Is there any article which explains the locks in solr??
there is some info on solrconfig.txt which says that you can set the lock
type to none(NoLockFactory), single(SingleInstanceLockFactory),
NativeFSLockFactory and simple(SimpleFSLockFactory) which locks everytime we
create a new file.
suppose my index dir has the following files:
_2s.fdt, _2t.fnm, _2u.nrm, _2v.tii, _2x.fdt, _2y.fnm, _2z.nrm, _30.tii,
_2s.fdx, _2t.frq, _2u.prx, _2v.tis _2x.fdx, _2y.frq _2z.prx, _30.tis,
_2s.fnm, _2t.nrm, _2u.tii, _2w.fdt _2x.fnm, _2y.nrm _2z.tii, segments_2s,
_2s.frq, _2t.prx, _2u.tis, _2w.fdx _2x.frq, _2y.prx _2z.tis, segments.gen

1.)   I assume for each of these files there is a lock. please correct me if
i am wrong.
2.) what are the different lock types in terms of read/write/updates?
3.) Can we have a document level locking scheme?
4.) we would like to know the best way to handle multiple simulataneous
writes to the index
Thanks a ton,
Raakhi