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
Levin Zimmermann
neoppod
Commits
c876098e
Commit
c876098e
authored
Jan 18, 2012
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store all ServerNode.__init__ parameters as keyword arguments.
parent
f1715aa2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
neo/tests/threaded/__init__.py
neo/tests/threaded/__init__.py
+9
-7
No files found.
neo/tests/threaded/__init__.py
View file @
c876098e
...
...
@@ -214,7 +214,9 @@ class ServerNode(Node):
name
=
kw
.
get
(
'name'
,
cluster
.
name
)
port
=
address
[
1
]
self
.
_node_list
[
port
]
=
weakref
.
proxy
(
self
)
self
.
_init_args
=
(
cluster
,
address
),
kw
.
copy
()
self
.
_init_args
=
init_args
=
kw
.
copy
()
init_args
[
'cluster'
]
=
cluster
init_args
[
'address'
]
=
address
threading
.
Thread
.
__init__
(
self
)
self
.
daemon
=
True
self
.
node_name
=
'%s_%u'
%
(
self
.
node_type
,
port
)
...
...
@@ -223,14 +225,14 @@ class ServerNode(Node):
super
(
ServerNode
,
self
).
__init__
(
Mock
(
kw
))
def
getVirtualAddress
(
self
):
return
self
.
_init_args
[
0
][
1
]
return
self
.
_init_args
[
'address'
]
def
resetNode
(
self
):
assert
not
self
.
isAlive
()
args
,
kw
=
self
.
_init_args
kw
=
self
.
_init_args
kw
[
'getUUID'
]
=
self
.
uuid
self
.
__dict__
.
clear
()
self
.
__init__
(
*
args
,
*
*
kw
)
self
.
__init__
(
**
kw
)
def
start
(
self
):
Serialized
.
pending
=
1
...
...
@@ -276,7 +278,7 @@ class MasterApplication(ServerNode, neo.master.app.Application):
class
StorageApplication
(
ServerNode
,
neo
.
storage
.
app
.
Application
):
def
resetNode
(
self
,
clear_database
=
False
):
self
.
_init_args
[
1
][
'getReset'
]
=
clear_database
self
.
_init_args
[
'getReset'
]
=
clear_database
dm
=
self
.
dm
super
(
StorageApplication
,
self
).
resetNode
()
if
dm
and
not
clear_database
:
...
...
@@ -291,7 +293,7 @@ class StorageApplication(ServerNode, neo.storage.app.Application):
pass
def
switchTables
(
self
):
adapter
=
self
.
_init_args
[
1
][
'getAdapter'
]
adapter
=
self
.
_init_args
[
'getAdapter'
]
dm
=
self
.
dm
if
adapter
==
'BTree'
:
dm
.
_obj
,
dm
.
_tobj
=
dm
.
_tobj
,
dm
.
_obj
...
...
@@ -312,7 +314,7 @@ class StorageApplication(ServerNode, neo.storage.app.Application):
assert
False
def
getDataLockInfo
(
self
):
adapter
=
self
.
_init_args
[
1
][
'getAdapter'
]
adapter
=
self
.
_init_args
[
'getAdapter'
]
dm
=
self
.
dm
if
adapter
==
'BTree'
:
checksum_dict
=
dict
((
x
,
x
)
for
x
in
dm
.
_data
)
...
...
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