internal virtual LongValues GetNumeric(NumericEntry entry)
        {
            IndexInput data = (IndexInput)this.Data.Clone();
            data.Seek(entry.Offset);

            switch (entry.Format)
            {
                case Lucene45DocValuesConsumer.DELTA_COMPRESSED:
                    BlockPackedReader reader = new BlockPackedReader(data, entry.PackedIntsVersion, entry.BlockSize, entry.Count, true);
                    return reader;

                case Lucene45DocValuesConsumer.GCD_COMPRESSED:
                    long min = entry.MinValue;
                    long mult = entry.Gcd;
                    BlockPackedReader quotientReader = new BlockPackedReader(data, entry.PackedIntsVersion, entry.BlockSize, entry.Count, true);
                    return new LongValuesAnonymousInnerClassHelper(this, min, mult, quotientReader);

                case Lucene45DocValuesConsumer.TABLE_COMPRESSED:
                    long[] table = entry.Table;
                    int bitsRequired = PackedInts.BitsRequired(table.Length - 1);
                    PackedInts.Reader ords = PackedInts.GetDirectReaderNoHeader(data, PackedInts.Format.PACKED, entry.PackedIntsVersion, (int)entry.Count, bitsRequired);
                    return new LongValuesAnonymousInnerClassHelper2(this, table, ords);

                default:
                    throw new Exception();
            }
        }
        public override SortedDocValues GetSorted(FieldInfo field)
        {
            int valueCount = (int)Binaries[field.Number].Count;
            BinaryDocValues binary = GetBinary(field);
            NumericEntry entry = Ords[field.Number];
            IndexInput data = (IndexInput)this.Data.Clone();
            data.Seek(entry.Offset);
            BlockPackedReader ordinals = new BlockPackedReader(data, entry.PackedIntsVersion, entry.BlockSize, entry.Count, true);

            return new SortedDocValuesAnonymousInnerClassHelper(this, valueCount, binary, ordinals);
        }
 public SortedDocValuesAnonymousInnerClassHelper(Lucene45DocValuesProducer outerInstance, int valueCount, BinaryDocValues binary, BlockPackedReader ordinals)
 {
     this.OuterInstance = outerInstance;
     this.valueCount = valueCount;
     this.Binary = binary;
     this.Ordinals = ordinals;
 }
 public LongValuesAnonymousInnerClassHelper(Lucene45DocValuesProducer outerInstance, long min, long mult, BlockPackedReader quotientReader)
 {
     this.OuterInstance = outerInstance;
     this.Min = min;
     this.Mult = mult;
     this.QuotientReader = quotientReader;
 }
 public NumericDocValuesAnonymousInnerClassHelper3(long min, long mult, BlockPackedReader quotientReader)
 {
     this.Min = min;
     this.Mult = mult;
     this.QuotientReader = quotientReader;
 }
        private NumericDocValues LoadNumeric(FieldInfo field)
        {
            NumericEntry entry = Numerics[field.Number];
            Data.Seek(entry.Offset);
            switch (entry.Format)
            {
                case TABLE_COMPRESSED:
                    int size = Data.ReadVInt();
                    if (size > 256)
                    {
                        throw new CorruptIndexException("TABLE_COMPRESSED cannot have more than 256 distinct values, input=" + Data);
                    }
                    var decode = new long[size];
                    for (int i = 0; i < decode.Length; i++)
                    {
                        decode[i] = Data.ReadLong();
                    }
                    int formatID = Data.ReadVInt();
                    int bitsPerValue = Data.ReadVInt();
                    PackedInts.Reader ordsReader = PackedInts.GetReaderNoHeader(Data, PackedInts.Format.ById(formatID), entry.PackedIntsVersion, MaxDoc, bitsPerValue);
                    RamBytesUsed_Renamed.AddAndGet(RamUsageEstimator.SizeOf(decode) + ordsReader.RamBytesUsed());
                    return new NumericDocValuesAnonymousInnerClassHelper(decode, ordsReader);

                case DELTA_COMPRESSED:
                    int blockSize = Data.ReadVInt();
                    var reader = new BlockPackedReader(Data, entry.PackedIntsVersion, blockSize, MaxDoc, false);
                    RamBytesUsed_Renamed.AddAndGet(reader.RamBytesUsed());
                    return reader;

                case UNCOMPRESSED:
                    byte[] bytes = new byte[MaxDoc];
                    Data.ReadBytes(bytes, 0, bytes.Length);
                    RamBytesUsed_Renamed.AddAndGet(RamUsageEstimator.SizeOf(bytes));
                    return new NumericDocValuesAnonymousInnerClassHelper2(this, bytes);

                case GCD_COMPRESSED:
                    long min = Data.ReadLong();
                    long mult = Data.ReadLong();
                    int quotientBlockSize = Data.ReadVInt();
                    BlockPackedReader quotientReader = new BlockPackedReader(Data, entry.PackedIntsVersion, quotientBlockSize, MaxDoc, false);
                    RamBytesUsed_Renamed.AddAndGet(quotientReader.RamBytesUsed());
                    return new NumericDocValuesAnonymousInnerClassHelper3(min, mult, quotientReader);

                default:
                    throw new InvalidOperationException();
            }
        }