浅谈序列化之protobuf与avro对比(Java)
最近在做socket通信中用到了关于序列化工具选型的问题,在调研过程中开始趋向于用protobuf,可以省去了编解码的过程。能够实现快速开发,且只需要维护一份协议文件即可。
但是调研过程中发现了protobuf的一些弊端,比如需要生成相应的文件类,和业务绑定太紧密,所以在看了AVRO之后发现它完美解决了这个问题。
下面记录下对这两种序列化工具的入门与测评。
一、protobuf基本操作
protobuf简介:
ProtocolBuffers(a.k.a.,protobuf)areGoogle'slanguage-neutral,platform-neutral,extensiblemechanismforserializingstructureddata.
protobuf是google提供的一种跨语言、跨平台、可扩展的序列化工具。
1.1定义协议文件(部分字段)(TCPLog.proto):
syntax="proto2";
messageTCPLog{
optionalint32total_byteps=1;
optionalint64flow_start_time=2;
optionalint64date=3;
}
1.2生成对应的Java类:
生成过程可以使用ecplise的插件或者直接在控制台中使用命令生成。
命令行中生成规则如下:
protoc.exe-I=proto的输入目录--java_out=java类输出目录proto的输入目录包括包括proto文件
生成java类如下:
//Generatedbytheprotocolbuffercompiler.DONOTEDIT!
//source:TCPLog.proto
publicfinalclassTCPLogOuterClass{
privateTCPLogOuterClass(){}
publicstaticvoidregisterAllExtensions(
com.google.protobuf.ExtensionRegistryLiteregistry){
}
publicstaticvoidregisterAllExtensions(
com.google.protobuf.ExtensionRegistryregistry){
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite)registry);
}
publicinterfaceTCPLogOrBuilderextends
//@@protoc_insertion_point(interface_extends:TCPLog)
com.google.protobuf.MessageOrBuilder{
/**
*optionalint32total_byteps=1;
*/
booleanhasTotalByteps();
/**
*optionalint32total_byteps=1;
*/
intgetTotalByteps();
/**
*optionalint64flow_start_time=2;
*/
booleanhasFlowStartTime();
/**
*optionalint64flow_start_time=2;
*/
longgetFlowStartTime();
/**
*optionalint64date=3;
*/
booleanhasDate();
/**
*optionalint64date=3;
*/
longgetDate();
/**
*optionalint64server_total_packet=4;
*/
booleanhasServerTotalPacket();
/**
*optionalint64server_total_packet=4;
*/
longgetServerTotalPacket();
/**
*optionalint64client_total_byte=5;
*/
booleanhasClientTotalByte();
/**
*optionalint64client_total_byte=5;
*/
longgetClientTotalByte();
/**
*optionalint32link_id=6;
*/
booleanhasLinkId();
/**
*optionalint32link_id=6;
*/
intgetLinkId();
/**
*optionalint64total_byte=7;
*/
booleanhasTotalByte();
/**
*optionalint64total_byte=7;
*/
longgetTotalByte();
/**
*optionalint64flow_end_time=8;
*/
booleanhasFlowEndTime();
/**
*optionalint64flow_end_time=8;
*/
longgetFlowEndTime();
/**
*optionalint32client_port=9;
*/
booleanhasClientPort();
/**
*optionalint32client_port=9;
*/
intgetClientPort();
/**
*optionalint32protocol=10;
*/
booleanhasProtocol();
/**
*optionalint32protocol=10;
*/
intgetProtocol();
/**
*optionalint64total_packet=11;
*/
booleanhasTotalPacket();
/**
*optionalint64total_packet=11;
*/
longgetTotalPacket();
/**
*optionalint64flow_duration=12;
*/
booleanhasFlowDuration();
/**
*optionalint64flow_duration=12;
*/
longgetFlowDuration();
/**
*optionalstringid=13;
*/
booleanhasId();
/**
*optionalstringid=13;
*/
java.lang.StringgetId();
/**
*optionalstringid=13;
*/
com.google.protobuf.ByteString
getIdBytes();
/**
*optionalstringserver_ip_addr=14;
*/
booleanhasServerIpAddr();
/**
*optionalstringserver_ip_addr=14;
*/
java.lang.StringgetServerIpAddr();
/**
*optionalstringserver_ip_addr=14;
*/
com.google.protobuf.ByteString
getServerIpAddrBytes();
/**
*optionalstringdirection_mask=15;
*/
booleanhasDirectionMask();
/**
*optionalstringdirection_mask=15;
*/
java.lang.StringgetDirectionMask();
/**
*optionalstringdirection_mask=15;
*/
com.google.protobuf.ByteString
getDirectionMaskBytes();
/**
*optionalint32app=16;
*/
booleanhasApp();
/**
*optionalint32app=16;
*/
intgetApp();
/**
*optionalint32client_country_id=17;
*/
booleanhasClientCountryId();
/**
*optionalint32client_country_id=17;
*/
intgetClientCountryId();
/**
*optionalint32client_netsegment_id=18;
*/
booleanhasClientNetsegmentId();
/**
*optionalint32client_netsegment_id=18;
*/
intgetClientNetsegmentId();
/**
*optionalint64client_total_packet=19;
*/
booleanhasClientTotalPacket();
/**
*optionalint64client_total_packet=19;
*/
longgetClientTotalPacket();
/**
*optionalstringclient_ip_addr=20;
*/
booleanhasClientIpAddr();
/**
*optionalstringclient_ip_addr=20;
*/
java.lang.StringgetClientIpAddr();
/**
*optionalstringclient_ip_addr=20;
*/
com.google.protobuf.ByteString
getClientIpAddrBytes();
/**
*optionalint32tcp_status=21;
*/
booleanhasTcpStatus();
/**
*optionalint32tcp_status=21;
*/
intgetTcpStatus();
/**
*optionalint32server_country_id=22;
*/
booleanhasServerCountryId();
/**
*optionalint32server_country_id=22;
*/
intgetServerCountryId();
/**
*optionalint32server_netsegment_id=23;
*/
booleanhasServerNetsegmentId();
/**
*optionalint32server_netsegment_id=23;
*/
intgetServerNetsegmentId();
/**
*optionalint64avg_pkt_size=24;
*/
booleanhasAvgPktSize();
/**
*optionalint64avg_pkt_size=24;
*/
longgetAvgPktSize();
/**
*optionalint32server_port=25;
*/
booleanhasServerPort();
/**
*optionalint32server_port=25;
*/
intgetServerPort();
/**
*optionalint64server_total_byte=26;
*/
booleanhasServerTotalByte();
/**
*optionalint64server_total_byte=26;
*/
longgetServerTotalByte();
/**
*optionalint32total_packetps=27;
*/
booleanhasTotalPacketps();
/**
*optionalint32total_packetps=27;
*/
intgetTotalPacketps();
}
/**
*Protobuftype{@codeTCPLog}
*/
publicstaticfinalclassTCPLogextends
com.google.protobuf.GeneratedMessageV3implements
//@@protoc_insertion_point(message_implements:TCPLog)
TCPLogOrBuilder{
//UseTCPLog.newBuilder()toconstruct.
privateTCPLog(com.google.protobuf.GeneratedMessageV3.Builder>builder){
super(builder);
}
privateTCPLog(){
totalByteps_=0;
flowStartTime_=0L;
date_=0L;
serverTotalPacket_=0L;
clientTotalByte_=0L;
linkId_=0;
totalByte_=0L;
flowEndTime_=0L;
clientPort_=0;
protocol_=0;
totalPacket_=0L;
flowDuration_=0L;
id_="";
serverIpAddr_="";
directionMask_="";
app_=0;
clientCountryId_=0;
clientNetsegmentId_=0;
clientTotalPacket_=0L;
clientIpAddr_="";
tcpStatus_=0;
serverCountryId_=0;
serverNetsegmentId_=0;
avgPktSize_=0L;
serverPort_=0;
serverTotalByte_=0L;
totalPacketps_=0;
}
@java.lang.Override
publicfinalcom.google.protobuf.UnknownFieldSet
getUnknownFields(){
returnthis.unknownFields;
}
privateTCPLog(
com.google.protobuf.CodedInputStreaminput,
com.google.protobuf.ExtensionRegistryLiteextensionRegistry)
throwscom.google.protobuf.InvalidProtocolBufferException{
this();
intmutable_bitField0_=0;
com.google.protobuf.UnknownFieldSet.BuilderunknownFields=
com.google.protobuf.UnknownFieldSet.newBuilder();
try{
booleandone=false;
while(!done){
inttag=input.readTag();
switch(tag){
case0:
done=true;
break;
default:{
if(!parseUnknownField(input,unknownFields,
extensionRegistry,tag)){
done=true;
}
break;
}
case8:{
bitField0_|=0x00000001;
totalByteps_=input.readInt32();
break;
}
case16:{
bitField0_|=0x00000002;
flowStartTime_=input.readInt64();
break;
}
case24:{
bitField0_|=0x00000004;
date_=input.readInt64();
break;
}
case32:{
bitField0_|=0x00000008;
serverTotalPacket_=input.readInt64();
break;
}
case40:{
bitField0_|=0x00000010;
clientTotalByte_=input.readInt64();
break;
}
case48:{
bitField0_|=0x00000020;
linkId_=input.readInt32();
break;
}
case56:{
bitField0_|=0x00000040;
totalByte_=input.readInt64();
break;
}
case64:{
bitField0_|=0x00000080;
flowEndTime_=input.readInt64();
break;
}
case72:{
bitField0_|=0x00000100;
clientPort_=input.readInt32();
break;
}
case80:{
bitField0_|=0x00000200;
protocol_=input.readInt32();
break;
}
case88:{
bitField0_|=0x00000400;
totalPacket_=input.readInt64();
break;
}
case96:{
bitField0_|=0x00000800;
flowDuration_=input.readInt64();
break;
}
case106:{
com.google.protobuf.ByteStringbs=input.readBytes();
bitField0_|=0x00001000;
id_=bs;
break;
}
case114:{
com.google.protobuf.ByteStringbs=input.readBytes();
bitField0_|=0x00002000;
serverIpAddr_=bs;
break;
}
case122:{
com.google.protobuf.ByteStringbs=input.readBytes();
bitField0_|=0x00004000;
directionMask_=bs;
break;
}
case128:{
bitField0_|=0x00008000;
app_=input.readInt32();
break;
}
case136:{
bitField0_|=0x00010000;
clientCountryId_=input.readInt32();
break;
}
case144:{
bitField0_|=0x00020000;
clientNetsegmentId_=input.readInt32();
break;
}
case152:{
bitField0_|=0x00040000;
clientTotalPacket_=input.readInt64();
break;
}
case162:{
com.google.protobuf.ByteStringbs=input.readBytes();
bitField0_|=0x00080000;
clientIpAddr_=bs;
break;
}
case168:{
bitField0_|=0x00100000;
tcpStatus_=input.readInt32();
break;
}
case176:{
bitField0_|=0x00200000;
serverCountryId_=input.readInt32();
break;
}
case184:{
bitField0_|=0x00400000;
serverNetsegmentId_=input.readInt32();
break;
}
case192:{
bitField0_|=0x00800000;
avgPktSize_=input.readInt64();
break;
}
case200:{
bitField0_|=0x01000000;
serverPort_=input.readInt32();
break;
}
case208:{
bitField0_|=0x02000000;
serverTotalByte_=input.readInt64();
break;
}
case216:{
bitField0_|=0x04000000;
totalPacketps_=input.readInt32();
break;
}
}
}
}catch(com.google.protobuf.InvalidProtocolBufferExceptione){
throwe.setUnfinishedMessage(this);
}catch(java.io.IOExceptione){
thrownewcom.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
}finally{
this.unknownFields=unknownFields.build();
makeExtensionsImmutable();
}
}
publicstaticfinalcom.google.protobuf.Descriptors.Descriptor
getDescriptor(){
returnTCPLogOuterClass.internal_static_TCPLog_descriptor;
}
protectedcom.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable(){
returnTCPLogOuterClass.internal_static_TCPLog_fieldAccessorTable
.ensureFieldAccessorsInitialized(
TCPLogOuterClass.TCPLog.class,TCPLogOuterClass.TCPLog.Builder.class);
}
privateintbitField0_;
publicstaticfinalintTOTAL_BYTEPS_FIELD_NUMBER=1;
privateinttotalByteps_;
/**
*optionalint32total_byteps=1;
*/
publicbooleanhasTotalByteps(){
return((bitField0_&0x00000001)==0x00000001);
}
/**
*optionalint32total_byteps=1;
*/
publicintgetTotalByteps(){
returntotalByteps_;
}
publicstaticfinalintFLOW_START_TIME_FIELD_NUMBER=2;
privatelongflowStartTime_;
/**
*optionalint64flow_start_time=2;
*/
publicbooleanhasFlowStartTime(){
return((bitField0_&0x00000002)==0x00000002);
}
/**
*optionalint64flow_start_time=2;
*/
publiclonggetFlowStartTime(){
returnflowStartTime_;
}
publicstaticfinalintDATE_FIELD_NUMBER=3;
privatelongdate_;
/**
*optionalint64date=3;
*/
publicbooleanhasDate(){
return((bitField0_&0x00000004)==0x00000004);
}
/**
*optionalint64date=3;
*/
publiclonggetDate(){
returndate_;
}
publicstaticfinalintSERVER_TOTAL_PACKET_FIELD_NUMBER=4;
privatelongserverTotalPacket_;
/**
*optionalint64server_total_packet=4;
*/
publicbooleanhasServerTotalPacket(){
return((bitField0_&0x00000008)==0x00000008);
}
/**
*optionalint64server_total_packet=4;
*/
publiclonggetServerTotalPacket(){
returnserverTotalPacket_;
}
publicstaticfinalintCLIENT_TOTAL_BYTE_FIELD_NUMBER=5;
privatelongclientTotalByte_;
/**
*optionalint64client_total_byte=5;
*/
publicbooleanhasClientTotalByte(){
return((bitField0_&0x00000010)==0x00000010);
}
/**
*optionalint64client_total_byte=5;
*/
publiclonggetClientTotalByte(){
returnclientTotalByte_;
}
publicstaticfinalintLINK_ID_FIELD_NUMBER=6;
privateintlinkId_;
/**
*optionalint32link_id=6;
*/
publicbooleanhasLinkId(){
return((bitField0_&0x00000020)==0x00000020);
}
/**
*optionalint32link_id=6;
*/
publicintgetLinkId(){
returnlinkId_;
}
publicstaticfinalintTOTAL_BYTE_FIELD_NUMBER=7;
privatelongtotalByte_;
/**
*optionalint64total_byte=7;
*/
publicbooleanhasTotalByte(){
return((bitField0_&0x00000040)==0x00000040);
}
/**
*optionalint64total_byte=7;
*/
publiclonggetTotalByte(){
returntotalByte_;
}
publicstaticfinalintFLOW_END_TIME_FIELD_NUMBER=8;
privatelongflowEndTime_;
/**
*optionalint64flow_end_time=8;
*/
publicbooleanhasFlowEndTime(){
return((bitField0_&0x00000080)==0x00000080);
}
/**
*optionalint64flow_end_time=8;
*/
publiclonggetFlowEndTime(){
returnflowEndTime_;
}
publicstaticfinalintCLIENT_PORT_FIELD_NUMBER=9;
privateintclientPort_;
/**
*optionalint32client_port=9;
*/
publicbooleanhasClientPort(){
return((bitField0_&0x00000100)==0x00000100);
}
/**
*optionalint32client_port=9;
*/
publicintgetClientPort(){
returnclientPort_;
}
publicstaticfinalintPROTOCOL_FIELD_NUMBER=10;
privateintprotocol_;
/**
*optionalint32protocol=10;
*/
publicbooleanhasProtocol(){
return((bitField0_&0x00000200)==0x00000200);
}
/**
*optionalint32protocol=10;
*/
publicintgetProtocol(){
returnprotocol_;
}
publicstaticfinalintTOTAL_PACKET_FIELD_NUMBER=11;
privatelongtotalPacket_;
/**
*optionalint64total_packet=11;
*/
publicbooleanhasTotalPacket(){
return((bitField0_&0x00000400)==0x00000400);
}
/**
*optionalint64total_packet=11;
*/
publiclonggetTotalPacket(){
returntotalPacket_;
}
publicstaticfinalintFLOW_DURATION_FIELD_NUMBER=12;
privatelongflowDuration_;
/**
*optionalint64flow_duration=12;
*/
publicbooleanhasFlowDuration(){
return((bitField0_&0x00000800)==0x00000800);
}
/**
*optionalint64flow_duration=12;
*/
publiclonggetFlowDuration(){
returnflowDuration_;
}
publicstaticfinalintID_FIELD_NUMBER=13;
privatevolatilejava.lang.Objectid_;
/**
*optionalstringid=13;
*/
publicbooleanhasId(){
return((bitField0_&0x00001000)==0x00001000);
}
/**
*optionalstringid=13;
*/
publicjava.lang.StringgetId(){
java.lang.Objectref=id_;
if(refinstanceofjava.lang.String){
return(java.lang.String)ref;
}else{
com.google.protobuf.ByteStringbs=
(com.google.protobuf.ByteString)ref;
java.lang.Strings=bs.toStringUtf8();
if(bs.isValidUtf8()){
id_=s;
}
returns;
}
}
/**
*optionalstringid=13;
*/
publiccom.google.protobuf.ByteString
getIdBytes(){
java.lang.Objectref=id_;
if(refinstanceofjava.lang.String){
com.google.protobuf.ByteStringb=
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String)ref);
id_=b;
returnb;
}else{
return(com.google.protobuf.ByteString)ref;
}
}
publicstaticfinalintSERVER_IP_ADDR_FIELD_NUMBER=14;
privatevolatilejava.lang.ObjectserverIpAddr_;
/**
*optionalstringserver_ip_addr=14;
*/
publicbooleanhasServerIpAddr(){
return((bitField0_&0x00002000)==0x00002000);
}
/**
*optionalstringserver_ip_addr=14;
*/
publicjava.lang.StringgetServerIpAddr(){
java.lang.Objectref=serverIpAddr_;
if(refinstanceofjava.lang.String){
return(java.lang.String)ref;
}else{
com.google.protobuf.ByteStringbs=
(com.google.protobuf.ByteString)ref;
java.lang.Strings=bs.toStringUtf8();
if(bs.isValidUtf8()){
serverIpAddr_=s;
}
returns;
}
}
/**
*optionalstringserver_ip_addr=14;
*/
publiccom.google.protobuf.ByteString
getServerIpAddrBytes(){
java.lang.Objectref=serverIpAddr_;
if(refinstanceofjava.lang.String){
com.google.protobuf.ByteStringb=
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String)ref);
serverIpAddr_=b;
returnb;
}else{
return(com.google.protobuf.ByteString)ref;
}
}
publicstaticfinalintDIRECTION_MASK_FIELD_NUMBER=15;
privatevolatilejava.lang.ObjectdirectionMask_;
/**
*optionalstringdirection_mask=15;
*/
publicbooleanhasDirectionMask(){
return((bitField0_&0x00004000)==0x00004000);
}
/**
*optionalstringdirection_mask=15;
*/
publicjava.lang.StringgetDirectionMask(){
java.lang.Objectref=directionMask_;
if(refinstanceofjava.lang.String){
return(java.lang.String)ref;
}else{
com.google.protobuf.ByteStringbs=
(com.google.protobuf.ByteString)ref;
java.lang.Strings=bs.toStringUtf8();
if(bs.isValidUtf8()){
directionMask_=s;
}
returns;
}
}
/**
*optionalstringdirection_mask=15;
*/
publiccom.google.protobuf.ByteString
getDirectionMaskBytes(){
java.lang.Objectref=directionMask_;
if(refinstanceofjava.lang.String){
com.google.protobuf.ByteStringb=
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String)ref);
directionMask_=b;
returnb;
}else{
return(com.google.protobuf.ByteString)ref;
}
}
publicstaticfinalintAPP_FIELD_NUMBER=16;
privateintapp_;
/**
*optionalint32app=16;
*/
publicbooleanhasApp(){
return((bitField0_&0x00008000)==0x00008000);
}
/**
*optionalint32app=16;
*/
publicintgetApp(){
returnapp_;
}
publicstaticfinalintCLIENT_COUNTRY_ID_FIELD_NUMBER=17;
privateintclientCountryId_;
/**
*optionalint32client_country_id=17;
*/
publicbooleanhasClientCountryId(){
return((bitField0_&0x00010000)==0x00010000);
}
/**
*optionalint32client_country_id=17;
*/
publicintgetClientCountryId(){
returnclientCountryId_;
}
publicstaticfinalintCLIENT_NETSEGMENT_ID_FIELD_NUMBER=18;
privateintclientNetsegmentId_;
/**
*optionalint32client_netsegment_id=18;
*/
publicbooleanhasClientNetsegmentId(){
return((bitField0_&0x00020000)==0x00020000);
}
/**
*optionalint32client_netsegment_id=18;
*/
publicintgetClientNetsegmentId(){
returnclientNetsegmentId_;
}
publicstaticfinalintCLIENT_TOTAL_PACKET_FIELD_NUMBER=19;
privatelongclientTotalPacket_;
/**
*optionalint64client_total_packet=19;
*/
publicbooleanhasClientTotalPacket(){
return((bitField0_&0x00040000)==0x00040000);
}
/**
*optionalint64client_total_packet=19;
*/
publiclonggetClientTotalPacket(){
returnclientTotalPacket_;
}
publicstaticfinalintCLIENT_IP_ADDR_FIELD_NUMBER=20;
privatevolatilejava.lang.ObjectclientIpAddr_;
/**
*optionalstringclient_ip_addr=20;
*/
publicbooleanhasClientIpAddr(){
return((bitField0_&0x00080000)==0x00080000);
}
/**
*optionalstringclient_ip_addr=20;
*/
publicjava.lang.StringgetClientIpAddr(){
java.lang.Objectref=clientIpAddr_;
if(refinstanceofjava.lang.String){
return(java.lang.String)ref;
}else{
com.google.protobuf.ByteStringbs=
(com.google.protobuf.ByteString)ref;
java.lang.Strings=bs.toStringUtf8();
if(bs.isValidUtf8()){
clientIpAddr_=s;
}
returns;
}
}
/**
*optionalstringclient_ip_addr=20;
*/
publiccom.google.protobuf.ByteString
getClientIpAddrBytes(){
java.lang.Objectref=clientIpAddr_;
if(refinstanceofjava.lang.String){
com.google.protobuf.ByteStringb=
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String)ref);
clientIpAddr_=b;
returnb;
}else{
return(com.google.protobuf.ByteString)ref;
}
}
publicstaticfinalintTCP_STATUS_FIELD_NUMBER=21;
privateinttcpStatus_;
/**
*optionalint32tcp_status=21;
*/
publicbooleanhasTcpStatus(){
return((bitField0_&0x00100000)==0x00100000);
}
/**
*optionalint32tcp_status=21;
*/
publicintgetTcpStatus(){
returntcpStatus_;
}
publicstaticfinalintSERVER_COUNTRY_ID_FIELD_NUMBER=22;
privateintserverCountryId_;
/**
*optionalint32server_country_id=22;
*/
publicbooleanhasServerCountryId(){
return((bitField0_&0x00200000)==0x00200000);
}
/**
*optionalint32server_country_id=22;
*/
publicintgetServerCountryId(){
returnserverCountryId_;
}
publicstaticfinalintSERVER_NETSEGMENT_ID_FIELD_NUMBER=23;
privateintserverNetsegmentId_;
/**
*optionalint32server_netsegment_id=23;
*/
publicbooleanhasServerNetsegmentId(){
return((bitField0_&0x00400000)==0x00400000);
}
/**
*optionalint32server_netsegment_id=23;
*/
publicintgetServerNetsegmentId(){
returnserverNetsegmentId_;
}
publicstaticfinalintAVG_PKT_SIZE_FIELD_NUMBER=24;
privatelongavgPktSize_;
/**
*optionalint64avg_pkt_size=24;
*/
publicbooleanhasAvgPktSize(){
return((bitField0_&0x00800000)==0x00800000);
}
/**
*optionalint64avg_pkt_size=24;
*/
publiclonggetAvgPktSize(){
returnavgPktSize_;
}
publicstaticfinalintSERVER_PORT_FIELD_NUMBER=25;
privateintserverPort_;
/**
*optionalint32server_port=25;
*/
publicbooleanhasServerPort(){
return((bitField0_&0x01000000)==0x01000000);
}
/**
*optionalint32server_port=25;
*/
publicintgetServerPort(){
returnserverPort_;
}
publicstaticfinalintSERVER_TOTAL_BYTE_FIELD_NUMBER=26;
privatelongserverTotalByte_;
/**
*optionalint64server_total_byte=26;
*/
publicbooleanhasServerTotalByte(){
return((bitField0_&0x02000000)==0x02000000);
}
/**
*optionalint64server_total_byte=26;
*/
publiclonggetServerTotalByte(){
returnserverTotalByte_;
}
publicstaticfinalintTOTAL_PACKETPS_FIELD_NUMBER=27;
privateinttotalPacketps_;
/**
*optionalint32total_packetps=27;
*/
publicbooleanhasTotalPacketps(){
return((bitField0_&0x04000000)==0x04000000);
}
/**
*optionalint32total_packetps=27;
*/
publicintgetTotalPacketps(){
returntotalPacketps_;
}
privatebytememoizedIsInitialized=-1;
publicfinalbooleanisInitialized(){
byteisInitialized=memoizedIsInitialized;
if(isInitialized==1)returntrue;
if(isInitialized==0)returnfalse;
memoizedIsInitialized=1;
returntrue;
}
publicvoidwriteTo(com.google.protobuf.CodedOutputStreamoutput)
throwsjava.io.IOException{
if(((bitField0_&0x00000001)==0x00000001)){
output.writeInt32(1,totalByteps_);
}
if(((bitField0_&0x00000002)==0x00000002)){
output.writeInt64(2,flowStartTime_);
}
if(((bitField0_&0x00000004)==0x00000004)){
output.writeInt64(3,date_);
}
if(((bitField0_&0x00000008)==0x00000008)){
output.writeInt64(4,serverTotalPacket_);
}
if(((bitField0_&0x00000010)==0x00000010)){
output.writeInt64(5,clientTotalByte_);
}
if(((bitField0_&0x00000020)==0x00000020)){
output.writeInt32(6,linkId_);
}
if(((bitField0_&0x00000040)==0x00000040)){
output.writeInt64(7,totalByte_);
}
if(((bitField0_&0x00000080)==0x00000080)){
output.writeInt64(8,flowEndTime_);
}
if(((bitField0_&0x00000100)==0x00000100)){
output.writeInt32(9,clientPort_);
}
if(((bitField0_&0x00000200)==0x00000200)){
output.writeInt32(10,protocol_);
}
if(((bitField0_&0x00000400)==0x00000400)){
output.writeInt64(11,totalPacket_);
}
if(((bitField0_&0x00000800)==0x00000800)){
output.writeInt64(12,flowDuration_);
}
if(((bitField0_&0x00001000)==0x00001000)){
com.google.protobuf.GeneratedMessageV3.writeString(output,13,id_);
}
if(((bitField0_&0x00002000)==0x00002000)){
com.google.protobuf.GeneratedMessageV3.writeString(output,14,serverIpAddr_);
}
if(((bitField0_&0x00004000)==0x00004000)){
com.google.protobuf.GeneratedMessageV3.writeString(output,15,directionMask_);
}
if(((bitField0_&0x00008000)==0x00008000)){
output.writeInt32(16,app_);
}
if(((bitField0_&0x00010000)==0x00010000)){
output.writeInt32(17,clientCountryId_);
}
if(((bitField0_&0x00020000)==0x00020000)){
output.writeInt32(18,clientNetsegmentId_);
}
if(((bitField0_&0x00040000)==0x00040000)){
output.writeInt64(19,clientTotalPacket_);
}
if(((bitField0_&0x00080000)==0x00080000)){
com.google.protobuf.GeneratedMessageV3.writeString(output,20,clientIpAddr_);
}
if(((bitField0_&0x00100000)==0x00100000)){
output.writeInt32(21,tcpStatus_);
}
if(((bitField0_&0x00200000)==0x00200000)){
output.writeInt32(22,serverCountryId_);
}
if(((bitField0_&0x00400000)==0x00400000)){
output.writeInt32(23,serverNetsegmentId_);
}
if(((bitField0_&0x00800000)==0x00800000)){
output.writeInt64(24,avgPktSize_);
}
if(((bitField0_&0x01000000)==0x01000000)){
output.writeInt32(25,serverPort_);
}
if(((bitField0_&0x02000000)==0x02000000)){
output.writeInt64(26,serverTotalByte_);
}
if(((bitField0_&0x04000000)==0x04000000)){
output.writeInt32(27,totalPacketps_);
}
unknownFields.writeTo(output);
}
publicintgetSerializedSize(){
intsize=memoizedSize;
if(size!=-1)returnsize;
size=0;
if(((bitField0_&0x00000001)==0x00000001)){
size+=com.google.protobuf.CodedOutputStream
.computeInt32Size(1,totalByteps_);
}
if(((bitField0_&0x00000002)==0x00000002)){
size+=com.google.protobuf.CodedOutputStream
.computeInt64Size(2,flowStartTime_);
}
if(((bitField0_&0x00000004)==0x00000004)){
size+=com.google.protobuf.CodedOutputStream
.computeInt64Size(3,date_);
}
if(((bitField0_&0x00000008)==0x00000008)){
size+=com.google.protobuf.CodedOutputStream
.computeInt64Size(4,serverTotalPacket_);
}
if(((bitField0_&0x00000010)==0x00000010)){
size+=com.google.protobuf.CodedOutputStream
.computeInt64Size(5,clientTotalByte_);
}
if(((bitField0_&0x00000020)==0x00000020)){
size+=com.google.protobuf.CodedOutputStream
.computeInt32Size(6,linkId_);
}
if(((bitField0_&0x00000040)==0x00000040)){
size+=com.google.protobuf.CodedOutputStream
.computeInt64Size(7,totalByte_);
}
if(((bitField0_&0x00000080)==0x00000080)){
size+=com.google.protobuf.CodedOutputStream
.computeInt64Size(8,flowEndTime_);
}
if(((bitField0_&0x00000100)==0x00000100)){
size+=com.google.protobuf.CodedOutputStream
.computeInt32Size(9,clientPort_);
}
if(((bitField0_&0x00000200)==0x00000200)){
size+=com.google.protobuf.CodedOutputStream
.computeInt32Size(10,protocol_);
}
if(((bitField0_&0x00000400)==0x00000400)){
size+=com.google.protobuf.CodedOutputStream
.computeInt64Size(11,totalPacket_);
}
if(((bitField0_&0x00000800)==0x00000800)){
size+=com.google.protobuf.CodedOutputStream
.computeInt64Size(12,flowDuration_);
}
if(((bitField0_&0x00001000)==0x00001000)){
size+=com.google.protobuf.GeneratedMessageV3.computeStringSize(13,id_);
}
if(((bitField0_&0x00002000)==0x00002000)){
size+=com.google.protobuf.GeneratedMessageV3.computeStringSize(14,serverIpAddr_);
}
if(((bitField0_&0x00004000)==0x00004000)){
size+=com.google.protobuf.GeneratedMessageV3.computeStringSize(15,directionMask_);
}
if(((bitField0_&0x00008000)==0x00008000)){
size+=com.google.protobuf.CodedOutputStream
.computeInt32Size(16,app_);
}
if(((bitField0_&0x00010000)==0x00010000)){
size+=com.google.protobuf.CodedOutputStream
.computeInt32Size(17,clientCountryId_);
}
if(((bitField0_&0x00020000)==0x00020000)){
size+=com.google.protobuf.CodedOutputStream
.computeInt32Size(18,clientNetsegmentId_);
}
if(((bitField0_&0x00040000)==0x00040000)){
size+=com.google.protobuf.CodedOutputStream
.computeInt64Size(19,clientTotalPacket_);
}
if(((bitField0_&0x00080000)==0x00080000)){
size+=com.google.protobuf.GeneratedMessageV3.computeStringSize(20,clientIpAddr_);
}
if(((bitField0_&0x00100000)==0x00100000)){
size+=com.google.protobuf.CodedOutputStream
.computeInt32Size(21,tcpStatus_);
}
if(((bitField0_&0x00200000)==0x00200000)){
size+=com.google.protobuf.CodedOutputStream
.computeInt32Size(22,serverCountryId_);
}
if(((bitField0_&0x00400000)==0x00400000)){
size+=com.google.protobuf.CodedOutputStream
.computeInt32Size(23,serverNetsegmentId_);
}
if(((bitField0_&0x00800000)==0x00800000)){
size+=com.google.protobuf.CodedOutputStream
.computeInt64Size(24,avgPktSize_);
}
if(((bitField0_&0x01000000)==0x01000000)){
size+=com.google.protobuf.CodedOutputStream
.computeInt32Size(25,serverPort_);
}
if(((bitField0_&0x02000000)==0x02000000)){
size+=com.google.protobuf.CodedOutputStream
.computeInt64Size(26,serverTotalByte_);
}
if(((bitField0_&0x04000000)==0x04000000)){
size+=com.google.protobuf.CodedOutputStream
.computeInt32Size(27,totalPacketps_);
}
size+=unknownFields.getSerializedSize();
memoizedSize=size;
returnsize;
}
privatestaticfinallongserialVersionUID=0L;
@java.lang.Override
publicbooleanequals(finaljava.lang.Objectobj){
if(obj==this){
returntrue;
}
if(!(objinstanceofTCPLogOuterClass.TCPLog)){
returnsuper.equals(obj);
}
TCPLogOuterClass.TCPLogother=(TCPLogOuterClass.TCPLog)obj;
booleanresult=true;
result=result&&(hasTotalByteps()==other.hasTotalByteps());
if(hasTotalByteps()){
result=result&&(getTotalByteps()
==other.getTotalByteps());
}
result=result&&(hasFlowStartTime()==other.hasFlowStartTime());
if(hasFlowStartTime()){
result=result&&(getFlowStartTime()
==other.getFlowStartTime());
}
result=result&&(hasDate()==other.hasDate());
if(hasDate()){
result=result&&(getDate()
==other.getDate());
}
result=result&&(hasServerTotalPacket()==other.hasServerTotalPacket());
if(hasServerTotalPacket()){
result=result&&(getServerTotalPacket()
==other.getServerTotalPacket());
}
result=result&&(hasClientTotalByte()==other.hasClientTotalByte());
if(hasClientTotalByte()){
result=result&&(getClientTotalByte()
==other.getClientTotalByte());
}
result=result&&(hasLinkId()==other.hasLinkId());
if(hasLinkId()){
result=result&&(getLinkId()
==other.getLinkId());
}
result=result&&(hasTotalByte()==other.hasTotalByte());
if(hasTotalByte()){
result=result&&(getTotalByte()
==other.getTotalByte());
}
result=result&&(hasFlowEndTime()==other.hasFlowEndTime());
if(hasFlowEndTime()){
result=result&&(getFlowEndTime()
==other.getFlowEndTime());
}
result=result&&(hasClientPort()==other.hasClientPort());
if(hasClientPort()){
result=result&&(getClientPort()
==other.getClientPort());
}
result=result&&(hasProtocol()==other.hasProtocol());
if(hasProtocol()){
result=result&&(getProtocol()
==other.getProtocol());
}
result=result&&(hasTotalPacket()==other.hasTotalPacket());
if(hasTotalPacket()){
result=result&&(getTotalPacket()
==other.getTotalPacket());
}
result=result&&(hasFlowDuration()==other.hasFlowDuration());
if(hasFlowDuration()){
result=result&&(getFlowDuration()
==other.getFlowDuration());
}
result=result&&(hasId()==other.hasId());
if(hasId()){
result=result&&getId()
.equals(other.getId());
}
result=result&&(hasServerIpAddr()==other.hasServerIpAddr());
if(hasServerIpAddr()){
result=result&&getServerIpAddr()
.equals(other.getServerIpAddr());
}
result=result&&(hasDirectionMask()==other.hasDirectionMask());
if(hasDirectionMask()){
result=result&&getDirectionMask()
.equals(other.getDirectionMask());
}
result=result&&(hasApp()==other.hasApp());
if(hasApp()){
result=result&&(getApp()
==other.getApp());
}
result=result&&(hasClientCountryId()==other.hasClientCountryId());
if(hasClientCountryId()){
result=result&&(getClientCountryId()
==other.getClientCountryId());
}
result=result&&(hasClientNetsegmentId()==other.hasClientNetsegmentId());
if(hasClientNetsegmentId()){
result=result&&(getClientNetsegmentId()
==other.getClientNetsegmentId());
}
result=result&&(hasClientTotalPacket()==other.hasClientTotalPacket());
if(hasClientTotalPacket()){
result=result&&(getClientTotalPacket()
==other.getClientTotalPacket());
}
result=result&&(hasClientIpAddr()==other.hasClientIpAddr());
if(hasClientIpAddr()){
result=result&&getClientIpAddr()
.equals(other.getClientIpAddr());
}
result=result&&(hasTcpStatus()==other.hasTcpStatus());
if(hasTcpStatus()){
result=result&&(getTcpStatus()
==other.getTcpStatus());
}
result=result&&(hasServerCountryId()==other.hasServerCountryId());
if(hasServerCountryId()){
result=result&&(getServerCountryId()
==other.getServerCountryId());
}
result=result&&(hasServerNetsegmentId()==other.hasServerNetsegmentId());
if(hasServerNetsegmentId()){
result=result&&(getServerNetsegmentId()
==other.getServerNetsegmentId());
}
result=result&&(hasAvgPktSize()==other.hasAvgPktSize());
if(hasAvgPktSize()){
result=result&&(getAvgPktSize()
==other.getAvgPktSize());
}
result=result&&(hasServerPort()==other.hasServerPort());
if(hasServerPort()){
result=result&&(getServerPort()
==other.getServerPort());
}
result=result&&(hasServerTotalByte()==other.hasServerTotalByte());
if(hasServerTotalByte()){
result=result&&(getServerTotalByte()
==other.getServerTotalByte());
}
result=result&&(hasTotalPacketps()==other.hasTotalPacketps());
if(hasTotalPacketps()){
result=result&&(getTotalPacketps()
==other.getTotalPacketps());
}
result=result&&unknownFields.equals(other.unknownFields);
returnresult;
}
@java.lang.Override
publicinthashCode(){
if(memoizedHashCode!=0){
returnmemoizedHashCode;
}
inthash=41;
hash=(19*hash)+getDescriptor().hashCode();
if(hasTotalByteps()){
hash=(37*hash)+TOTAL_BYTEPS_FIELD_NUMBER;
hash=(53*hash)+getTotalByteps();
}
if(hasFlowStartTime()){
hash=(37*hash)+FLOW_START_TIME_FIELD_NUMBER;
hash=(53*hash)+com.google.protobuf.Internal.hashLong(
getFlowStartTime());
}
if(hasDate()){
hash=(37*hash)+DATE_FIELD_NUMBER;
hash=(53*hash)+com.google.protobuf.Internal.hashLong(
getDate());
}
if(hasServerTotalPacket()){
hash=(37*hash)+SERVER_TOTAL_PACKET_FIELD_NUMBER;
hash=(53*hash)+com.google.protobuf.Internal.hashLong(
getServerTotalPacket());
}
if(hasClientTotalByte()){
hash=(37*hash)+CLIENT_TOTAL_BYTE_FIELD_NUMBER;
hash=(53*hash)+com.google.protobuf.Internal.hashLong(
getClientTotalByte());
}
if(hasLinkId()){
hash=(37*hash)+LINK_ID_FIELD_NUMBER;
hash=(53*hash)+getLinkId();
}
if(hasTotalByte()){
hash=(37*hash)+TOTAL_BYTE_FIELD_NUMBER;
hash=(53*hash)+com.google.protobuf.Internal.hashLong(
getTotalByte());
}
if(hasFlowEndTime()){
hash=(37*hash)+FLOW_END_TIME_FIELD_NUMBER;
hash=(53*hash)+com.google.protobuf.Internal.hashLong(
getFlowEndTime());
}
if(hasClientPort()){
hash=(37*hash)+CLIENT_PORT_FIELD_NUMBER;
hash=(53*hash)+getClientPort();
}
if(hasProtocol()){
hash=(37*hash)+PROTOCOL_FIELD_NUMBER;
hash=(53*hash)+getProtocol();
}
if(hasTotalPacket()){
hash=(37*hash)+TOTAL_PACKET_FIELD_NUMBER;
hash=(53*hash)+com.google.protobuf.Internal.hashLong(
getTotalPacket());
}
if(hasFlowDuration()){
hash=(37*hash)+FLOW_DURATION_FIELD_NUMBER;
hash=(53*hash)+com.google.protobuf.Internal.hashLong(
getFlowDuration());
}
if(hasId()){
hash=(37*hash)+ID_FIELD_NUMBER;
hash=(53*hash)+getId().hashCode();
}
if(hasServerIpAddr()){
hash=(37*hash)+SERVER_IP_ADDR_FIELD_NUMBER;
hash=(53*hash)+getServerIpAddr().hashCode();
}
if(hasDirectionMask()){
hash=(37*hash)+DIRECTION_MASK_FIELD_NUMBER;
hash=(53*hash)+getDirectionMask().hashCode();
}
if(hasApp()){
hash=(37*hash)+APP_FIELD_NUMBER;
hash=(53*hash)+getApp();
}
if(hasClientCountryId()){
hash=(37*hash)+CLIENT_COUNTRY_ID_FIELD_NUMBER;
hash=(53*hash)+getClientCountryId();
}
if(hasClientNetsegmentId()){
hash=(37*hash)+CLIENT_NETSEGMENT_ID_FIELD_NUMBER;
hash=(53*hash)+getClientNetsegmentId();
}
if(hasClientTotalPacket()){
hash=(37*hash)+CLIENT_TOTAL_PACKET_FIELD_NUMBER;
hash=(53*hash)+com.google.protobuf.Internal.hashLong(
getClientTotalPacket());
}
if(hasClientIpAddr()){
hash=(37*hash)+CLIENT_IP_ADDR_FIELD_NUMBER;
hash=(53*hash)+getClientIpAddr().hashCode();
}
if(hasTcpStatus()){
hash=(37*hash)+TCP_STATUS_FIELD_NUMBER;
hash=(53*hash)+getTcpStatus();
}
if(hasServerCountryId()){
hash=(37*hash)+SERVER_COUNTRY_ID_FIELD_NUMBER;
hash=(53*hash)+getServerCountryId();
}
if(hasServerNetsegmentId()){
hash=(37*hash)+SERVER_NETSEGMENT_ID_FIELD_NUMBER;
hash=(53*hash)+getServerNetsegmentId();
}
if(hasAvgPktSize()){
hash=(37*hash)+AVG_PKT_SIZE_FIELD_NUMBER;
hash=(53*hash)+com.google.protobuf.Internal.hashLong(
getAvgPktSize());
}
if(hasServerPort()){
hash=(37*hash)+SERVER_PORT_FIELD_NUMBER;
hash=(53*hash)+getServerPort();
}
if(hasServerTotalByte()){
hash=(37*hash)+SERVER_TOTAL_BYTE_FIELD_NUMBER;
hash=(53*hash)+com.google.protobuf.Internal.hashLong(
getServerTotalByte());
}
if(hasTotalPacketps()){
hash=(37*hash)+TOTAL_PACKETPS_FIELD_NUMBER;
hash=(53*hash)+getTotalPacketps();
}
hash=(29*hash)+unknownFields.hashCode();
memoizedHashCode=hash;
returnhash;
}
publicstaticTCPLogOuterClass.TCPLogparseFrom(
java.nio.ByteBufferdata)
throwscom.google.protobuf.InvalidProtocolBufferException{
returnPARSER.parseFrom(data);
}
publicstaticTCPLogOuterClass.TCPLogparseFrom(
java.nio.ByteBufferdata,
com.google.protobuf.ExtensionRegistryLiteextensionRegistry)
throwscom.google.protobuf.InvalidProtocolBufferException{
returnPARSER.parseFrom(data,extensionRegistry);
}
publicstaticTCPLogOuterClass.TCPLogparseFrom(
com.google.protobuf.ByteStringdata)
throwscom.google.protobuf.InvalidProtocolBufferException{
returnPARSER.parseFrom(data);
}
publicstaticTCPLogOuterClass.TCPLogparseFrom(
com.google.protobuf.ByteStringdata,
com.google.protobuf.ExtensionRegistryLiteextensionRegistry)
throwscom.google.protobuf.InvalidProtocolBufferException{
returnPARSER.parseFrom(data,extensionRegistry);
}
publicstaticTCPLogOuterClass.TCPLogparseFrom(byte[]data)
throwscom.google.protobuf.InvalidProtocolBufferException{
returnPARSER.parseFrom(data);
}
publicstaticTCPLogOuterClass.TCPLogparseFrom(
byte[]data,
com.google.protobuf.ExtensionRegistryLiteextensionRegistry)
throwscom.google.protobuf.InvalidProtocolBufferException{
returnPARSER.parseFrom(data,extensionRegistry);
}
publicstaticTCPLogOuterClass.TCPLogparseFrom(java.io.InputStreaminput)
throwsjava.io.IOException{
returncom.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER,input);
}
publicstaticTCPLogOuterClass.TCPLogparseFrom(
java.io.InputStreaminput,
com.google.protobuf.ExtensionRegistryLiteextensionRegistry)
throwsjava.io.IOException{
returncom.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER,input,extensionRegistry);
}
publicstaticTCPLogOuterClass.TCPLogparseDelimitedFrom(java.io.InputStreaminput)
throwsjava.io.IOException{
returncom.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER,input);
}
publicstaticTCPLogOuterClass.TCPLogparseDelimitedFrom(
java.io.InputStreaminput,
com.google.protobuf.ExtensionRegistryLiteextensionRegistry)
throwsjava.io.IOException{
returncom.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER,input,extensionRegistry);
}
publicstaticTCPLogOuterClass.TCPLogparseFrom(
com.google.protobuf.CodedInputStreaminput)
throwsjava.io.IOException{
returncom.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER,input);
}
publicstaticTCPLogOuterClass.TCPLogparseFrom(
com.google.protobuf.CodedInputStreaminput,
com.google.protobuf.ExtensionRegistryLiteextensionRegistry)
throwsjava.io.IOException{
returncom.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER,input,extensionRegistry);
}
publicBuildernewBuilderForType(){returnnewBuilder();}
publicstaticBuildernewBuilder(){
returnDEFAULT_INSTANCE.toBuilder();
}
publicstaticBuildernewBuilder(TCPLogOuterClass.TCPLogprototype){
returnDEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
publicBuildertoBuilder(){
returnthis==DEFAULT_INSTANCE
?newBuilder():newBuilder().mergeFrom(this);
}
@java.lang.Override
protectedBuildernewBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParentparent){
Builderbuilder=newBuilder(parent);
returnbuilder;
}
/**
*Protobuftype{@codeTCPLog}
*/
publicstaticfinalclassBuilderextends
com.google.protobuf.GeneratedMessageV3.Builderimplements
//@@protoc_insertion_point(builder_implements:TCPLog)
TCPLogOuterClass.TCPLogOrBuilder{
publicstaticfinalcom.google.protobuf.Descriptors.Descriptor
getDescriptor(){
returnTCPLogOuterClass.internal_static_TCPLog_descriptor;
}
protectedcom.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable(){
returnTCPLogOuterClass.internal_static_TCPLog_fieldAccessorTable
.ensureFieldAccessorsInitialized(
TCPLogOuterClass.TCPLog.class,TCPLogOuterClass.TCPLog.Builder.class);
}
//ConstructusingTCPLogOuterClass.TCPLog.newBuilder()
privateBuilder(){
maybeForceBuilderInitialization();
}
privateBuilder(
com.google.protobuf.GeneratedMessageV3.BuilderParentparent){
super(parent);
maybeForceBuilderInitialization();
}
privatevoidmaybeForceBuilderInitialization(){
if(com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders){
}
}
publicBuilderclear(){
super.clear();
totalByteps_=0;
bitField0_=(bitField0_&~0x00000001);
flowStartTime_=0L;
bitField0_=(bitField0_&~0x00000002);
date_=0L;
bitField0_=(bitField0_&~0x00000004);
serverTotalPacket_=0L;
bitField0_=(bitField0_&~0x00000008);
clientTotalByte_=0L;
bitField0_=(bitField0_&~0x00000010);
linkId_=0;
bitField0_=(bitField0_&~0x00000020);
totalByte_=0L;
bitField0_=(bitField0_&~0x00000040);
flowEndTime_=0L;
bitField0_=(bitField0_&~0x00000080);
clientPort_=0;
bitField0_=(bitField0_&~0x00000100);
protocol_=0;
bitField0_=(bitField0_&~0x00000200);
totalPacket_=0L;
bitField0_=(bitField0_&~0x00000400);
flowDuration_=0L;
bitField0_=(bitField0_&~0x00000800);
id_="";
bitField0_=(bitField0_&~0x00001000);
serverIpAddr_="";
bitField0_=(bitField0_&~0x00002000);
directionMask_="";
bitField0_=(bitField0_&~0x00004000);
app_=0;
bitField0_=(bitField0_&~0x00008000);
clientCountryId_=0;
bitField0_=(bitField0_&~0x00010000);
clientNetsegmentId_=0;
bitField0_=(bitField0_&~0x00020000);
clientTotalPacket_=0L;
bitField0_=(bitField0_&~0x00040000);
clientIpAddr_="";
bitField0_=(bitField0_&~0x00080000);
tcpStatus_=0;
bitField0_=(bitField0_&~0x00100000);
serverCountryId_=0;
bitField0_=(bitField0_&~0x00200000);
serverNetsegmentId_=0;
bitField0_=(bitField0_&~0x00400000);
avgPktSize_=0L;
bitField0_=(bitField0_&~0x00800000);
serverPort_=0;
bitField0_=(bitField0_&~0x01000000);
serverTotalByte_=0L;
bitField0_=(bitField0_&~0x02000000);
totalPacketps_=0;
bitField0_=(bitField0_&~0x04000000);
returnthis;
}
publiccom.google.protobuf.Descriptors.Descriptor
getDescriptorForType(){
returnTCPLogOuterClass.internal_static_TCPLog_descriptor;
}
publicTCPLogOuterClass.TCPLoggetDefaultInstanceForType(){
returnTCPLogOuterClass.TCPLog.getDefaultInstance();
}
publicTCPLogOuterClass.TCPLogbuild(){
TCPLogOuterClass.TCPLogresult=buildPartial();
if(!result.isInitialized()){
thrownewUninitializedMessageException(result);
}
returnresult;
}
publicTCPLogOuterClass.TCPLogbuildPartial(){
TCPLogOuterClass.TCPLogresult=newTCPLogOuterClass.TCPLog(this);
intfrom_bitField0_=bitField0_;
intto_bitField0_=0;
if(((from_bitField0_&0x00000001)==0x00000001)){
to_bitField0_|=0x00000001;
}
result.totalByteps_=totalByteps_;
if(((from_bitField0_&0x00000002)==0x00000002)){
to_bitField0_|=0x00000002;
}
result.flowStartTime_=flowStartTime_;
if(((from_bitField0_&0x00000004)==0x00000004)){
to_bitField0_|=0x00000004;
}
result.date_=date_;
if(((from_bitField0_&0x00000008)==0x00000008)){
to_bitField0_|=0x00000008;
}
result.serverTotalPacket_=serverTotalPacket_;
if(((from_bitField0_&0x00000010)==0x00000010)){
to_bitField0_|=0x00000010;
}
result.clientTotalByte_=clientTotalByte_;
if(((from_bitField0_&0x00000020)==0x00000020)){
to_bitField0_|=0x00000020;
}
result.linkId_=linkId_;
if(((from_bitField0_&0x00000040)==0x00000040)){
to_bitField0_|=0x00000040;
}
result.totalByte_=totalByte_;
if(((from_bitField0_&0x00000080)==0x00000080)){
to_bitField0_|=0x00000080;
}
result.flowEndTime_=flowEndTime_;
if(((from_bitField0_&0x00000100)==0x00000100)){
to_bitField0_|=0x00000100;
}
result.clientPort_=clientPort_;
if(((from_bitField0_&0x00000200)==0x00000200)){
to_bitField0_|=0x00000200;
}
result.protocol_=protocol_;
if(((from_bitField0_&0x00000400)==0x00000400)){
to_bitField0_|=0x00000400;
}
result.totalPacket_=totalPacket_;
if(((from_bitField0_&0x00000800)==0x00000800)){
to_bitField0_|=0x00000800;
}
result.flowDuration_=flowDuration_;
if(((from_bitField0_&0x00001000)==0x00001000)){
to_bitField0_|=0x00001000;
}
result.id_=id_;
if(((from_bitField0_&0x00002000)==0x00002000)){
to_bitField0_|=0x00002000;
}
result.serverIpAddr_=serverIpAddr_;
if(((from_bitField0_&0x00004000)==0x00004000)){
to_bitField0_|=0x00004000;
}
result.directionMask_=directionMask_;
if(((from_bitField0_&0x00008000)==0x00008000)){
to_bitField0_|=0x00008000;
}
result.app_=app_;
if(((from_bitField0_&0x00010000)==0x00010000)){
to_bitField0_|=0x00010000;
}
result.clientCountryId_=clientCountryId_;
if(((from_bitField0_&0x00020000)==0x00020000)){
to_bitField0_|=0x00020000;
}
result.clientNetsegmentId_=clientNetsegmentId_;
if(((from_bitField0_&0x00040000)==0x00040000)){
to_bitField0_|=0x00040000;
}
result.clientTotalPacket_=clientTotalPacket_;
if(((from_bitField0_&0x00080000)==0x00080000)){
to_bitField0_|=0x00080000;
}
result.clientIpAddr_=clientIpAddr_;
if(((from_bitField0_&0x00100000)==0x00100000)){
to_bitField0_|=0x00100000;
}
result.tcpStatus_=tcpStatus_;
if(((from_bitField0_&0x00200000)==0x00200000)){
to_bitField0_|=0x00200000;
}
result.serverCountryId_=serverCountryId_;
if(((from_bitField0_&0x00400000)==0x00400000)){
to_bitField0_|=0x00400000;
}
result.serverNetsegmentId_=serverNetsegmentId_;
if(((from_bitField0_&0x00800000)==0x00800000)){
to_bitField0_|=0x00800000;
}
result.avgPktSize_=avgPktSize_;
if(((from_bitField0_&0x01000000)==0x01000000)){
to_bitField0_|=0x01000000;
}
result.serverPort_=serverPort_;
if(((from_bitField0_&0x02000000)==0x02000000)){
to_bitField0_|=0x02000000;
}
result.serverTotalByte_=serverTotalByte_;
if(((from_bitField0_&0x04000000)==0x04000000)){
to_bitField0_|=0x04000000;
}
result.totalPacketps_=totalPacketps_;
result.bitField0_=to_bitField0_;
onBuilt();
returnresult;
}
publicBuilderclone(){
return(Builder)super.clone();
}
publicBuildersetField(
com.google.protobuf.Descriptors.FieldDescriptorfield,
Objectvalue){
return(Builder)super.setField(field,value);
}
publicBuilderclearField(
com.google.protobuf.Descriptors.FieldDescriptorfield){
return(Builder)super.clearField(field);
}
publicBuilderclearOneof(
com.google.protobuf.Descriptors.OneofDescriptoroneof){
return(Builder)super.clearOneof(oneof);
}
publicBuildersetRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptorfield,
intindex,Objectvalue){
return(Builder)super.setRepeatedField(field,index,value);
}
publicBuilderaddRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptorfield,
Objectvalue){
return(Builder)super.addRepeatedField(field,value);
}
publicBuildermergeFrom(com.google.protobuf.Messageother){
if(otherinstanceofTCPLogOuterClass.TCPLog){
returnmergeFrom((TCPLogOuterClass.TCPLog)other);
}else{
super.mergeFrom(other);
returnthis;
}
}
publicBuildermergeFrom(TCPLogOuterClass.TCPLogother){
if(other==TCPLogOuterClass.TCPLog.getDefaultInstance())returnthis;
if(other.hasTotalByteps()){
setTotalByteps(other.getTotalByteps());
}
if(other.hasFlowStartTime()){
setFlowStartTime(other.getFlowStartTime());
}
if(other.hasDate()){
setDate(other.getDate());
}
if(other.hasServerTotalPacket()){
setServerTotalPacket(other.getServerTotalPacket());
}
if(other.hasClientTotalByte()){
setClientTotalByte(other.getClientTotalByte());
}
if(other.hasLinkId()){
setLinkId(other.getLinkId());
}
if(other.hasTotalByte()){
setTotalByte(other.getTotalByte());
}
if(other.hasFlowEndTime()){
setFlowEndTime(other.getFlowEndTime());
}
if(other.hasClientPort()){
setClientPort(other.getClientPort());
}
if(other.hasProtocol()){
setProtocol(other.getProtocol());
}
if(other.hasTotalPacket()){
setTotalPacket(other.getTotalPacket());
}
if(other.hasFlowDuration()){
setFlowDuration(other.getFlowDuration());
}
if(other.hasId()){
bitField0_|=0x00001000;
id_=other.id_;
onChanged();
}
if(other.hasServerIpAddr()){
bitField0_|=0x00002000;
serverIpAddr_=other.serverIpAddr_;
onChanged();
}
if(other.hasDirectionMask()){
bitField0_|=0x00004000;
directionMask_=other.directionMask_;
onChanged();
}
if(other.hasApp()){
setApp(other.getApp());
}
if(other.hasClientCountryId()){
setClientCountryId(other.getClientCountryId());
}
if(other.hasClientNetsegmentId()){
setClientNetsegmentId(other.getClientNetsegmentId());
}
if(other.hasClientTotalPacket()){
setClientTotalPacket(other.getClientTotalPacket());
}
if(other.hasClientIpAddr()){
bitField0_|=0x00080000;
clientIpAddr_=other.clientIpAddr_;
onChanged();
}
if(other.hasTcpStatus()){
setTcpStatus(other.getTcpStatus());
}
if(other.hasServerCountryId()){
setServerCountryId(other.getServerCountryId());
}
if(other.hasServerNetsegmentId()){
setServerNetsegmentId(other.getServerNetsegmentId());
}
if(other.hasAvgPktSize()){
setAvgPktSize(other.getAvgPktSize());
}
if(other.hasServerPort()){
setServerPort(other.getServerPort());
}
if(other.hasServerTotalByte()){
setServerTotalByte(other.getServerTotalByte());
}
if(other.hasTotalPacketps()){
setTotalPacketps(other.getTotalPacketps());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
returnthis;
}
publicfinalbooleanisInitialized(){
returntrue;
}
publicBuildermergeFrom(
com.google.protobuf.CodedInputStreaminput,
com.google.protobuf.ExtensionRegistryLiteextensionRegistry)
throwsjava.io.IOException{
TCPLogOuterClass.TCPLogparsedMessage=null;
try{
parsedMessage=PARSER.parsePartialFrom(input,extensionRegistry);
}catch(com.google.protobuf.InvalidProtocolBufferExceptione){
parsedMessage=(TCPLogOuterClass.TCPLog)e.getUnfinishedMessage();
throwe.unwrapIOException();
}finally{
if(parsedMessage!=null){
mergeFrom(parsedMessage);
}
}
returnthis;
}
privateintbitField0_;
privateinttotalByteps_;
/**
*optionalint32total_byteps=1;
*/
publicbooleanhasTotalByteps(){
return((bitField0_&0x00000001)==0x00000001);
}
/**
*optionalint32total_byteps=1;
*/
publicintgetTotalByteps(){
returntotalByteps_;
}
/**
*optionalint32total_byteps=1;
*/
publicBuildersetTotalByteps(intvalue){
bitField0_|=0x00000001;
totalByteps_=value;
onChanged();
returnthis;
}
/**
*optionalint32total_byteps=1;
*/
publicBuilderclearTotalByteps(){
bitField0_=(bitField0_&~0x00000001);
totalByteps_=0;
onChanged();
returnthis;
}
privatelongflowStartTime_;
/**
*optionalint64flow_start_time=2;
*/
publicbooleanhasFlowStartTime(){
return((bitField0_&0x00000002)==0x00000002);
}
/**
*optionalint64flow_start_time=2;
*/
publiclonggetFlowStartTime(){
returnflowStartTime_;
}
/**
*optionalint64flow_start_time=2;
*/
publicBuildersetFlowStartTime(longvalue){
bitField0_|=0x00000002;
flowStartTime_=value;
onChanged();
returnthis;
}
/**
*optionalint64flow_start_time=2;
*/
publicBuilderclearFlowStartTime(){
bitField0_=(bitField0_&~0x00000002);
flowStartTime_=0L;
onChanged();
returnthis;
}
privatelongdate_;
/**
*optionalint64date=3;
*/
publicbooleanhasDate(){
return((bitField0_&0x00000004)==0x