public Int64BinaryDocValuesAnonymousInnerClassHelper2(Lucene45DocValuesProducer outerInstance, Lucene45DocValuesProducer.BinaryEntry bytes, IndexInput data, MonotonicBlockPackedReader addresses)
 {
     this.outerInstance = outerInstance;
     this.bytes         = bytes;
     this.data          = data;
     this.addresses     = addresses;
 }
示例#2
0
 public BinaryDocValuesAnonymousInnerClassHelper2(MemoryDocValuesProducer outerInstance,
                                                  PagedBytes.Reader bytesReader, MonotonicBlockPackedReader addresses)
 {
     this.outerInstance = outerInstance;
     this.bytesReader   = bytesReader;
     this.addresses     = addresses;
 }
示例#3
0
        /// <summary>
        /// Returns an address instance for prefix-compressed binary values.
        /// <para/>
        /// @lucene.internal
        /// </summary>
        protected virtual MonotonicBlockPackedReader GetIntervalInstance(IndexInput data, FieldInfo field, BinaryEntry bytes)
        {
            MonotonicBlockPackedReader addresses;
            long interval = bytes.AddressInterval;

            lock (addressInstances)
            {
                if (!addressInstances.TryGetValue(field.Number, out MonotonicBlockPackedReader addrInstance))
                {
                    data.Seek(bytes.AddressesOffset);
                    long size;
                    if (bytes.Count % interval == 0)
                    {
                        size = bytes.Count / interval;
                    }
                    else
                    {
                        size = 1L + bytes.Count / interval;
                    }
                    addrInstance = new MonotonicBlockPackedReader(data, bytes.PackedInt32sVersion, bytes.BlockSize, size, false);
                    addressInstances[field.Number] = addrInstance;
                    ramBytesUsed.AddAndGet(addrInstance.RamBytesUsed() + RamUsageEstimator.NUM_BYTES_INT32);
                }
                addresses = addrInstance;
            }
            return(addresses);
        }
示例#4
0
        private BinaryDocValues LoadBinary(FieldInfo field)
        {
            BinaryEntry entry = binaries[field.Number];

            data.Seek(entry.offset);
            var bytes = new PagedBytes(16);

            bytes.Copy(data, entry.numBytes);
            var bytesReader = bytes.Freeze(true);

            if (entry.minLength == entry.maxLength)
            {
                int fixedLength = entry.minLength;
                ramBytesUsed.AddAndGet(bytes.RamBytesUsed());
                return(new BinaryDocValuesAnonymousInnerClassHelper(this, bytesReader, fixedLength));
            }
            else
            {
                data.Seek(data.GetFilePointer() + entry.missingBytes);
                var addresses = new MonotonicBlockPackedReader(data, entry.packedIntsVersion,
                                                               entry.blockSize, maxDoc, false);
                ramBytesUsed.AddAndGet(bytes.RamBytesUsed() + addresses.RamBytesUsed());
                return(new BinaryDocValuesAnonymousInnerClassHelper2(this, bytesReader, addresses));
            }
        }
示例#5
0
        private BinaryDocValues LoadBinary(FieldInfo field)
        {
            BinaryEntry entry = binaries[field.Number];

            data.Seek(entry.offset);
            var bytes = new PagedBytes(16);

            bytes.Copy(data, entry.numBytes);
            var bytesReader = bytes.Freeze(true);

            if (entry.minLength == entry.maxLength)
            {
                int fixedLength = entry.minLength;
                ramBytesUsed.AddAndGet(bytes.RamBytesUsed());
                return(new BinaryDocValuesAnonymousClass(bytesReader, fixedLength));
            }
            else
            {
                data.Seek(data.Position + entry.missingBytes); // LUCENENET specific: Renamed from getFilePointer() to match FileStream
                var addresses = new MonotonicBlockPackedReader(data, entry.packedIntsVersion,
                                                               entry.blockSize, maxDoc, false);
                ramBytesUsed.AddAndGet(bytes.RamBytesUsed() + addresses.RamBytesUsed());
                return(new BinaryDocValuesAnonymousClass2(bytesReader, addresses));
            }
        }
示例#6
0
 public RandomAccessOrdsAnonymousInnerClassHelper(long valueCount, Lucene45DocValuesProducer.Int64BinaryDocValues binary, Int64Values ordinals, MonotonicBlockPackedReader ordIndex)
 {
     this.valueCount = valueCount;
     this.binary     = binary;
     this.ordinals   = ordinals;
     this.ordIndex   = ordIndex;
 }
示例#7
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private index.BinaryDocValues loadBinary(index.FieldInfo field) throws java.io.IOException
        private BinaryDocValues loadBinary(FieldInfo field)
        {
            BinaryEntry entry = binaries[field.number];

            data.seek(entry.offset);
            PagedBytes bytes = new PagedBytes(16);

            bytes.copy(data, entry.numBytes);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final util.PagedBytes.Reader bytesReader = bytes.freeze(true);
            PagedBytes.Reader bytesReader = bytes.freeze(true);
            if (entry.minLength == entry.maxLength)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final int fixedLength = entry.minLength;
                int fixedLength = entry.minLength;
                ramBytesUsed_Renamed.addAndGet(bytes.ramBytesUsed());
                return(new BinaryDocValuesAnonymousInnerClassHelper(this, bytesReader, fixedLength));
            }
            else
            {
                data.seek(data.FilePointer + entry.missingBytes);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final util.packed.MonotonicBlockPackedReader addresses = new util.packed.MonotonicBlockPackedReader(data, entry.packedIntsVersion, entry.blockSize, maxDoc, false);
                MonotonicBlockPackedReader addresses = new MonotonicBlockPackedReader(data, entry.packedIntsVersion, entry.blockSize, maxDoc, false);
                ramBytesUsed_Renamed.addAndGet(bytes.ramBytesUsed() + addresses.ramBytesUsed());
                return(new BinaryDocValuesAnonymousInnerClassHelper2(this, bytesReader, addresses));
            }
        }
 public RandomAccessOrdsAnonymousInnerClassHelper(Lucene45DocValuesProducer outerInstance, long valueCount, Lucene45DocValuesProducer.LongBinaryDocValues binary, LongValues ordinals, MonotonicBlockPackedReader ordIndex)
 {
     this.OuterInstance = outerInstance;
     this.valueCount    = valueCount;
     this.Binary        = binary;
     this.Ordinals      = ordinals;
     this.OrdIndex      = ordIndex;
 }
示例#9
0
        private BinaryDocValues GetCompressedBinary(FieldInfo field, BinaryEntry bytes)
        {
            IndexInput data = (IndexInput)this.data.Clone();

            MonotonicBlockPackedReader addresses = GetIntervalInstance(data, field, bytes);

            return(new CompressedBinaryDocValues(bytes, addresses, data));
        }
示例#10
0
        private BinaryDocValues GetVariableBinary(FieldInfo field, BinaryEntry bytes)
        {
            IndexInput data = (IndexInput)this.data.Clone();

            MonotonicBlockPackedReader addresses = GetAddressInstance(data, field, bytes);

            return(new Int64BinaryDocValuesAnonymousInnerClassHelper2(bytes, data, addresses));
        }
示例#11
0
 public CompressedBinaryDocValues(BinaryEntry bytes, MonotonicBlockPackedReader addresses, IndexInput data)
 {
     this.bytes          = bytes;
     this.interval       = bytes.AddressInterval;
     this.addresses      = addresses;
     this.data           = data;
     this.numValues      = bytes.Count;
     this.numIndexValues = addresses.Count;
     this.termsEnum      = GetTermsEnum(data);
 }
示例#12
0
 public CompressedBinaryDocValues(BinaryEntry bytes, MonotonicBlockPackedReader addresses, IndexInput data)
 {
     this.Bytes             = bytes;
     this.Interval          = bytes.AddressInterval;
     this.Addresses         = addresses;
     this.Data              = data;
     this.NumValues         = bytes.Count;
     this.NumIndexValues    = addresses.Size();
     this.TermsEnum_Renamed = GetTermsEnum(data);
 }
示例#13
0
        /// <summary>
        /// Returns an address instance for sortedset ordinal lists.
        /// <para/>
        /// @lucene.internal
        /// </summary>
        protected virtual MonotonicBlockPackedReader GetOrdIndexInstance(IndexInput data, FieldInfo field, NumericEntry entry)
        {
            MonotonicBlockPackedReader ordIndex;

            lock (ordIndexInstances)
            {
                if (!ordIndexInstances.TryGetValue(field.Number, out MonotonicBlockPackedReader ordIndexInstance))
                {
                    data.Seek(entry.Offset);
                    ordIndexInstance = new MonotonicBlockPackedReader(data, entry.PackedInt32sVersion, entry.BlockSize, entry.Count, false);
                    ordIndexInstances[field.Number] = ordIndexInstance;
                    ramBytesUsed.AddAndGet(ordIndexInstance.RamBytesUsed() + RamUsageEstimator.NUM_BYTES_INT32);
                }
                ordIndex = ordIndexInstance;
            }
            return(ordIndex);
        }
        /// <summary>
        /// Returns an address instance for variable-length binary values.
        /// <para/>
        /// @lucene.internal
        /// </summary>
        protected virtual MonotonicBlockPackedReader GetAddressInstance(IndexInput data, FieldInfo field, BinaryEntry bytes)
        {
            MonotonicBlockPackedReader addresses;

            lock (addressInstances)
            {
                MonotonicBlockPackedReader addrInstance;
                if (!addressInstances.TryGetValue(field.Number, out addrInstance) || addrInstance == null)
                {
                    data.Seek(bytes.AddressesOffset);
                    addrInstance = new MonotonicBlockPackedReader(data, bytes.PackedInt32sVersion, bytes.BlockSize, bytes.Count, false);
                    addressInstances[field.Number] = addrInstance;
                    ramBytesUsed.AddAndGet(addrInstance.RamBytesUsed() + RamUsageEstimator.NUM_BYTES_INT32);
                }
                addresses = addrInstance;
            }
            return(addresses);
        }
        private BinaryDocValues LoadBinary(FieldInfo field)
        {
            BinaryEntry entry = binaries[field.Number];

            data.Seek(entry.Offset);
            PagedBytes bytes = new PagedBytes(16);

            bytes.Copy(data, entry.NumBytes);
            PagedBytes.Reader bytesReader = bytes.Freeze(true);
            if (entry.MinLength == entry.MaxLength)
            {
                int fixedLength = entry.MinLength;
                ramBytesUsed.AddAndGet(bytes.RamBytesUsed());
                return(new BinaryDocValuesAnonymousInnerClassHelper(bytesReader, fixedLength));
            }
            else
            {
                MonotonicBlockPackedReader addresses = new MonotonicBlockPackedReader(data, entry.PackedInt32sVersion, entry.BlockSize, maxDoc, false);
                ramBytesUsed.AddAndGet(bytes.RamBytesUsed() + addresses.RamBytesUsed());
                return(new BinaryDocValuesAnonymousInnerClassHelper2(bytesReader, addresses));
            }
        }
示例#16
0
        public override SortedSetDocValues GetSortedSet(FieldInfo field)
        {
            SortedSetEntry ss = sortedSets[field.Number];

            if (ss.Format == Lucene45DocValuesConsumer.SORTED_SET_SINGLE_VALUED_SORTED)
            {
                SortedDocValues values = GetSorted(field);
                return(DocValues.Singleton(values));
            }
            else if (ss.Format != Lucene45DocValuesConsumer.SORTED_SET_WITH_ADDRESSES)
            {
                throw new Exception();
            }

            IndexInput data       = (IndexInput)this.data.Clone();
            long       valueCount = binaries[field.Number].Count;
            // we keep the byte[]s and list of ords on disk, these could be large
            Int64BinaryDocValues binary   = (Int64BinaryDocValues)GetBinary(field);
            Int64Values          ordinals = GetNumeric(ords[field.Number]);
            // but the addresses to the ord stream are in RAM
            MonotonicBlockPackedReader ordIndex = GetOrdIndexInstance(data, field, ordIndexes[field.Number]);

            return(new RandomAccessOrdsAnonymousInnerClassHelper(valueCount, binary, ordinals, ordIndex));
        }
 public BinaryDocValuesAnonymousInnerClassHelper2(PagedBytes.Reader bytesReader, MonotonicBlockPackedReader addresses)
 {
     this.bytesReader = bytesReader;
     this.addresses   = addresses;
 }
 public BinaryDocValuesAnonymousInnerClassHelper2(PagedBytes.Reader bytesReader, MonotonicBlockPackedReader addresses)
 {
     this.BytesReader = bytesReader;
     this.Addresses = addresses;
 }
 public Int64BinaryDocValuesAnonymousClass2(Lucene45DocValuesProducer.BinaryEntry bytes, IndexInput data, MonotonicBlockPackedReader addresses)
 {
     this.bytes     = bytes;
     this.data      = data;
     this.addresses = addresses;
 }
 private BinaryDocValues LoadBinary(FieldInfo field)
 {
     BinaryEntry entry = Binaries[field.Number];
     Data.Seek(entry.Offset);
     PagedBytes bytes = new PagedBytes(16);
     bytes.Copy(Data, entry.NumBytes);
     PagedBytes.Reader bytesReader = bytes.Freeze(true);
     if (entry.MinLength == entry.MaxLength)
     {
         int fixedLength = entry.MinLength;
         RamBytesUsed_Renamed.AddAndGet(bytes.RamBytesUsed());
         return new BinaryDocValuesAnonymousInnerClassHelper(this, bytesReader, fixedLength);
     }
     else
     {
         MonotonicBlockPackedReader addresses = new MonotonicBlockPackedReader(Data, entry.PackedIntsVersion, entry.BlockSize, MaxDoc, false);
         RamBytesUsed_Renamed.AddAndGet(bytes.RamBytesUsed() + addresses.RamBytesUsed());
         return new BinaryDocValuesAnonymousInnerClassHelper2(this, bytesReader, addresses);
     }
 }
 public BinaryDocValuesAnonymousInnerClassHelper2(Lucene42DocValuesProducer outerInstance, PagedBytes.Reader bytesReader, MonotonicBlockPackedReader addresses)
 {
     this.OuterInstance = outerInstance;
     this.BytesReader = bytesReader;
     this.Addresses = addresses;
 }