Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vincent Pelletier
neoppod
Commits
2fae3e54
Commit
2fae3e54
authored
Apr 19, 2018
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
importer: log when the transaction index for FileStorage DB is built
parent
db20bf37
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
neo/lib/patch.py
neo/lib/patch.py
+4
-0
No files found.
neo/lib/patch.py
View file @
2fae3e54
...
@@ -25,6 +25,7 @@ def speedupFileStorageTxnLookup():
...
@@ -25,6 +25,7 @@ def speedupFileStorageTxnLookup():
from
array
import
array
from
array
import
array
from
bisect
import
bisect
from
bisect
import
bisect
from
collections
import
defaultdict
from
collections
import
defaultdict
from
neo.lib
import
logging
from
ZODB.FileStorage.FileStorage
import
FileStorage
,
FileIterator
from
ZODB.FileStorage.FileStorage
import
FileStorage
,
FileIterator
typecode
=
'L'
if
array
(
'I'
).
itemsize
<
4
else
'I'
typecode
=
'L'
if
array
(
'I'
).
itemsize
<
4
else
'I'
...
@@ -44,6 +45,8 @@ def speedupFileStorageTxnLookup():
...
@@ -44,6 +45,8 @@ def speedupFileStorageTxnLookup():
try
:
try
:
index
=
self
.
_tidindex
index
=
self
.
_tidindex
except
AttributeError
:
except
AttributeError
:
logging
.
info
(
"Building index for faster lookup of"
" transactions in the FileStorage DB."
)
# Cache a sorted list of all the file pos from oid index.
# Cache a sorted list of all the file pos from oid index.
# To reduce memory usage, the list is splitted in arrays of
# To reduce memory usage, the list is splitted in arrays of
# low order 32-bit words.
# low order 32-bit words.
...
@@ -55,6 +58,7 @@ def speedupFileStorageTxnLookup():
...
@@ -55,6 +58,7 @@ def speedupFileStorageTxnLookup():
l
=
array
(
typecode
,
sorted
(
l
))
l
=
array
(
typecode
,
sorted
(
l
))
x
=
self
.
_read_data_header
(
h
<<
32
|
l
[
0
])
x
=
self
.
_read_data_header
(
h
<<
32
|
l
[
0
])
index
.
append
((
x
.
tid
,
h
,
l
))
index
.
append
((
x
.
tid
,
h
,
l
))
logging
.
info
(
"... index built"
)
x
=
bisect
(
index
,
(
start
,))
-
1
x
=
bisect
(
index
,
(
start
,))
-
1
if
x
>=
0
:
if
x
>=
0
:
x
,
h
,
index
=
index
[
x
]
x
,
h
,
index
=
index
[
x
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment