Package org.apache.lucene.backward_codecs.lucene50

# Class Lucene50LiveDocsFormat

java.lang.Object
org.apache.lucene.codecs.LiveDocsFormat
org.apache.lucene.backward_codecs.lucene50.Lucene50LiveDocsFormat

public final class Lucene50LiveDocsFormat extends LiveDocsFormat
Lucene 5.0 live docs format

The .liv file is optional, and only exists when a segment contains deletions.

Although per-segment, this file is maintained exterior to compound segment files.

Deletions (.liv) --> IndexHeader,Generation,Bits

- SegmentHeader --> `IndexHeader`
- Bits --> <`Int64`> LongCount

## Constructor Summary

Constructors
Constructor
Description
`Lucene50LiveDocsFormat()`
Sole constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`files(SegmentCommitInfo info, Collection<String> files)`
`Bits`
`readLiveDocs(Directory dir, SegmentCommitInfo info, IOContext context)`
`void`
`writeLiveDocs(Bits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context)`
Note: although this format is only used on older versions, we need to keep the write logic in addition to the read logic.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Lucene50LiveDocsFormat

public Lucene50LiveDocsFormat()
Sole constructor.

## Method Details

### readLiveDocs

public Bits readLiveDocs(Directory dir, SegmentCommitInfo info, IOContext context) throws IOException

Specified by:
  `readLiveDocs` in class `LiveDocsFormat`
Throws:
  `IOException`

### writeLiveDocs

public void writeLiveDocs(Bits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context) throws IOException
Note: although this format is only used on older versions, we need to keep the write logic in addition to the read logic. When we delete documents that live in an older segment, we write to the live docs for that segment.

Specified by:
  `writeLiveDocs` in class `LiveDocsFormat`
Throws:
  `IOException`

### files

public void files(SegmentCommitInfo info, Collection<String> files) throws IOException

Specified by:
  `files` in class `LiveDocsFormat`
Throws:
  `IOException`