Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
山不在高_有仙则灵
SkyWalking
提交
2eb5d967
S
SkyWalking
项目概览
山不在高_有仙则灵
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
12
Star
0
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2eb5d967
编写于
1月 25, 2016
作者:
A
ascrutae
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.将发送线程改成Netty
上级
a5a4cceb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
31 deletion
+12
-31
skywalking-api/src/main/java/com/ai/cloud/skywalking/sender/DataSender.java
.../main/java/com/ai/cloud/skywalking/sender/DataSender.java
+12
-23
skywalking-api/src/main/java/com/ai/cloud/skywalking/sender/DataSenderFactoryWithBalance.java
...cloud/skywalking/sender/DataSenderFactoryWithBalance.java
+0
-8
未找到文件。
skywalking-api/src/main/java/com/ai/cloud/skywalking/sender/DataSender.java
浏览文件 @
2eb5d967
package
com.ai.cloud.skywalking.sender
;
import
java.io.IOException
;
import
java.net.InetSocketAddress
;
import
java.util.logging.Logger
;
import
com.ai.cloud.io.netty.bootstrap.Bootstrap
;
import
com.ai.cloud.io.netty.channel.Channel
;
import
com.ai.cloud.io.netty.channel.ChannelHandlerContext
;
import
com.ai.cloud.io.netty.channel.ChannelInboundHandlerAdapter
;
import
com.ai.cloud.io.netty.channel.ChannelInitializer
;
import
com.ai.cloud.io.netty.channel.ChannelOption
;
import
com.ai.cloud.io.netty.channel.ChannelPipeline
;
import
com.ai.cloud.io.netty.channel.EventLoopGroup
;
import
com.ai.cloud.io.netty.channel.*
;
import
com.ai.cloud.io.netty.channel.nio.NioEventLoopGroup
;
import
com.ai.cloud.io.netty.channel.socket.SocketChannel
;
import
com.ai.cloud.io.netty.channel.socket.nio.NioSocketChannel
;
...
...
@@ -20,7 +10,11 @@ import com.ai.cloud.io.netty.handler.codec.LengthFieldPrepender;
import
com.ai.cloud.io.netty.handler.codec.bytes.ByteArrayDecoder
;
import
com.ai.cloud.io.netty.handler.codec.bytes.ByteArrayEncoder
;
public
class
DataSender
extends
ChannelInboundHandlerAdapter
implements
IDataSender
{
import
java.io.IOException
;
import
java.net.InetSocketAddress
;
import
java.util.logging.Logger
;
public
class
DataSender
implements
IDataSender
{
private
static
Logger
logger
=
Logger
.
getLogger
(
DataSender
.
class
.
getName
());
private
EventLoopGroup
group
;
private
SenderStatus
status
=
SenderStatus
.
FAILED
;
...
...
@@ -48,11 +42,11 @@ public class DataSender extends ChannelInboundHandlerAdapter implements IDataSen
p
.
addLast
(
"frameEncoder"
,
new
LengthFieldPrepender
(
4
));
p
.
addLast
(
"decoder"
,
new
ByteArrayDecoder
());
p
.
addLast
(
"encoder"
,
new
ByteArrayEncoder
());
p
.
addLast
(
new
ChannelInboundHandlerAdapter
(){
public
void
channelActive
(
ChannelHandlerContext
ctx
)
throws
Exception
{
super
.
channelActive
(
ctx
);
channel
=
ctx
.
channel
();
}
p
.
addLast
(
new
ChannelInboundHandlerAdapter
()
{
public
void
channelActive
(
ChannelHandlerContext
ctx
)
throws
Exception
{
super
.
channelActive
(
ctx
);
channel
=
ctx
.
channel
();
}
});
}
});
...
...
@@ -72,7 +66,7 @@ public class DataSender extends ChannelInboundHandlerAdapter implements IDataSen
public
boolean
send
(
String
data
)
{
try
{
if
(
channel
!=
null
&&
channel
.
isActive
())
{
channel
.
writeAndFlush
(
data
.
getBytes
());
channel
.
writeAndFlush
(
data
.
getBytes
());
return
true
;
}
}
catch
(
Exception
e
)
{
...
...
@@ -86,11 +80,6 @@ public class DataSender extends ChannelInboundHandlerAdapter implements IDataSen
return
this
.
socketAddress
;
}
@Override
public
void
exceptionCaught
(
ChannelHandlerContext
ctx
,
Throwable
cause
)
throws
Exception
{
close
();
}
public
void
close
()
{
if
(
group
!=
null
)
{
group
.
shutdownGracefully
();
...
...
skywalking-api/src/main/java/com/ai/cloud/skywalking/sender/DataSenderFactoryWithBalance.java
浏览文件 @
2eb5d967
package
com.ai.cloud.skywalking.sender
;
import
com.ai.cloud.skywalking.conf.Config
;
import
com.ai.cloud.skywalking.protocol.Span
;
import
com.ai.cloud.skywalking.util.StringUtil
;
import
java.io.IOException
;
...
...
@@ -219,11 +218,4 @@ public class DataSenderFactoryWithBalance {
.
setStatus
(
DataSender
.
SenderStatus
.
FAILED
);
}
}
public
static
void
main
(
String
[]
args
)
throws
InterruptedException
{
Span
span
=
new
Span
(
"1.0a2.1453508782702.e8f7323.4115.762.256@~ @~0@~http://m.aisse.asiainfo.com/aisseMobilePage/toAisseMobilePage@~1453508782702@~85@~ITSC-MIS-LEV-web01/10.1.31.12@~1@~org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.RuntimeException: org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: ORA-00257: archiver error. Connect internal only, until freed.#~#~org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: ORA-00257: archiver error. Connect internal only, until freed.#~#~\tat org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:241)#~\tat org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:372)#~\tat org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:417)#~\tat org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:255)#~\tat org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)#~\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)#~\tat org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)#~\tat com.sun.proxy.$Proxy28.searchByNt(Unknown Source)#~\tat com.ai.aisse.core.rest.impl.ExpenseInitApiImpl.searchMembersinfo(ExpenseInitApiImpl.java:22)#~\tat com.alibaba.dubbo.common.bytecode.Wrapper3.invokeMethod(Wrapper3.java)#~\tat com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:46)#~\tat com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:72)#~\tat com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:53)#~\tat com.ai.cloud.skywalking.plugin.dubbo.SWDubboEnhanceFilter.invoke(SWDubboEnhanceFilter.java:19)#~\tat com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)#~\tat com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:64)#~\tat com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)#~\tat com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42)#~\tat com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)#~\tat com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75)#~\tat com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)#~\tat com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78)#~\tat com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)#~\tat com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:70)#~\tat com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)#~\tat com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:132)#~\tat com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)#~\tat com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38)#~\tat com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)#~\tat com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38)#~\tat com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)#~\tat com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:113)#~\tat com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:84)#~\tat com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:170)#~\tat com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52)#~\tat com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82)#~\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)#~\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)#~\tat java.lang.Thread.run(Thread.java:745)#~Caused by: java.sql.SQLException: ORA-00257: archiver error. Connect internal only, until freed.#~#~\tat oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)#~\tat oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)#~\tat oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)#~\tat oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)#~\tat oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:406)#~\tat oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)#~\tat oracle.jdbc.driver.T4CTTIoauthenticate.receiveOsesskey(T4CTTIoauthenticate.java:306)#~\tat oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)#~\tat oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:490)#~\tat oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:202)#~\tat oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)#~\tat oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:474)#~\tat com.ai.cloud.skywalking.plugin.jdbc.TracingDriver.connect(TracingDriver.java:24)#~\tat org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:39)#~\tat org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:205)#~\tat org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:861)#~\tat org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:435)#~\tat org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363)#~\tat org.apache.commons.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:102)#~\tat org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1413)#~\tat org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:203)#~\t... 38 more#~#~\tat org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:981)#~\tat org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:860)#~\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:624)#~\tat org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845)#~\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:731)#~\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)#~\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)#~\tat org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)#~\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)#~\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)#~\tat com.ai.sso.app.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:70)#~\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)#~\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)#~\tat com.ai.net.xss.filter.XSSFilter.doFilter(XSSFilter.java:38)#~\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)#~\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)#~\tat org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)#~\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)#~\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)#~\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)#~\tat com.ai.cloud.skywalking.plugin.web.SkyWalkingFilter.doFilter(SkyWalkingFilter.java:57)#~\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)#~\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)#~\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)#~\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)#~\tat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)#~\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)#~\tat com.googlecode.psiprobe.Tomcat70AgentValve.invoke(Tomcat70AgentValve.java:38)#~\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)#~\tat org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)#~\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)#~\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)#~\tat org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)#~\tat org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)#~\tat org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2476)#~\tat org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2465)#~\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)#~\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)#~\tat org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)#~\tat java.lang.Thread.run(Thread.java:745)#~Caused by: java.lang.RuntimeException: org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: ORA-00257: archiver error. Connect internal only, until freed.#~#~org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: ORA-00257: archiver error. Connect internal only, until freed.#~#~\tat org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:241)#~\tat org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:372)#~\tat org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:417)#~\tat org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:255)#~\tat org.springframewo \u0002.1.0a2.1453508787798.e8f7323.4115.1104.70@~0@~0@~com.ai.aisse.controller.myAisse.aisseMyselfPage.myAisse(com.ai.net.xss.wrapper.XssRequestWrapper,org.apache.catalina.connector.ResponseFacade,org.springframework.validation.support.BindingAwareModelMap)@~1453508787800@~4@~ITSC-MIS-LEV-web01/10.1.31.12@~0@~ @~M@~false@~ @~4115@~aisse-mobile-web@~5@~L"
);
getSender
().
send
(
span
.
toString
());
Thread
.
sleep
(
2000L
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录