Package org.apache.lucene.store

Examples of org.apache.lucene.store.FSDirectory$FSIndexInput$Descriptor


    assertNotNull(indexFactory2.getAnalyzer());
    assertNotSame(analyzer, indexFactory2.getAnalyzer());
  }

  private void testFSDirectoryCreation(ApplicationContext context, Analyzer analyzer) {
    FSDirectory directory1 = (FSDirectory)context.getBean("fsDirectory-fsDirectory1");
    assertNotNull(directory1);
    assertNotNull(directory1.getFile());
   
    SimpleIndexFactory indexFactory1 = (SimpleIndexFactory)context.getBean("fsDirectory1");
    assertNotNull(indexFactory1);
    assertSame(directory1, indexFactory1.getDirectory());
    assertSame(analyzer, indexFactory1.getAnalyzer());

    FSDirectory directory2 = (FSDirectory)context.getBean("fsDirectory-fsDirectory2");
    assertNotNull(directory2);
    assertNotNull(directory2.getFile());

    SimpleIndexFactory indexFactory2 = (SimpleIndexFactory)context.getBean("fsDirectory2");
    assertNotNull(indexFactory2);
    assertNotNull(indexFactory2.getDirectory());
    assertSame(directory2, indexFactory2.getDirectory());
View Full Code Here


    ChannelIndexFactory channelIndexFactory1 = (ChannelIndexFactory)context.getBean("fsDirectory1");
    assertNotNull(channelIndexFactory1);
    assertSame(indexFactory1, channelIndexFactory1.getTargetIndexFactory());*/

    FSDirectory directory2 = (FSDirectory)context.getBean("fsDirectory-fsDirectory2");
    assertNotNull(directory2);
    assertNotNull(directory2.getFile());
   
    SimpleIndexFactory indexFactory2 = (SimpleIndexFactory)context.getBean("target-fsDirectory2");
    assertNotNull(indexFactory2);
    assertSame(directory2, indexFactory2.getDirectory());
    assertSame(analyzer, indexFactory2.getAnalyzer());

    LockIndexFactory channelIndexFactory2 = (LockIndexFactory)context.getBean("fsDirectory2");
    assertNotNull(channelIndexFactory2);
    assertSame(indexFactory2, channelIndexFactory2.getTargetIndexFactory());

    //Directories 3 & 4
    /*FSDirectory directory3 = (FSDirectory)context.getBean("fsDirectory-fsDirectory3");
    assertNotNull(directory3);
    assertNotNull(directory3.getFile());

    SimpleIndexFactory indexFactory3 = (SimpleIndexFactory)context.getBean("target-fsDirectory3");
    assertNotNull(indexFactory3);
    assertNotNull(indexFactory3.getDirectory());
    assertSame(directory3, indexFactory3.getDirectory());
    assertNotNull(indexFactory3.getAnalyzer());
    assertNotSame(analyzer, indexFactory3.getAnalyzer());

    ChannelIndexFactory channelIndexFactory3 = (ChannelIndexFactory)context.getBean("fsDirectory3");
    assertNotNull(channelIndexFactory3);
    assertSame(indexFactory3, channelIndexFactory3.getTargetIndexFactory());*/

    FSDirectory directory4 = (FSDirectory)context.getBean("fsDirectory-fsDirectory4");
    assertNotNull(directory4);
    assertNotNull(directory4.getFile());

    SimpleIndexFactory indexFactory4 = (SimpleIndexFactory)context.getBean("target-fsDirectory4");
    assertNotNull(indexFactory4);
    assertNotNull(indexFactory4.getDirectory());
    assertSame(directory4, indexFactory4.getDirectory());
View Full Code Here

        }

        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

TOP

Related Classes of org.apache.lucene.store.FSDirectory$FSIndexInput$Descriptor

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.