Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
byit-myth-job
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyuan
byit-myth-job
Commits
4fa01369
Commit
4fa01369
authored
Apr 01, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加部分注释 删除多余代码
parent
2e83f196
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
19 deletions
+16
-19
AdminRegisterConfig.java
...in/src/main/java/com/byit/config/AdminRegisterConfig.java
+2
-2
RpcSpringInvokerFactory.java
...it/rpc/remoting/invoker/impl/RpcSpringInvokerFactory.java
+1
-1
RpcReferenceBean.java
...byit/rpc/remoting/invoker/reference/RpcReferenceBean.java
+10
-13
ConnectClient.java
.../java/com/byit/rpc/remoting/net/common/ConnectClient.java
+1
-1
AddComplexPy.java
...-demo-client/src/main/java/com/byit/job/AddComplexPy.java
+1
-1
AddComplexPy1.java
...demo-client/src/main/java/com/byit/job/AddComplexPy1.java
+1
-1
No files found.
byit-myth-admin/src/main/java/com/byit/config/AdminRegisterConfig.java
View file @
4fa01369
...
...
@@ -39,7 +39,7 @@ public class AdminRegisterConfig {
return
invokerFactory
;
}
@Bean
/*
@Bean
public RpcSpringProviderFactory rpcSpringProviderFactory() {
RpcSpringProviderFactory providerFactory = new RpcSpringProviderFactory();
//providerFactory.setPort(port);
...
...
@@ -52,6 +52,6 @@ public class AdminRegisterConfig {
log.info(">>>>>>>>>>>>>>> byit-myth-admin 向注册中心注册config初始化完成");
return providerFactory;
}
}
*/
}
byit-myth-rpc/src/main/java/com/byit/rpc/remoting/invoker/impl/RpcSpringInvokerFactory.java
View file @
4fa01369
...
...
@@ -87,7 +87,7 @@ public class RpcSpringInvokerFactory extends InstantiationAwareBeanPostProcessor
null
,
rpcInvokerFactory
);
//获取一个代理对象
Object
serviceProxy
=
referenceBean
.
getObject
();
// set bean
...
...
byit-myth-rpc/src/main/java/com/byit/rpc/remoting/invoker/reference/RpcReferenceBean.java
View file @
4fa01369
...
...
@@ -136,9 +136,7 @@ public class RpcReferenceBean {
public
Object
getObject
()
{
return
Proxy
.
newProxyInstance
(
Thread
.
currentThread
()
.
getContextClassLoader
(),
new
Class
[]
{
iface
},
new
InvocationHandler
()
{
@Override
public
Object
invoke
(
Object
proxy
,
Method
method
,
Object
[]
args
)
throws
Throwable
{
(
proxy
,
method
,
args
)
->
{
// method param
String
className
=
method
.
getDeclaringClass
().
getName
();
// iface.getName()
...
...
@@ -232,23 +230,23 @@ public class RpcReferenceBean {
}
else
if
(
CallType
.
FUTURE
==
callType
)
{
// future-response set
RpcFutureResponse
futureResponse
=
new
RpcFutureResponse
(
invokerFactory
,
rpcRequest
,
null
);
try
{
try
{
// invoke future set
RpcInvokeFuture
invokeFuture
=
new
RpcInvokeFuture
(
futureResponse
);
RpcInvokeFuture
.
setFuture
(
invokeFuture
);
// do invoke
client
.
asyncSend
(
finalAddress
,
rpcRequest
);
// do invoke
client
.
asyncSend
(
finalAddress
,
rpcRequest
);
return
null
;
}
catch
(
Exception
e
)
{
return
null
;
}
catch
(
Exception
e
)
{
logger
.
info
(
">>>>>>>>>>> myth-rpc, invoke error, address:{}, RpcRequest{}"
,
finalAddress
,
rpcRequest
);
// future-response remove
futureResponse
.
removeInvokerFuture
();
throw
(
e
instanceof
RpcException
)?
e:
new
RpcException
(
e
);
}
}
}
else
if
(
CallType
.
CALLBACK
==
callType
)
{
...
...
@@ -277,13 +275,12 @@ public class RpcReferenceBean {
return
null
;
}
else
if
(
CallType
.
ONEWAY
==
callType
)
{
client
.
asyncSend
(
finalAddress
,
rpcRequest
);
return
null
;
}
else
{
client
.
asyncSend
(
finalAddress
,
rpcRequest
);
return
null
;
}
else
{
throw
new
RpcException
(
"myth-rpc callType["
+
callType
+
"] invalid"
);
}
}
});
}
...
...
byit-myth-rpc/src/main/java/com/byit/rpc/remoting/net/common/ConnectClient.java
View file @
4fa01369
...
...
@@ -82,7 +82,7 @@ public abstract class ConnectClient {
if
(
connectClient
!=
null
&&
connectClient
.
isValidate
())
{
return
connectClient
;
}
//获取对应地址的锁对象
// lock
Object
clientLock
=
connectClientLockMap
.
get
(
address
);
if
(
clientLock
==
null
)
{
...
...
demo-client/byit-demo-client/src/main/java/com/byit/job/AddComplexPy.java
View file @
4fa01369
...
...
@@ -19,7 +19,7 @@ public class AddComplexPy {
runNode
.
setNodeId
(
"2"
);
runNode
.
setNodeName
(
"lijkki"
);
runNode
.
setRunCmd
(
"python ${biz_file}"
);
JobUtils
.
setRequestUrl
(
"http://1
27.0.0.1:8081/myth-job-admin
"
);
JobUtils
.
setRequestUrl
(
"http://1
0.0.120.208:8081/myth-job-admin/
"
);
JobUtils
.
setTOKEN
(
"test"
);
JobUtils
.
realExectNode
(
runNode
);
/* PluginPackage pluginPackage = new PluginPackage();
...
...
demo-client/byit-demo-client/src/main/java/com/byit/job/AddComplexPy1.java
View file @
4fa01369
...
...
@@ -16,7 +16,7 @@ public class AddComplexPy1 {
PluginPackage
pluginPackage
=
new
PluginPackage
();
pluginPackage
.
setWorkspaceName
(
"test"
);
pluginPackage
.
setFlow
(
createFlow
());
JobUtils
.
setRequestUrl
(
"http://1
27.0.0.1
:8081/myth-job-admin"
);
JobUtils
.
setRequestUrl
(
"http://1
0.0.120.208
:8081/myth-job-admin"
);
JobUtils
.
setTOKEN
(
"test"
);
JobUtils
.
publish
(
pluginPackage
);
}
...
...
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