Package org.apache.lucene.store

Examples of org.apache.lucene.store.Directory.sync()


      iw.addDocument(new Document());
      iw.close();
      IndexOutput output = dir.createOutput("_hello.world", IOContext.DEFAULT);
      output.writeString("i am unreferenced!");
      output.close();
      dir.sync(Collections.singleton("_hello.world"));
      dir.close();
    }
  }

  @Test
View Full Code Here


    @Override public void forceSync(String name) throws IOException {
        Directory dir = getDirectory(name);
        if (dir instanceof ForceSyncDirectory) {
            ((ForceSyncDirectory) dir).forceSync(name);
        } else {
            dir.sync(name);
        }
    }

    @Override public IndexInput openInput(String name) throws IOException {
        return getDirectory(name).openInput(name);
View Full Code Here

      iw.addDocument(new Document());
      iw.close();
      IndexOutput output = dir.createOutput("_hello.world", IOContext.DEFAULT);
      output.writeString("i am unreferenced!");
      output.close();
      dir.sync(Collections.singleton("_hello.world"));
      dir.close();
    }
  }

  @Test
View Full Code Here

        Directory dir = getIndexDir();
        for(String file: dir.listAll())
        {
          if( dir.fileExists(file) ) // still exits
          {
            dir.sync(file);
            dir.deleteFile(file);
          }
        }
        dir.close();
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.