mirror of
https://github.com/twitter/the-algorithm.git
synced 2025-01-05 09:01:54 +01:00
Merge 54f8db5749
into 72eda9a24f
This commit is contained in:
commit
7a0d693901
@ -37,14 +37,17 @@ public final class EarlybirdRealtimeIndexSegmentAtomicReader
|
|||||||
*/
|
*/
|
||||||
EarlybirdRealtimeIndexSegmentAtomicReader(EarlybirdRealtimeIndexSegmentData segmentData) {
|
EarlybirdRealtimeIndexSegmentAtomicReader(EarlybirdRealtimeIndexSegmentData segmentData) {
|
||||||
super(segmentData);
|
super(segmentData);
|
||||||
|
|
||||||
|
final int initialMaxDocId = Integer.MAX_VALUE;
|
||||||
|
|
||||||
this.fields = new InMemoryFields(segmentData.getPerFieldMap(), syncData.getIndexPointers());
|
this.fields = new InMemoryFields(segmentData.getPerFieldMap(), syncData.getIndexPointers());
|
||||||
|
|
||||||
// We cache the highest doc ID and the number of docs, because the reader must return the same
|
// We cache the highest doc ID and the number of docs, because the reader must return the same
|
||||||
// values for its entire lifetime, and the segment will get more tweets over time.
|
// values for its entire lifetime, and the segment will get more tweets over time.
|
||||||
// These values could be slightly out of sync with 'fields', because we don't update these
|
// These values could be slightly out of sync with 'fields', because we don't update these
|
||||||
// values atomically with the fields.
|
// values atomically with the fields.
|
||||||
this.maxDocId = segmentData.getDocIDToTweetIDMapper().getPreviousDocID(Integer.MAX_VALUE);
|
int initialMaxDocId = Integer.MAX_VALUE;
|
||||||
|
this.maxDocId = segmentData.getDocIDToTweetIDMapper().getPreviousDocID(initialMaxDocId);
|
||||||
this.numDocs = segmentData.getDocIDToTweetIDMapper().getNumDocs();
|
this.numDocs = segmentData.getDocIDToTweetIDMapper().getNumDocs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user