NCBI C++ ToolKit
Public Types | Public Member Functions | Protected Attributes | List of all members

Search Toolkit Book for CNetICacheClient

Client to NetCache server (implements ICache interface) More...

#include <connect/services/neticache_client.hpp>

+ Inheritance diagram for CNetICacheClient:
+ Collaboration diagram for CNetICacheClient:

Public Types

enum  EAppRegistry { eAppRegistry }
 Defines how this object must be initialized. More...
 
typedef SNetICacheClientImplTInstance
 
typedef grid::netcache::search::CBlobInfo CBlobInfo
 
typedef grid::netcache::search::CExpression CExpression
 
typedef grid::netcache::search::CFields CFields
 
- Public Types inherited from ICache
enum  EFlags { fBestPerformance = (0 << 0) , fBestReliability = (1 << 0) }
 Flags for the underlying storage. More...
 
enum  ETimeStampFlags {
  fNoTimeStamp = 0 , fTimeStampOnCreate = (1 << 0) , fTimeStampOnRead = (1 << 1) , fTrackSubKey = (1 << 2) ,
  fExpireLeastFrequentlyUsed = (1 << 3) , fPurgeOnStartup = (1 << 4) , fCheckExpirationAlways = (1 << 5)
}
 ICache keeps timestamps of every cache entry. More...
 
enum  EKeepVersions { eKeepAll , eDropOlder , eDropAll }
 If to keep already cached versions of the BLOB when storing another version of it (not necessarily a newer one) More...
 
enum  EBlobVersionValidity { eCurrent , eExpired , eValid = eCurrent }
 BLOB version existence and validity – from the point of view of the underlying cache implementation. More...
 
typedef int TBlobVersion
 
typedef int TFlags
 Bitwise OR of "EFlags" flags. More...
 
typedef ETimeStampFlags ETimeStampPolicy
 
typedef int TTimeStampFlags
 Holds a bitwise OR of "ETimeStampFlags". More...
 
typedef EBlobVersionValidity EBlobValidity
 Backward-compatibility typedef. More...
 
typedef TPluginManagerParamTree TCacheParams
 Key values to search for a cache with given params. More...
 

Public Member Functions

 CNetICacheClient (EVoid)
 
 CNetICacheClient (SNetICacheClientImpl *impl)
 
CNetICacheClientoperator= (SNetICacheClientImpl *impl)
 
 operator SNetICacheClientImpl * ()
 
 operator const SNetICacheClientImpl * () const
 
SNetICacheClientImploperator-- (int)
 
const SNetICacheClientImploperator-- (int) const
 
SNetICacheClientImploperator-> ()
 
const SNetICacheClientImploperator-> () const
 
 CNetICacheClient (EAppRegistry use_app_reg, const string &conf_section=kEmptyStr)
 Create an instance of CNetICacheClient and initialize it with parameters read from the application registry. More...
 
 CNetICacheClient (CConfig *config=NULL, const string &driver_name=kEmptyStr)
 
 CNetICacheClient (const IRegistry &reg, const string &conf_section=kEmptyStr)
 
 CNetICacheClient (const string &host, unsigned short port, const string &cache_name, const string &client_name)
 
 CNetICacheClient (const string &service_name, const string &cache_name, const string &client_name)
 
void RegisterSession (unsigned pid)
 Send session registration command. More...
 
void UnRegisterSession (unsigned pid)
 Send session unregistration command. More...
 
virtual TFlags GetFlags ()
 Retrieve the effective combination of flags from the underlying storage. More...
 
virtual void SetFlags (TFlags flags)
 Pass flags to the underlying storage. More...
 
virtual void SetTimeStampPolicy (TTimeStampFlags policy, unsigned int timeout, unsigned int max_timeout=0)
 Set timestamp update policy. More...
 
virtual TTimeStampFlags GetTimeStampPolicy () const
 Get timestamp policy. More...
 
virtual int GetTimeout () const
 Get expiration timeout. More...
 
virtual bool IsOpen () const
 
virtual void SetVersionRetention (EKeepVersions policy)
 Set version retention policy. More...
 
virtual EKeepVersions GetVersionRetention () const
 Get version retention. More...
 
virtual void Store (const string &key, int version, const string &subkey, const void *data, size_t size, unsigned int time_to_live=0, const string &owner=kEmptyStr)
 Add or replace BLOB. More...
 
virtual size_t GetSize (const string &key, int version, const string &subkey)
 Check if BLOB exists, return BLOB size. More...
 
size_t GetBlobSize (const string &key, int version, const string &subkey, const CNamedParameterList *optional=NULL)
 Returns the size of the BLOB identified by the "key", "version", and "subkey" parameters. More...
 
virtual void GetBlobOwner (const string &key, int version, const string &subkey, string *owner)
 Retrieve BLOB owner. More...
 
vector< CBlobInfoSearch (CExpression expression, CFields fields=CFields())
 Returns information for all blobs matching provided search expression. More...
 
virtual bool Read (const string &key, int version, const string &subkey, void *buf, size_t buf_size)
 
bool ReadPart (const string &key, int version, const string &subkey, size_t offset, size_t part_size, void *buf, size_t buf_size)
 
IReaderGetReadStream (const string &key, int version, const string &subkey, size_t *blob_size_ptr, const CNamedParameterList *optional=NULL)
 Read a lengthy blob via the IReader interface. More...
 
virtual IReaderGetReadStream (const string &key, const string &subkey, int *version, EBlobVersionValidity *validity)
 Read a lengthy blob via the IReader interface. More...
 
virtual void SetBlobVersionAsCurrent (const string &key, const string &subkey, int version)
 Set current valid version for a BLOB. More...
 
IReaderGetReadStreamPart (const string &key, int version, const string &subkey, size_t offset, size_t part_size, size_t *blob_size_ptr, const CNamedParameterList *optional=NULL)
 Read data from the specified blob. More...
 
virtual IReaderGetReadStream (const string &key, int version, const string &subkey)
 Read a lengthy blob via the IReader interface. More...
 
virtual void GetBlobAccess (const string &key, int version, const string &subkey, SBlobAccessDescr *blob_descr)
 Get BLOB access using BlobAccessDescr. More...
 
IEmbeddedStreamWriterGetNetCacheWriter (const string &key, int version, const string &subkey, const CNamedParameterList *optional=NULL)
 Create or update the specified blob. More...
 
virtual IWriterGetWriteStream (const string &key, int version, const string &subkey, unsigned int time_to_live=0, const string &owner=kEmptyStr)
 Return sequential stream interface to write BLOB data. More...
 
virtual void Remove (const string &key, int version, const string &subkey)
 Remove specific cache entry. More...
 
void RemoveBlob (const string &key, int version, const string &subkey, const CNamedParameterList *optional=NULL)
 
virtual time_t GetAccessTime (const string &key, int version, const string &subkey)
 Return last access time for the specified cache entry. More...
 
virtual bool HasBlobs (const string &key, const string &subkey)
 Check if any BLOB exists (any version) More...
 
bool HasBlob (const string &key, const string &subkey, const CNamedParameterList *optional=NULL)
 
virtual void Purge (time_t access_timeout)
 Delete all BLOBs older than specified. More...
 
virtual void Purge (const string &key, const string &subkey, time_t access_timeout)
 Delete BLOBs with access time older than specified. More...
 
virtual bool SameCacheParams (const TCacheParams *params) const
 
virtual string GetCacheName (void) const
 
void SetCommunicationTimeout (const STimeout &to)
 Set communication timeout. More...
 
STimeout GetCommunicationTimeout () const
 
CNetServerMultilineCmdOutput GetBlobInfo (const string &key, int version, const string &subkey, const CNamedParameterList *optional=NULL)
 Return a CNetServerMultilineCmdOutput object for reading meta information about the specified blob. More...
 
void PrintBlobInfo (const string &key, int version, const string &subkey)
 Print meta information about the specified blob. More...
 
CNetService GetService ()
 
list< stringGetSubkeyList (const string &key)
 
- Public Member Functions inherited from ICache
virtual ~ICache ()
 

Protected Attributes

CNetRef< SNetICacheClientImplm_Impl
 

Detailed Description

Client to NetCache server (implements ICache interface)

Note
This implementation is thread safe and synchronized

Definition at line 70 of file neticache_client.hpp.


The documentation for this class was generated from the following files:
Modified on Wed May 15 15:09:39 2024 by modify_doxy.py rev. 669887