mirror of
https://github.com/twitter/the-algorithm.git
synced 2025-01-20 16:01:16 +01:00
Compare commits
2 Commits
7a0d693901
...
33e2f8a54c
Author | SHA1 | Date | |
---|---|---|---|
|
33e2f8a54c | ||
|
54f8db5749 |
@ -38,13 +38,16 @@ 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…
x
Reference in New Issue
Block a user