#include <BundleStore.h>
Definition at line 36 of file BundleStore.h.
Public Types | |
typedef oasys::OpenFdCache < std::string > | FdCache |
Helper class typedefs. | |
typedef oasys::InternalKeyDurableTable < oasys::UIntShim, u_int32_t, Bundle > | BundleTable |
typedef BundleTable::iterator | iterator |
Public Member Functions | |
BundleStore (const DTNStorageConfig &cfg) | |
Constructor. | |
bool | add (Bundle *bundle) |
Add a new bundle. | |
Bundle * | get (u_int32_t bundleid) |
Retrieve a bundle. | |
bool | update (Bundle *bundle) |
Update the metabundle for the bundle. | |
bool | del (Bundle *bundle) |
Delete the bundle. | |
iterator * | new_iterator () |
Return a new iterator. | |
void | close () |
Close down the table. | |
const std::string & | payload_dir () |
Accessors. | |
u_int64_t | payload_quota () |
Accessors. | |
FdCache * | payload_fdcache () |
Accessors. | |
u_int64_t | total_size () |
Accessors. | |
Static Public Member Functions | |
static int | init (const DTNStorageConfig &cfg, oasys::DurableStore *store) |
Boot time initializer that takes as a parameter the storage configuration to use. | |
Protected Member Functions | |
void | set_total_size (u_int64_t sz) |
When the bundle store is loaded at boot time, we need to reset the in-memory total_size_ parameter. | |
Protected Attributes | |
const DTNStorageConfig & | cfg_ |
Storage configuration. | |
BundleTable | bundles_ |
Bundle metabundle table. | |
FdCache | payload_fdcache_ |
File descriptor cache. | |
u_int64_t | total_size_ |
Friends | |
class | BundleDaemon |
typedef oasys::OpenFdCache<std::string> dtn::BundleStore::FdCache |
typedef oasys::InternalKeyDurableTable< oasys::UIntShim, u_int32_t, Bundle> dtn::BundleStore::BundleTable |
Definition at line 41 of file BundleStore.h.
Definition at line 42 of file BundleStore.h.
dtn::BundleStore::BundleStore | ( | const DTNStorageConfig & | cfg | ) |
int dtn::BundleStore::init | ( | const DTNStorageConfig & | cfg, | |
oasys::DurableStore * | store | |||
) | [static] |
Boot time initializer that takes as a parameter the storage configuration to use.
Definition at line 39 of file BundleStore.cc.
References BundleStore().
Referenced by dtn::DTNServer::init_datastore().
Add a new bundle.
Definition at line 51 of file BundleStore.cc.
References oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::add(), bundles_, dtn::Bundle::durable_size(), and total_size_.
Bundle * dtn::BundleStore::get | ( | u_int32_t | bundleid | ) |
Retrieve a bundle.
Definition at line 62 of file BundleStore.cc.
References bundles_, and oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::get().
Referenced by dtn::BundleDaemon::load_bundles().
Update the metabundle for the bundle.
Reimplemented in dtn::SQLBundleStore.
Definition at line 69 of file BundleStore.cc.
References bundles_, and oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::update().
Delete the bundle.
Definition at line 76 of file BundleStore.cc.
References ASSERT, dtn::Bundle::bundleid_, bundles_, oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::del(), dtn::Bundle::durable_size(), and total_size_.
BundleStore::iterator * dtn::BundleStore::new_iterator | ( | ) |
Return a new iterator.
Definition at line 88 of file BundleStore.cc.
References bundles_, and oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::new_iterator().
Referenced by dtn::BundleDaemon::load_bundles().
void dtn::BundleStore::close | ( | ) |
Close down the table.
Definition at line 95 of file BundleStore.cc.
References bundles_, and oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::close().
const std::string& dtn::BundleStore::payload_dir | ( | ) | [inline] |
Accessors.
Definition at line 75 of file BundleStore.h.
References cfg_, and dtn::DTNStorageConfig::payload_dir_.
Referenced by dtn::BundlePayload::init(), and dtn::BundlePayload::init_from_store().
u_int64_t dtn::BundleStore::payload_quota | ( | ) | [inline] |
Accessors.
Definition at line 76 of file BundleStore.h.
References cfg_, and dtn::DTNStorageConfig::payload_quota_.
Referenced by dtn::BundleRouter::accept_bundle().
FdCache* dtn::BundleStore::payload_fdcache | ( | ) | [inline] |
Accessors.
Definition at line 77 of file BundleStore.h.
References payload_fdcache_.
Referenced by dtn::BundlePayload::init(), dtn::BundlePayload::init_from_store(), and dtn::BundlePayload::pin_file().
u_int64_t dtn::BundleStore::total_size | ( | ) | [inline] |
Accessors.
Definition at line 78 of file BundleStore.h.
References total_size_.
Referenced by dtn::BundleRouter::accept_bundle().
void dtn::BundleStore::set_total_size | ( | u_int64_t | sz | ) | [inline, protected] |
When the bundle store is loaded at boot time, we need to reset the in-memory total_size_ parameter.
Definition at line 86 of file BundleStore.h.
References total_size_.
Referenced by dtn::BundleDaemon::load_bundles().
friend class BundleDaemon [friend] |
Definition at line 82 of file BundleStore.h.
const DTNStorageConfig& dtn::BundleStore::cfg_ [protected] |
Storage configuration.
Definition at line 88 of file BundleStore.h.
Referenced by payload_dir(), and payload_quota().
BundleTable dtn::BundleStore::bundles_ [protected] |
Bundle metabundle table.
Definition at line 89 of file BundleStore.h.
Referenced by add(), close(), del(), get(), new_iterator(), and update().
FdCache dtn::BundleStore::payload_fdcache_ [protected] |
File descriptor cache.
Definition at line 90 of file BundleStore.h.
Referenced by payload_fdcache().
u_int64_t dtn::BundleStore::total_size_ [protected] |
Definition at line 91 of file BundleStore.h.
Referenced by add(), del(), set_total_size(), and total_size().