Examples of openInput()


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

        }
        Directory dir = newDirectory();
        IndexOutput out = dir.createOutput("bytes", IOContext.DEFAULT);
        bytes.writeTo(out);
        out.close();
        IndexInput in = dir.openInput("bytes", IOContext.DEFAULT);
        bytesToVerify = new BytesStore(in, numBytes, _TestUtil.nextInt(random(), 256, Integer.MAX_VALUE));
        in.close();
        dir.close();
      } else {
        bytesToVerify = bytes;
View Full Code Here

Examples of org.apache.lucene.store.MMapDirectory.openInput()

          if (verify == 0) {
            System.out.println("\nTEST: save/load FST and re-verify");
            IndexOutput out = dir.createOutput("fst", IOContext.DEFAULT);
            fst.save(out);
            out.close();
            IndexInput in = dir.openInput("fst", IOContext.DEFAULT);
            fst = new FST<Object>(in, outputs);
            in.close();
          } else {
            dir.deleteFile("fst");
          }
View Full Code Here

Examples of org.apache.lucene.store.MockDirectoryWrapper.openInput()

      String fileNameIn = SegmentInfos.getCurrentSegmentFileName(dir);
      String fileNameOut = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS,
                                                                 "",
                                                                 1+gen);
      IndexInput in = dir.openInput(fileNameIn);
      IndexOutput out = dir.createOutput(fileNameOut);
      long length = in.length();
      for(int i=0;i<length-1;i++) {
        out.writeByte(in.readByte());
      }
View Full Code Here

Examples of org.apache.lucene.store.MockDirectoryWrapper.openInput()

      // writing segments file:
      String fileNameIn = SegmentInfos.getCurrentSegmentFileName(dir);
      String fileNameOut = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS,
                                                                 "",
                                                                 1+gen);
      IndexInput in = dir.openInput(fileNameIn);
      IndexOutput out = dir.createOutput(fileNameOut);
      long length = in.length();
      for(int i=0;i<length-1;i++) {
        out.writeByte(in.readByte());
      }
View Full Code Here

Examples of org.apache.lucene.store.MockRAMDirectory.openInput()

    long gen = SegmentInfos.getCurrentSegmentGeneration(dir);
    assertTrue("segment generation should be > 1 but got " + gen, gen > 1);

    final String segmentsFileName = SegmentInfos.getCurrentSegmentFileName(dir);
    IndexInput in = dir.openInput(segmentsFileName);
    IndexOutput out = dir.createOutput(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", 1+gen));
    out.copyBytes(in, in.length()-1);
    byte b = in.readByte();
    out.writeByte((byte) (1+b));
    out.close();
View Full Code Here

Examples of org.apache.lucene.store.RAMDirectory.openInput()

        // writing segments file:
        String fileNameIn = SegmentInfos.getCurrentSegmentFileName(dir);
        String fileNameOut = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS,
                                                                   "",
                                                                   1+gen);
        IndexInput in = dir.openInput(fileNameIn);
        IndexOutput out = dir.createOutput(fileNameOut);
        long length = in.length();
        for(int i=0;i<length-1;i++) {
          out.writeByte(in.readByte());
        }
View Full Code Here

Examples of org.apache.lucene.store.RAMDirectory.openInput()

        String fileNameIn = SegmentInfos.getCurrentSegmentFileName(dir);
        String fileNameOut = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS,
                                                                   "",
                                                                   1+gen);
        IndexInput in = dir.openInput(fileNameIn);
        IndexOutput out = dir.createOutput(fileNameOut);
        long length = in.length();
        for(int i=0;i<length-1;i++) {
          out.writeByte(in.readByte());
        }
View Full Code Here

Examples of org.apache.lucene.store.RAMDirectory.openInput()

    Random random = random();
    final RAMDirectory dir = new RAMDirectory();
    IndexOutput os = dir.createOutput("foo", newIOContext(random));
    os.writeBytes(READ_TEST_BYTES, READ_TEST_BYTES.length);
    os.close();
    IndexInput is = dir.openInput("foo", newIOContext(random));
    checkReads(is, IOException.class);
    is.close();
   
    os = dir.createOutput("bar", newIOContext(random));
    os.writeBytes(RANDOM_TEST_BYTES, RANDOM_TEST_BYTES.length);
View Full Code Here

Examples of org.apache.lucene.store.RAMDirectory.openInput()

    is.close();
   
    os = dir.createOutput("bar", newIOContext(random));
    os.writeBytes(RANDOM_TEST_BYTES, RANDOM_TEST_BYTES.length);
    os.close();
    is = dir.openInput("bar", newIOContext(random));
    checkRandomReads(is);
    is.close();
    dir.close();
  }
View Full Code Here

Examples of org.apache.lucene.store.RAMDirectory.openInput()

        // writing segments file:
        String fileNameIn = SegmentInfos.getCurrentSegmentFileName(dir);
        String fileNameOut = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS,
                                                                   "",
                                                                   1+gen);
        IndexInput in = dir.openInput(fileNameIn);
        IndexOutput out = dir.createOutput(fileNameOut);
        long length = in.length();
        for(int i=0;i<length-1;i++) {
          out.writeByte(in.readByte());
        }
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.