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
Jérome Perrin
neoppod
Commits
3dc40dc6
Commit
3dc40dc6
authored
Dec 26, 2011
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factorise code.
For easier understanding of answerLastIDs' final else block.
parent
142ad156
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
neo/master/recovery.py
neo/master/recovery.py
+8
-8
No files found.
neo/master/recovery.py
View file @
3dc40dc6
...
@@ -110,6 +110,12 @@ class RecoveryManager(MasterHandler):
...
@@ -110,6 +110,12 @@ class RecoveryManager(MasterHandler):
# ask the last IDs to perform the recovery
# ask the last IDs to perform the recovery
conn
.
ask
(
Packets
.
AskLastIDs
())
conn
.
ask
(
Packets
.
AskLastIDs
())
def
_lastIDsCompleted
(
self
,
conn
):
node
=
self
.
app
.
nm
.
getByUUID
(
conn
.
getUUID
())
assert
node
.
isPending
()
node
.
setRunning
()
self
.
app
.
broadcastNodesInformation
([
node
])
def
answerLastIDs
(
self
,
conn
,
loid
,
ltid
,
lptid
):
def
answerLastIDs
(
self
,
conn
,
loid
,
ltid
,
lptid
):
# Get max values.
# Get max values.
if
loid
is
not
None
:
if
loid
is
not
None
:
...
@@ -121,22 +127,16 @@ class RecoveryManager(MasterHandler):
...
@@ -121,22 +127,16 @@ class RecoveryManager(MasterHandler):
self
.
target_ptid
=
lptid
self
.
target_ptid
=
lptid
conn
.
ask
(
Packets
.
AskPartitionTable
())
conn
.
ask
(
Packets
.
AskPartitionTable
())
else
:
else
:
node
=
self
.
app
.
nm
.
getByUUID
(
conn
.
getUUID
())
self
.
_lastIDsCompleted
(
conn
)
assert
node
.
isPending
()
node
.
setRunning
()
self
.
app
.
broadcastNodesInformation
([
node
])
def
answerPartitionTable
(
self
,
conn
,
ptid
,
row_list
):
def
answerPartitionTable
(
self
,
conn
,
ptid
,
row_list
):
node
=
self
.
app
.
nm
.
getByUUID
(
conn
.
getUUID
())
assert
node
.
isPending
()
node
.
setRunning
()
if
ptid
!=
self
.
target_ptid
:
if
ptid
!=
self
.
target_ptid
:
# If this is not from a target node, ignore it.
# If this is not from a target node, ignore it.
neo
.
lib
.
logging
.
warn
(
'Got %s while waiting %s'
,
dump
(
ptid
),
neo
.
lib
.
logging
.
warn
(
'Got %s while waiting %s'
,
dump
(
ptid
),
dump
(
self
.
target_ptid
))
dump
(
self
.
target_ptid
))
else
:
else
:
self
.
_broadcastPartitionTable
(
ptid
,
row_list
)
self
.
_broadcastPartitionTable
(
ptid
,
row_list
)
self
.
app
.
broadcastNodesInformation
([
node
]
)
self
.
_lastIDsCompleted
(
conn
)
def
_broadcastPartitionTable
(
self
,
ptid
,
row_list
):
def
_broadcastPartitionTable
(
self
,
ptid
,
row_list
):
try
:
try
:
...
...
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