projects
/
cumulus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
856ba6a
)
Database rebuilder fixes.
author
Michael Vrable
<vrable@cs.hmc.edu>
Wed, 24 Apr 2013 19:57:32 +0000
(12:57 -0700)
committer
Michael Vrable
<vrable@cs.hmc.edu>
Wed, 22 Jan 2014 05:11:09 +0000
(21:11 -0800)
python/cumulus/rebuild_database.py
patch
|
blob
|
history
diff --git
a/python/cumulus/rebuild_database.py
b/python/cumulus/rebuild_database.py
index
a1ba9e8
..
53481d5
100755
(executable)
--- a/
python/cumulus/rebuild_database.py
+++ b/
python/cumulus/rebuild_database.py
@@
-201,7
+201,7
@@
class ChunkerExternal(Chunker):
self.subproc.stdin.write(buf)
self.subproc.stdin.flush()
breaks = self.subproc.stdout.readline()
self.subproc.stdin.write(buf)
self.subproc.stdin.flush()
breaks = self.subproc.stdout.readline()
- return [int(x) + 1 for x in breaks.split()]
+ return [
0] + [
int(x) + 1 for x in breaks.split()]
class DatabaseRebuilder(object):
class DatabaseRebuilder(object):
@@
-209,10
+209,8
@@
class DatabaseRebuilder(object):
self.database = database
self.cursor = database.cursor()
self.segment_ids = {}
self.database = database
self.cursor = database.cursor()
self.segment_ids = {}
- #try:
self.chunker = ChunkerExternal()
self.chunker = ChunkerExternal()
- #except:
- # self.chunker = Chunker()
+ #self.chunker = Chunker()
def segment_to_id(self, segment):
if segment in self.segment_ids: return self.segment_ids[segment]
def segment_to_id(self, segment):
if segment in self.segment_ids: return self.segment_ids[segment]
@@
-311,14
+309,13
@@
class DatabaseRebuilder(object):
blockid = self.cursor.lastrowid
# Store subblock signatures, if available.
blockid = self.cursor.lastrowid
# Store subblock signatures, if available.
- print "blockid:", blockid
- if
(segment, object) in subblock_signature
s:
+ sigs = subblock_signatures.get((segment, object))
+ if
sig
s:
self.cursor.execute(
"""insert or replace into subblock_signatures(
blockid, algorithm, signatures)
values (?, ?, ?)""",
self.cursor.execute(
"""insert or replace into subblock_signatures(
blockid, algorithm, signatures)
values (?, ?, ?)""",
- (blockid, self.chunker.ALGORITHM_NAME,
- buffer(subblock_signatures[(segment, object)])))
+ (blockid, self.chunker.ALGORITHM_NAME, buffer(sigs)))
if __name__ == "__main__":
if __name__ == "__main__":