7 #ifndef SEGMENTREADER_H
8 #define SEGMENTREADER_H
45 int32_t readBufferSize;
46 bool deletedDocsDirty;
48 int32_t pendingDeleteCount;
50 bool rollbackHasChanges;
51 bool rollbackDeletedDocsDirty;
52 bool rollbackNormsDirty;
53 int32_t rollbackPendingDeleteCount;
60 virtual void initialize();
77 virtual bool hasDeletions();
94 virtual bool isDeleted(int32_t n);
106 virtual int32_t docFreq(
TermPtr t);
109 virtual int32_t numDocs();
112 virtual int32_t maxDoc();
118 virtual bool hasNorms(
const String& field);
121 virtual ByteArray norms(
const String& field);
124 virtual void norms(
const String& field, ByteArray norms, int32_t offset);
126 bool termsIndexLoaded();
130 void loadTermsIndex(int32_t termsIndexDivisor);
133 bool normsClosed(
const String& field);
138 virtual TermFreqVectorPtr getTermFreqVector(int32_t docNumber,
const String& field);
142 virtual void getTermFreqVector(int32_t docNumber,
const String& field,
TermVectorMapperPtr mapper);
153 String getSegmentName();
160 void rollbackCommit();
171 virtual int64_t getUniqueTermCount();
176 virtual int32_t getTermInfosIndexDivisor();
179 bool checkDeletedCounts();
180 void loadDeletedDocs();
185 virtual ByteArray cloneNormBytes(ByteArray bytes);
193 virtual void doCommit(MapStringString commitUserData);
195 virtual void commitChanges(MapStringString commitUserData);
198 virtual void doClose();
202 virtual void doDelete(int32_t docNum);
205 virtual void doUndeleteAll();
208 ByteArray getNorms(
const String& field);
211 virtual void doSetNorm(int32_t doc,
const String& field, uint8_t value);
213 void openNorms(
DirectoryPtr cfsDir, int32_t readBufferSize);
215 friend class ReaderPool;