示例#1
0
 def __init__(self, hash_announcer, blob_dir, db_dir):
     DHTHashSupplier.__init__(self, hash_announcer)
     self.blob_dir = blob_dir
     self.db_file = os.path.join(db_dir, "blobs.db")
     self.db_conn = adbapi.ConnectionPool('sqlite3',
                                          self.db_file,
                                          check_same_thread=False)
     self.blob_type = BlobFile
     self.blob_creator_type = BlobFileCreator
     # TODO: consider using an LRU for blobs as there could potentially
     #       be thousands of blobs loaded up, many stale
     self.blobs = {}
     self.blob_hashes_to_delete = {
     }  # {blob_hash: being_deleted (True/False)}
示例#2
0
    def __init__(self, hash_announcer, blob_dir, storage):
        """
        This class stores blobs on the hard disk,
        blob_dir - directory where blobs are stored
        db_dir - directory where sqlite database of blob information is stored
        """

        DHTHashSupplier.__init__(self, hash_announcer)
        self.storage = storage
        self.announce_head_blobs_only = conf.settings[
            'announce_head_blobs_only']
        self.blob_dir = blob_dir
        self.blob_creator_type = BlobFileCreator
        # TODO: consider using an LRU for blobs as there could potentially
        #       be thousands of blobs loaded up, many stale
        self.blobs = {}
        self.blob_hashes_to_delete = {
        }  # {blob_hash: being_deleted (True/False)}
示例#3
0
    def __init__(self, hash_announcer, blob_dir, db_dir):

        """
        This class stores blobs on the hard disk,
        blob_dir - directory where blobs are stored
        db_dir - directory where sqlite database of blob information is stored
        """

        DHTHashSupplier.__init__(self, hash_announcer)

        self.announce_head_blobs_only = conf.settings['announce_head_blobs_only']

        self.blob_dir = blob_dir
        self.db_file = os.path.join(db_dir, "blobs.db")
        self.db_conn = adbapi.ConnectionPool('sqlite3', self.db_file, check_same_thread=False)
        self.blob_creator_type = BlobFileCreator
        # TODO: consider using an LRU for blobs as there could potentially
        #       be thousands of blobs loaded up, many stale
        self.blobs = {}
        self.blob_hashes_to_delete = {} # {blob_hash: being_deleted (True/False)}
示例#4
0
    def __init__(self, hash_announcer, blob_dir, db_dir):
        """
        This class stores blobs on the hard disk,
        blob_dir - directory where blobs are stored
        db_dir - directory where sqlite database of blob information is stored
        """

        DHTHashSupplier.__init__(self, hash_announcer)

        self.announce_head_blobs_only = conf.settings[
            'announce_head_blobs_only']

        self.blob_dir = blob_dir
        self.db_file = os.path.join(db_dir, "blobs.db")
        self.db_conn = adbapi.ConnectionPool('sqlite3',
                                             self.db_file,
                                             check_same_thread=False)
        self.blob_creator_type = BlobFileCreator
        # TODO: consider using an LRU for blobs as there could potentially
        #       be thousands of blobs loaded up, many stale
        self.blobs = {}
        self.blob_hashes_to_delete = {
        }  # {blob_hash: being_deleted (True/False)}
示例#5
0
 def __init__(self, hash_announcer):
     DHTHashSupplier.__init__(self, hash_announcer)
示例#6
0
 def __init__(self, hash_announcer):
     DHTHashSupplier.__init__(self, hash_announcer)
 def __init__(self, hash_announcer):
     DHTHashSupplier.__init__(self, hash_announcer)
     self.streams = {}
     self.stream_blobs = {}
     self.stream_desc = {}
 def __init__(self, db_dir, hash_announcer):
     DHTHashSupplier.__init__(self, hash_announcer)
     self.db_dir = db_dir
     self.db_conn = None
 def __init__(self, hash_announcer):
     DHTHashSupplier.__init__(self, hash_announcer)
     self.streams = {}
     self.stream_blobs = {}
     self.stream_desc = {}
 def __init__(self, db_dir, hash_announcer):
     DHTHashSupplier.__init__(self, hash_announcer)
     self.db_dir = db_dir
     self.db_conn = None