Java 类org.apache.lucene.util.packed.BlockPackedReader 实例源码

项目:NYBC    文件:DiskDocValuesProducer.java   
LongNumericDocValues getNumeric(NumericEntry entry) throws IOException {
  final IndexInput data = this.data.clone();
  data.seek(entry.offset);

  final BlockPackedReader reader = new BlockPackedReader(data, entry.packedIntsVersion, entry.blockSize, entry.count, true);
  return new LongNumericDocValues() {
    @Override
    public long get(long id) {
      return reader.get(id);
    }
  };
}
项目:NYBC    文件:CheapBastardDocValuesProducer.java   
private LongNumericDocValues getNumeric(FieldInfo field, final NumericEntry entry) throws IOException {
  final IndexInput data = this.data.clone();
  data.seek(entry.offset);

  final BlockPackedReader reader = new BlockPackedReader(data, entry.packedIntsVersion, entry.blockSize, entry.count, true);
  return new LongNumericDocValues() {
    @Override
    public long get(long id) {
      return reader.get(id);
    }
  };
}
项目:incubator-blur    文件:DiskDocValuesProducer.java   
LongNumericDocValues newNumeric(NumericEntry entry) throws IOException {
  final IndexInput data = this.data.clone();
  data.seek(entry.offset);

  final BlockPackedReader reader = new BlockPackedReader(data, entry.packedIntsVersion, entry.blockSize, entry.count,
      true);
  return new LongNumericDocValues() {
    @Override
    public long get(long id) {
      return reader.get(id);
    }
  };
}
项目:lams    文件:Lucene45DocValuesProducer.java   
@Override
public SortedDocValues getSorted(FieldInfo field) throws IOException {
  final int valueCount = (int) binaries.get(field.number).count;
  final BinaryDocValues binary = getBinary(field);
  NumericEntry entry = ords.get(field.number);
  IndexInput data = this.data.clone();
  data.seek(entry.offset);
  final BlockPackedReader ordinals = new BlockPackedReader(data, entry.packedIntsVersion, entry.blockSize, entry.count, true);

  return new SortedDocValues() {

    @Override
    public int getOrd(int docID) {
      return (int) ordinals.get(docID);
    }

    @Override
    public BytesRef lookupOrd(int ord) {
      return binary.get(ord);
    }

    @Override
    public int getValueCount() {
      return valueCount;
    }

    @Override
    public int lookupTerm(BytesRef key) {
      if (binary instanceof CompressedBinaryDocValues) {
        return (int) ((CompressedBinaryDocValues)binary).lookupTerm(key);
      } else {
      return super.lookupTerm(key);
      }
    }

    @Override
    public TermsEnum termsEnum() {
      if (binary instanceof CompressedBinaryDocValues) {
        return ((CompressedBinaryDocValues)binary).getTermsEnum();
      } else {
        return super.termsEnum();
      }
    }
  };
}
项目:search    文件:Lucene45DocValuesProducer.java   
@Override
public SortedDocValues getSorted(FieldInfo field) throws IOException {
  final int valueCount = (int) binaries.get(field.number).count;
  final BinaryDocValues binary = getBinary(field);
  NumericEntry entry = ords.get(field.number);
  IndexInput data = this.data.clone();
  data.seek(entry.offset);
  final BlockPackedReader ordinals = new BlockPackedReader(data, entry.packedIntsVersion, entry.blockSize, entry.count, true);

  return new SortedDocValues() {

    @Override
    public int getOrd(int docID) {
      return (int) ordinals.get(docID);
    }

    @Override
    public BytesRef lookupOrd(int ord) {
      return binary.get(ord);
    }

    @Override
    public int getValueCount() {
      return valueCount;
    }

    @Override
    public int lookupTerm(BytesRef key) {
      if (binary instanceof CompressedBinaryDocValues) {
        return (int) ((CompressedBinaryDocValues)binary).lookupTerm(key);
      } else {
      return super.lookupTerm(key);
      }
    }

    @Override
    public TermsEnum termsEnum() {
      if (binary instanceof CompressedBinaryDocValues) {
        return ((CompressedBinaryDocValues)binary).getTermsEnum();
      } else {
        return super.termsEnum();
      }
    }
  };
}
项目:read-open-source-code    文件:Lucene45DocValuesProducer.java   
@Override
public SortedDocValues getSorted(FieldInfo field) throws IOException {
  final int valueCount = (int) binaries.get(field.number).count;
  final BinaryDocValues binary = getBinary(field);
  NumericEntry entry = ords.get(field.number);
  IndexInput data = this.data.clone();
  data.seek(entry.offset);
  final BlockPackedReader ordinals = new BlockPackedReader(data, entry.packedIntsVersion, entry.blockSize, entry.count, true);

  return new SortedDocValues() {

    @Override
    public int getOrd(int docID) {
      return (int) ordinals.get(docID);
    }

    @Override
    public void lookupOrd(int ord, BytesRef result) {
      binary.get(ord, result);
    }

    @Override
    public int getValueCount() {
      return valueCount;
    }

    @Override
    public int lookupTerm(BytesRef key) {
      if (binary instanceof CompressedBinaryDocValues) {
        return (int) ((CompressedBinaryDocValues)binary).lookupTerm(key);
      } else {
      return super.lookupTerm(key);
      }
    }

    @Override
    public TermsEnum termsEnum() {
      if (binary instanceof CompressedBinaryDocValues) {
        return ((CompressedBinaryDocValues)binary).getTermsEnum();
      } else {
        return super.termsEnum();
      }
    }
  };
}
项目:read-open-source-code    文件:Lucene45DocValuesProducer.java   
@Override
public SortedDocValues getSorted(FieldInfo field) throws IOException {
  final int valueCount = (int) binaries.get(field.number).count;
  final BinaryDocValues binary = getBinary(field);
  NumericEntry entry = ords.get(field.number);
  IndexInput data = this.data.clone();
  data.seek(entry.offset);
  final BlockPackedReader ordinals = new BlockPackedReader(data, entry.packedIntsVersion, entry.blockSize, entry.count, true);

  return new SortedDocValues() {

    @Override
    public int getOrd(int docID) {
      return (int) ordinals.get(docID);
    }

    @Override
    public void lookupOrd(int ord, BytesRef result) {
      binary.get(ord, result);
    }

    @Override
    public int getValueCount() {
      return valueCount;
    }

    @Override
    public int lookupTerm(BytesRef key) {
      if (binary instanceof CompressedBinaryDocValues) {
        return (int) ((CompressedBinaryDocValues)binary).lookupTerm(key);
      } else {
      return super.lookupTerm(key);
      }
    }

    @Override
    public TermsEnum termsEnum() {
      if (binary instanceof CompressedBinaryDocValues) {
        return ((CompressedBinaryDocValues)binary).getTermsEnum();
      } else {
        return super.termsEnum();
      }
    }
  };
}
项目:read-open-source-code    文件:Lucene45DocValuesProducer.java   
@Override
public SortedDocValues getSorted(FieldInfo field) throws IOException {
  final int valueCount = (int) binaries.get(field.number).count;
  final BinaryDocValues binary = getBinary(field);
  NumericEntry entry = ords.get(field.number);
  IndexInput data = this.data.clone();
  data.seek(entry.offset);
  final BlockPackedReader ordinals = new BlockPackedReader(data, entry.packedIntsVersion, entry.blockSize, entry.count, true);

  return new SortedDocValues() {

    @Override
    public int getOrd(int docID) {
      return (int) ordinals.get(docID);
    }

    @Override
    public BytesRef lookupOrd(int ord) {
      return binary.get(ord);
    }

    @Override
    public int getValueCount() {
      return valueCount;
    }

    @Override
    public int lookupTerm(BytesRef key) {
      if (binary instanceof CompressedBinaryDocValues) {
        return (int) ((CompressedBinaryDocValues)binary).lookupTerm(key);
      } else {
      return super.lookupTerm(key);
      }
    }

    @Override
    public TermsEnum termsEnum() {
      if (binary instanceof CompressedBinaryDocValues) {
        return ((CompressedBinaryDocValues)binary).getTermsEnum();
      } else {
        return super.termsEnum();
      }
    }
  };
}
项目:Maskana-Gestor-de-Conocimiento    文件:Lucene45DocValuesProducer.java   
@Override
public SortedDocValues getSorted(FieldInfo field) throws IOException {
  final int valueCount = (int) binaries.get(field.number).count;
  final BinaryDocValues binary = getBinary(field);
  NumericEntry entry = ords.get(field.number);
  IndexInput data = this.data.clone();
  data.seek(entry.offset);
  final BlockPackedReader ordinals = new BlockPackedReader(data, entry.packedIntsVersion, entry.blockSize, entry.count, true);

  return new SortedDocValues() {

    @Override
    public int getOrd(int docID) {
      return (int) ordinals.get(docID);
    }

    @Override
    public void lookupOrd(int ord, BytesRef result) {
      binary.get(ord, result);
    }

    @Override
    public int getValueCount() {
      return valueCount;
    }

    @Override
    public int lookupTerm(BytesRef key) {
      if (binary instanceof CompressedBinaryDocValues) {
        return (int) ((CompressedBinaryDocValues)binary).lookupTerm(key);
      } else {
      return super.lookupTerm(key);
      }
    }

    @Override
    public TermsEnum termsEnum() {
      if (binary instanceof CompressedBinaryDocValues) {
        return ((CompressedBinaryDocValues)binary).getTermsEnum();
      } else {
        return super.termsEnum();
      }
    }
  };
}