pike.git / lib / modules / Cache.pmod / Storage.pmod / Yabu.pike

version» Context lines:

pike.git/lib/modules/Cache.pmod/Storage.pmod/Yabu.pike:2:   //!   //! Settings will be added later.   //!   //! @thanks   //! Thanks to Francesco Chemolli <kinkie@@roxen.com> for the contribution.      #pike __REAL_VERSION__      #define CLUTTERED 200    + inherit Cache.Storage.Base; +    Yabu.Table db, metadb; - Yabu.db yabudb; + Yabu.DB yabudb;      int deletion_ops=0;   int have_dependants=0;      //!   class Data {    inherit Cache.Data;    //metadata is kept around, data loaded on demand.       int _size=0;
pike.git/lib/modules/Cache.pmod/Storage.pmod/Yabu.pike:103:    if (programp(value)||functionp(value)||objectp(value)) {    werror("can't store value\n"); //TODO: use crumbs    return 0;    }    int tm=time(1);    mapping meta;    db->set(key,value);    //maybe we could lazy-ify this    meta=(["size":sizeof(encode_value(value)), "atime":tm,"ctime":tm]);    if (expire_time) meta->etime=expire_time; -  if (preciousness||!zero_type(preciousness)) +  if (preciousness||!undefinedp(preciousness))    meta->cost=preciousness;    else    meta->cost=1.0;    if (dependants) {    meta->dependants=dependants;    have_dependants=1;    }    metadb->set(key,meta);   }   
pike.git/lib/modules/Cache.pmod/Storage.pmod/Yabu.pike:166:    }       if (deletion_ops > CLUTTERED) {    yabudb->reorganize();    deletion_ops=0;    }   }      //!   void create(string path) { -  yabudb=Yabu.db(path+".yabu","wcSQ"); //let's hope I got the mode right. +  yabudb=Yabu.DB(path+".yabu","wcSQ"); //let's hope I got the mode right.    db=yabudb["data"];    metadb=yabudb["metadata"];   }         /**************** thoughts and miscellanea ******************/   //maybe we should split the database into two databases, one for the data   //and one for the metadata.      //we should really use an in-memory cache for the objects. I delay that   //for now, since we don't have a decent footprint-constrained policy   //manager yet.