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
11c428e0
Commit
11c428e0
authored
Jan 04, 2014
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup
parent
7834ef10
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
24 deletions
+5
-24
neo/client/Storage.py
neo/client/Storage.py
+0
-8
neo/client/app.py
neo/client/app.py
+0
-12
neo/client/pool.py
neo/client/pool.py
+5
-4
No files found.
neo/client/Storage.py
View file @
11c428e0
...
@@ -67,8 +67,6 @@ class Storage(BaseStorage.BaseStorage,
...
@@ -67,8 +67,6 @@ class Storage(BaseStorage.BaseStorage,
'deleteObject'
,
'deleteObject'
,
'undo'
,
'undo'
,
'undoLog'
,
'undoLog'
,
'abortVersion'
,
'commitVersion'
,
):
):
setattr
(
self
,
method_id
,
raiseReadOnlyError
)
setattr
(
self
,
method_id
,
raiseReadOnlyError
)
if
_app
is
None
:
if
_app
is
None
:
...
@@ -156,12 +154,6 @@ class Storage(BaseStorage.BaseStorage,
...
@@ -156,12 +154,6 @@ class Storage(BaseStorage.BaseStorage,
def
supportsTransactionalUndo
(
self
):
def
supportsTransactionalUndo
(
self
):
return
True
return
True
def
abortVersion
(
self
,
src
,
transaction
):
return
self
.
app
.
abortVersion
(
src
,
transaction
)
def
commitVersion
(
self
,
src
,
dest
,
transaction
):
return
self
.
app
.
commitVersion
(
src
,
dest
,
transaction
)
def
loadEx
(
self
,
oid
,
version
):
def
loadEx
(
self
,
oid
,
version
):
try
:
try
:
data
,
serial
,
_
=
self
.
app
.
load
(
oid
)
data
,
serial
,
_
=
self
.
app
.
load
(
oid
)
...
...
neo/client/app.py
View file @
11c428e0
...
@@ -465,7 +465,6 @@ class Application(object):
...
@@ -465,7 +465,6 @@ class Application(object):
if
answer_ttid
is
None
:
if
answer_ttid
is
None
:
raise
NEOStorageError
(
'tpc_begin failed'
)
raise
NEOStorageError
(
'tpc_begin failed'
)
assert
tid
in
(
None
,
answer_ttid
),
(
tid
,
answer_ttid
)
assert
tid
in
(
None
,
answer_ttid
),
(
tid
,
answer_ttid
)
txn_context
[
'txn'
]
=
transaction
txn_context
[
'ttid'
]
=
answer_ttid
txn_context
[
'ttid'
]
=
answer_ttid
def
store
(
self
,
oid
,
serial
,
data
,
version
,
transaction
):
def
store
(
self
,
oid
,
serial
,
data
,
version
,
transaction
):
...
@@ -475,7 +474,6 @@ class Application(object):
...
@@ -475,7 +474,6 @@ class Application(object):
raise
StorageTransactionError
(
self
,
transaction
)
raise
StorageTransactionError
(
self
,
transaction
)
logging
.
debug
(
'storing oid %s serial %s'
,
dump
(
oid
),
dump
(
serial
))
logging
.
debug
(
'storing oid %s serial %s'
,
dump
(
oid
),
dump
(
serial
))
self
.
_store
(
txn_context
,
oid
,
serial
,
data
)
self
.
_store
(
txn_context
,
oid
,
serial
,
data
)
return
None
def
_store
(
self
,
txn_context
,
oid
,
serial
,
data
,
data_serial
=
None
,
def
_store
(
self
,
txn_context
,
oid
,
serial
,
data
,
data_serial
=
None
,
unlock
=
False
):
unlock
=
False
):
...
@@ -984,16 +982,6 @@ class Application(object):
...
@@ -984,16 +982,6 @@ class Application(object):
self
.
_askPrimary
(
Packets
.
AskLastTransaction
())
self
.
_askPrimary
(
Packets
.
AskLastTransaction
())
return
self
.
last_tid
return
self
.
last_tid
def
abortVersion
(
self
,
src
,
transaction
):
if
self
.
_txn_container
.
get
(
transaction
)
is
None
:
raise
StorageTransactionError
(
self
,
transaction
)
return
''
,
[]
def
commitVersion
(
self
,
src
,
dest
,
transaction
):
if
self
.
_txn_container
.
get
(
transaction
)
is
None
:
raise
StorageTransactionError
(
self
,
transaction
)
return
''
,
[]
def
__del__
(
self
):
def
__del__
(
self
):
"""Clear all connection."""
"""Clear all connection."""
# Due to bug in ZODB, close is not always called when shutting
# Due to bug in ZODB, close is not always called when shutting
...
...
neo/client/pool.py
View file @
11c428e0
...
@@ -114,7 +114,7 @@ class ConnectionPool(object):
...
@@ -114,7 +114,7 @@ class ConnectionPool(object):
if
not
cell_list
:
if
not
cell_list
:
raise
NEOStorageError
(
'no storage available'
)
raise
NEOStorageError
(
'no storage available'
)
getConnForNode
=
self
.
getConnForNode
getConnForNode
=
self
.
getConnForNode
while
cell_list
:
while
1
:
new_cell_list
=
[]
new_cell_list
=
[]
# Shuffle to randomise node to access...
# Shuffle to randomise node to access...
shuffle
(
cell_list
)
shuffle
(
cell_list
)
...
@@ -131,10 +131,11 @@ class ConnectionPool(object):
...
@@ -131,10 +131,11 @@ class ConnectionPool(object):
# state can have changed during connection attempt.
# state can have changed during connection attempt.
elif
node
.
isRunning
():
elif
node
.
isRunning
():
new_cell_list
.
append
(
cell
)
new_cell_list
.
append
(
cell
)
if
not
new_cell_list
:
break
cell_list
=
new_cell_list
cell_list
=
new_cell_list
if
new_cell_list
:
# wait a bit to avoid a busy loop
# wait a bit to avoid a busy loop
time
.
sleep
(
1
)
time
.
sleep
(
1
)
def
getConnForNode
(
self
,
node
):
def
getConnForNode
(
self
,
node
):
"""Return a locked connection object to a given node
"""Return a locked connection object to a given node
...
...
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