void add(int docID) { if (docID <= lastDocId) { throw new IllegalArgumentException("Out of order doc ids: last=" + lastDocId + ", next=" + docID); } if (set != null) { set = FixedBitSet.ensureCapacity(set, docID); set.set(docID); } else if (docID != cost) { // migrate to a sparse encoding using a bit set set = new FixedBitSet(docID + 1); set.set(0, cost); set.set(docID); } lastDocId = docID; cost++; }
bits = FixedBitSet.ensureCapacity(bits, k);
bits = FixedBitSet.ensureCapacity(bits, k);
void add(int docID) { if (docID <= lastDocId) { throw new IllegalArgumentException("Out of order doc ids: last=" + lastDocId + ", next=" + docID); } if (set != null) { set = FixedBitSet.ensureCapacity(set, docID); set.set(docID); } else if (docID != cost) { // migrate to a sparse encoding using a bit set set = new FixedBitSet(docID + 1); set.set(0, cost); set.set(docID); } lastDocId = docID; cost++; }
public void addValue(int docID, BytesRef value) { if (docID < addedValues) { throw new IllegalArgumentException("DocValuesField \"" + fieldInfo.name + "\" appears more than once in this document (only one value is allowed per field)"); } if (value == null) { throw new IllegalArgumentException("field=\"" + fieldInfo.name + "\": null value not allowed"); } if (value.length > MAX_LENGTH) { throw new IllegalArgumentException("DocValuesField \"" + fieldInfo.name + "\" is too large, must be <= " + MAX_LENGTH); } // Fill in any holes: while(addedValues < docID) { addedValues++; lengths.add(0); } addedValues++; lengths.add(value.length); try { bytesOut.writeBytes(value.bytes, value.offset, value.length); } catch (IOException ioe) { // Should never happen! throw new RuntimeException(ioe); } docsWithField = FixedBitSet.ensureCapacity(docsWithField, docID); docsWithField.set(docID); updateBytesUsed(); }
public void addValue(int docID, BytesRef value) { if (docID < addedValues) { throw new IllegalArgumentException("DocValuesField \"" + fieldInfo.name + "\" appears more than once in this document (only one value is allowed per field)"); } if (value == null) { throw new IllegalArgumentException("field=\"" + fieldInfo.name + "\": null value not allowed"); } if (value.length > MAX_LENGTH) { throw new IllegalArgumentException("DocValuesField \"" + fieldInfo.name + "\" is too large, must be <= " + MAX_LENGTH); } // Fill in any holes: while(addedValues < docID) { addedValues++; lengths.add(0); } addedValues++; lengths.add(value.length); try { bytesOut.writeBytes(value.bytes, value.offset, value.length); } catch (IOException ioe) { // Should never happen! throw new RuntimeException(ioe); } docsWithField = FixedBitSet.ensureCapacity(docsWithField, docID); docsWithField.set(docID); updateBytesUsed(); }
public void addValue(int docID, long value) { if (docID < pending.size()) { throw new IllegalArgumentException("DocValuesField \"" + fieldInfo.name + "\" appears more than once in this document (only one value is allowed per field)"); } // Fill in any holes: for (int i = (int)pending.size(); i < docID; ++i) { pending.add(MISSING); } pending.add(value); docsWithField = FixedBitSet.ensureCapacity(docsWithField, docID); docsWithField.set(docID); updateBytesUsed(); }
public void addValue(int docID, long value) { if (docID < pending.size()) { throw new IllegalArgumentException("DocValuesField \"" + fieldInfo.name + "\" appears more than once in this document (only one value is allowed per field)"); } // Fill in any holes: for (int i = (int)pending.size(); i < docID; ++i) { pending.add(MISSING); } pending.add(value); docsWithField = FixedBitSet.ensureCapacity(docsWithField, docID); docsWithField.set(docID); updateBytesUsed(); }
bits = FixedBitSet.ensureCapacity(bits, k);
bits = FixedBitSet.ensureCapacity(bits, k);
bits = FixedBitSet.ensureCapacity(bits, k);