Package org.apache.lucene.store

Examples of org.apache.lucene.store.FSDirectory

Unfortunately, because of system peculiarities, there is no single overall best implementation. Therefore, we've added the {@link #open} method, to allow Lucene to choosethe best FSDirectory implementation given your environment, and the known limitations of each implementation. For users who have no reason to prefer a specific implementation, it's best to simply use {@link #open}. For all others, you should instantiate the desired implementation directly.

The locking implementation is by default {@link NativeFSLockFactory}, but can be changed by passing in a custom {@link LockFactory} instance. @see Directory


        }

        File cachedir = null;
        if(dir instanceof FSDirectory)
        {
          FSDirectory d=(FSDirectory)dir;
          cachedir=new File(d.getDirectory(), "cacheField");
        }else{
          cachedir=new File(f, "cacheField");
        }
       
       
View Full Code Here


  }

  private void initSourceReader() {
    if (sourceLocation != null) {
      try {
        FSDirectory luceneIndexDir = FSDirectory.open(new File(sourceLocation));
        this.reader = IndexReader.open(luceneIndexDir);
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
View Full Code Here

      // make sure that all index files have been read or are kept open
      // so that if an index update removes them we'll still have them
      String filename=IndexFileNames.segmentFileName(segment, IndexFileNames.FREQ_EXTENSION);
      if(cfsDir instanceof FSDirectory)
      {
        FSDirectory dddir=(FSDirectory)cfsDir;
        freqStream = new BlockBufferInput.KeyInput(cfsDir.openInput(filename, readBufferSize), cfsDir,filename,cfsDir.getP());
        if (fieldInfos.hasProx()) {
      String fname=IndexFileNames.segmentFileName(segment, IndexFileNames.PROX_EXTENSION);
          proxStream = BlockBufferInput.MaybeInstance(cfsDir.openInput(fname, readBufferSize), cfsDir,fname,cfsDir.getP());
        } else {
View Full Code Here

        m1.d.deleteFile(s);
      }
    }
    if(m1.d instanceof FSDirectory)
    {
      FSDirectory fd=(FSDirectory)m1.d;
            FileUtils.forceDelete(fd.getDirectory());
    }
   
    if(m1.d instanceof FileSystemDirectory)
    {
      FileSystemDirectory fd=(FileSystemDirectory)m1.d;
View Full Code Here

        m1.d.deleteFile(s);
      }
    }
    if(m1.d instanceof FSDirectory)
    {
      FSDirectory fd=(FSDirectory)m1.d;
            FileUtils.forceDelete(fd.getDirectory());
    }
   
    if(m1.d instanceof FileSystemDirectory)
    {
      FileSystemDirectory fd=(FileSystemDirectory)m1.d;
View Full Code Here

        if (s1.trim().length() > 0) {
          File f = new File(s1);
          if (!f.exists()) {
            continue;
          }
          FSDirectory d = LinkFSDirectory.open(f,true);
          DirectoryInfo info = new DirectoryInfo();
          info.d = d;
          info.tp = DirectoryInfo.DirTpe.file;
          this.diskDirector.put(s1, info);
          SolrCore.log.info(">>>>> add links "+ s1);
View Full Code Here

            File f=new File(s1);
            if(!f.exists())
            {
              continue;
            }
            FSDirectory d=LinkFSDirectory.open(f);
            DirectoryInfo info=new DirectoryInfo();
            info.d=d;
            info.tp=DirectoryInfo.DirTpe.file;
            diskDirector.put(s1, info);
            SolrCore.log.info(">>>>>LinkFSDirectory readOnlyOpen add links "+s1);
View Full Code Here

        if (s1.trim().length() > 0) {
          File f = new File(s1);
          if (!f.exists()) {
            continue;
          }
          FSDirectory d = LinkFSDirectory.open(f,true);
          DirectoryInfo info = new DirectoryInfo();
          info.d = d;
          info.tp = DirectoryInfo.DirTpe.file;
          this.diskDirector.put(s1, info);
          SolrCore.log.info(">>>>> add links "+ s1);
View Full Code Here

            File f=new File(s1);
            if(!f.exists())
            {
              continue;
            }
            FSDirectory d=LinkFSDirectory.open(f);
            DirectoryInfo info=new DirectoryInfo();
            info.d=d;
            info.tp=DirectoryInfo.DirTpe.file;
            diskDirector.put(s1, info);
            SolrCore.log.info(">>>>>LinkFSDirectory readOnlyOpen add links "+s1);
View Full Code Here

      sb.append("commit{");

      Directory dir = commit.getDirectory();

      if (dir instanceof FSDirectory) {
        FSDirectory fsd = (FSDirectory) dir;
        sb.append("dir=").append(fsd.getDirectory());
      }else if (dir instanceof FileSystemDirectory) {
        FileSystemDirectory fsd = (FileSystemDirectory) dir;
          sb.append("dir=").append(fsd.directory.toString());
        }else {
        sb.append("dir=").append(dir);
View Full Code Here

TOP

Related Classes of org.apache.lucene.store.FSDirectory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.