veil_config.c File Reference


Detailed Description

     Author:       Marc Munro
     Copyright (c) 2006 Marc Munro
     License:      BSD
 $Id: veil_config.c,v 1.3 2007/07/31 22:18:27 bloodnok Exp $

Code for setting and reading configuration data.

Definition in file veil_config.c.

#include "postgres.h"
#include "storage/fd.h"
#include "utils/guc.h"
#include "veil_version.h"
#include "veil_funcs.h"

Include dependency graph for veil_config.c:

Go to the source code of this file.

Functions

int veil_dbs_in_cluster ()
 Return the number of databases, within the database cluster, that will use Veil.
int veil_shared_hash_elems ()
 Return the number of entries that should be allocated for shared variables in our shared hashes.
int veil_shmem_context_size ()
 Return the amount of shared memory to be requested for each of the two shared memory contexts.
void veil_config_init ()
 Initialise Veil's use of GUC variables.

Variables

static int shared_hash_elems = 32
 The number of buckets to create in the hash for shared variables.
static int dbs_in_cluster = 2
 The number of databases within the db cluster that will use veil.
static int shmem_context_size = 16384
 The size in KBytes, of each of Veil's shared memory contexts.


Function Documentation

int veil_dbs_in_cluster ( void   ) 

Return the number of databases, within the database cluster, that will use Veil.

Each such database will be allocated 2 chunks of shared memory (of shmem_context_size), and a single LWLock. It defaults to 1 and may be defined in postgresql.conf using eg: "veil.dbs_in_cluster = 2"

Definition at line 52 of file veil_config.c.

References dbs_in_cluster, and veil_config_init().

Referenced by _PG_init(), and get_shmem_context().

Here is the call graph for this function:

int veil_shared_hash_elems ( void   ) 

Return the number of entries that should be allocated for shared variables in our shared hashes.

This defaults to 32 and may be defined in postgresql.conf using eg: "veil.shared_hash_elems = 64"

Definition at line 65 of file veil_config.c.

References shared_hash_elems, and veil_config_init().

Referenced by create_shared_hash().

Here is the call graph for this function:

int veil_shmem_context_size ( void   ) 

Return the amount of shared memory to be requested for each of the two shared memory contexts.

This variable has no effect unless shared_preload_libraries has been defined in postgresql.conf to load the Veil shared library Note that this must be large enough to allocate at least one chunk of memory for each veil-using database in the Postgres cluster. It defaults to 16K and may be defined in postgresql.conf using eg: "veil.shmem_context_size = 16384"

Definition at line 82 of file veil_config.c.

References shmem_context_size, and veil_config_init().

Referenced by _PG_init().

Here is the call graph for this function:


Variable Documentation

int shared_hash_elems = 32 [static]

The number of buckets to create in the hash for shared variables.

This defaults to 32 and may be defined in postgresql.conf using eg: "veil.shared_hash_elems = 64"

Definition at line 26 of file veil_config.c.

Referenced by veil_config_init(), and veil_shared_hash_elems().

int dbs_in_cluster = 2 [static]

The number of databases within the db cluster that will use veil.

Every veil-using database within the cluster will get the same allocation of shared memory.

Definition at line 33 of file veil_config.c.

Referenced by veil_config_init(), and veil_dbs_in_cluster().

int shmem_context_size = 16384 [static]

The size in KBytes, of each of Veil's shared memory contexts.

Veil will pre-allocate (from Postgres 8.2 onwards) twice this amount of shared memory, one for each context area. The default is 16384 Bytes and may be defined in postgresql.conf using eg: "veil.shmem_context_size = 8192"

Definition at line 42 of file veil_config.c.

Referenced by veil_config_init(), and veil_shmem_context_size().


Generated on Tue Jul 31 15:35:52 2007 for Veil by  doxygen 1.5.2