Java Code Examples for org.apache.lucene.store.ChecksumIndexInput#readShort()

The following examples show how to use org.apache.lucene.store.ChecksumIndexInput#readShort() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Lucene80DocValuesProducer.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
private void readNumeric(ChecksumIndexInput meta, NumericEntry entry) throws IOException {
  entry.docsWithFieldOffset = meta.readLong();
  entry.docsWithFieldLength = meta.readLong();
  entry.jumpTableEntryCount = meta.readShort();
  entry.denseRankPower = meta.readByte();
  entry.numValues = meta.readLong();
  int tableSize = meta.readInt();
  if (tableSize > 256) {
    throw new CorruptIndexException("invalid table size: " + tableSize, meta);
  }
  if (tableSize >= 0) {
    entry.table = new long[tableSize];
    ramBytesUsed += RamUsageEstimator.sizeOf(entry.table);
    for (int i = 0; i < tableSize; ++i) {
      entry.table[i] = meta.readLong();
    }
  }
  if (tableSize < -1) {
    entry.blockShift = -2 - tableSize;
  } else {
    entry.blockShift = -1;
  }
  entry.bitsPerValue = meta.readByte();
  entry.minValue = meta.readLong();
  entry.gcd = meta.readLong();
  entry.valuesOffset = meta.readLong();
  entry.valuesLength = meta.readLong();
  entry.valueJumpTableOffset = meta.readLong();
}
 
Example 2
Source File: Lucene80DocValuesProducer.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
private BinaryEntry readBinary(ChecksumIndexInput meta) throws IOException {
  BinaryEntry entry = new BinaryEntry();
  entry.dataOffset = meta.readLong();
  entry.dataLength = meta.readLong();
  entry.docsWithFieldOffset = meta.readLong();
  entry.docsWithFieldLength = meta.readLong();
  entry.jumpTableEntryCount = meta.readShort();
  entry.denseRankPower = meta.readByte();
  entry.numDocsWithField = meta.readInt();
  entry.minLength = meta.readInt();
  entry.maxLength = meta.readInt();
  if ((version >= Lucene80DocValuesFormat.VERSION_BIN_COMPRESSED && entry.numDocsWithField > 0) ||  entry.minLength < entry.maxLength) {
    entry.addressesOffset = meta.readLong();

    // Old count of uncompressed addresses 
    long numAddresses = entry.numDocsWithField + 1L;
    // New count of compressed addresses - the number of compresseed blocks
    if (version >= Lucene80DocValuesFormat.VERSION_BIN_COMPRESSED) {
      entry.numCompressedChunks = meta.readVInt();
      entry.docsPerChunkShift = meta.readVInt();
      entry.maxUncompressedChunkSize = meta.readVInt();
      numAddresses = entry.numCompressedChunks;
    }      
    
    final int blockShift = meta.readVInt();
    entry.addressesMeta = DirectMonotonicReader.loadMeta(meta, numAddresses, blockShift);
    ramBytesUsed += entry.addressesMeta.ramBytesUsed();
    entry.addressesLength = meta.readLong();
  }
  return entry;
}
 
Example 3
Source File: Lucene80DocValuesProducer.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
private SortedEntry readSorted(ChecksumIndexInput meta) throws IOException {
  SortedEntry entry = new SortedEntry();
  entry.docsWithFieldOffset = meta.readLong();
  entry.docsWithFieldLength = meta.readLong();
  entry.jumpTableEntryCount = meta.readShort();
  entry.denseRankPower = meta.readByte();
  entry.numDocsWithField = meta.readInt();
  entry.bitsPerValue = meta.readByte();
  entry.ordsOffset = meta.readLong();
  entry.ordsLength = meta.readLong();
  readTermDict(meta, entry);
  return entry;
}
 
Example 4
Source File: Lucene80DocValuesProducer.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
private SortedSetEntry readSortedSet(ChecksumIndexInput meta) throws IOException {
  SortedSetEntry entry = new SortedSetEntry();
  byte multiValued = meta.readByte();
  switch (multiValued) {
    case 0: // singlevalued
      entry.singleValueEntry = readSorted(meta);
      return entry;
    case 1: // multivalued
      break;
    default:
      throw new CorruptIndexException("Invalid multiValued flag: " + multiValued, meta);
  }
  entry.docsWithFieldOffset = meta.readLong();
  entry.docsWithFieldLength = meta.readLong();
  entry.jumpTableEntryCount = meta.readShort();
  entry.denseRankPower = meta.readByte();
  entry.bitsPerValue = meta.readByte();
  entry.ordsOffset = meta.readLong();
  entry.ordsLength = meta.readLong();
  entry.numDocsWithField = meta.readInt();
  entry.addressesOffset = meta.readLong();
  final int blockShift = meta.readVInt();
  entry.addressesMeta = DirectMonotonicReader.loadMeta(meta, entry.numDocsWithField + 1, blockShift);
  ramBytesUsed += entry.addressesMeta.ramBytesUsed();
  entry.addressesLength = meta.readLong();
  readTermDict(meta, entry);
  return entry;
}