[강운덕] [LUCYSUS-1744] datasender의 메모리 할당 및 copy를 줄임. cl로드 구조 변경에 따른 TestCase 를 수정

git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@1453 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
Woonduk Kang
2013-04-12 08:53:10 +00:00
parent ead8cd4c0e
commit 2def838574
11 changed files with 269 additions and 49 deletions
@@ -22,7 +22,7 @@ public class HeaderTBaseSerializer {
* This is the byte array that data is actually serialized into
*/
// udp 패킷 사이즈에 최대 맞춤.
private final ByteArrayOutputStream baos_ = new ByteArrayOutputStream(1024 * 64);
private final UnsafeByteArrayOutputStream baos_ = new UnsafeByteArrayOutputStream(1024 * 64);
/**
* This transport wraps that byte array
@@ -39,7 +39,6 @@ public class HeaderTBaseSerializer {
*/
public HeaderTBaseSerializer() {
// this(new TBinaryProtocol.Factory());
this(new TCompactProtocol.Factory());
}
@@ -65,7 +64,13 @@ public class HeaderTBaseSerializer {
baos_.reset();
writeHeader(header);
base.write(protocol_);
return baos_.toByteArray();
// return baos_.toByteArray();
return baos_.getInterBuffer();
}
public int getInterBufferSize() {
return baos_.size();
}
private void writeHeader(Header header) throws TException {