Package org.apache.lucene.store

Examples of org.apache.lucene.store.IndexOutput.writeInt()


          indexStream.writeInt(FieldsWriterCompress.FORMAT_CURRENT);
          fieldsStream=new FdtCompressIndexOutput(fdt,1024*512);
          fieldsStream.writeInt(FieldsWriterCompress.FORMAT_CURRENT);

      }else{
          fdt.writeInt(FORMAT_CURRENT);
          indexStream.writeInt(FORMAT_CURRENT);
          fieldsStream=fdt;
          fieldsStream.writeInt(FieldsWriterCompress.FORMAT_CURRENT);
      }

View Full Code Here


                copyFile(fe, os);
            }

            // Write the data offsets into the directory of the compound stream
           
            ospos.writeInt(entries.size());
            for (FileEntry fe : entries) {
//                os.seek(fe.directoryOffset);
//                os.writeLong(fe.dataOffset);
                ospos.writeLong(fe.directoryOffset);
                ospos.writeLong(fe.dataOffset);
View Full Code Here

    lastGeneration = generation;

    try {
      IndexOutput genOutput = dir.createOutput(IndexFileNames.SEGMENTS_GEN);
      try {
        genOutput.writeInt(FORMAT_LOCKLESS);
        genOutput.writeLong(generation);
        genOutput.writeLong(generation);
      } finally {
        genOutput.close();
      }
View Full Code Here

    lastGeneration = generation;

    try {
      IndexOutput genOutput = dir.createOutput(IndexFileNames.SEGMENTS_GEN);
      try {
        genOutput.writeInt(FORMAT_LOCKLESS);
        genOutput.writeLong(generation);
        genOutput.writeLong(generation);
      } finally {
        genOutput.close();
      }
View Full Code Here

    lastGeneration = generation;

    try {
      IndexOutput genOutput = dir.createOutput(IndexFileNames.SEGMENTS_GEN);
      try {
        genOutput.writeInt(FORMAT_LOCKLESS);
        genOutput.writeLong(generation);
        genOutput.writeLong(generation);
      } finally {
        genOutput.close();
      }
View Full Code Here

  @Test
  public void testWritingAndReadingAFile() throws IOException {

    IndexOutput output = directory.createOutput("testing.test", IOContext.DEFAULT);
    output.writeInt(12345);
    output.flush();
    output.close();

    IndexInput input = directory.openInput("testing.test", IOContext.DEFAULT);
    assertEquals(12345, input.readInt());
View Full Code Here

        public void saveCacheToFile() throws IOException {
            IndexOutput io = null;
            try {
                io = reader.directory().createOutput(FILE_CACHE_NAME_ARRAY);
                for (int parent : inSegmentParents) {
                    io.writeInt(parent);
                }
            } catch (Exception e) {
                log.error(
                        "Error saving " + FILE_CACHE_NAME_ARRAY + ": "
                                + e.getMessage(), e);
View Full Code Here

      assert si.getCodec() instanceof Lucene3xCodec : "broken test, trying to mix preflex with other codecs";
      CodecUtil.writeHeader(output, Lucene3xSegmentInfoFormat.UPGRADED_SI_CODEC_NAME,
                                    Lucene3xSegmentInfoFormat.UPGRADED_SI_VERSION_CURRENT);
      // Write the Lucene version that created this segment, since 3.1
      output.writeString(si.getVersion());
      output.writeInt(si.getDocCount());

      output.writeStringStringMap(si.attributes());

      output.writeByte((byte) (si.getUseCompoundFile() ? SegmentInfo.YES : SegmentInfo.NO));
      output.writeStringStringMap(si.getDiagnostics());
View Full Code Here

   */
  public static void writeSegmentsGen(Directory dir, long generation) {
    try {
      IndexOutput genOutput = dir.createOutput(IndexFileNames.SEGMENTS_GEN, IOContext.READONCE);
      try {
        genOutput.writeInt(FORMAT_SEGMENTS_GEN_CURRENT);
        genOutput.writeLong(generation);
        genOutput.writeLong(generation);
      } finally {
        genOutput.close();
        dir.sync(Collections.singleton(IndexFileNames.SEGMENTS_GEN));
View Full Code Here

            BLOOM_CODEC_VERSION);
        // remember the name of the postings format we will delegate to
        bloomOutput.writeString(delegatePostingsFormat.getName());
       
        // First field in the output file is the number of fields+blooms saved
        bloomOutput.writeInt(nonSaturatedBlooms.size());
        for (Entry<FieldInfo,FuzzySet> entry : nonSaturatedBlooms) {
          FieldInfo fieldInfo = entry.getKey();
          FuzzySet bloomFilter = entry.getValue();
          bloomOutput.writeInt(fieldInfo.number);
          saveAppropriatelySizedBloomFilter(bloomOutput, bloomFilter, fieldInfo);
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.