Identifying open segments.

2021-01-05 Thread Jacob Ward
Hello,

I am looking for a way to identify the open segment files in a lucene
index, so that I can export only the closed segments (and the segmentsN
file). My current ideas are:

- Ignore any segment files newer than the segmentsN file.
OR
- Open the segmentsN file using Lucene core's SegmentInfos class (which I
presume would allow me to identify which are the closed segments).

Could anyone provide suggestions on how to do this best? Ideally I'd like
to do this without the SegmentInfos class if there is a suitable method.

Thanks.

-- 

Jacob Ward|Graduate Data Infrastructure Engineer

jw...@brandwatch.com


NEW YORK   | BOSTON   | BRIGHTON   | LONDON   | BERLIN |   STUTTGART |
PARIS   | SINGAPORE | SYDNEY


Re: Identifying open segments.

2021-01-06 Thread Jacob Ward
Thanks Ilan.

Yes I'm working on a process for distributing and backing-up indexes
externally. I discovered the beauty of the snapshot API which does exactly
what I want - temporarily protects closed segments and returns a list of
all files requires to restore that snapshot.

On Tue, 5 Jan 2021 at 23:11, Ilan Ginzburg  wrote:

> Are you trying to copy the index by an external process not running in
> the Solr JVM? I believe this is risky if the Solr JVM is running at
> the same time. For example segments can be deleted by Solr.
> There might also be closed segments that you do not need but that are
> still on the disk (no longer part of the current commit point).
>
> You could look at backup options in Solr, I believe they basically do
> what you need (I'm not familiar with what's available but I'm sure you
> can find the info).
>
> Ilan
>
>
> On Tue, Jan 5, 2021 at 12:46 PM Jacob Ward  wrote:
> >
> > Hello,
> >
> > I am looking for a way to identify the open segment files in a lucene
> > index, so that I can export only the closed segments (and the segmentsN
> > file). My current ideas are:
> >
> > - Ignore any segment files newer than the segmentsN file.
> > OR
> > - Open the segmentsN file using Lucene core's SegmentInfos class (which I
> > presume would allow me to identify which are the closed segments).
> >
> > Could anyone provide suggestions on how to do this best? Ideally I'd like
> > to do this without the SegmentInfos class if there is a suitable method.
> >
> > Thanks.
> >
> > --
> >
> > Jacob Ward|Graduate Data Infrastructure Engineer
> >
> > jw...@brandwatch.com
> >
> >
> > NEW YORK   | BOSTON   | BRIGHTON   | LONDON   | BERLIN |   STUTTGART |
> > PARIS   | SINGAPORE | SYDNEY
>


-- 

Jacob Ward|Graduate Data Infrastructure Engineer

jw...@brandwatch.com


NEW YORK   | BOSTON   | BRIGHTON   | LONDON   | BERLIN |   STUTTGART |
PARIS   | SINGAPORE | SYDNEY