예제 #1
0
    def __init__(self):

        if 'cache_storage_path' not in options.keys():
            define("cache_storage_path",
                   default="/tmp/cache",
                   help="Data Block Storage")
        self.path = options.cache_storage_path
예제 #2
0
    def __init__(self):
        self.blockCounter = 0
        self.objCounter = 0

        if (
            "cache_meta_driver"
            and "cache_storage_driver"
            and "cache_block_size"
            and "cache_meta_size" not in options.keys()
        ):
            define("cache_meta_driver", default="mem", help="Metadata Driver")
            define("cache_storage_driver", default="disk", help="Block Storage system")
            define("cache_block_size", default=100, help="Cache Block Max size")
            define("cache_meta_size", default=100, help="Cache Block Max size")

        storage_plugin = "restfsc.cache.%s.CacheStorageDriver" % options.cache_storage_driver
        storage_mod = __import__(storage_plugin, globals(), locals(), ["CacheStorageDriver"])
        CacheStorageDriver = getattr(storage_mod, "CacheStorageDriver")
        self.cacheStorageDriver = CacheStorageDriver()

        meta_plugin = "restfsc.cache.%s.CacheMetaDriver" % options.cache_meta_driver
        meta_mod = __import__(meta_plugin, globals(), locals(), ["CacheMetaDriver"])
        CacheMetaDriver = getattr(meta_mod, "CacheMetaDriver")
        self.cacheMetaDriver = CacheMetaDriver()

        self.meta_lock = thread.allocate_lock()
        self.block_lock = thread.allocate_lock()

        #####STATS
        self.num_get = 0
        self.num_set = 0
        self.num_get_failed = 0
예제 #3
0
파일: base.py 프로젝트: dmitriko/swarm
 def setUp(self):
     AsyncTestCase.setUp(self)
     for key in options.keys():
         del options[key]
     define_common_options()
     define_node_options()
     parse_config_file(os.path.join(DIR, 'config_data.py'))
     self.init_storages()
     self.node_oid = str(uuid.uuid1())
     Cluster.instance().init()
예제 #4
0
 def __init__(self):
     
     if 'storage_driver' not in options.keys():
             define("storage_driver",     default="fs2",  help="Storage Driver")
             
     
     storage_plugin_bucket = "restfs.storage.%s.StorageBucketDriver" % options.storage_driver
     storage_mod_bucket = __import__(storage_plugin_bucket, globals(), locals(), ['StorageBucketDriver'])
     StorageBucketDriver = getattr(storage_mod_bucket, 'StorageBucketDriver')
     self.storageBuck = StorageBucketDriver()
     
    
     storage_object_plugin = "restfs.storage.%s.StorageObjectDriver" % options.storage_driver
     storage_object_mod = __import__(storage_object_plugin, globals(), locals(), ['StorageObjectDriver'])
     StorageObjectDriver = getattr(storage_object_mod, 'StorageObjectDriver')
     self.storage = StorageObjectDriver()
예제 #5
0
 def __init__(self):
     
     if 'cache_storage_path' not in options.keys():
         define("cache_storage_path",     default="/tmp/cache",  help="Data Block Storage")
     self.path       = options.cache_storage_path
예제 #6
0
    def __init__(self):
        self.blockCounter = 0
        self.objCounter = 0

        if 'cache_meta_driver' and 'cache_storage_driver' and 'cache_block_size' and 'cache_meta_size' not in options.keys(
        ):
            define("cache_meta_driver", default="mem", help="Metadata Driver")
            define("cache_storage_driver",
                   default="disk",
                   help="Block Storage system")
            define("cache_block_size",
                   default=100,
                   help="Cache Block Max size")
            define("cache_meta_size", default=100, help="Cache Block Max size")

        storage_plugin = "restfsc.cache.%s.CacheStorageDriver" % options.cache_storage_driver
        storage_mod = __import__(storage_plugin, globals(), locals(),
                                 ['CacheStorageDriver'])
        CacheStorageDriver = getattr(storage_mod, 'CacheStorageDriver')
        self.cacheStorageDriver = CacheStorageDriver()

        meta_plugin = "restfsc.cache.%s.CacheMetaDriver" % options.cache_meta_driver
        meta_mod = __import__(meta_plugin, globals(), locals(),
                              ['CacheMetaDriver'])
        CacheMetaDriver = getattr(meta_mod, 'CacheMetaDriver')
        self.cacheMetaDriver = CacheMetaDriver()

        self.meta_lock = thread.allocate_lock()
        self.block_lock = thread.allocate_lock()

        #####STATS
        self.num_get = 0
        self.num_set = 0
        self.num_get_failed = 0