Back to index

obnam  1.1
Public Member Functions | Public Attributes
obnamlib.chunklist.ChunkList Class Reference
Inheritance diagram for obnamlib.chunklist.ChunkList:
Inheritance graph
[legend]
Collaboration diagram for obnamlib.chunklist.ChunkList:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def key
def add
def get_checksum
def remove

Public Attributes

 key_bytes
 keep_just_one_tree

Detailed Description

Repository's list of chunks.

The list maps a chunk id to its checksum.

The list is implemented as a B-tree, with the 64-bit chunk id as the
key, and the checksum as the value.

Definition at line 25 of file chunklist.py.


Constructor & Destructor Documentation

def obnamlib.chunklist.ChunkList.__init__ (   self,
  fs,
  node_size,
  upload_queue_size,
  lru_size,
  hooks 
)

Definition at line 36 of file chunklist.py.

00036 
00037     def __init__(self, fs, node_size, upload_queue_size, lru_size, hooks):
00038         tracing.trace('new ChunkList')
00039         self.key_bytes = len(self.key(0))
00040         obnamlib.RepositoryTree.__init__(self, fs, 'chunklist', self.key_bytes, 
00041                                          node_size, upload_queue_size, 
00042                                          lru_size, hooks)
00043         self.keep_just_one_tree = True


Member Function Documentation

def obnamlib.chunklist.ChunkList.add (   self,
  chunk_id,
  checksum 
)

Definition at line 47 of file chunklist.py.

00047 
00048     def add(self, chunk_id, checksum):
00049         tracing.trace('chunk_id=%s', chunk_id)
00050         tracing.trace('checksum=%s', repr(checksum))
00051         self.start_changes()
00052         self.tree.insert(self.key(chunk_id), checksum)
        

Here is the call graph for this function:

def obnamlib.chunklist.ChunkList.get_checksum (   self,
  chunk_id 
)

Definition at line 53 of file chunklist.py.

00053 
00054     def get_checksum(self, chunk_id):
00055         if self.init_forest() and self.forest.trees:
00056             t = self.forest.trees[-1]
00057             return t.lookup(self.key(chunk_id))
00058         raise KeyError(chunk_id)
        

Here is the call graph for this function:

def obnamlib.chunklist.ChunkList.key (   self,
  chunk_id 
)

Definition at line 44 of file chunklist.py.

00044 
00045     def key(self, chunk_id):
00046         return struct.pack('!Q', chunk_id)

Here is the caller graph for this function:

def obnamlib.chunklist.ChunkList.remove (   self,
  chunk_id 
)

Definition at line 59 of file chunklist.py.

00059 
00060     def remove(self, chunk_id):
00061         tracing.trace('chunk_id=%s', chunk_id)
00062         self.start_changes()
00063         key = self.key(chunk_id)
00064         self.tree.remove_range(key, key)
00065 

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 42 of file chunklist.py.

Definition at line 38 of file chunklist.py.


The documentation for this class was generated from the following file: