def __init__(self, namespace=None, serializers=None): KeyValueStoreBase.__init__(self, serializers) self._client = j.clients.arakoon.getClient(namespace) self.categories = dict() if not self.exists("dbsystem", "categories"): self.set("dbsystem", "categories", {}) self.categories=self.get("dbsystem", "categories")
def __init__(self, namespace=None, serializers=None): KeyValueStoreBase.__init__(self, serializers) self._client = j.clients.arakoon.getClient(namespace) self.categories = dict() if not self.exists("dbsystem", "categories"): self.set("dbsystem", "categories", {}) self.categories = self.get("dbsystem", "categories")
def __init__(self, namespace=None, basedir="", serializers=None): KeyValueStoreBase.__init__(self, serializers) self.dbclient = LevelDBInterface(namespace, basedir) self.categories = dict() if not self.exists("dbsystem", "categories"): key = self._getCategoryKey("dbsystem", "categories") self.dbclient.set(key, {}) self.categories = self.get("dbsystem", "categories")
def __init__(self, namespace=None,basedir="", serializers=None): KeyValueStoreBase.__init__(self, serializers) self.dbclient = LevelDBInterface(namespace,basedir) self.categories = dict() if not self.exists("dbsystem", "categories"): key=self._getCategoryKey("dbsystem", "categories") self.dbclient.set(key, {}) self.categories=self.get("dbsystem", "categories")
def __init__(self, namespace="", baseDir=None, serializers=None): KeyValueStoreBase.__init__(self, serializers) if not baseDir: baseDir = j.sal.fs.joinPaths(j.dirs.varDir, 'db') #self.id = j.application.getUniqueMachineId() self.dbpath = j.sal.fs.joinPaths(baseDir, namespace)
def __init__(self, namespace="", baseDir=None, serializers=None): KeyValueStoreBase.__init__(self, serializers) if not baseDir: baseDir = j.sal.fs.joinPaths(j.dirs.varDir, 'db') #self.id = j.application.getUniqueMachineId() self.dbpath = j.sal.fs.joinPaths(baseDir,namespace)
def __init__(self, namespace="", host='localhost', port=7771, db=0, password='', serializers=[], masterdb=None, changelog=True): raise RuntimeError("not implemented") self.namespace = namespace self.db = MongoClient() KeyValueStoreBase.__init__(self, [])
def __init__(self,namespace="",host='localhost',port=7771,db=0,password='', serializers=[],masterdb=None, changelog=True): self.redisclient=j.clients.redis.getRedisClient(host, port,password=password) self.redisclient.port=port self.redisclient.host=host self._changelog = changelog self.namespace = namespace KeyValueStoreBase.__init__(self, serializers) self.hasmaster = bool(masterdb) self.writedb=masterdb or self self.lastchangeIdKey="changelog:lastid" self.nodelastchangeIdkey = "changelog:%s:lastid" % j.application.whoAmI.gid if self.redisclient.get(self.nodelastchangeIdkey)==None: self.writedb.redisclient.set(self.nodelastchangeIdkey,0) self.lastchangeId=int(self.redisclient.get(self.nodelastchangeIdkey) or 0)
def __init__(self, namespace=None): if namespace: self.db = NAMESPACES.setdefault(namespace, dict()) else: self.db = dict() KeyValueStoreBase.__init__(self)