dmlite  0.6
Classes | Macros | Typedefs | Functions
pool.h File Reference

C wrapper for DMLite Pool API. More...

#include "dmlite.h"
#include "any.h"
#include "inode.h"
#include "utils.h"
Include dependency graph for pool.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

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

Macros

#define POOL_TYPE_MAX   16
 
#define POOL_MAX   16
 

Typedefs

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

Functions

int dmlite_getpools (dmlite_context *context, unsigned *nPools, dmlite_pool **pools)
 Gets the list of pools. More...
 
int dmlite_pools_free (unsigned nPools, dmlite_pool *pools)
 Frees an array of pools. More...
 
dmlite_locationdmlite_get (dmlite_context *context, const char *path)
 Gets a single replica (synchronous). More...
 
dmlite_locationdmlite_iget (dmlite_context *context, ino_t inode)
 Gets a single replica (synchronous). More...
 
dmlite_locationdmlite_getlocation (dmlite_context *context, const dmlite_replica *replica)
 Gets the location of a replica. More...
 
dmlite_locationdmlite_put (dmlite_context *context, const char *path)
 Puts a file (synchronous). More...
 
int dmlite_put_abort (dmlite_context *context, const dmlite_location *loc)
 Aborts a put request. More...
 
int dmlite_location_free (dmlite_location *loc)
 Frees a location struct. More...
 

Detailed Description

C wrapper for DMLite Pool API.

Author
Alejandro Álvarez Ayllon aalva.nosp@m.rez@.nosp@m.cern..nosp@m.ch

Macro Definition Documentation

#define POOL_MAX   16
#define POOL_TYPE_MAX   16

Typedef Documentation

typedef struct dmlite_chunk dmlite_chunk

Chunk of data.

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
contextThe DM context.
pathThe logical file name.
Returns
A pointer to a dmlite_location struct, or NULL on error.
dmlite_location* dmlite_getlocation ( dmlite_context context,
const dmlite_replica replica 
)

Gets the location of a replica.

Parameters
contextThe DM context.
replicaThe 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
contextThe DM context.
nPoolsThe number of pools.
poolsAn 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
contextThe DM context.
inodeThe 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
locThe 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
nPoolsThe number of pools in the array.
poolsThe 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
contextThe DM context.
pathThe 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
contextThe DM context.
locAs returned by dmlite_put.
Returns
0 on success, error code otherwise.