[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-275) support NIOFSDirectory and others as optimized FSDirectory extensions

Hardy Ferentschik (JIRA) noreply at atlassian.com
Mon Nov 8 06:36:13 EST 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=39063#action_39063 ] 

Hardy Ferentschik commented on HSEARCH-275:
-------------------------------------------

It is not a pure documentation issue (at least not anymore). As of Lucene 3.0 {{FSDirectory.open}} will never return a {{MMapDirectory}}. You will have to instantiate this directory yourself. 
As mentioned before {{NIOFSDiretory}} is already the default on non Windows systems:
{code:title=FSDirectory.java|borderStyle=solid}
...
    if (Constants.WINDOWS) {
      return new SimpleFSDirectory(path, lockFactory);
    } else {
      return new NIOFSDirectory(path, lockFactory);
    }
...
{code}
where {{Constants.WINDOWS}} is the system property _os.name_. I guess one can override the _os.name_ property on the command line when starting the JVM to get an {{NIOFSDirectory}} on Windows. However, this is really a hack and maybe other parts of the app depend on the property as well.

The best solution is to either provide additional options in our configuration to be able to control which subclass of {{FSDirectory}} to instantiate or to just add {{NIOFSDirectoryProvider}} and {{MMapDirectoryProvider}} implementations. I prefer the latter since we have already so many configuration options and having explicit provider classes seems clearer.

> support NIOFSDirectory and others as optimized FSDirectory extensions
> ---------------------------------------------------------------------
>
>                 Key: HSEARCH-275
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-275
>             Project: Hibernate Search
>          Issue Type: Improvement
>            Reporter: Sanne Grinovero
>            Assignee: Sanne Grinovero
>             Fix For: 3.3.0.CR1
>
>
> # LUCENE-753: Added new Directory implementation org.apache.lucene.store.NIOFSDirectory, which uses java.nio's FileChannel to do file reads. On most non-Windows platforms, with many threads sharing a single searcher, this may yield sizable improvement to query throughput when compared to FSDirectory, which only allows a single thread to read from an open file at a time.
> (Jason Rutherglen via Mike McCandless)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list