getTimestamp method in IndexCommit

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

getTimestamp method in IndexCommit

Akshay-8
Hi,

We need a feature for time based cleanup of IndexCommits. Would it be
possible to add a method to IndexCommit class to get the timestamp of an
index commit?

Thanks.

--
Regards,
Akshay Ukey.
Reply | Threaded
Open this post in threaded view
|

Re: getTimestamp method in IndexCommit

Michael McCandless-2

Are you thinking this would just fallback to Directory.fileModified on  
the segments_N file for that commit?

You could actually do that without any API change, because IndexCommit  
exposes a getSegmentsFileName().

Mike

Akshay wrote:

> Hi,
>
> We need a feature for time based cleanup of IndexCommits. Would it be
> possible to add a method to IndexCommit class to get the timestamp  
> of an
> index commit?
>
> Thanks.
>
> --
> Regards,
> Akshay Ukey.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: getTimestamp method in IndexCommit

Noble Paul നോബിള്‍  नोब्ळ्
On Tue, Sep 2, 2008 at 1:56 PM, Michael McCandless
<[hidden email]> wrote:
>
> Are you thinking this would just fallback to Directory.fileModified on the
> segments_N file for that commit?
>
> You could actually do that without any API change, because IndexCommit
> exposes a getSegmentsFileName().
If it is a RAMDirectory how can we get the lastmodified?
Isn't it a lot of overhead to read the file modified time everytime
the timestamp is tobe obtained?

>
> Mike
>
> Akshay wrote:
>
>> Hi,
>>
>> We need a feature for time based cleanup of IndexCommits. Would it be
>> possible to add a method to IndexCommit class to get the timestamp of an
>> index commit?
>>
>> Thanks.
>>
>> --
>> Regards,
>> Akshay Ukey.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



--
--Noble Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: getTimestamp method in IndexCommit

Michael McCandless-2

Noble Paul നോബിള്‍ नोब्ळ् wrote:

> On Tue, Sep 2, 2008 at 1:56 PM, Michael McCandless
> <[hidden email]> wrote:
>>
>> Are you thinking this would just fallback to Directory.fileModified  
>> on the
>> segments_N file for that commit?
>>
>> You could actually do that without any API change, because  
>> IndexCommit
>> exposes a getSegmentsFileName().
> If it is a RAMDirectory how can we get the lastmodified?

RAMDirectory will report the System.currentTimeMillis() when the file  
was last changed.  Is that not sufficient?

> Isn't it a lot of overhead to read the file modified time everytime
> the timestamp is tobe obtained?

I would think this method does not need to be super fast -- how  
frequently are you planning to call it?

Note that the segments_N file has no other means of extracting a  
timestamp for itself; it does not store a timestamp internally or  
anything.

Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: getTimestamp method in IndexCommit

Noble Paul നോബിള്‍  नोब्ळ्
On Wed, Sep 3, 2008 at 2:06 PM, Michael McCandless
<[hidden email]> wrote:

>
> Noble Paul നോബിള്‍ नोब्ळ् wrote:
>
>> On Tue, Sep 2, 2008 at 1:56 PM, Michael McCandless
>> <[hidden email]> wrote:
>>>
>>> Are you thinking this would just fallback to Directory.fileModified on
>>> the
>>> segments_N file for that commit?
>>>
>>> You could actually do that without any API change, because IndexCommit
>>> exposes a getSegmentsFileName().
>>
>> If it is a RAMDirectory how can we get the lastmodified?
>
> RAMDirectory will report the System.currentTimeMillis() when the file was
> last changed.  Is that not sufficient?
>
>> Isn't it a lot of overhead to read the file modified time everytime
>> the timestamp is tobe obtained?
>
> I would think this method does not need to be super fast -- how frequently
> are you planning to call it?
Only during a onCommit() or a onInit(). So if the commit point is
passed over multiple times it would call this as many times.Not a big
deal in terms of performance. But it is still some 3-4 lines of code
which could very well be added to the API and exposed as a method
getTimestamp()

>
> Note that the segments_N file has no other means of extracting a timestamp
> for itself; it does not store a timestamp internally or anything.
>
> Mike
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



--
--Noble Paul
Reply | Threaded
Open this post in threaded view
|

Re: getTimestamp method in IndexCommit

Michael McCandless-2

Noble Paul നോബിള്‍ नोब्ळ् wrote:

> On Wed, Sep 3, 2008 at 2:06 PM, Michael McCandless
> <[hidden email]> wrote:
>>
>> Noble Paul നോബിള്‍ नोब्ळ् wrote:
>>
>>> On Tue, Sep 2, 2008 at 1:56 PM, Michael McCandless
>>> <[hidden email]> wrote:
>>>>
>>>> Are you thinking this would just fallback to  
>>>> Directory.fileModified on
>>>> the
>>>> segments_N file for that commit?
>>>>
>>>> You could actually do that without any API change, because  
>>>> IndexCommit
>>>> exposes a getSegmentsFileName().
>>>
>>> If it is a RAMDirectory how can we get the lastmodified?
>>
>> RAMDirectory will report the System.currentTimeMillis() when the  
>> file was
>> last changed.  Is that not sufficient?
>>
>>> Isn't it a lot of overhead to read the file modified time everytime
>>> the timestamp is tobe obtained?
>>
>> I would think this method does not need to be super fast -- how  
>> frequently
>> are you planning to call it?
> Only during a onCommit() or a onInit(). So if the commit point is
> passed over multiple times it would call this as many times.Not a big
> deal in terms of performance. But it is still some 3-4 lines of code
> which could very well be added to the API and exposed as a method
> getTimestamp()

OK I'll commit this -- it's trivial.  It's simply convenience for  
calling Directory.fileModified.

>>
>> Note that the segments_N file has no other means of extracting a  
>> timestamp
>> for itself; it does not store a timestamp internally or anything.
>>
>> Mike
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
>
> --
> --Noble Paul


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: getTimestamp method in IndexCommit

Noble Paul നോബിള്‍  नोब्ळ्
YOU ARE FAST
thanks.

--Noble

On Thu, Sep 4, 2008 at 2:54 PM, Michael McCandless
<[hidden email]> wrote:

>
> Noble Paul നോബിള്‍ नोब्ळ् wrote:
>
>> On Wed, Sep 3, 2008 at 2:06 PM, Michael McCandless
>> <[hidden email]> wrote:
>>>
>>> Noble Paul നോബിള്‍ नोब्ळ् wrote:
>>>
>>>> On Tue, Sep 2, 2008 at 1:56 PM, Michael McCandless
>>>> <[hidden email]> wrote:
>>>>>
>>>>> Are you thinking this would just fallback to Directory.fileModified on
>>>>> the
>>>>> segments_N file for that commit?
>>>>>
>>>>> You could actually do that without any API change, because IndexCommit
>>>>> exposes a getSegmentsFileName().
>>>>
>>>> If it is a RAMDirectory how can we get the lastmodified?
>>>
>>> RAMDirectory will report the System.currentTimeMillis() when the file was
>>> last changed.  Is that not sufficient?
>>>
>>>> Isn't it a lot of overhead to read the file modified time everytime
>>>> the timestamp is tobe obtained?
>>>
>>> I would think this method does not need to be super fast -- how
>>> frequently
>>> are you planning to call it?
>>
>> Only during a onCommit() or a onInit(). So if the commit point is
>> passed over multiple times it would call this as many times.Not a big
>> deal in terms of performance. But it is still some 3-4 lines of code
>> which could very well be added to the API and exposed as a method
>> getTimestamp()
>
> OK I'll commit this -- it's trivial.  It's simply convenience for calling
> Directory.fileModified.
>
>>>
>>> Note that the segments_N file has no other means of extracting a
>>> timestamp
>>> for itself; it does not store a timestamp internally or anything.
>>>
>>> Mike
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>>
>>
>> --
>> --Noble Paul
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



--
--Noble Paul
Reply | Threaded
Open this post in threaded view
|

Re: getTimestamp method in IndexCommit

Michael McCandless-2

Thanks for raising it!

It's through requests like this that Lucene's API improves.

Mike

Noble Paul നോബിള്‍ नोब्ळ् wrote:

> YOU ARE FAST
> thanks.
>
> --Noble
>
> On Thu, Sep 4, 2008 at 2:54 PM, Michael McCandless
> <[hidden email]> wrote:
>>
>> Noble Paul നോബിള്‍ नोब्ळ् wrote:
>>
>>> On Wed, Sep 3, 2008 at 2:06 PM, Michael McCandless
>>> <[hidden email]> wrote:
>>>>
>>>> Noble Paul നോബിള്‍ नोब्ळ् wrote:
>>>>
>>>>> On Tue, Sep 2, 2008 at 1:56 PM, Michael McCandless
>>>>> <[hidden email]> wrote:
>>>>>>
>>>>>> Are you thinking this would just fallback to  
>>>>>> Directory.fileModified on
>>>>>> the
>>>>>> segments_N file for that commit?
>>>>>>
>>>>>> You could actually do that without any API change, because  
>>>>>> IndexCommit
>>>>>> exposes a getSegmentsFileName().
>>>>>
>>>>> If it is a RAMDirectory how can we get the lastmodified?
>>>>
>>>> RAMDirectory will report the System.currentTimeMillis() when the  
>>>> file was
>>>> last changed.  Is that not sufficient?
>>>>
>>>>> Isn't it a lot of overhead to read the file modified time  
>>>>> everytime
>>>>> the timestamp is tobe obtained?
>>>>
>>>> I would think this method does not need to be super fast -- how
>>>> frequently
>>>> are you planning to call it?
>>>
>>> Only during a onCommit() or a onInit(). So if the commit point is
>>> passed over multiple times it would call this as many times.Not a  
>>> big
>>> deal in terms of performance. But it is still some 3-4 lines of code
>>> which could very well be added to the API and exposed as a method
>>> getTimestamp()
>>
>> OK I'll commit this -- it's trivial.  It's simply convenience for  
>> calling
>> Directory.fileModified.
>>
>>>>
>>>> Note that the segments_N file has no other means of extracting a
>>>> timestamp
>>>> for itself; it does not store a timestamp internally or anything.
>>>>
>>>> Mike
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> --Noble Paul
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
>
> --
> --Noble Paul


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]