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

SnapshotDeletionPolicy.h
Go to the documentation of this file.
1 // 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 SNAPSHOTDELETIONPOLICY_H
8 #define SNAPSHOTDELETIONPOLICY_H
9
10 #include "IndexDeletionPolicy.h"
11
12 namespace Lucene {
13
14 class LPPAPI SnapshotDeletionPolicy : public IndexDeletionPolicy {
15 public:
16 SnapshotDeletionPolicy(const IndexDeletionPolicyPtr& primary);
17 virtual ~SnapshotDeletionPolicy();
18
19 LUCENE_CLASS(SnapshotDeletionPolicy);
20
21 protected:
22 IndexCommitPtr lastCommit;
23 IndexDeletionPolicyPtr primary;
24 String _snapshot;
25
26 public:
29 virtual void onInit(Collection<IndexCommitPtr> commits);
30
33 virtual void onCommit(Collection<IndexCommitPtr> commits);
34
40 virtual IndexCommitPtr snapshot();
41
43 virtual void release();
44
45 protected:
46 Collection<IndexCommitPtr> wrapCommits(Collection<IndexCommitPtr> commits);
47
48 friend class MyCommitPoint;
49 };
50
51 }
52
53 #endif
IndexDeletionPolicy.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::Collection< IndexCommitPtr >
Lucene::IndexDeletionPolicy
Policy for deletion of stale index commits. Implement this interface, and pass it to one of the Index...
Definition: IndexDeletionPolicy.h:27
Lucene::SnapshotDeletionPolicy
Definition: SnapshotDeletionPolicy.h:14
Lucene::SnapshotDeletionPolicy::onCommit
virtual void onCommit(Collection< IndexCommitPtr > commits)
This is called each time the writer completed a commit. This gives the policy a chance to remove old ...
Lucene::SnapshotDeletionPolicy::onInit
virtual void onInit(Collection< IndexCommitPtr > commits)
This is called once when a writer is first instantiated to give the policy a chance to remove old com...
Lucene::SnapshotDeletionPolicy::~SnapshotDeletionPolicy
virtual ~SnapshotDeletionPolicy()
Lucene::SnapshotDeletionPolicy::lastCommit
IndexCommitPtr lastCommit
Definition: SnapshotDeletionPolicy.h:19
Lucene::SnapshotDeletionPolicy::wrapCommits
Collection< IndexCommitPtr > wrapCommits(Collection< IndexCommitPtr > commits)
Lucene::SnapshotDeletionPolicy::release
virtual void release()
Release the currently held snapshot.
Lucene::SnapshotDeletionPolicy::_snapshot
String _snapshot
Definition: SnapshotDeletionPolicy.h:24
Lucene::SnapshotDeletionPolicy::snapshot
virtual IndexCommitPtr snapshot()
Take a snapshot of the most recent commit to the index. You must call release() to free this snapshot...
Lucene::SnapshotDeletionPolicy::primary
IndexDeletionPolicyPtr primary
Definition: SnapshotDeletionPolicy.h:23
Lucene::SnapshotDeletionPolicy::SnapshotDeletionPolicy
SnapshotDeletionPolicy(const IndexDeletionPolicyPtr &primary)
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::IndexCommitPtr
boost::shared_ptr< IndexCommit > IndexCommitPtr
Definition: LuceneTypes.h:152
Lucene::IndexDeletionPolicyPtr
boost::shared_ptr< IndexDeletionPolicy > IndexDeletionPolicyPtr
Definition: LuceneTypes.h:153

clucene.sourceforge.net