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
Carlos Ramos Carreño
neoppod
Commits
f1715aa2
Commit
f1715aa2
authored
Jan 18, 2012
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't require a Cluster instance to instantiate a ServerNode.
parent
61d37895
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
13 deletions
+19
-13
neo/tests/threaded/__init__.py
neo/tests/threaded/__init__.py
+19
-13
No files found.
neo/tests/threaded/__init__.py
View file @
f1715aa2
...
...
@@ -203,17 +203,23 @@ class ServerNode(Node):
return
cls
.
_node_list
[
address
[
1
]].
getListeningAddress
()
@
SerializedEventManager
.
decorate
def
__init__
(
self
,
cluster
,
address
=
None
,
**
kw
):
def
__init__
(
self
,
cluster
=
None
,
address
=
None
,
**
kw
):
if
not
address
:
address
=
self
.
newAddress
()
if
cluster
is
None
:
master_nodes
=
kw
[
'master_nodes'
]
name
=
kw
[
'name'
]
else
:
master_nodes
=
kw
.
get
(
'master_nodes'
,
cluster
.
master_nodes
)
name
=
kw
.
get
(
'name'
,
cluster
.
name
)
port
=
address
[
1
]
self
.
_node_list
[
port
]
=
weakref
.
proxy
(
self
)
self
.
_init_args
=
(
cluster
,
address
),
kw
.
copy
()
threading
.
Thread
.
__init__
(
self
)
self
.
daemon
=
True
self
.
node_name
=
'%s_%u'
%
(
self
.
node_type
,
port
)
kw
.
update
(
getCluster
=
cluster
.
name
,
getBind
=
address
,
getMasters
=
parseMasterList
(
cluster
.
master_nodes
,
address
))
kw
.
update
(
getCluster
=
name
,
getBind
=
address
,
getMasters
=
parseMasterList
(
master_nodes
,
address
))
super
(
ServerNode
,
self
).
__init__
(
Mock
(
kw
))
def
getVirtualAddress
(
self
):
...
...
@@ -321,9 +327,8 @@ class StorageApplication(ServerNode, neo.storage.app.Application):
class
ClientApplication
(
Node
,
neo
.
client
.
app
.
Application
):
@
SerializedEventManager
.
decorate
def
__init__
(
self
,
cluster
):
super
(
ClientApplication
,
self
).
__init__
(
cluster
.
master_nodes
,
cluster
.
name
)
def
__init__
(
self
,
master_nodes
,
name
):
super
(
ClientApplication
,
self
).
__init__
(
master_nodes
,
name
)
self
.
em
.
_lock
=
threading
.
Lock
()
def
setPoll
(
self
,
master
=
False
):
...
...
@@ -357,9 +362,8 @@ class ClientApplication(Node, neo.client.app.Application):
class
NeoCTL
(
neo
.
neoctl
.
app
.
NeoCTL
):
@
SerializedEventManager
.
decorate
def
__init__
(
self
,
cluster
):
self
.
_cluster
=
cluster
super
(
NeoCTL
,
self
).
__init__
(
cluster
.
admin
.
getVirtualAddress
())
def
__init__
(
self
,
*
args
,
**
kw
):
super
(
NeoCTL
,
self
).
__init__
(
*
args
,
**
kw
)
self
.
em
.
_timeout
=
-
1
...
...
@@ -582,8 +586,9 @@ class NEOCluster(object):
self
.
storage_list
=
[
StorageApplication
(
getDatabase
=
db
%
x
,
**
kw
)
for
x
in
db_list
]
self
.
admin_list
=
[
AdminApplication
(
**
kw
)]
self
.
client
=
ClientApplication
(
weak_self
)
self
.
neoctl
=
NeoCTL
(
weak_self
)
self
.
client
=
ClientApplication
(
name
=
self
.
name
,
master_nodes
=
self
.
master_nodes
)
self
.
neoctl
=
NeoCTL
(
self
.
admin
.
getVirtualAddress
())
# A few shortcuts that work when there's only 1 master/storage/admin
@
property
...
...
@@ -607,8 +612,9 @@ class NEOCluster(object):
kw
[
'clear_database'
]
=
clear_database
for
node
in
getattr
(
self
,
node_type
+
'_list'
):
node
.
resetNode
(
**
kw
)
self
.
client
=
ClientApplication
(
self
)
self
.
neoctl
=
NeoCTL
(
weakref
.
proxy
(
self
))
self
.
client
=
ClientApplication
(
name
=
self
.
name
,
master_nodes
=
self
.
master_nodes
)
self
.
neoctl
=
NeoCTL
(
self
.
admin
.
getVirtualAddress
())
def
start
(
self
,
storage_list
=
None
,
fast_startup
=
False
):
self
.
_patch
()
...
...
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