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

C wrapper for DMLite Pool API. More...

#include "any.h"
#include "inode.h"
#include "dmlite.h"
#include "utils.h"
Include dependency graph for pool.h:

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.
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 (dmlite_context *context, unsigned nPools, dmlite_pool *pools)
 Frees an array of pools.
dmlite_locationdmlite_get (dmlite_context *context, const char *path)
 Gets a single replica (synchronous).
dmlite_locationdmlite_iget (dmlite_context *context, ino_t inode)
 Gets a single replica (synchronous).
dmlite_locationdmlite_getlocation (dmlite_context *context, const dmlite_replica *replica)
 Gets the location of a replica.
dmlite_locationdmlite_put (dmlite_context *context, const char *path)
 Puts a file (synchronous).
int dmlite_location_free (dmlite_context *context, dmlite_location *loc)
 Frees a location struct.

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.

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 succes, -1 on failure.
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_context context,
dmlite_location loc 
)

Frees a location struct.

Parameters
contextThe DM context.
locThe struct to free.
Returns
0 on success, error code otherwise.
int dmlite_pools_free ( dmlite_context context,
unsigned  nPools,
dmlite_pool pools 
)

Frees an array of pools.

Parameters
contextThe DM context.
nPoolsThe number of pools in the array.
poolsThe array to free.
Returns
0 on succes, -1 on failure.
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.