7 #ifndef SEGMENTREADER_H
8 #define SEGMENTREADER_H
44 int32_t readBufferSize;
45 bool deletedDocsDirty;
47 int32_t pendingDeleteCount;
49 bool rollbackHasChanges;
50 bool rollbackDeletedDocsDirty;
51 bool rollbackNormsDirty;
52 int32_t rollbackPendingDeleteCount;
59 virtual void initialize();
76 virtual bool hasDeletions();
93 virtual bool isDeleted(int32_t n);
105 virtual int32_t docFreq(
const TermPtr& t);
108 virtual int32_t numDocs();
111 virtual int32_t maxDoc();
117 virtual bool hasNorms(
const String& field);
120 virtual ByteArray norms(
const String& field);
123 virtual void norms(
const String& field, ByteArray norms, int32_t offset);
125 bool termsIndexLoaded();
129 void loadTermsIndex(int32_t termsIndexDivisor);
132 bool normsClosed(
const String& field);
137 virtual TermFreqVectorPtr getTermFreqVector(int32_t docNumber,
const String& field);
141 virtual void getTermFreqVector(int32_t docNumber,
const String& field,
const TermVectorMapperPtr& mapper);
152 String getSegmentName();
159 void rollbackCommit();
170 virtual int64_t getUniqueTermCount();
175 virtual int32_t getTermInfosIndexDivisor();
178 bool checkDeletedCounts();
179 void loadDeletedDocs();
184 virtual ByteArray cloneNormBytes(ByteArray bytes);
192 virtual void doCommit(MapStringString commitUserData);
194 virtual void commitChanges(MapStringString commitUserData);
197 virtual void doClose();
201 virtual void doDelete(int32_t docNum);
204 virtual void doUndeleteAll();
207 ByteArray getNorms(
const String& field);
210 virtual void doSetNorm(int32_t doc,
const String& field, uint8_t value);
212 void openNorms(
const DirectoryPtr& cfsDir, int32_t readBufferSize);
214 friend class ReaderPool;