Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
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
Stefane Fermigier
neo
Commits
6b6ab5d1
Commit
6b6ab5d1
authored
Feb 10, 2012
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make buildDatabaseManager independent from database parameters.
parent
dcb0e404
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
neo/storage/app.py
neo/storage/app.py
+3
-1
neo/storage/database/__init__.py
neo/storage/database/__init__.py
+2
-2
neo/tests/storage/testReplication.py
neo/tests/storage/testReplication.py
+1
-1
No files found.
neo/storage/app.py
View file @
6b6ab5d1
...
...
@@ -48,7 +48,9 @@ class Application(object):
self
.
em
=
EventManager
()
self
.
nm
=
NodeManager
(
config
.
getDynamicMasterList
())
self
.
tm
=
TransactionManager
(
self
)
self
.
dm
=
buildDatabaseManager
(
config
.
getAdapter
(),
config
.
getDatabase
())
self
.
dm
=
buildDatabaseManager
(
config
.
getAdapter
(),
(
config
.
getDatabase
(),
)
)
# load master nodes
master_addresses
,
connector_name
=
config
.
getMasters
()
...
...
neo/storage/database/__init__.py
View file @
6b6ab5d1
...
...
@@ -38,11 +38,11 @@ else:
if
not
DATABASE_MANAGER_DICT
:
raise
ImportError
(
'No database back-end available.'
)
def
buildDatabaseManager
(
name
,
config
):
def
buildDatabaseManager
(
name
,
args
=
(),
kw
=
{}
):
if
name
is
None
:
name
=
DATABASE_MANAGER_DICT
.
keys
()[
0
]
adapter_klass
=
DATABASE_MANAGER_DICT
.
get
(
name
,
None
)
if
adapter_klass
is
None
:
raise
DatabaseFailure
(
'Cannot find a database adapter <%s>'
%
name
)
return
adapter_klass
(
config
)
return
adapter_klass
(
*
args
,
**
kw
)
neo/tests/storage/testReplication.py
View file @
6b6ab5d1
...
...
@@ -118,7 +118,7 @@ class ReplicationTests(NeoUnitTestBase):
def
buildStorage
(
self
,
transactions
,
objects
,
name
=
'BTree'
,
database
=
None
):
def
makeid
(
oid_or_tid
):
return
pack
(
'!Q'
,
oid_or_tid
)
storage
=
buildDatabaseManager
(
name
,
database
)
storage
=
buildDatabaseManager
(
name
,
(
database
,
)
)
storage
.
setup
(
reset
=
True
)
storage
.
setNumPartitions
(
1
)
storage
.
_transactions
=
transactions
...
...
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