Exemplo n.º 1
0
        def topic(self):
            config = Config(HBASE_STORAGE_TABLE=self.parent.table,
                            HBASE_STORAGE_SERVER_PORT=9090)
            storage = Storage(
                Context(config=config, server=get_server('ACME-SEC')))

            return storage.resolve_original_photo_path("toto")
Exemplo n.º 2
0
 def topic(self):
     config = Config(HBASE_STORAGE_TABLE=self.parent.parent.table,
                     HBASE_STORAGE_SERVER_PORT=9090,
                     STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
     storage = Storage(
         Context(config=config, server=get_server('ACME-SEC')))
     return storage.get_crypto(IMAGE_URL % '9999')
Exemplo n.º 3
0
        def topic(self,callback ):
            config = Config(HBASE_STORAGE_TABLE=self.parent.table,HBASE_STORAGE_SERVER_PORT=9090)
            context = Context(config=config, server=get_server('ACME-SEC'))
            storage = Storage(context)

            storage.put(IMAGE_URL % '1', IMAGE_BYTES)
            return loader.load(context, IMAGE_URL % '1', callback)
Exemplo n.º 4
0
        def topic(self):
            config = Config(HBASE_STORAGE_TABLE=self.parent.table,
                            HBASE_STORAGE_SERVER_PORT=9090)
            storage = Storage(
                Context(config=config, server=get_server('ACME-SEC')))

            return storage.exists(IMAGE_URL % '9999')
Exemplo n.º 5
0
 def topic(self):
     config = Config(
         HBASE_STORAGE_TABLE=self.parent.parent.table,
         HBASE_STORAGE_SERVER_PORT=9090,
         STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True,
     )
     storage = Storage(Context(config=config, server=get_server("ACME-SEC")))
     return storage.get_crypto(IMAGE_URL % "9999")
Exemplo n.º 6
0
        def topic(self, callback):
            config = Config(HBASE_STORAGE_TABLE=self.parent.table,
                            HBASE_STORAGE_SERVER_PORT=9090)
            context = Context(config=config, server=get_server('ACME-SEC'))
            storage = Storage(context)

            storage.put(IMAGE_URL % '1', IMAGE_BYTES)
            return loader.load(context, IMAGE_URL % '1', callback)
Exemplo n.º 7
0
 def topic(self):
     config = Config(
         HBASE_STORAGE_TABLE=self.parent.table, HBASE_STORAGE_SERVER_PORT=9090, SECURITY_KEY="ACME-SEC"
     )
     storage = Storage(Context(config=config, server=get_server("ACME-SEC")))
     return (
         storage.put(IMAGE_URL % "àé", IMAGE_BYTES),
         self.parent.connection.get(self.parent.table, IMAGE_URL % "àé", self.parent.family),
     )
Exemplo n.º 8
0
 def topic(self):
     config = Config(HBASE_STORAGE_TABLE=self.parent.table,
                     HBASE_STORAGE_SERVER_PORT=9090,
                     SECURITY_KEY='ACME-SEC')
     storage = Storage(
         Context(config=config, server=get_server('ACME-SEC')))
     return (storage.put(IMAGE_URL % 'àé', IMAGE_BYTES),
             self.parent.connection.get(self.parent.table,
                                        IMAGE_URL % 'àé',
                                        self.parent.family))
Exemplo n.º 9
0
 def topic(self):
     config = Config(
         HBASE_STORAGE_TABLE=self.parent.parent.table,
         HBASE_STORAGE_SERVER_PORT=9090,
         SECURITY_KEY="",
         STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True,
     )
     storage = Storage(Context(config=config, server=get_server("")))
     storage.put(IMAGE_URL % "3", IMAGE_BYTES)
     storage.put_crypto(IMAGE_URL % "3")
Exemplo n.º 10
0
 def topic(self):
     config = Config(HBASE_STORAGE_TABLE=self.parent.table,
                     HBASE_STORAGE_SERVER_PORT=9090,
                     SECURITY_KEY='ACME-SEC')
     storage = Storage(
         Context(config=config, server=get_server('ACME-SEC')))
     return (storage.put(IMAGE_URL % u'àé'.encode('utf-8'),
                         IMAGE_BYTES),
             self.parent.connection.get(
                 self.parent.table,
                 hbasekey(IMAGE_URL % u'àé'.encode('utf-8')),
                 self.parent.family + 'raw')[0].value)
Exemplo n.º 11
0
        def topic(self):
            config = Config(HBASE_STORAGE_TABLE=self.parent.table,
                            HBASE_STORAGE_SERVER_PORT=9090)
            storage = Storage(
                Context(config=config, server=get_server('ACME-SEC')))

            storage.put(IMAGE_URL % '10', IMAGE_BYTES)
            storage.remove(IMAGE_URL % '10')
            time.sleep(1)
            created = storage.exists(IMAGE_URL % '10')
            time.sleep(1)
            storage.put(IMAGE_URL % '10', IMAGE_BYTES)
            return storage.exists(IMAGE_URL % '10') != created
Exemplo n.º 12
0
def load(context, path, callback):
    def callback_wrapper(result):
        r = LoaderResult()
        if result is not None:
            r.successful = True
            r.buffer = result
        else:
            r.error = LoaderResult.ERROR_NOT_FOUND
            r.successful = False

        callback(r)

    storage = Storage(context)
    storage.get(path, callback_wrapper)
Exemplo n.º 13
0
        def topic(self):
            config = Config(HBASE_STORAGE_TABLE=self.parent.table,HBASE_STORAGE_SERVER_PORT=9090)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))

            storage.put(IMAGE_URL % '10', IMAGE_BYTES)
            storage.remove(IMAGE_URL % '10')
            time.sleep(1)  
            created = storage.exists(IMAGE_URL % '10')
            time.sleep(1)
            storage.put(IMAGE_URL % '10', IMAGE_BYTES)
            return storage.exists(IMAGE_URL % '10') != created
Exemplo n.º 14
0
 def topic(self):
     config = Config(HBASE_STORAGE_SERVER_HOST='dummyserver',
                     HBASE_STORAGE_TABLE=self.parent.table,
                     HBASE_STORAGE_SERVER_PORT=9090,
                     SECURITY_KEY='ACME-SEC')
     storage = Storage(
         Context(config=config, server=get_server('ACME-SEC')))
Exemplo n.º 15
0
 def topic(self):
     config = Config(HBASE_STORAGE_TABLE=self.parent.parent.table,
                     HBASE_STORAGE_SERVER_PORT=9090)
     storage = Storage(
         Context(config=config, server=get_server('ACME-SEC')))
     storage.put(IMAGE_URL % '7', IMAGE_BYTES)
     storage.put_detector_data(IMAGE_URL % '7', 'some-data')
     return storage.get_detector_data(IMAGE_URL % '7')
Exemplo n.º 16
0
        def topic(self):
            config = Config(HBASE_STORAGE_TABLE=self.parent.table, HBASE_STORAGE_SERVER_PORT=9090)
            storage = Storage(Context(config=config, server=get_server("ACME-SEC")))

            storage.put(IMAGE_URL % "9", IMAGE_BYTES)
            created = storage.exists(IMAGE_URL % "9")
            storage.remove(IMAGE_URL % "9")
            return storage.exists(IMAGE_URL % "9") != created
Exemplo n.º 17
0
            def topic(self):
                config = Config(HBASE_STORAGE_TABLE=self.parent.parent.table,HBASE_STORAGE_SERVER_PORT=9090, SECURITY_KEY='ACME-SEC', STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
                storage = Storage(Context(config=config, server=get_server('ACME-SEC')))

                storage.put(IMAGE_URL % '6', IMAGE_BYTES)
                storage.put_crypto(IMAGE_URL % '6')
                return storage.get_crypto(IMAGE_URL % '6')
Exemplo n.º 18
0
 def topic(self):
     config = Config(HBASE_STORAGE_TABLE=self.parent.parent.table,
                     HBASE_STORAGE_SERVER_PORT=9090,
                     SECURITY_KEY='',
                     STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
     storage = Storage(Context(config=config,
                               server=get_server('')))
     storage.put(IMAGE_URL % '3', IMAGE_BYTES)
     storage.put_crypto(IMAGE_URL % '3')
Exemplo n.º 19
0
        def topic(self):
            config = Config(HBASE_STORAGE_TABLE=self.parent.table,HBASE_STORAGE_SERVER_PORT=9090)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))

            storage.put(IMAGE_URL % '2', IMAGE_BYTES)
            return storage.get(IMAGE_URL % '2')
Exemplo n.º 20
0
        def topic(self):
            config = Config(HBASE_STORAGE_TABLE=self.parent.table, HBASE_STORAGE_SERVER_PORT=9090)
            storage = Storage(Context(config=config, server=get_server("ACME-SEC")))

            return storage.exists(IMAGE_URL % "9999")
Exemplo n.º 21
0
 def topic(self):
     config = Config(HBASE_STORAGE_TABLE=self.parent.parent.table,HBASE_STORAGE_SERVER_PORT=9090)
     storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
     return storage.get_detector_data(IMAGE_URL % '10000')
Exemplo n.º 22
0
 def topic(self):
     config = Config(HBASE_STORAGE_TABLE=self.parent.table,HBASE_STORAGE_SERVER_PORT=9090,SECURITY_KEY='ACME-SEC')
     storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
     return (storage.put(IMAGE_URL % u'àé'.encode('utf-8'), IMAGE_BYTES) , self.parent.connection.get(self.parent.table,IMAGE_URL % u'àé'.encode('utf-8'), self.parent.family) )
Exemplo n.º 23
0
 def topic(self):
     config = Config(HBASE_STORAGE_TABLE=self.parent.parent.table, HBASE_STORAGE_SERVER_PORT=9090)
     storage = Storage(Context(config=config, server=get_server("ACME-SEC")))
     storage.put(IMAGE_URL % "7", IMAGE_BYTES)
     storage.put_detector_data(IMAGE_URL % "7", "some-data")
     return storage.get_detector_data(IMAGE_URL % "7")
Exemplo n.º 24
0
        def topic(self):
            config = Config(HBASE_STORAGE_TABLE=self.parent.table,HBASE_STORAGE_SERVER_PORT=9090)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))

            return storage.resolve_original_photo_path("toto")
Exemplo n.º 25
0
 def topic(self):
     config = Config(HBASE_STORAGE_TABLE=self.parent.table,HBASE_STORAGE_SERVER_PORT=9090,SECURITY_KEY='ACME-SEC')
     storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
     return (storage.put(IMAGE_URL % 'àé', IMAGE_BYTES) , self.parent.connection.get(self.parent.table, hbasekey(IMAGE_URL % 'àé'), self.parent.family+'raw')[0].value )
Exemplo n.º 26
0
def load(context, path, callback):
    storage = Storage(context)
    callback(storage.get(path))
Exemplo n.º 27
0
def load(context, path, callback):
    storage = Storage(context)
    callback(storage.get(path))