4#ifndef DMLITE_CPP_POOLDRIVER_H
5#define DMLITE_CPP_POOLDRIVER_H
7#include "dmlite/common/config.h"
28 explicit Chunk(
const std::string& str);
Base class for factories.
Definition base.h:48
Base class for interfaces.
Definition base.h:18
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:31
bool operator>(const Chunk &) const
bool operator!=(const Chunk &) const
Url url
Definition pooldriver.h:32
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:39
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:35
std::string toString(void) const
uint64_t offset
Definition pooldriver.h:30
Represent the complete location of a file.
Definition pooldriver.h:50
std::string toString(void) const
Location(const std::string &str)
Location(const Location &l)
Definition pooldriver.h:55
Location()
Definition pooldriver.h:52
Location(int nitems, const Chunk &proto)
Definition pooldriver.h:53
PoolDriver factory.
Definition pooldriver.h:126
virtual ~PoolDriverFactory()
Destructor.
virtual PoolDriver * createPoolDriver(void)
Instantiate the implemented pool driver.
virtual std::string implementedPool()
Supported pool type.
Interface for a pool driver.
Definition pooldriver.h:101
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 PoolHandler * createPoolHandler(const std::string &poolName)
Create a handler.
virtual void update(const Pool &pool)
Called when updating a pool.
virtual void toBeCreated(const Pool &pool)
Handler for a pool. Works similary to a file handler.
Definition pooldriver.h:64
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.
Internal interface for handling pool metadata.
Definition poolmanager.h:22
File replica metadata.
Definition inode.h:73
Exceptions used by the API.
Namespace for the dmlite C++ API.
Definition authn.h:16
Common methods and functions for URL and path.