Optimization of PUT

This commit is contained in:
Olof hagsand 2024-02-05 17:14:36 +01:00
parent 4e3bd6fbdd
commit 23dcb58758
15 changed files with 221 additions and 131 deletions

View file

@ -52,11 +52,14 @@
* modified, and these changes have not been committed or rolled back.
*/
typedef struct {
uint32_t de_id; /* If set, locked by this client/session id */
struct timeval de_tv; /* Timevalue */
cxobj *de_xml; /* cache */
int de_modified; /* Dirty since loaded/copied/committed/etc XXX:nocache? */
int de_empty; /* Empty on read from file, xmldb_readfile and xmldb_put sets it */
uint32_t de_id; /* If set, locked by this client/session id */
struct timeval de_tv; /* Timevalue, set by lock/unlock */
cxobj *de_xml; /* cache */
int de_modified; /* Dirty since loaded/copied/committed/etc Used by lock
* This set by NETCONF edit-config, copy, delete,
* reset by commit, discard
*/
int de_empty; /* Empty on read from file, xmldb_readfile and xmldb_put sets it */
} db_elmnt;
/*

View file

@ -72,9 +72,10 @@ cxobj *xmldb_cache_get(clixon_handle h, const char *db);
int xmldb_modified_get(clixon_handle h, const char *db);
int xmldb_modified_set(clixon_handle h, const char *db, int value);
int xmldb_empty_get(clixon_handle h, const char *db);
int xmldb_dump(clixon_handle h, FILE *f, cxobj *xt);
int xmldb_print(clixon_handle h, FILE *f);
int xmldb_rename(clixon_handle h, const char *db, const char *newdb, const char *suffix);
int xmldb_populate(clixon_handle h, const char *db);
int xmldb_write_cache2file(clixon_handle h, const char *db);
int xmldb_dump(clixon_handle h, FILE *f, cxobj *xt, withdefaults_type wdef);
#endif /* _CLIXON_DATASTORE_H */

View file

@ -201,7 +201,7 @@ enum format_enum{
#define XML_FLAG_ADD 0x04 /* Node is added (commits) or parent added rec*/
#define XML_FLAG_DEL 0x08 /* Node is deleted (commits) or parent deleted rec */
#define XML_FLAG_CHANGE 0x10 /* Node is changed (commits) or child changed rec */
#define XML_FLAG_NONE 0x20 /* Node is added as NONE */
#define XML_FLAG_NONE 0x20 /* Node is added as NETCONF edit-config operation=NONE */
#define XML_FLAG_DEFAULT 0x40 /* Added when a value is set as default @see xml_default */
#define XML_FLAG_TOP 0x80 /* Top datastore symbol */
#define XML_FLAG_BODYKEY 0x100 /* Text parsing key to be translated from body to key */
@ -248,7 +248,7 @@ cxobj *xml_child_i_set(cxobj *xt, int i, cxobj *xc);
int xml_child_order(cxobj *xn, cxobj *xc);
cxobj *xml_child_each(cxobj *xparent, cxobj *xprev, enum cxobj_type type);
cxobj *xml_child_each_attr(cxobj *xparent, cxobj *xprev);
int xml_child_insert_pos(cxobj *x, cxobj *xc, int i);
int xml_child_insert_pos(cxobj *x, cxobj *xc, int pos);
int xml_childvec_set(cxobj *x, int len);
cxobj **xml_childvec_get(cxobj *x);
int clixon_child_xvec_append(cxobj *x, clixon_xvec *xv);

View file

@ -50,6 +50,7 @@ typedef enum yang_class yang_class;
* Prototypes
*/
int xml_default_recurse(cxobj *xn, int state);
int xml_default_recurse_flag(cxobj *xn, int state, int flag);
int xml_global_defaults(clixon_handle h, cxobj *xn, cvec *nsc, const char *xpath, yang_stmt *yspec, int state);
int xml_defaults_nopresence(cxobj *xn, int purge);
int xml_add_default_tag(cxobj *x, uint16_t flags);