/// <summary>
 /// Sole constructor. </summary>
 public Builder()
 {
     Data                  = new GrowableByteArrayDataOutput(128);
     BufferSize            = 0;
     PreviousDoc           = -1;
     IndexInterval_Renamed = 2;
     Cardinality           = 0;
     NumBlocks             = 0;
 }
Beispiel #2
0
 /// <summary>
 /// Sole constructor. </summary>
 public Builder()
 {
     data          = new GrowableByteArrayDataOutput(128);
     bufferSize    = 0;
     previousDoc   = -1;
     indexInterval = 2;
     cardinality   = 0;
     numBlocks     = 0;
 }
Beispiel #3
0
 internal WordBuilder()
 {
     @out                  = new GrowableByteArrayDataOutput(1024);
     DirtyWords            = new GrowableByteArrayDataOutput(128);
     Clean                 = 0;
     LastWordNum           = -1;
     NumSequences          = 0;
     IndexInterval_Renamed = DEFAULT_INDEX_INTERVAL;
     Cardinality           = 0;
 }
Beispiel #4
0
 internal WordBuilder()
 {
     @out          = new GrowableByteArrayDataOutput(1024);
     dirtyWords    = new GrowableByteArrayDataOutput(128);
     clean         = 0;
     lastWordNum   = -1;
     numSequences  = 0;
     indexInterval = DEFAULT_INDEX_INTERVAL;
     cardinality   = 0;
 }
        private int NumBufferedDocs; // docBase + numBufferedDocs == current doc ID

        /// <summary>
        /// Sole constructor. </summary>
        public CompressingStoredFieldsWriter(Directory directory, SegmentInfo si, string segmentSuffix, IOContext context, string formatName, CompressionMode compressionMode, int chunkSize)
        {
            Debug.Assert(directory != null);
            this.Directory = directory;
            this.Segment = si.Name;
            this.SegmentSuffix = segmentSuffix;
            this.CompressionMode = compressionMode;
            this.Compressor = compressionMode.NewCompressor();
            this.ChunkSize = chunkSize;
            this.DocBase = 0;
            this.BufferedDocs = new GrowableByteArrayDataOutput(chunkSize);
            this.NumStoredFields = new int[16];
            this.EndOffsets = new int[16];
            this.NumBufferedDocs = 0;

            bool success = false;
            IndexOutput indexStream = directory.CreateOutput(IndexFileNames.SegmentFileName(Segment, segmentSuffix, Lucene40StoredFieldsWriter.FIELDS_INDEX_EXTENSION), context);
            try
            {
                FieldsStream = directory.CreateOutput(IndexFileNames.SegmentFileName(Segment, segmentSuffix, Lucene40StoredFieldsWriter.FIELDS_EXTENSION), context);

                string codecNameIdx = formatName + CODEC_SFX_IDX;
                string codecNameDat = formatName + CODEC_SFX_DAT;
                CodecUtil.WriteHeader(indexStream, codecNameIdx, VERSION_CURRENT);
                CodecUtil.WriteHeader(FieldsStream, codecNameDat, VERSION_CURRENT);
                Debug.Assert(CodecUtil.HeaderLength(codecNameDat) == FieldsStream.FilePointer);
                Debug.Assert(CodecUtil.HeaderLength(codecNameIdx) == indexStream.FilePointer);

                IndexWriter = new CompressingStoredFieldsIndexWriter(indexStream);
                indexStream = null;

                FieldsStream.WriteVInt(chunkSize);
                FieldsStream.WriteVInt(PackedInts.VERSION_CURRENT);

                success = true;
            }
            finally
            {
                if (!success)
                {
                    IOUtils.CloseWhileHandlingException(indexStream);
                    Abort();
                }
            }
        }
 /// <summary>
 /// Sole constructor. </summary>
 public Builder()
 {
     Data = new GrowableByteArrayDataOutput(128);
     BufferSize = 0;
     PreviousDoc = -1;
     IndexInterval_Renamed = 2;
     Cardinality = 0;
     NumBlocks = 0;
 }