Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
9c8502ed
Commit
9c8502ed
authored
Nov 10, 2016
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
d48930fe
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
5 additions
and
11 deletions
+5
-11
neo/lib/event.py
neo/lib/event.py
+1
-2
neo/storage/handlers/client.py
neo/storage/handlers/client.py
+3
-4
neo/storage/handlers/identification.py
neo/storage/handlers/identification.py
+0
-1
neo/storage/replicator.py
neo/storage/replicator.py
+0
-1
neo/tests/master/testClientHandler.py
neo/tests/master/testClientHandler.py
+1
-1
neo/tests/threaded/__init__.py
neo/tests/threaded/__init__.py
+0
-1
tools/replication
tools/replication
+0
-1
No files found.
neo/lib/event.py
View file @
9c8502ed
...
@@ -136,8 +136,7 @@ class EpollEventManager(object):
...
@@ -136,8 +136,7 @@ class EpollEventManager(object):
if
self
.
_closeAcquire
(
0
):
if
self
.
_closeAcquire
(
0
):
self
.
_closeRelease
()
self
.
_closeRelease
()
# NOTE
def
isIdle
(
self
):
# NOTE
def
isIdle
(
self
):
return
not
(
self
.
_pending_processing
or
self
.
writer_set
)
return
not
(
self
.
_pending_processing
or
self
.
writer_set
)
def
_addPendingConnection
(
self
,
conn
):
def
_addPendingConnection
(
self
,
conn
):
...
...
neo/storage/handlers/client.py
View file @
9c8502ed
...
@@ -23,8 +23,6 @@ from ..transactions import ConflictError, DelayedError, NotRegisteredError
...
@@ -23,8 +23,6 @@ from ..transactions import ConflictError, DelayedError, NotRegisteredError
from
..exception
import
AlreadyPendingError
from
..exception
import
AlreadyPendingError
import
time
import
time
import
traceback
# Log stores taking (incl. lock delays) more than this many seconds.
# Log stores taking (incl. lock delays) more than this many seconds.
# Set to None to disable.
# Set to None to disable.
SLOW_STORE
=
2
SLOW_STORE
=
2
...
@@ -47,7 +45,6 @@ class ClientOperationHandler(EventHandler):
...
@@ -47,7 +45,6 @@ class ClientOperationHandler(EventHandler):
app
.
queueEvent
(
self
.
askObject
,
conn
,
(
oid
,
serial
,
tid
))
app
.
queueEvent
(
self
.
askObject
,
conn
,
(
oid
,
serial
,
tid
))
return
return
o
=
app
.
dm
.
getObject
(
oid
,
serial
,
tid
)
o
=
app
.
dm
.
getObject
(
oid
,
serial
,
tid
)
print
'askObject -> %r'
%
(
o
,)
try
:
try
:
serial
,
next_serial
,
compression
,
checksum
,
data
,
data_serial
=
o
serial
,
next_serial
,
compression
,
checksum
,
data
,
data_serial
=
o
except
TypeError
:
except
TypeError
:
...
@@ -242,7 +239,6 @@ class ClientROOperationHandler(ClientOperationHandler):
...
@@ -242,7 +239,6 @@ class ClientROOperationHandler(ClientOperationHandler):
askVoteTransaction
=
_readOnly
askVoteTransaction
=
_readOnly
askStoreObject
=
_readOnly
askStoreObject
=
_readOnly
askFinalTID
=
_readOnly
askFinalTID
=
_readOnly
# askObjectUndoSerial is used in undo() but itself is read-only query XXX or cut <= backup_tid ?
askCheckCurrentSerial
=
_readOnly
# takes write lock & is only used when going to commit
askCheckCurrentSerial
=
_readOnly
# takes write lock & is only used when going to commit
# below operations: like in ClientOperationHandler but cut tid <= backup_tid
# below operations: like in ClientOperationHandler but cut tid <= backup_tid
...
@@ -284,6 +280,9 @@ class ClientROOperationHandler(ClientOperationHandler):
...
@@ -284,6 +280,9 @@ class ClientROOperationHandler(ClientOperationHandler):
tid_list
=
filter
(
lambda
tid
:
tid
<=
backup_tid
,
tid_list
)
tid_list
=
filter
(
lambda
tid
:
tid
<=
backup_tid
,
tid_list
)
conn
.
answer
(
Packets
.
AnswerTIDs
(
tid_list
))
conn
.
answer
(
Packets
.
AnswerTIDs
(
tid_list
))
# FIXME askObjectUndoSerial to limit tid <= backup_tid
# (askObjectUndoSerial is used in undo() but itself is read-only query)
# FIXME askObjectHistory to limit tid <= backup_tid
# FIXME askObjectHistory to limit tid <= backup_tid
# TODO dm.getObjectHistory has to be first fixed for this
# TODO dm.getObjectHistory has to be first fixed for this
#def askObjectHistory(self, conn, oid, first, last):
#def askObjectHistory(self, conn, oid, first, last):
neo/storage/handlers/identification.py
View file @
9c8502ed
...
@@ -70,7 +70,6 @@ class IdentificationHandler(EventHandler):
...
@@ -70,7 +70,6 @@ class IdentificationHandler(EventHandler):
else
:
else
:
raise
ProtocolError
(
'reject non-client-or-storage node'
)
raise
ProtocolError
(
'reject non-client-or-storage node'
)
# apply the handler and set up the connection
# apply the handler and set up the connection
print
'S: -> handler: %s'
%
handler
handler
=
handler
(
self
.
app
)
handler
=
handler
(
self
.
app
)
conn
.
setHandler
(
handler
)
conn
.
setHandler
(
handler
)
node
.
setConnection
(
conn
,
app
.
uuid
<
uuid
)
node
.
setConnection
(
conn
,
app
.
uuid
<
uuid
)
...
...
neo/storage/replicator.py
View file @
9c8502ed
...
@@ -366,7 +366,6 @@ class Replicator(object):
...
@@ -366,7 +366,6 @@ class Replicator(object):
node
=
self
.
current_node
node
=
self
.
current_node
if
node
is
not
None
is
node
.
getUUID
():
if
node
is
not
None
is
node
.
getUUID
():
self
.
cancel
()
self
.
cancel
()
# NOTE
# Cancel all replication orders from upstream cluster.
# Cancel all replication orders from upstream cluster.
for
offset
in
self
.
replicate_dict
.
keys
():
for
offset
in
self
.
replicate_dict
.
keys
():
addr
,
name
=
self
.
source_dict
.
get
(
offset
,
(
None
,
None
))
addr
,
name
=
self
.
source_dict
.
get
(
offset
,
(
None
,
None
))
...
...
neo/tests/master/testClientHandler.py
View file @
9c8502ed
...
@@ -34,7 +34,7 @@ class MasterClientHandlerTests(NeoUnitTestBase):
...
@@ -34,7 +34,7 @@ class MasterClientHandlerTests(NeoUnitTestBase):
self
.
app
.
em
=
Mock
()
self
.
app
.
em
=
Mock
()
self
.
app
.
loid
=
'
\
0
'
*
8
self
.
app
.
loid
=
'
\
0
'
*
8
self
.
app
.
tm
.
setLastTID
(
'
\
0
'
*
8
)
self
.
app
.
tm
.
setLastTID
(
'
\
0
'
*
8
)
self
.
service
=
ClientServiceHandler
(
self
.
app
)
# TODO tests for RO handler
self
.
service
=
ClientServiceHandler
(
self
.
app
)
# define some variable to simulate client and storage node
# define some variable to simulate client and storage node
self
.
client_port
=
11022
self
.
client_port
=
11022
self
.
storage_port
=
10021
self
.
storage_port
=
10021
...
...
neo/tests/threaded/__init__.py
View file @
9c8502ed
...
@@ -751,7 +751,6 @@ class NEOCluster(object):
...
@@ -751,7 +751,6 @@ class NEOCluster(object):
self
.
enableStorageList
(
storage_list
)
self
.
enableStorageList
(
storage_list
)
def
newClient
(
self
):
def
newClient
(
self
):
print
'%r: newClient()'
%
self
return
ClientApplication
(
name
=
self
.
name
,
master_nodes
=
self
.
master_nodes
,
return
ClientApplication
(
name
=
self
.
name
,
master_nodes
=
self
.
master_nodes
,
compress
=
self
.
compress
,
ssl
=
self
.
SSL
)
compress
=
self
.
compress
,
ssl
=
self
.
SSL
)
...
...
tools/replication
View file @
9c8502ed
...
@@ -33,7 +33,6 @@ class DummyObject(Persistent):
...
@@ -33,7 +33,6 @@ class DummyObject(Persistent):
def
__init__
(
self
,
data
):
def
__init__
(
self
,
data
):
self
.
_data
=
None
self
.
_data
=
None
# NOTE
class
ReplicationBenchmark
(
BenchmarkRunner
):
class
ReplicationBenchmark
(
BenchmarkRunner
):
""" Test replication process """
""" Test replication process """
...
...
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