strus  0.17
storageClientInterface.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Patrick P. Frey
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
10 #ifndef _STRUS_STORAGE_CLIENT_INTERFACE_HPP_INCLUDED
11 #define _STRUS_STORAGE_CLIENT_INTERFACE_HPP_INCLUDED
12 #include "strus/index.hpp"
13 #include "strus/termStatistics.hpp"
14 #include <string>
15 #include <vector>
16 #include <ostream>
17 
18 namespace strus
19 {
20 
22 class PostingIteratorInterface;
24 class StructIteratorInterface;
26 class ForwardIteratorInterface;
28 class DocumentTermIteratorInterface;
30 class InvAclIteratorInterface;
32 class ValueIteratorInterface;
34 class StorageTransactionInterface;
36 class StorageDocumentInterface;
38 class StatisticsProcessorInterface;
40 class StatisticsIteratorInterface;
42 class MetaDataReaderInterface;
44 class MetaDataRestrictionInterface;
46 class AttributeReaderInterface;
48 class AclReaderInterface;
49 
50 
53 {
54 public:
58 
61  virtual std::string config() const=0;
62 
71  const std::string& type,
72  const std::string& value,
73  const Index& length) const=0;
74 
80  const std::string& structstr) const=0;
81 
91  const MetaDataRestrictionInterface* restriction,
92  const Index& maxpos) const=0;
93 
100  virtual PostingIteratorInterface*
102  const std::string& meta_fieldStart,
103  const std::string& meta_fieldEnd) const=0;
104 
108  virtual ForwardIteratorInterface*
110  const std::string& type) const=0;
111 
117  const std::string& type) const=0;
118 
123  virtual InvAclIteratorInterface*
125  const std::string& username) const=0;
126 
130  virtual AclReaderInterface* createAclReader() const=0;
131 
134  virtual Index nofDocumentsInserted() const=0;
135 
140  virtual Index documentFrequency(
141  const std::string& type,
142  const std::string& term) const=0;
143 
146  virtual Index maxDocumentNumber() const=0;
147 
151  virtual Index documentNumber( const std::string& docid) const=0;
152 
156  virtual Index termTypeNumber( const std::string& type) const=0;
157 
161  virtual bool isForwardIndexTerm( const std::string& type) const=0;
162 
166 
170 
174 
177  virtual ValueIteratorInterface* createDocIdIterator() const=0;
178 
182 
185  {
188  };
189 
194  virtual Index documentStatistics(
195  const Index& docno,
196  const DocumentStatisticsType& stat,
197  const std::string& type) const=0;
198 
202 
206 
210 
215 
219  virtual StatisticsIteratorInterface* createAllStatisticsIterator( bool sign=true)=0;
220 
224 
227  virtual const StatisticsProcessorInterface* getStatisticsProcessor() const=0;
228 
234  const std::string& docid,
235  const std::string& logfilename) const=0;
236 
240  virtual bool checkStorage( std::ostream& errorlog) const=0;
241 
246  virtual void close()=0;
247 };
248 
249 }//namespace
250 #endif
251 
252 
Interface of a strus IR storage.
Definition: storageClientInterface.hpp:52
virtual StructIteratorInterface * createStructIterator(const std::string &structstr) const =0
Create an iterator on the structures (relations of ordinal position ranges) of a defined type...
virtual ValueIteratorInterface * createTermValueIterator() const =0
Create an iterator on the term value inserted.
virtual PostingIteratorInterface * createTermPostingIterator(const std::string &type, const std::string &value, const Index &length) const =0
Create an iterator on the occurrencies of a term in the storage.
int32_t Index
Number type generally used for locally counted indices.
Definition: index.hpp:29
virtual ValueIteratorInterface * createStructTypeIterator() const =0
Create an iterator on the structure types inserted.
virtual ValueIteratorInterface * createTermTypeIterator() const =0
Create an iterator on the term types inserted.
virtual Index documentStatistics(const Index &docno, const DocumentStatisticsType &stat, const std::string &type) const =0
Get one specified element of the documents statistics for a term type on the local server node...
Structure that represents relations of position info index ranges (directed graph) per document...
Definition: structIteratorInterface.hpp:20
virtual bool isForwardIndexTerm(const std::string &type) const =0
Evaluate if there exists forward index blocks for this type.
Class for building up a metadata restriction.
Definition: metaDataRestrictionInterface.hpp:21
virtual const StatisticsProcessorInterface * getStatisticsProcessor() const =0
Get the processing message interface for introspecting and packing messages outside the queue context...
Numeric types used for local and global indices.
Object to declare all items for one insert/replace of a document in the storage.
Definition: storageDocumentInterface.hpp:21
Interface for accessing document attributes from a strus storage.
Definition: aclReaderInterface.hpp:20
DocumentStatisticsType
Enumeration of document statistics.
Definition: storageClientInterface.hpp:184
Structure that represents a set of strings as iterator.
Definition: valueIteratorInterface.hpp:21
Object to declare all items for one insert/update of a document in the storage.
Definition: storageTransactionInterface.hpp:26
virtual Index termTypeNumber(const std::string &type) const =0
Get the local internal term type number.
virtual StatisticsIteratorInterface * createAllStatisticsIterator(bool sign=true)=0
Creates an iterator on storage statistics messages for initialization/deregistration.
virtual MetaDataReaderInterface * createMetaDataReader() const =0
Create an interface to access items of document metadata.
virtual bool checkStorage(std::ostream &errorlog) const =0
Iterate through all key/value pairs and check their data for validity.
virtual Index nofDocumentsInserted() const =0
Get the number of documents inserted in this storage instance.
Interface for accessing document attributes from a strus storage.
Definition: attributeReaderInterface.hpp:20
Iterator of sets of documents used to implement ACL access restrictions.
Definition: invAclIteratorInterface.hpp:18
virtual ValueIteratorInterface * createUserNameIterator() const =0
Create an iterator on the user names used in document access restrictions.
virtual InvAclIteratorInterface * createInvAclIterator(const std::string &username) const =0
Create a an iterator on the numbers of documents a specified user is allowed to see.
number of accumulated dfs (number of terms)
Definition: storageClientInterface.hpp:187
Structure that represents a set of feature occurrencies (postings) as iterator.
Definition: postingIteratorInterface.hpp:20
virtual ForwardIteratorInterface * createForwardIterator(const std::string &type) const =0
Create a viewer to inspect the term stored values with the forward index of the storage.
virtual StorageDocumentInterface * createDocumentChecker(const std::string &docid, const std::string &logfilename) const =0
Create an interface to verify, if the contents of a document are inserted correctly into the storage...
Interface for accessing meta data from a strus storage.
Definition: metaDataReaderInterface.hpp:24
virtual PostingIteratorInterface * createFieldPostingIterator(const std::string &meta_fieldStart, const std::string &meta_fieldEnd) const =0
Create an iterator postings specified as field in the meta data (by start and end position) ...
virtual PostingIteratorInterface * createBrowsePostingIterator(const MetaDataRestrictionInterface *restriction, const Index &maxpos) const =0
Create an iterator on all enumerable postings of document selected by a metadata restriction.
virtual ValueIteratorInterface * createDocIdIterator() const =0
Create an iterator on the document identifiers inserted.
Structure that allows to iterate on document term occurrencies.
Definition: documentTermIteratorInterface.hpp:21
number of distinct terms
Definition: storageClientInterface.hpp:186
virtual std::string config() const =0
Get the interpreted configuration this storage client was created with.
virtual MetaDataRestrictionInterface * createMetaDataRestriction() const =0
Create an object for restrictions on metadata.
virtual Index maxDocumentNumber() const =0
Get the highest document number used in this stogage.
virtual StatisticsIteratorInterface * createChangeStatisticsIterator()=0
Creates an iterator on the storage statistics messages created by updates of this storage...
virtual Index documentFrequency(const std::string &type, const std::string &term) const =0
Get the local document frequency of a feature in this storage instance.
Interface for an iterator on statistics.
Definition: statisticsIteratorInterface.hpp:18
virtual AttributeReaderInterface * createAttributeReader() const =0
Create an interface to access attributes attached to documents for representation.
virtual StorageTransactionInterface * createTransaction()=0
Create an insert/update transaction object.
virtual DocumentTermIteratorInterface * createDocumentTermIterator(const std::string &type) const =0
Create an iterator on term occurrencies in documents (support for feature selection) ...
virtual AclReaderInterface * createAclReader() const =0
Create a an iterator on the access control lists of documents.
virtual Index documentNumber(const std::string &docid) const =0
Get the local internal document number.
Interface for packing/unpacking messages with statistics used for query evaluation.
Definition: statisticsProcessorInterface.hpp:24
Iterator on the forward index mapping occurrencies to the terms inserted.
Definition: forwardIteratorInterface.hpp:19
virtual ~StorageClientInterface()
Destructor.
Definition: storageClientInterface.hpp:57
virtual void close()=0
Close client connection and eventually do some cleanup.