1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
|
#ifndef __SGE_SPOOL_SPR_L_H
#define __SGE_SPOOL_SPR_L_H
/*___INFO__MARK_BEGIN__*/
/*************************************************************************
*
* The Contents of this file are made available subject to the terms of
* the Sun Industry Standards Source License Version 1.2
*
* Sun Microsystems Inc., March, 2001
*
*
* Sun Industry Standards Source License Version 1.2
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.2 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2001 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
************************************************************************/
/*___INFO__MARK_END__*/
#include "cull/cull.h"
#include "sgeobj/sge_boundaries.h"
#ifdef __cplusplus
extern "C" {
#endif
/****** spool/--SPR_Type ***************************************
*
* NAME
* SPR_Type -- Spooling rule
*
* ELEMENTS
* SGE_STRING(SPR_name, CULL_HASH | CULL_UNIQUE)
* Unique name of the rule.
*
* SGE_STRING(SPR_url, CULL_DEFAULT)
* An url, e.g. a spool directory, a database url etc.
*
* SGE_REF(SPR_option_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
* function pointer to a function to set any database specific options,
* e.g. whether to do database recovery at startup or not.
*
* SGE_REF(SPR_startup_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
* function pointer to a startup function,
* e.g. establishing a connection to a database.
*
* SGE_REF(SPR_shutdown_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
* function pointer to a shutdown function,
* e.g. disconnecting from a database or closing file handles.
*
* SGE_REF(SPR_maintenance_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
* function pointer to a maintenance function for
* - creating the database tables / directories in case of
* filebased spooling
* - switching between spooling with/without history
* - backup
* - cleaning up / compressing database
* - etc.
*
* SGE_REF(SPR_trigger_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
* function pointer to a trigger function.
* A trigger function is used to trigger regular actions, e.g.
* checkpointing and cleaning the transaction log in case of the
* Berkeley DB or vacuuming in case of PostgreSQL.
*
* SGE_REF(SPR_transaction_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
* function pointer to a function beginning and ending transactions.
*
* SGE_REF(SPR_list_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
* pointer to a function reading complete lists (master lists)
* from the spooling data source.
*
* SGE_REF(SPR_read_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
* pointer to a function reading a single object from the
* spooling data source.
*
* SGE_REF(SPR_write_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
* pointer to a function writing a single object.
*
* SGE_REF(SPR_delete_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
* pointer to a function deleting a single object.
*
* SGE_REF(SPR_validate_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
* pointer to a function validating a single object.
*
* SGE_REF(SPR_validate_list_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
* pointer to a function validating a list of objects.
*
* SGE_REF(SPR_clientdata, CULL_ANY_SUBTYPE, CULL_DEFAULT)
* clientdata; any pointer, can be used to store and
* reference rule specific data, e.g. file or database handles.
*
* FUNCTION
* A spooling rule describes a certain way to store and retrieve
* data from a defined storage facility.
*
* Spooling rules can implement spooling to files in a certain
* directory or spooling into a database, to an LDAP repository
* etc.
*
* A spooling context can contain multiple spooling rules.
*
* SEE ALSO
* spool/--Spooling
* spool/--SPC_Type
****************************************************************************
*/
enum {
SPR_name = SPR_LOWERBOUND, /* name of the rule */
SPR_url, /* an url, e.g. base dir, database url */
SPR_option_func, /* function pointer: option, e.g. set db specific parameters */
SPR_startup_func, /* function pointer: startup, e.g. connect to database */
SPR_shutdown_func, /* function pointer: shutdown, e.g. disconnect from db */
SPR_maintenance_func, /* function pointer: maintenance, e.g. backup of db */
SPR_trigger_func, /* function pointer: trigger */
SPR_transaction_func, /* function pointer: transaction */
SPR_list_func, /* function pointer: read master list */
SPR_read_func, /* function pointer: read an object */
SPR_write_func, /* function pointer: write an object */
SPR_delete_func, /* function pointer: delete an object */
SPR_validate_func, /* function pointer: validate an object */
SPR_validate_list_func, /* function pointer: validate a list */
SPR_clientdata /* any rule specific data */
};
LISTDEF(SPR_Type)
SGE_STRING(SPR_name, CULL_HASH | CULL_UNIQUE)
SGE_STRING(SPR_url, CULL_DEFAULT)
SGE_REF(SPR_option_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
SGE_REF(SPR_startup_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
SGE_REF(SPR_shutdown_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
SGE_REF(SPR_maintenance_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
SGE_REF(SPR_trigger_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
SGE_REF(SPR_transaction_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
SGE_REF(SPR_list_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
SGE_REF(SPR_read_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
SGE_REF(SPR_write_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
SGE_REF(SPR_delete_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
SGE_REF(SPR_validate_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
SGE_REF(SPR_validate_list_func, CULL_ANY_SUBTYPE, CULL_DEFAULT)
SGE_REF(SPR_clientdata, CULL_ANY_SUBTYPE, CULL_DEFAULT)
LISTEND
NAMEDEF(SPRN)
NAME("SPR_name")
NAME("SPR_url")
NAME("SPR_option_func")
NAME("SPR_startup_func")
NAME("SPR_shutdown_func")
NAME("SPR_maintenance_func")
NAME("SPR_trigger_func")
NAME("SPR_transaction_func")
NAME("SPR_list_func")
NAME("SPR_read_func")
NAME("SPR_write_func")
NAME("SPR_delete_func")
NAME("SPR_validate_func")
NAME("SPR_validate_list_func")
NAME("SPR_clientdata")
NAMEEND
#define SPRS sizeof(SPRN)/sizeof(char *)
#ifdef __cplusplus
}
#endif
#endif /* __SGE_SPOOLL_H */
|