コード例 #1
0
ファイル: replicator.py プロジェクト: mshafiq/kinetic-swift
    def is_object_on_target(self, target, key):
        # get key ready for getPrevious on target
        hashpath, _nounce = split_key(key)
        key = object_key(hashpath)

        conn = self.get_conn(target)
        with conn:
            entry = conn.getPrevious(key).wait()
        return entry and entry.key.startswith(key[:-1])
コード例 #2
0
ファイル: replicator.py プロジェクト: iij/kinetic-swift
    def is_object_on_target(self, target, key):
        # get key ready for getPrevious on target
        policy_index, hashpath, _nounce = split_key(key)
        key = object_key(policy_index, hashpath)

        conn = self.get_conn(target)
        with conn:
            entry = conn.getPrevious(key).wait()
        return entry and entry.key.startswith(key[:-1])
コード例 #3
0
    def is_object_on_target(self, target, key):
        # get key ready for getPrevious on target
        key_info = split_key(key)
        key = object_key(key_info['policy_index'], key_info['hashpath'])

        conn = self.get_conn(target)
        entry = conn.getPrevious(key).wait()
        target_key_info = split_key
        if not entry:
            return False
        target_key_info = split_key(entry.key)
        if target_key_info['hashpath'] != key_info['hashpath']:
            return False
        if target_key_info['timestamp'] < key_info['timestamp']:
            return False
        return True
コード例 #4
0
ファイル: replicator.py プロジェクト: mba811/kinetic-swift
    def is_object_on_target(self, target, key):
        # get key ready for getPrevious on target
        key_info = split_key(key)
        key = object_key(key_info['policy'], key_info['hashpath'])

        conn = self.get_conn(target['device'])
        entry = conn.getPrevious(key).wait()
        if not entry:
            return False
        target_key_info = split_key(entry.key)
        if not target_key_info:
            return False
        if target_key_info['hashpath'] != key_info['hashpath']:
            return False
        if target_key_info['timestamp'] < key_info['timestamp']:
            return False
        if (target_key_info['frag_index'] is not None and
                target_key_info['frag_index'] != target.get('index')):
            return False
        return True