jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Attila Király (JIRA) <j...@apache.org>
Subject [jira] Commented: (JCR-2067) FileDataStore: only open a stream when really necessary
Date Tue, 12 May 2009 07:30:45 GMT

    [ https://issues.apache.org/jira/browse/JCR-2067?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12708352#action_12708352

Attila Király commented on JCR-2067:

We run into a "too many open files" problem with using FileDataStore and adding a massive
ammount of data to the repository (around 80GB documents). We were not searching just adding
elements to the repository.

However using the modifications of this issue (namly /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/FileDataRecord.java
and /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/LazyFileInputStream.java)
solves our issue. Is it possible that this modification gets ported to the 1.5.x branch?

We tested with 1.5.5 and these two files.

> FileDataStore: only open a stream when really necessary
> -------------------------------------------------------
>                 Key: JCR-2067
>                 URL: https://issues.apache.org/jira/browse/JCR-2067
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
> Currently, PropertyImpl.getValue() opens a FileInputStream if the FileDataStore is used.
> If the application doesn't use the value, this stream is never closed.
> PropertyImpl.getValue():
>   return internalGetValue().toJCRValue(session);
> InternalValue.toJCRValue(..):
>   case PropertyType.BINARY:
>     return new BinaryValue(((BLOBFileValue) val).getStream());
> BLOBInDataStore.getStream():
>   return getDataRecord().getStream();
> FileDataRecord.getStream():
>   return new FileInputStream(file);
> One solution is to return a 'lazy' file input stream that only opens the file when reading
from the stream (and closing the file when the last byte was read). Maybe there is already
a class (in Apache Commons maybe?) that can do that.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message