4 #ifndef DMLITE_CPP_POOLDRIVER_H
5 #define DMLITE_CPP_POOLDRIVER_H
7 #include "dmlite/common/config.h"
27 explicit Chunk(
const std::string& str);
Base class for factories.
Definition: base.h:48
Base class for interfaces.
Definition: base.h:18
PoolDriver factory.
Definition: pooldriver.h:124
virtual PoolDriver * createPoolDriver(void)
Instantiate the implemented pool driver.
virtual ~PoolDriverFactory()
Destructor.
virtual std::string implementedPool()
Supported pool type.
Interface for a pool driver.
Definition: pooldriver.h:99
virtual void toBeDeleted(const Pool &pool)
virtual ~PoolDriver()
Destructor.
virtual void justCreated(const Pool &pool)
Called just after a pool is added to the database.
virtual void update(const Pool &pool)
Called when updating a pool.
virtual void toBeCreated(const Pool &pool)
virtual PoolHandler * createPoolHandler(const std::string &poolName)
Create a handler.
Handler for a pool. Works similary to a file handler.
Definition: pooldriver.h:62
virtual uint64_t getFreeSpace(void)
Get the free space of this pool.
virtual std::string getPoolName(void)
Get the pool name of this pool.
virtual void removeReplica(const Replica &replica)
Remove a replica from the pool.
virtual Location whereToRead(const Replica &replica)
Get the actual location of the file replica. This is pool-specific.
virtual ~PoolHandler()
Destructor.
virtual bool poolIsAvailable(bool write=true)
Check if the pool is actually available.
virtual bool replicaIsAvailable(const Replica &replica)
Check if a replica is available.
virtual std::string getPoolType(void)
Get the pool type of this pool.
virtual Location whereToWrite(const std::string &path)
Get where to put a file.
virtual uint64_t getTotalSpace(void)
Get the total space of this pool.
virtual void cancelWrite(const Location &loc)
Cancel a write.
Exceptions used by the API.
Namespace for the dmlite C++ API.
Definition: authn.h:15
Represents a chunk of a file.
Definition: pooldriver.h:23
bool operator==(const Chunk &) const
Chunk(const std::string &url, uint64_t offset, uint64_t size)
uint64_t size
Definition: pooldriver.h:30
bool operator>(const Chunk &) const
bool operator!=(const Chunk &) const
Url url
Definition: pooldriver.h:31
Chunk(const std::string &str)
Chunk from a serialized string.
std::string chunkid
Some implementations need to pass an ID for a chunk.
Definition: pooldriver.h:38
bool operator<(const Chunk &) const
std::string url_alt
Some implementations need to pass two urls per chunk, e.g. one for PUT and one for POST.
Definition: pooldriver.h:34
std::string toString(void) const
uint64_t offset
Definition: pooldriver.h:29
Represent the complete location of a file.
Definition: pooldriver.h:49
std::string toString(void) const
Location(const std::string &str)
Location(const Location &l)
Definition: pooldriver.h:53
Location()
Definition: pooldriver.h:50
Location(int nitems, const Chunk &proto)
Definition: pooldriver.h:51
Internal interface for handling pool metadata.
Definition: poolmanager.h:22
File replica metadata.
Definition: inode.h:71
Common methods and functions for URL and path.