Client API to NCBI NetCache
[General Purpose Network Infrastructure Services]

Collaboration diagram for Client API to NCBI NetCache:


Classes

class  CBlobStorage_NetCache
 CBlobStorage_NetCache --- Implementation of IBlobStorage interface based on NetCache service. More...
class  CNetCacheAdmin
class  CNetCacheAPI
 Client API for NetCache server. More...
class  CNetCacheException
 NetCache internal exception. More...
struct  CNetCacheKey
 Meaningful information encoded in the NetCache key. More...
class  CNetICacheClient
 Client to NetCache server (implements ICache interface). More...
class  CNetCacheReader
class  CNetCacheWriter

Typedefs

typedef unsigned int CBlobStorage_NetCache::TCacheFlags

Functions

 CBlobStorage_NetCache::CBlobStorage_NetCache ()
 CBlobStorage_NetCache::CBlobStorage_NetCache (CNetCacheAPI::TInstance nc_client, TCacheFlags flags=0x0, const string &temp_dir=".")
 Create Blob Storage.
virtual CBlobStorage_NetCache::~CBlobStorage_NetCache ()
virtual bool CBlobStorage_NetCache::IsKeyValid (const string &str)
 Check if a given string is a valid key.
virtual string CBlobStorage_NetCache::GetBlobAsString (const string &data_id)
 Get a blob content as a string.
virtual CNcbiIstreamCBlobStorage_NetCache::GetIStream (const string &data_id, size_t *blob_size=0, ELockMode lock_mode=eLockWait)
 Get an input stream to a blob.
virtual CNcbiOstreamCBlobStorage_NetCache::CreateOStream (string &data_id, ELockMode lock_mode=eLockNoWait)
 Get an output stream to a blob.
virtual string CBlobStorage_NetCache::CreateEmptyBlob ()
 Create an new blob.
virtual void CBlobStorage_NetCache::DeleteBlob (const string &data_id)
 Delete a blob.
virtual void CBlobStorage_NetCache::Reset ()
 Close all streams and connections.
auto_ptr< IReaderCBlobStorage_NetCache::x_GetReader (const string &key, size_t &blob_size, ELockMode lockMode)
void CBlobStorage_NetCache::x_Check (const string &where)
 CBlobStorage_NetCache::CBlobStorage_NetCache (const CBlobStorage_NetCache &)
CBlobStorage_NetCacheCBlobStorage_NetCache::operator= (CBlobStorage_NetCache &)
void NCBI_EntryPoint_xblobstorage_netcache (CPluginManager< IBlobStorage >::TDriverInfoList &info_list, CPluginManager< IBlobStorage >::EEntryPointRequest method)
void BlobStorage_RegisterDriver_NetCache (void)
 NCBI_DECLARE_INTERFACE_VERSION (SNetCacheAPIImpl,"xnetcacheapi", 1, 1, 0)
void NCBI_EntryPoint_xnetcacheapi (CPluginManager< SNetCacheAPIImpl >::TDriverInfoList &info_list, CPluginManager< SNetCacheAPIImpl >::EEntryPointRequest method)
void NCBI_EntryPoint_xcache_netcache (CPluginManager< ICache >::TDriverInfoList &info_list, CPluginManager< ICache >::EEntryPointRequest method)
void Cache_RegisterDriver_NetCache (void)
 CNetCacheKey::CNetCacheKey (unsigned int _id, const string &_host, unsigned int _port, unsigned int ver=1)
unsigned int CNetCacheKey::GetId (void) const
const string & CNetCacheKey::GetHost (void) const
unsigned int CNetCacheKey::GetPort (void) const
unsigned int CNetCacheKey::GetVersion (void) const

Variables

static const string CBlobStorage_NetCache::sm_InputBlobCachePrefix
static const string CBlobStorage_NetCache::sm_OutputBlobCachePrefix
CNetCacheAPI CBlobStorage_NetCache::m_NCClient
auto_ptr< CNcbiIstreamCBlobStorage_NetCache::m_IStream
auto_ptr< CNcbiOstreamCBlobStorage_NetCache::m_OStream
TCacheFlags CBlobStorage_NetCache::m_CacheFlags
string CBlobStorage_NetCache::m_CreatedBlobId
string CBlobStorage_NetCache::m_TempDir
const char * kBlobStorageNetCacheDriverName
const char * kNetCacheAPIDriverName
const char * kNetICacheDriverName


Typedef Documentation

typedef unsigned int CBlobStorage_NetCache::TCacheFlags [inherited]
 

Definition at line 65 of file blob_storage_netcache.hpp.


Function Documentation

void BlobStorage_RegisterDriver_NetCache void   ) 
 

Definition at line 448 of file blob_storage_netcache.cpp.

Referenced by CCgiSession_NetCache::CCgiSession_NetCache(), CRemoteCgiApp::CRemoteCgiApp(), CRemoteAppClientSampleApp::Init(), CGridClientSampleApp::Init(), CRemoteAppDispatcher::Init(), CNSSubmitRemoteJobApp::Init(), CNSRemoveJobControlApp::Init(), CGridCgiApplication::InitGridClient(), and main().

void Cache_RegisterDriver_NetCache void   ) 
 

Definition at line 537 of file neticache_client.cpp.

References NCBI_EntryPoint_xcache_netcache().

CBlobStorage_NetCache::CBlobStorage_NetCache const CBlobStorage_NetCache  )  [private, inherited]
 

CBlobStorage_NetCache::CBlobStorage_NetCache CNetCacheAPI::TInstance  nc_client,
TCacheFlags  flags = 0x0,
const string &  temp_dir = "."
[inherited]
 

Create Blob Storage.

Parameters:
[in] nc_client NetCache client - an instance of CNetCacheAPI.
[in] flags Specifies if blobs should be cached on a local fs before they are accessed for read/write.
in[ temp_dir Specifies where on a local fs those blobs will be cached

Definition at line 55 of file blob_storage_netcache.cpp.

CBlobStorage_NetCache::CBlobStorage_NetCache  )  [inherited]
 

Definition at line 66 of file blob_storage_netcache.cpp.

References eInvalid, and NCBI_THROW.

CNetCacheKey::CNetCacheKey unsigned int  _id,
const string &  _host,
unsigned int  _port,
unsigned int  ver = 1
[inline, inherited]
 

Definition at line 115 of file netcache_key.hpp.

string CBlobStorage_NetCache::CreateEmptyBlob  )  [virtual, inherited]
 

Create an new blob.

Returns:
Newly create blob key

Implements IBlobStorage.

Definition at line 217 of file blob_storage_netcache.cpp.

References kEmptyStr, CBlobStorage_NetCache::m_NCClient, CNetCacheAPI::PutData(), and CBlobStorage_NetCache::x_Check().

CNcbiOstream & CBlobStorage_NetCache::CreateOStream string &  data_id,
ELockMode  lock_mode = eLockNoWait
[virtual, inherited]
 

Get an output stream to a blob.

Parameters:
[in,out] blob_key Blob key to read. If a blob with a given key does not exist an key of a newly create blob will be assigned to blob_key
[in] lock_mode Blob locking mode

Definition at line 163 of file blob_storage_netcache.cpp.

References CBlobStorage_NetCache::eCacheOutput, ERR_POST_XX, CNetServiceException::eTimeout, CException::GetErrCode(), CBlobStorage_NetCache::m_CacheFlags, CBlobStorage_NetCache::m_NCClient, CNetCacheAPI::PutData(), auto_ptr< X >::reset(), SleepMilliSec(), CException::what(), and CBlobStorage_NetCache::x_Check().

void CBlobStorage_NetCache::DeleteBlob const string &  data_id  )  [virtual, inherited]
 

Delete a blob.

Parameters:
[in] blob_key Blob key to read

Implements IBlobStorage.

Definition at line 227 of file blob_storage_netcache.cpp.

References CBlobStorage_NetCache::m_NCClient, CNetCacheAPI::Remove(), and CBlobStorage_NetCache::x_Check().

string CBlobStorage_NetCache::GetBlobAsString const string &  data_id  )  [virtual, inherited]
 

Get a blob content as a string.

Parameters:
[in] blob_key Blob key to read

Implements IBlobStorage.

Definition at line 137 of file blob_storage_netcache.cpp.

References buf, IBlobStorage::eLockWait, eRW_Eof, eRW_Success, NCBI_THROW, and CBlobStorage_NetCache::x_GetReader().

const string & CNetCacheKey::GetHost void   )  const [inline, inherited]
 

Definition at line 129 of file netcache_key.hpp.

References CNetCacheKey::m_Host.

Referenced by SNetCacheAPIImpl::GetServer().

unsigned int CNetCacheKey::GetId void   )  const [inline, inherited]
 

Definition at line 123 of file netcache_key.hpp.

References CNetCacheKey::m_Id.

CNcbiIstream & CBlobStorage_NetCache::GetIStream const string &  data_id,
size_t *  blob_size = 0,
ELockMode  lock_mode = eLockWait
[virtual, inherited]
 

Get an input stream to a blob.

Parameters:
[in] blob_key Blob key to read
[out] blob_size if blob_size if not NULL the size of a blob is returned
[in] lock_mode Blob locking mode

Definition at line 92 of file blob_storage_netcache.cpp.

References buf, CDirEntry::CreateTmpFileEx(), CBlobStorage_NetCache::eCacheInput, eRW_Success, auto_ptr< X >::get(), CBlobStorage_NetCache::m_CacheFlags, CBlobStorage_NetCache::m_IStream, CBlobStorage_NetCache::m_TempDir, NCBI_THROW, auto_ptr< X >::reset(), CBlobStorage_NetCache::sm_InputBlobCachePrefix, and CBlobStorage_NetCache::x_GetReader().

unsigned int CNetCacheKey::GetPort void   )  const [inline, inherited]
 

Definition at line 135 of file netcache_key.hpp.

References CNetCacheKey::m_Port.

Referenced by SNetCacheAPIImpl::GetServer().

unsigned int CNetCacheKey::GetVersion void   )  const [inline, inherited]
 

Definition at line 141 of file netcache_key.hpp.

References CNetCacheKey::m_Version.

bool CBlobStorage_NetCache::IsKeyValid const string &  str  )  [virtual, inherited]
 

Check if a given string is a valid key.

The implementaion should not make any connection to the storage, it just checks the str structure.

Implements IBlobStorage.

Definition at line 81 of file blob_storage_netcache.cpp.

NCBI_DECLARE_INTERFACE_VERSION SNetCacheAPIImpl  ,
"xnetcacheapi"  ,
,
,
 

void NCBI_EntryPoint_xblobstorage_netcache CPluginManager< IBlobStorage >::TDriverInfoList &  info_list,
CPluginManager< IBlobStorage >::EEntryPointRequest  method
 

Definition at line 440 of file blob_storage_netcache.cpp.

References CHostEntryPointImpl< TClassFactory >::NCBI_EntryPointImpl().

Referenced by BlobStorage_RegisterDriver_NetCache().

void NCBI_EntryPoint_xcache_netcache CPluginManager< ICache >::TDriverInfoList &  info_list,
CPluginManager< ICache >::EEntryPointRequest  method
 

Definition at line 529 of file neticache_client.cpp.

References CHostEntryPointImpl< TClassFactory >::NCBI_EntryPointImpl().

Referenced by Cache_RegisterDriver_NetCache().

void NCBI_EntryPoint_xnetcacheapi CPluginManager< SNetCacheAPIImpl >::TDriverInfoList &  info_list,
CPluginManager< SNetCacheAPIImpl >::EEntryPointRequest  method
 

Definition at line 531 of file netcache_api.cpp.

References CHostEntryPointImpl< TClassFactory >::NCBI_EntryPointImpl().

Referenced by CBlobStorageNetCacheCF::CreateInstance().

CBlobStorage_NetCache& CBlobStorage_NetCache::operator= CBlobStorage_NetCache  )  [private, inherited]
 

void CBlobStorage_NetCache::Reset  )  [virtual, inherited]
 

Close all streams and connections.

Implements IBlobStorage.

Definition at line 234 of file blob_storage_netcache.cpp.

References CBlobStorage_NetCache::eCacheOutput, ERR_POST_XX, CNetServiceException::eTimeout, auto_ptr< X >::get(), CException::GetErrCode(), CBlobStorage_NetCache::m_CacheFlags, CBlobStorage_NetCache::m_CreatedBlobId, CBlobStorage_NetCache::m_IStream, CBlobStorage_NetCache::m_NCClient, CBlobStorage_NetCache::m_OStream, CNetCacheAPI::PutData(), auto_ptr< X >::reset(), SleepMilliSec(), and CException::what().

Referenced by CBlobStorage_NetCache::~CBlobStorage_NetCache().

void CBlobStorage_NetCache::x_Check const string &  where  )  [private, inherited]
 

Definition at line 344 of file blob_storage_netcache.cpp.

References CBlobStorage_NetCache::eCacheInput, CBlobStorage_NetCache::eCacheOutput, auto_ptr< X >::get(), CBlobStorage_NetCache::m_CacheFlags, CBlobStorage_NetCache::m_IStream, CBlobStorage_NetCache::m_OStream, and NCBI_THROW.

Referenced by CBlobStorage_NetCache::CreateEmptyBlob(), CBlobStorage_NetCache::CreateOStream(), CBlobStorage_NetCache::DeleteBlob(), and CBlobStorage_NetCache::x_GetReader().

auto_ptr< IReader > CBlobStorage_NetCache::x_GetReader const string &  key,
size_t &  blob_size,
ELockMode  lockMode
[private, inherited]
 

Definition at line 295 of file blob_storage_netcache.cpp.

References CNetCacheAPI::eLockNoWait, IBlobStorage::eLockNoWait, CNetCacheAPI::eLockWait, NCBI_THROW, and CBlobStorage_NetCache::x_Check().

Referenced by CBlobStorage_NetCache::GetBlobAsString(), and CBlobStorage_NetCache::GetIStream().

CBlobStorage_NetCache::~CBlobStorage_NetCache  )  [virtual, inherited]
 

Definition at line 73 of file blob_storage_netcache.cpp.

References NCBI_CATCH_ALL, and CBlobStorage_NetCache::Reset().


Variable Documentation

const char* kBlobStorageNetCacheDriverName
 

Definition at line 357 of file blob_storage_netcache.cpp.

const char* kNetCacheAPIDriverName
 

Definition at line 116 of file netcache_api.cpp.

Referenced by CBlobStorageNetCacheCF::CreateInstance(), CNSSubmitRemoteJobApp::Run(), and CNSRemoveJobControlApp::Run().

const char* kNetICacheDriverName
 

Definition at line 61 of file neticache_client.cpp.

TCacheFlags CBlobStorage_NetCache::m_CacheFlags [private, inherited]
 

Definition at line 145 of file blob_storage_netcache.hpp.

Referenced by CBlobStorage_NetCache::CreateOStream(), CBlobStorage_NetCache::GetIStream(), CBlobStorage_NetCache::Reset(), and CBlobStorage_NetCache::x_Check().

string CBlobStorage_NetCache::m_CreatedBlobId [private, inherited]
 

Definition at line 146 of file blob_storage_netcache.hpp.

Referenced by CBlobStorage_NetCache::Reset().

auto_ptr<CNcbiIstream> CBlobStorage_NetCache::m_IStream [private, inherited]
 

Definition at line 136 of file blob_storage_netcache.hpp.

Referenced by CBlobStorage_NetCache::GetIStream(), CBlobStorage_NetCache::Reset(), and CBlobStorage_NetCache::x_Check().

CNetCacheAPI CBlobStorage_NetCache::m_NCClient [private, inherited]
 

Definition at line 134 of file blob_storage_netcache.hpp.

Referenced by CBlobStorage_NetCache::CreateEmptyBlob(), CBlobStorage_NetCache::CreateOStream(), CBlobStorage_NetCache::DeleteBlob(), and CBlobStorage_NetCache::Reset().

auto_ptr<CNcbiOstream> CBlobStorage_NetCache::m_OStream [private, inherited]
 

Definition at line 137 of file blob_storage_netcache.hpp.

Referenced by CBlobStorage_NetCache::Reset(), and CBlobStorage_NetCache::x_Check().

string CBlobStorage_NetCache::m_TempDir [private, inherited]
 

Definition at line 147 of file blob_storage_netcache.hpp.

Referenced by CBlobStorage_NetCache::GetIStream().

const string CBlobStorage_NetCache::sm_InputBlobCachePrefix [static, inherited]
 

Initial value:

    ".nc_cache_input."

Definition at line 130 of file blob_storage_netcache.hpp.

Referenced by CBlobStorageNetCacheCF::CreateInstance(), and CBlobStorage_NetCache::GetIStream().

const string CBlobStorage_NetCache::sm_OutputBlobCachePrefix [static, inherited]
 

Initial value:

    ".nc_cache_output."

Definition at line 131 of file blob_storage_netcache.hpp.

Referenced by CBlobStorageNetCacheCF::CreateInstance().


Generated on Mon Dec 7 16:02:04 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:24:35 2009 by modify_doxy.py rev. 173732