pool.h man page

pool.h — C wrapper for DMLite Pool API.

Synopsis

#include 'dmlite.h'
#include 'any.h'
#include 'inode.h'
#include 'utils.h'

Data Structures

struct dmlite_pool
Pool data.
struct dmlite_chunk
Chunk of data.
struct dmlite_location
Collection of chunks that form a replica.

Macros

#define POOL_TYPE_MAX 16

#define POOL_MAX 16

Typedefs

typedef struct dmlite_pool dmlite_pool
Pool data.
typedef struct dmlite_chunk dmlite_chunk
Chunk of data.
typedef struct dmlite_location dmlite_location
Collection of chunks that form a replica.

Functions

int dmlite_getpools (dmlite_context *context, unsigned *nPools, dmlite_pool **pools)
Gets the list of pools.
int dmlite_pools_free (unsigned nPools, dmlite_pool *pools)
Frees an array of pools.
dmlite_location * dmlite_get (dmlite_context *context, const char *path)
Gets a single replica (synchronous).
dmlite_location * dmlite_iget (dmlite_context *context, ino_t inode)
Gets a single replica (synchronous).
dmlite_location * dmlite_getlocation (dmlite_context *context, const dmlite_replica *replica)
Gets the location of a replica.
dmlite_location * dmlite_put (dmlite_context *context, const char *path)
Puts a file (synchronous).
int dmlite_put_abort (dmlite_context *context, const dmlite_location *loc)
Aborts a put request.
int dmlite_location_free (dmlite_location *loc)
Frees a location struct.
int dmlite_getdirspaces (dmlite_context *context, const char *logicaldir, int64_t *freespace, int64_t *used)
Get the estimation of the free/used space for writing into a directory.

Detailed Description

C wrapper for DMLite Pool API.

Author:

Alejandro Álvarez Ayllon aalvarez@cern.ch

Macro Definition Documentation

#define POOL_MAX 16

#define POOL_TYPE_MAX 16

Typedef Documentation

typedef struct dmlite_chunk dmlite_chunk

Chunk of data.

typedef struct dmlite_location dmlite_location

Collection of chunks that form a replica. On read, there may be duplicated chunks.

typedef struct dmlite_pool dmlite_pool

Pool data.

Function Documentation

dmlite_location* dmlite_get (dmlite_context * context, const char * path)

Gets a single replica (synchronous).

Parameters:

context The DM context.
path The logical file name.

Returns:

A pointer to a dmlite_location struct, or NULL on error.

int dmlite_getdirspaces (dmlite_context * context, const char * logicaldir, int64_t * freespace, int64_t * used)

Get the estimation of the free/used space for writing into a directory.

Parameters:

path The path of the directory to query
totalfree The total number of free bytes (may not be contiguous)
used The total number of used bytes

Returns:

0 on success, error code otherwise.

dmlite_location* dmlite_getlocation (dmlite_context * context, const dmlite_replica * replica)

Gets the location of a replica.

Parameters:

context The DM context.
replica The replica to translate.

Returns:

A pointer to a dmlite_location struct, or NULL on error.

int dmlite_getpools (dmlite_context * context, unsigned * nPools, dmlite_pool ** pools)

Gets the list of pools.

Parameters:

context The DM context.
nPools The number of pools.
pools An array with the pools. Use dmlite_freepools to free.

Returns:

0 on success, error code otherwise.

dmlite_location* dmlite_iget (dmlite_context * context, ino_t inode)

Gets a single replica (synchronous).

Parameters:

context The DM context.
inode The file inode.

Returns:

A pointer to a dmlite_location struct, or NULL on error.

int dmlite_location_free (dmlite_location * loc)

Frees a location struct.

Parameters:

loc The struct to free.

Returns:

0 on success, error code otherwise.

int dmlite_pools_free (unsigned nPools, dmlite_pool * pools)

Frees an array of pools.

Parameters:

nPools The number of pools in the array.
pools The array to free.

Returns:

0 on success, error code otherwise.

dmlite_location* dmlite_put (dmlite_context * context, const char * path)

Puts a file (synchronous).

Parameters:

context The DM context.
path The logical file name to put.

Returns:

A pointer to a dmlite_location struct, or NULL on error.

int dmlite_put_abort (dmlite_context * context, const dmlite_location * loc)

Aborts a put request.

Parameters:

context The DM context.
loc As returned by dmlite_put.

Returns:

0 on success, error code otherwise.

Author

Generated automatically by Doxygen for dmlite from the source code.

Info

Fri Sep 23 2016 Version 0.6 dmlite