You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by Vasil Vangelovski <vv...@gmail.com> on 2011/01/06 13:40:47 UTC

Update files in a web based recommender

When does FileDataModel read any update files from the directory?
Specifically if I run a recommender within a servlet much like in
taste-webapp where updates are written to update files in the directory
where the main ratings file is when will the FileDataModel take these
updates into consideration?

Re: Update files in a web based recommender

Posted by Sean Owen <sr...@gmail.com>.
You can name it whatever you like. The update files should have the
same prefix (everything up to the first '.') as the main file.

I forgot. We took out the auto-reload logic a while ago. You have it
reload by calling refresh(). It won't reload changes if the last
update was recent. You could of course set up a simpler Timer to
refresh regularly if you want.

On Thu, Jan 6, 2011 at 7:56 PM, Vasil Vangelovski
<vv...@gmail.com> wrote:
> Should the files be exactly named starting from one as ratings.1.txt or can
> they be named ratings.2011-6.txt?
>
> By looking at the code it's not very clear to me how this mechanism works. I
> can see there's a constructor argument for FileDataModel which defaults to 1
> minute. But, from what I'm seing the model doesn't load changes a few
> minutes after I create the update file.
> Is there some thread that runs and scans the folder periodically? Or should
> refresh be explicitly called on the FileDataModel?
>
> On Thu, Jan 6, 2011 at 1:48 PM, Sean Owen <sr...@gmail.com> wrote:
>
>> By default every few minutes, you could change it though.
>>
>> On Thu, Jan 6, 2011 at 12:40 PM, Vasil Vangelovski
>> <vv...@gmail.com> wrote:
>> > When does FileDataModel read any update files from the directory?
>> > Specifically if I run a recommender within a servlet much like in
>> > taste-webapp where updates are written to update files in the directory
>> > where the main ratings file is when will the FileDataModel take these
>> > updates into consideration?
>> >
>>
>

Re: Update files in a web based recommender

Posted by Vasil Vangelovski <vv...@gmail.com>.
Should the files be exactly named starting from one as ratings.1.txt or can
they be named ratings.2011-6.txt?

By looking at the code it's not very clear to me how this mechanism works. I
can see there's a constructor argument for FileDataModel which defaults to 1
minute. But, from what I'm seing the model doesn't load changes a few
minutes after I create the update file.
Is there some thread that runs and scans the folder periodically? Or should
refresh be explicitly called on the FileDataModel?

On Thu, Jan 6, 2011 at 1:48 PM, Sean Owen <sr...@gmail.com> wrote:

> By default every few minutes, you could change it though.
>
> On Thu, Jan 6, 2011 at 12:40 PM, Vasil Vangelovski
> <vv...@gmail.com> wrote:
> > When does FileDataModel read any update files from the directory?
> > Specifically if I run a recommender within a servlet much like in
> > taste-webapp where updates are written to update files in the directory
> > where the main ratings file is when will the FileDataModel take these
> > updates into consideration?
> >
>

Re: Update files in a web based recommender

Posted by Sean Owen <sr...@gmail.com>.
By default every few minutes, you could change it though.

On Thu, Jan 6, 2011 at 12:40 PM, Vasil Vangelovski
<vv...@gmail.com> wrote:
> When does FileDataModel read any update files from the directory?
> Specifically if I run a recommender within a servlet much like in
> taste-webapp where updates are written to update files in the directory
> where the main ratings file is when will the FileDataModel take these
> updates into consideration?
>