Lucene++ - a full-featured, c++ search engine
API Documentation

Loading...
Searching...
No Matches
MultiLevelSkipListWriter.h
Go to the documentation of this file.
1
2// Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3// Distributable under the terms of either the Apache License (Version 2.0)
4// or the GNU Lesser General Public License.
6
7#ifndef MULTILEVELSKIPLISTWRITER_H
8#define MULTILEVELSKIPLISTWRITER_H
9
10#include "LuceneObject.h"
11
12 namespace Lucene {
13
36 class MultiLevelSkipListWriter : public LuceneObject {
37 public:
38 MultiLevelSkipListWriter(int32_t skipInterval, int32_t maxSkipLevels, int32_t df);
39 virtual ~MultiLevelSkipListWriter();
40
41 LUCENE_CLASS(MultiLevelSkipListWriter);
42
43 protected:
45 int32_t numberOfSkipLevels;
46
48 int32_t skipInterval;
49
51 Collection<RAMOutputStreamPtr> skipBuffer;
52
53 public:
57 void bufferSkip(int32_t df);
58
62 int64_t writeSkip(const IndexOutputPtr& output);
63
64 protected:
65 void init();
66 virtual void resetSkip();
67
71 virtual void writeSkipData(int32_t level, const IndexOutputPtr& skipBuffer) = 0;
72};
73
74}
75
76#endif
LuceneObject.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Lucene::Collection
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
Lucene::LuceneObject
Base class for all Lucene classes.
Definition LuceneObject.h:31
Lucene::MultiLevelSkipListWriter
This abstract class writes skip lists with multiple levels.
Definition MultiLevelSkipListWriter.h:36
Lucene::MultiLevelSkipListWriter::~MultiLevelSkipListWriter
virtual ~MultiLevelSkipListWriter()
Lucene::MultiLevelSkipListWriter::skipInterval
int32_t skipInterval
the skip interval in the list with level = 0
Definition MultiLevelSkipListWriter.h:48
Lucene::MultiLevelSkipListWriter::resetSkip
virtual void resetSkip()
Lucene::MultiLevelSkipListWriter::MultiLevelSkipListWriter
MultiLevelSkipListWriter(int32_t skipInterval, int32_t maxSkipLevels, int32_t df)
Lucene::MultiLevelSkipListWriter::init
void init()
Lucene::MultiLevelSkipListWriter::skipBuffer
Collection< RAMOutputStreamPtr > skipBuffer
for every skip level a different buffer is used
Definition MultiLevelSkipListWriter.h:51
Lucene::MultiLevelSkipListWriter::numberOfSkipLevels
int32_t numberOfSkipLevels
number of levels in this skip list
Definition MultiLevelSkipListWriter.h:45
Lucene::MultiLevelSkipListWriter::bufferSkip
void bufferSkip(int32_t df)
Writes the current skip data to the buffers. The current document frequency determines the max level ...
Lucene::MultiLevelSkipListWriter::writeSkip
int64_t writeSkip(const IndexOutputPtr &output)
Writes the buffered skip lists to the given output.
Lucene::MultiLevelSkipListWriter::writeSkipData
virtual void writeSkipData(int32_t level, const IndexOutputPtr &skipBuffer)=0
Subclasses must implement the actual skip data encoding in this method.
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::IndexOutputPtr
boost::shared_ptr< IndexOutput > IndexOutputPtr
Definition LuceneTypes.h:494

clucene.sourceforge.net