Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Madan Jampani
2014-11-09 22:29:34 -0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
515865dfce6b50e291046a0b92d55413bc9950b0
515865df
1 parent
9254d965
Removed dead code. Took care of some tech debt
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
17 deletions
core/store/dist/src/main/java/org/onlab/onos/store/service/impl/ClusterMessagingProtocol.java
core/store/dist/src/main/java/org/onlab/onos/store/service/impl/ClusterMessagingProtocolClient.java
core/store/dist/src/main/java/org/onlab/onos/store/service/impl/ClusterMessagingProtocol.java
View file @
515865d
...
...
@@ -168,10 +168,10 @@ public class ClusterMessagingProtocol
@Override
public
ProtocolClient
createClient
(
TcpMember
member
)
{
ControllerNode
n
ode
=
getControllerNode
(
member
.
host
(),
member
.
port
());
checkNotNull
(
n
ode
,
"A valid controller node is expected"
);
ControllerNode
remoteN
ode
=
getControllerNode
(
member
.
host
(),
member
.
port
());
checkNotNull
(
remoteN
ode
,
"A valid controller node is expected"
);
return
new
ClusterMessagingProtocolClient
(
clusterCommunicator
,
n
ode
);
clusterCommunicator
,
clusterService
.
getLocalNode
(),
remoteN
ode
);
}
private
ControllerNode
getControllerNode
(
String
host
,
int
port
)
{
...
...
core/store/dist/src/main/java/org/onlab/onos/store/service/impl/ClusterMessagingProtocolClient.java
View file @
515865d
...
...
@@ -42,6 +42,7 @@ public class ClusterMessagingProtocolClient implements ProtocolClient {
public
static
final
long
RETRY_INTERVAL_MILLIS
=
2000
;
private
final
ClusterCommunicationService
clusterCommunicator
;
private
final
ControllerNode
localNode
;
private
final
ControllerNode
remoteNode
;
// FIXME: Thread pool sizing.
...
...
@@ -50,8 +51,10 @@ public class ClusterMessagingProtocolClient implements ProtocolClient {
public
ClusterMessagingProtocolClient
(
ClusterCommunicationService
clusterCommunicator
,
ControllerNode
localNode
,
ControllerNode
remoteNode
)
{
this
.
clusterCommunicator
=
clusterCommunicator
;
this
.
localNode
=
localNode
;
this
.
remoteNode
=
remoteNode
;
}
...
...
@@ -117,7 +120,7 @@ public class ClusterMessagingProtocolClient implements ProtocolClient {
this
.
request
=
request
;
this
.
message
=
new
ClusterMessage
(
null
,
// FIXME fill in proper sender
localNode
.
id
(),
messageType
(
request
),
ClusterMessagingProtocol
.
SERIALIZER
.
encode
(
request
));
this
.
future
=
future
;
...
...
@@ -132,22 +135,12 @@ public class ClusterMessagingProtocolClient implements ProtocolClient {
future
.
complete
(
ClusterMessagingProtocol
.
SERIALIZER
.
decode
(
response
));
}
catch
(
IOException
|
InterruptedException
|
ExecutionException
|
TimeoutException
e
)
{
// if (message.subject().equals(ClusterMessagingProtocol.COPYCAT_SYNC) ||
// message.subject().equals(ClusterMessagingProtocol.COPYCAT_PING)) {
// log.warn("{} Request to {} failed. Will retry in {} ms",
// message.subject(), remoteNode, RETRY_INTERVAL_MILLIS);
// THREAD_POOL.schedule(
// this,
// RETRY_INTERVAL_MILLIS,
// TimeUnit.MILLISECONDS);
// } else {
log
.
warn
(
"RPCTask for {} failed."
,
request
,
e
);
future
.
completeExceptionally
(
e
);
// }
log
.
warn
(
"RPCTask for {} failed."
,
request
,
e
);
future
.
completeExceptionally
(
e
);
}
catch
(
Exception
e
)
{
log
.
warn
(
"RPCTask for {} terribly failed."
,
request
,
e
);
future
.
completeExceptionally
(
e
);
}
}
}
}
\ No newline at end of file
}
...
...
Please
register
or
login
to post a comment