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
c32895c6
Commit
c32895c6
authored
Mar 21, 2012
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factorise node acceptance logging.
parent
4640bf1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
neo/master/app.py
neo/master/app.py
+5
-4
No files found.
neo/master/app.py
View file @
c32895c6
...
@@ -478,12 +478,12 @@ class Application(object):
...
@@ -478,12 +478,12 @@ class Application(object):
# always accept admin nodes
# always accept admin nodes
node_ctor
=
self
.
nm
.
createAdmin
node_ctor
=
self
.
nm
.
createAdmin
handler
=
administration
.
AdministrationHandler
(
self
)
handler
=
administration
.
AdministrationHandler
(
self
)
logging
.
info
(
'Accept an admin %s'
,
dump
(
uuid
))
human_readable_node_type
=
'n admin '
elif
node_type
==
NodeTypes
.
MASTER
:
elif
node_type
==
NodeTypes
.
MASTER
:
# always put other master in waiting state
# always put other master in waiting state
node_ctor
=
self
.
nm
.
createMaster
node_ctor
=
self
.
nm
.
createMaster
handler
=
secondary
.
SecondaryMasterHandler
(
self
)
handler
=
secondary
.
SecondaryMasterHandler
(
self
)
logging
.
info
(
'Accept a master %s'
,
dump
(
uuid
))
human_readable_node_type
=
' master '
elif
node_type
==
NodeTypes
.
CLIENT
:
elif
node_type
==
NodeTypes
.
CLIENT
:
# refuse any client before running
# refuse any client before running
if
self
.
cluster_state
!=
ClusterStates
.
RUNNING
:
if
self
.
cluster_state
!=
ClusterStates
.
RUNNING
:
...
@@ -491,16 +491,17 @@ class Application(object):
...
@@ -491,16 +491,17 @@ class Application(object):
raise
NotReadyError
raise
NotReadyError
node_ctor
=
self
.
nm
.
createClient
node_ctor
=
self
.
nm
.
createClient
handler
=
client
.
ClientServiceHandler
(
self
)
handler
=
client
.
ClientServiceHandler
(
self
)
logging
.
info
(
'Accept a client %s'
,
dump
(
uuid
))
human_readable_node_type
=
' client '
elif
node_type
==
NodeTypes
.
STORAGE
:
elif
node_type
==
NodeTypes
.
STORAGE
:
node_ctor
=
self
.
nm
.
createStorage
node_ctor
=
self
.
nm
.
createStorage
manager
=
self
.
_current_manager
manager
=
self
.
_current_manager
if
manager
is
None
:
if
manager
is
None
:
manager
=
self
manager
=
self
(
uuid
,
state
,
handler
)
=
manager
.
identifyStorageNode
(
uuid
,
node
)
(
uuid
,
state
,
handler
)
=
manager
.
identifyStorageNode
(
uuid
,
node
)
logging
.
info
(
'Accept a storage %s (%s)'
,
dump
(
uuid
),
state
)
human_readable_node_type
=
' storage (%s) '
%
(
state
,
)
else
:
else
:
raise
NotImplementedError
(
node_type
)
raise
NotImplementedError
(
node_type
)
logging
.
info
(
'Accept a'
+
human_readable_node_type
+
dump
(
uuid
))
return
(
uuid
,
node
,
state
,
handler
,
node_ctor
)
return
(
uuid
,
node
,
state
,
handler
,
node_ctor
)
def
onTransactionCommitted
(
self
,
txn
):
def
onTransactionCommitted
(
self
,
txn
):
...
...
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