From 55c3491aeb8982fd40caf2864632ad709f98e26d Mon Sep 17 00:00:00 2001 From: eson Date: Thu, 9 Jun 2022 18:10:52 +0800 Subject: [PATCH] =?UTF-8?q?TODO:=20=E6=B5=8B=E8=AF=95grpc=20c++=E4=BA=92?= =?UTF-8?q?=E7=9B=B8=E8=B0=83=E6=95=B4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 25 +- proto_grpc.sh | 9 - .../dataflow/grpc/CollectPackets.java | 25 + .../com/yuandian/dataflow/master/Header.java | 104 +- .../proto/ApmBaseDataFlowOuterClass.java | 4022 +++++++++++++++++ .../com/yuandian/dataflow/proto/Base.java | 2077 +++++++++ .../proto/CollectPacketsServerGrpc.java | 269 ++ .../proto/decode/ApmBaseDataFlow.java | 289 -- .../dataflow/proto/decode/AppFlow.java | 100 - .../proto/decode/BacktrackingFlow.java | 95 - .../proto/decode/BasicTrafficFlow.java | 73 - .../proto/decode/BusinessBodyData.java | 29 - .../dataflow/proto/decode/BussFlowDb.java | 231 - .../proto/decode/BussFlowExternal.java | 137 - .../dataflow/proto/decode/BussFlowMidd.java | 250 - .../dataflow/proto/decode/BussFlowOrl.java | 111 - .../dataflow/proto/decode/BussFlowWeb.java | 353 -- .../dataflow/proto/decode/DataBaseModel.java | 381 -- .../dataflow/proto/decode/DataFlow.java | 112 - .../dataflow/proto/decode/PacketBase.java | 80 - .../dataflow/proto/decode/PacketHeader.java | 55 - .../dataflow/proto/decode/QoeFlow.java | 156 - .../dataflow/proto/decode/SstFlow.java | 115 - .../yuandian/dataflow/proto/decode/utils.java | 22 - src/main/proto/ApmBaseDataFlow.proto | 168 + src/main/proto/Base.proto | 25 + 26 files changed, 6691 insertions(+), 2622 deletions(-) delete mode 100755 proto_grpc.sh create mode 100644 src/main/java/com/yuandian/dataflow/grpc/CollectPackets.java create mode 100644 src/main/java/com/yuandian/dataflow/proto/ApmBaseDataFlowOuterClass.java create mode 100644 src/main/java/com/yuandian/dataflow/proto/Base.java create mode 100644 src/main/java/com/yuandian/dataflow/proto/CollectPacketsServerGrpc.java delete mode 100644 src/main/java/com/yuandian/dataflow/proto/decode/ApmBaseDataFlow.java delete mode 100644 src/main/java/com/yuandian/dataflow/proto/decode/AppFlow.java delete mode 100644 src/main/java/com/yuandian/dataflow/proto/decode/BacktrackingFlow.java delete mode 100644 src/main/java/com/yuandian/dataflow/proto/decode/BasicTrafficFlow.java delete mode 100644 src/main/java/com/yuandian/dataflow/proto/decode/BusinessBodyData.java delete mode 100644 src/main/java/com/yuandian/dataflow/proto/decode/BussFlowDb.java delete mode 100644 src/main/java/com/yuandian/dataflow/proto/decode/BussFlowExternal.java delete mode 100644 src/main/java/com/yuandian/dataflow/proto/decode/BussFlowMidd.java delete mode 100644 src/main/java/com/yuandian/dataflow/proto/decode/BussFlowOrl.java delete mode 100644 src/main/java/com/yuandian/dataflow/proto/decode/BussFlowWeb.java delete mode 100644 src/main/java/com/yuandian/dataflow/proto/decode/DataBaseModel.java delete mode 100644 src/main/java/com/yuandian/dataflow/proto/decode/DataFlow.java delete mode 100644 src/main/java/com/yuandian/dataflow/proto/decode/PacketBase.java delete mode 100644 src/main/java/com/yuandian/dataflow/proto/decode/PacketHeader.java delete mode 100644 src/main/java/com/yuandian/dataflow/proto/decode/QoeFlow.java delete mode 100644 src/main/java/com/yuandian/dataflow/proto/decode/SstFlow.java delete mode 100644 src/main/java/com/yuandian/dataflow/proto/decode/utils.java create mode 100644 src/main/proto/ApmBaseDataFlow.proto create mode 100644 src/main/proto/Base.proto diff --git a/pom.xml b/pom.xml index 8066b66..425beef 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,14 @@ - + @@ -133,16 +140,17 @@ 1.6.2 - + org.springframework.boot spring-boot-maven-plugin diff --git a/proto_grpc.sh b/proto_grpc.sh deleted file mode 100755 index 81013b0..0000000 --- a/proto_grpc.sh +++ /dev/null @@ -1,9 +0,0 @@ -#! /bin/bash -# OUTPUT_FILE="./src/main/java/" - -# for PROTOFILE in `find ./src -name "*.proto"` -# do -# protoc $PROTOFILE --plugin=/home/eson/workspace/dataflow/target/protoc-plugins --java_out=$OUTPUT_FILE --grpc-java_out=$OUTPUT_FILE -# done - -ln -sf ./target/gener \ No newline at end of file diff --git a/src/main/java/com/yuandian/dataflow/grpc/CollectPackets.java b/src/main/java/com/yuandian/dataflow/grpc/CollectPackets.java new file mode 100644 index 0000000..d4b67e0 --- /dev/null +++ b/src/main/java/com/yuandian/dataflow/grpc/CollectPackets.java @@ -0,0 +1,25 @@ +/** + * description + * + * @author eson + *2022年6月09日-16:29:17 + */ +package com.yuandian.dataflow.grpc; + +import com.yuandian.dataflow.proto.Base.Request; +import com.yuandian.dataflow.proto.Base.Response; +import com.yuandian.dataflow.proto.CollectPacketsServerGrpc.CollectPacketsServerImplBase; + +import io.grpc.stub.StreamObserver; + +/** + * description + * + * @author eson + *2022年6月09日-16:29:17 + */ +public class CollectPackets extends CollectPacketsServerImplBase { + + + +} diff --git a/src/main/java/com/yuandian/dataflow/master/Header.java b/src/main/java/com/yuandian/dataflow/master/Header.java index a1cdb8c..10dbf04 100644 --- a/src/main/java/com/yuandian/dataflow/master/Header.java +++ b/src/main/java/com/yuandian/dataflow/master/Header.java @@ -13,9 +13,11 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.ArrayList; -import com.yuandian.dataflow.proto.decode.PacketBase; -import com.yuandian.dataflow.proto.decode.PacketHeader; +// import com.yuandian.dataflow.proto.decode.PacketBase; +// import com.yuandian.dataflow.proto.decode.PacketHeader; +// import com.yuandian.dataflow.proto.decode.utils; +import io.netty.handler.codec.compression.ZlibDecoder; import lombok.Cleanup; import lombok.Getter; import lombok.Setter; @@ -40,25 +42,95 @@ public class Header { var in = new DataInputStream(sock.getInputStream()); var out = new DataOutputStream(sock.getOutputStream()); // 发送验证字符串 - out.write("public".getBytes()); - log.error("{}", PacketHeader.PacketCode(in)); - var pheader = new PacketHeader(in); + // out.write("public".getBytes()); + // log.error("{}", PacketHeader.PacketCode(in)); + // var pheader = new PacketHeader(in); - log.error("{}", pheader); - log.error("{}",PacketBase.createPacketBase(pheader)); + // log.error("{}", pheader); + // var pbase = PacketBase.createPacketBase(pheader); + // log.error("{}",pbase); - //60010流需要解压 - byte[] unzipbodydata = null; - if (pheader.getTableID() == 20) { - - pheader.parseNextHeader_60010(in); + // //60010流需要解压 + // byte[] unzipbodydata = null; + // if (pheader.getTableID() == 20) { + // pheader.parseNextHeader_60010(in); + // byte[] zipbodydata = in.readNBytes(pheader.getMsgLen()); + // unzipbodydata = utils.Inflate(zipbodydata); + // } - byte[] zipbodydata = new byte[packetHeader.getMsg_len()]; - readTillLength(zipbodydata, packetHeader.getMsg_len()); - unzipbodydata = ZlibUtil.Inflate(zipbodydata); + // for (int i = 0; i < pheader.getRecCount(); i++) { + // PacketBase dataBean = null; - } + // if (pheader.getTableID() >= 22 && pheader.getTableID() <= 24) { + // // 读取具体数据头信息,获取前四个字段值,第四个字段为整条数据的长度 字段长度分别为 4 1 4 4 + // // bodyhead = new byte[13]; + // // readTillLength(bodyhead, 13); + + // var p1 = ByteBuffer.wrap(in.readNBytes(4)).order(ByteOrder.LITTLE_ENDIAN).getInt(); + // var p2 = ByteBuffer.wrap(in.readNBytes(1)).order(ByteOrder.LITTLE_ENDIAN).getInt(); + // var p3 = ByteBuffer.wrap(in.readNBytes(4)).order(ByteOrder.LITTLE_ENDIAN).getInt(); + // var length = ByteBuffer.wrap(in.readNBytes(4)).order(ByteOrder.LITTLE_ENDIAN).getInt(); + + // if (length <= 13) { + // log.error("[{}:{}][数据总条数:{}][当前解析第{}条][length<13][探针发包有问题]"); + // throw new Exception("数据解析异常"); + // } + + // // 解析数据 + // dataBean = pbase.Parse(pheader, ByteBuffer.wrap(in.readNBytes(length - 13))); + // } else if (pheader.getTableID() == 25) { + + // var nowtype = ByteBuffer.wrap(in.readNBytes(4)).order(ByteOrder.LITTLE_ENDIAN).getInt(); + // var p2 = ByteBuffer.wrap(in.readNBytes(1)).order(ByteOrder.LITTLE_ENDIAN).getInt(); + // var p3 = ByteBuffer.wrap(in.readNBytes(4)).order(ByteOrder.LITTLE_ENDIAN).getInt(); + // var length = ByteBuffer.wrap(in.readNBytes(4)).order(ByteOrder.LITTLE_ENDIAN).getInt(); + // pheader.setNowType(nowtype); + + + // if (length <= 13) { + // log.error("[{}:{}][数据总条数:{}][当前解析第{}条][length<13][探针发包有问题]"); + // throw new Exception("数据解析异常"); + // } + + // // 读取具体数据体信息 + // byte[] bodydata = new byte[length - 13]; + // readTillLength(bodydata, length - 13); + + // // 解析数据 + // dataBean = instance.Parse(pheader, bodydata, 0); + // } else if (pheader.getTableID() == 28 || pheader.getTableID() == 29) { //28或29为Apm流统计 + + // if (pheader.getTableID() == 28) { + // length = ApmBaseDataFlow.SIZE; + // } else { + // length = BasicTrafficFlow.SIZE; + // } + + // byte[] bodydata = new byte[length]; + // readTillLength(bodydata, length); + // dataBean = instance.Parse(pheader, bodydata, 0); + + // } else if (pheader.getTableID() == 17 || pheader.getTableID() == 18) { //18 为网络性能流 + // if (pheader.getTableID() == 17) { + // length = AppFlow.SIZE; + // } else if (pheader.getTableID() == 18) { + // length = QoeFlow.SIZE; + // } + // byte[] bodydata = new byte[length]; + // readTillLength(bodydata, length); + // dataBean = instance.Parse(pheader, bodydata, 0); + // } else if (pheader.getTableID() == 20) { + // int offset = i * SstFlow.SIZE; + // dataBean = instance.Parse(pheader, unzipbodydata, offset); + // } else { + // logger.info("不需要的数据类型:" + pheader.getTableID()); + // break; + // } + // if (dataBean != null) { + // tempBaseDatas.add(dataBean); + // } + // } } } diff --git a/src/main/java/com/yuandian/dataflow/proto/ApmBaseDataFlowOuterClass.java b/src/main/java/com/yuandian/dataflow/proto/ApmBaseDataFlowOuterClass.java new file mode 100644 index 0000000..247fb8a --- /dev/null +++ b/src/main/java/com/yuandian/dataflow/proto/ApmBaseDataFlowOuterClass.java @@ -0,0 +1,4022 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ApmBaseDataFlow.proto + +package com.yuandian.dataflow.proto; + +public final class ApmBaseDataFlowOuterClass { + private ApmBaseDataFlowOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ApmBaseDataFlowOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.yuandian.dataflow.proto.ApmBaseDataFlow) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 tableID = 1; + * @return The tableID. + */ + int getTableID(); + + /** + *
+     *四元组
+     * 
+ * + * int32 probeIf = 2; + * @return The probeIf. + */ + int getProbeIf(); + + /** + *
+     **
+     * 请求端口
+     * 
+ * + * int32 requestPort = 3; + * @return The requestPort. + */ + int getRequestPort(); + + /** + *
+     **
+     * 响应端口
+     * 
+ * + * int32 responsePort = 4; + * @return The responsePort. + */ + int getResponsePort(); + + /** + *
+     **
+     * 请求IP
+     * 
+ * + * int32 requestIp = 5; + * @return The requestIp. + */ + int getRequestIp(); + + /** + *
+     **
+     * 响应Ip
+     * 
+ * + * int32 responseIp = 6; + * @return The responseIp. + */ + int getResponseIp(); + + /** + *
+     **
+     * 源mac
+     * 
+ * + * int64 srcMac = 7; + * @return The srcMac. + */ + long getSrcMac(); + + /** + *
+     **
+     * 目的mac
+     * 
+ * + * int64 dstMac = 8; + * @return The dstMac. + */ + long getDstMac(); + + /** + *
+     **
+     * 链路编号
+     * 
+ * + * int32 vlanId = 9; + * @return The vlanId. + */ + int getVlanId(); + + /** + * int32 tvSec = 10; + * @return The tvSec. + */ + int getTvSec(); + + /** + * int32 tvUsec = 11; + * @return The tvUsec. + */ + int getTvUsec(); + + /** + *
+     **
+     * 开始时间
+     * 
+ * + * int32 startTm = 12; + * @return The startTm. + */ + int getStartTm(); + + /** + *
+     **
+     * 总字节数
+     * 
+ * + * int32 totalBytes = 13; + * @return The totalBytes. + */ + int getTotalBytes(); + + /** + *
+     **
+     * 总包数
+     * 
+ * + * int32 totalPackets = 14; + * @return The totalPackets. + */ + int getTotalPackets(); + + /** + *
+     **
+     * 总丢包数
+     * 
+ * + * int32 totalDropPackets = 15; + * @return The totalDropPackets. + */ + int getTotalDropPackets(); + + /** + *
+     **
+     * 重传延时
+     * 
+ * + * int32 retranTimeDelay = 16; + * @return The retranTimeDelay. + */ + int getRetranTimeDelay(); + + /** + *
+     **
+     * 客户端rtt
+     * 
+ * + * int32 clientRtt = 17; + * @return The clientRtt. + */ + int getClientRtt(); + + /** + *
+     **
+     * 服务端Rtt
+     * 
+ * + * int32 serverRtt = 18; + * @return The serverRtt. + */ + int getServerRtt(); + + /** + *
+     **
+     * 用户响应时间
+     * 
+ * + * int32 userResponseTime = 19; + * @return The userResponseTime. + */ + int getUserResponseTime(); + + /** + *
+     **
+     * 服务响应时间
+     * 
+ * + * int32 serverResponseTime = 20; + * @return The serverResponseTime. + */ + int getServerResponseTime(); + + /** + *
+     **
+     * tcp回话连接失败数
+     * 
+ * + * int32 conFail = 21; + * @return The conFail. + */ + int getConFail(); + + /** + *
+     **
+     * 服务端总字节数
+     * 
+ * + * int32 bytesIn = 23; + * @return The bytesIn. + */ + int getBytesIn(); + + /** + *
+     **
+     * 客户端总字节数
+     * 
+ * + * int32 bytesOut = 24; + * @return The bytesOut. + */ + int getBytesOut(); + + /** + *
+     **
+     * 探针推送时间
+     * 
+ * + * int32 timeFlag = 25; + * @return The timeFlag. + */ + int getTimeFlag(); + + /** + *
+     **
+     * 结束时间
+     * 
+ * + * int32 endTm = 26; + * @return The endTm. + */ + int getEndTm(); + + /** + *
+     **
+     * 结束时间微秒
+     * 
+ * + * int32 endTmUsec = 27; + * @return The endTmUsec. + */ + int getEndTmUsec(); + + /** + *
+     **
+     * 总响应数
+     * 
+ * + * int32 responNum = 28; + * @return The responNum. + */ + int getResponNum(); + + /** + *
+     **
+     * 客户端零窗口数
+     * 
+ * + * int32 csWindow = 29; + * @return The csWindow. + */ + int getCsWindow(); + + /** + *
+     **
+     * 服务端零窗口数
+     * 
+ * + * int32 scWindow = 30; + * @return The scWindow. + */ + int getScWindow(); + + /** + *
+     **
+     * 客户端重置数
+     * 
+ * + * int32 csReset = 31; + * @return The csReset. + */ + int getCsReset(); + + /** + *
+     **
+     * 服务端重置数
+     * 
+ * + * int32 scReset = 32; + * @return The scReset. + */ + int getScReset(); + + /** + *
+     **
+     * 客户端重传数
+     * 
+ * + * int32 csRetran = 33; + * @return The csRetran. + */ + int getCsRetran(); + + /** + *
+     **
+     * 服务端重传数
+     * 
+ * + * int32 scRetran = 34; + * @return The scRetran. + */ + int getScRetran(); + + /** + *
+     **
+     * 会话建立时间
+     * 
+ * + * int32 connSetupTm = 35; + * @return The connSetupTm. + */ + int getConnSetupTm(); + + /** + *
+     **
+     * 新建会话数
+     * 
+ * + * int32 newSession = 36; + * @return The newSession. + */ + int getNewSession(); + + /** + * int32 csAlert = 37; + * @return The csAlert. + */ + int getCsAlert(); + + /** + * int32 scAlert = 38; + * @return The scAlert. + */ + int getScAlert(); + + /** + * string protocal = 39; + * @return The protocal. + */ + java.lang.String getProtocal(); + /** + * string protocal = 39; + * @return The bytes for protocal. + */ + com.google.protobuf.ByteString + getProtocalBytes(); + } + /** + * Protobuf type {@code com.yuandian.dataflow.proto.ApmBaseDataFlow} + */ + public static final class ApmBaseDataFlow extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.yuandian.dataflow.proto.ApmBaseDataFlow) + ApmBaseDataFlowOrBuilder { + private static final long serialVersionUID = 0L; + // Use ApmBaseDataFlow.newBuilder() to construct. + private ApmBaseDataFlow(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ApmBaseDataFlow() { + protocal_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ApmBaseDataFlow(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ApmBaseDataFlow( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + tableID_ = input.readInt32(); + break; + } + case 16: { + + probeIf_ = input.readInt32(); + break; + } + case 24: { + + requestPort_ = input.readInt32(); + break; + } + case 32: { + + responsePort_ = input.readInt32(); + break; + } + case 40: { + + requestIp_ = input.readInt32(); + break; + } + case 48: { + + responseIp_ = input.readInt32(); + break; + } + case 56: { + + srcMac_ = input.readInt64(); + break; + } + case 64: { + + dstMac_ = input.readInt64(); + break; + } + case 72: { + + vlanId_ = input.readInt32(); + break; + } + case 80: { + + tvSec_ = input.readInt32(); + break; + } + case 88: { + + tvUsec_ = input.readInt32(); + break; + } + case 96: { + + startTm_ = input.readInt32(); + break; + } + case 104: { + + totalBytes_ = input.readInt32(); + break; + } + case 112: { + + totalPackets_ = input.readInt32(); + break; + } + case 120: { + + totalDropPackets_ = input.readInt32(); + break; + } + case 128: { + + retranTimeDelay_ = input.readInt32(); + break; + } + case 136: { + + clientRtt_ = input.readInt32(); + break; + } + case 144: { + + serverRtt_ = input.readInt32(); + break; + } + case 152: { + + userResponseTime_ = input.readInt32(); + break; + } + case 160: { + + serverResponseTime_ = input.readInt32(); + break; + } + case 168: { + + conFail_ = input.readInt32(); + break; + } + case 184: { + + bytesIn_ = input.readInt32(); + break; + } + case 192: { + + bytesOut_ = input.readInt32(); + break; + } + case 200: { + + timeFlag_ = input.readInt32(); + break; + } + case 208: { + + endTm_ = input.readInt32(); + break; + } + case 216: { + + endTmUsec_ = input.readInt32(); + break; + } + case 224: { + + responNum_ = input.readInt32(); + break; + } + case 232: { + + csWindow_ = input.readInt32(); + break; + } + case 240: { + + scWindow_ = input.readInt32(); + break; + } + case 248: { + + csReset_ = input.readInt32(); + break; + } + case 256: { + + scReset_ = input.readInt32(); + break; + } + case 264: { + + csRetran_ = input.readInt32(); + break; + } + case 272: { + + scRetran_ = input.readInt32(); + break; + } + case 280: { + + connSetupTm_ = input.readInt32(); + break; + } + case 288: { + + newSession_ = input.readInt32(); + break; + } + case 296: { + + csAlert_ = input.readInt32(); + break; + } + case 304: { + + scAlert_ = input.readInt32(); + break; + } + case 314: { + java.lang.String s = input.readStringRequireUtf8(); + + protocal_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.internal_static_com_yuandian_dataflow_proto_ApmBaseDataFlow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.internal_static_com_yuandian_dataflow_proto_ApmBaseDataFlow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow.class, com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow.Builder.class); + } + + public static final int TABLEID_FIELD_NUMBER = 1; + private int tableID_; + /** + * int32 tableID = 1; + * @return The tableID. + */ + @java.lang.Override + public int getTableID() { + return tableID_; + } + + public static final int PROBEIF_FIELD_NUMBER = 2; + private int probeIf_; + /** + *
+     *四元组
+     * 
+ * + * int32 probeIf = 2; + * @return The probeIf. + */ + @java.lang.Override + public int getProbeIf() { + return probeIf_; + } + + public static final int REQUESTPORT_FIELD_NUMBER = 3; + private int requestPort_; + /** + *
+     **
+     * 请求端口
+     * 
+ * + * int32 requestPort = 3; + * @return The requestPort. + */ + @java.lang.Override + public int getRequestPort() { + return requestPort_; + } + + public static final int RESPONSEPORT_FIELD_NUMBER = 4; + private int responsePort_; + /** + *
+     **
+     * 响应端口
+     * 
+ * + * int32 responsePort = 4; + * @return The responsePort. + */ + @java.lang.Override + public int getResponsePort() { + return responsePort_; + } + + public static final int REQUESTIP_FIELD_NUMBER = 5; + private int requestIp_; + /** + *
+     **
+     * 请求IP
+     * 
+ * + * int32 requestIp = 5; + * @return The requestIp. + */ + @java.lang.Override + public int getRequestIp() { + return requestIp_; + } + + public static final int RESPONSEIP_FIELD_NUMBER = 6; + private int responseIp_; + /** + *
+     **
+     * 响应Ip
+     * 
+ * + * int32 responseIp = 6; + * @return The responseIp. + */ + @java.lang.Override + public int getResponseIp() { + return responseIp_; + } + + public static final int SRCMAC_FIELD_NUMBER = 7; + private long srcMac_; + /** + *
+     **
+     * 源mac
+     * 
+ * + * int64 srcMac = 7; + * @return The srcMac. + */ + @java.lang.Override + public long getSrcMac() { + return srcMac_; + } + + public static final int DSTMAC_FIELD_NUMBER = 8; + private long dstMac_; + /** + *
+     **
+     * 目的mac
+     * 
+ * + * int64 dstMac = 8; + * @return The dstMac. + */ + @java.lang.Override + public long getDstMac() { + return dstMac_; + } + + public static final int VLANID_FIELD_NUMBER = 9; + private int vlanId_; + /** + *
+     **
+     * 链路编号
+     * 
+ * + * int32 vlanId = 9; + * @return The vlanId. + */ + @java.lang.Override + public int getVlanId() { + return vlanId_; + } + + public static final int TVSEC_FIELD_NUMBER = 10; + private int tvSec_; + /** + * int32 tvSec = 10; + * @return The tvSec. + */ + @java.lang.Override + public int getTvSec() { + return tvSec_; + } + + public static final int TVUSEC_FIELD_NUMBER = 11; + private int tvUsec_; + /** + * int32 tvUsec = 11; + * @return The tvUsec. + */ + @java.lang.Override + public int getTvUsec() { + return tvUsec_; + } + + public static final int STARTTM_FIELD_NUMBER = 12; + private int startTm_; + /** + *
+     **
+     * 开始时间
+     * 
+ * + * int32 startTm = 12; + * @return The startTm. + */ + @java.lang.Override + public int getStartTm() { + return startTm_; + } + + public static final int TOTALBYTES_FIELD_NUMBER = 13; + private int totalBytes_; + /** + *
+     **
+     * 总字节数
+     * 
+ * + * int32 totalBytes = 13; + * @return The totalBytes. + */ + @java.lang.Override + public int getTotalBytes() { + return totalBytes_; + } + + public static final int TOTALPACKETS_FIELD_NUMBER = 14; + private int totalPackets_; + /** + *
+     **
+     * 总包数
+     * 
+ * + * int32 totalPackets = 14; + * @return The totalPackets. + */ + @java.lang.Override + public int getTotalPackets() { + return totalPackets_; + } + + public static final int TOTALDROPPACKETS_FIELD_NUMBER = 15; + private int totalDropPackets_; + /** + *
+     **
+     * 总丢包数
+     * 
+ * + * int32 totalDropPackets = 15; + * @return The totalDropPackets. + */ + @java.lang.Override + public int getTotalDropPackets() { + return totalDropPackets_; + } + + public static final int RETRANTIMEDELAY_FIELD_NUMBER = 16; + private int retranTimeDelay_; + /** + *
+     **
+     * 重传延时
+     * 
+ * + * int32 retranTimeDelay = 16; + * @return The retranTimeDelay. + */ + @java.lang.Override + public int getRetranTimeDelay() { + return retranTimeDelay_; + } + + public static final int CLIENTRTT_FIELD_NUMBER = 17; + private int clientRtt_; + /** + *
+     **
+     * 客户端rtt
+     * 
+ * + * int32 clientRtt = 17; + * @return The clientRtt. + */ + @java.lang.Override + public int getClientRtt() { + return clientRtt_; + } + + public static final int SERVERRTT_FIELD_NUMBER = 18; + private int serverRtt_; + /** + *
+     **
+     * 服务端Rtt
+     * 
+ * + * int32 serverRtt = 18; + * @return The serverRtt. + */ + @java.lang.Override + public int getServerRtt() { + return serverRtt_; + } + + public static final int USERRESPONSETIME_FIELD_NUMBER = 19; + private int userResponseTime_; + /** + *
+     **
+     * 用户响应时间
+     * 
+ * + * int32 userResponseTime = 19; + * @return The userResponseTime. + */ + @java.lang.Override + public int getUserResponseTime() { + return userResponseTime_; + } + + public static final int SERVERRESPONSETIME_FIELD_NUMBER = 20; + private int serverResponseTime_; + /** + *
+     **
+     * 服务响应时间
+     * 
+ * + * int32 serverResponseTime = 20; + * @return The serverResponseTime. + */ + @java.lang.Override + public int getServerResponseTime() { + return serverResponseTime_; + } + + public static final int CONFAIL_FIELD_NUMBER = 21; + private int conFail_; + /** + *
+     **
+     * tcp回话连接失败数
+     * 
+ * + * int32 conFail = 21; + * @return The conFail. + */ + @java.lang.Override + public int getConFail() { + return conFail_; + } + + public static final int BYTESIN_FIELD_NUMBER = 23; + private int bytesIn_; + /** + *
+     **
+     * 服务端总字节数
+     * 
+ * + * int32 bytesIn = 23; + * @return The bytesIn. + */ + @java.lang.Override + public int getBytesIn() { + return bytesIn_; + } + + public static final int BYTESOUT_FIELD_NUMBER = 24; + private int bytesOut_; + /** + *
+     **
+     * 客户端总字节数
+     * 
+ * + * int32 bytesOut = 24; + * @return The bytesOut. + */ + @java.lang.Override + public int getBytesOut() { + return bytesOut_; + } + + public static final int TIMEFLAG_FIELD_NUMBER = 25; + private int timeFlag_; + /** + *
+     **
+     * 探针推送时间
+     * 
+ * + * int32 timeFlag = 25; + * @return The timeFlag. + */ + @java.lang.Override + public int getTimeFlag() { + return timeFlag_; + } + + public static final int ENDTM_FIELD_NUMBER = 26; + private int endTm_; + /** + *
+     **
+     * 结束时间
+     * 
+ * + * int32 endTm = 26; + * @return The endTm. + */ + @java.lang.Override + public int getEndTm() { + return endTm_; + } + + public static final int ENDTMUSEC_FIELD_NUMBER = 27; + private int endTmUsec_; + /** + *
+     **
+     * 结束时间微秒
+     * 
+ * + * int32 endTmUsec = 27; + * @return The endTmUsec. + */ + @java.lang.Override + public int getEndTmUsec() { + return endTmUsec_; + } + + public static final int RESPONNUM_FIELD_NUMBER = 28; + private int responNum_; + /** + *
+     **
+     * 总响应数
+     * 
+ * + * int32 responNum = 28; + * @return The responNum. + */ + @java.lang.Override + public int getResponNum() { + return responNum_; + } + + public static final int CSWINDOW_FIELD_NUMBER = 29; + private int csWindow_; + /** + *
+     **
+     * 客户端零窗口数
+     * 
+ * + * int32 csWindow = 29; + * @return The csWindow. + */ + @java.lang.Override + public int getCsWindow() { + return csWindow_; + } + + public static final int SCWINDOW_FIELD_NUMBER = 30; + private int scWindow_; + /** + *
+     **
+     * 服务端零窗口数
+     * 
+ * + * int32 scWindow = 30; + * @return The scWindow. + */ + @java.lang.Override + public int getScWindow() { + return scWindow_; + } + + public static final int CSRESET_FIELD_NUMBER = 31; + private int csReset_; + /** + *
+     **
+     * 客户端重置数
+     * 
+ * + * int32 csReset = 31; + * @return The csReset. + */ + @java.lang.Override + public int getCsReset() { + return csReset_; + } + + public static final int SCRESET_FIELD_NUMBER = 32; + private int scReset_; + /** + *
+     **
+     * 服务端重置数
+     * 
+ * + * int32 scReset = 32; + * @return The scReset. + */ + @java.lang.Override + public int getScReset() { + return scReset_; + } + + public static final int CSRETRAN_FIELD_NUMBER = 33; + private int csRetran_; + /** + *
+     **
+     * 客户端重传数
+     * 
+ * + * int32 csRetran = 33; + * @return The csRetran. + */ + @java.lang.Override + public int getCsRetran() { + return csRetran_; + } + + public static final int SCRETRAN_FIELD_NUMBER = 34; + private int scRetran_; + /** + *
+     **
+     * 服务端重传数
+     * 
+ * + * int32 scRetran = 34; + * @return The scRetran. + */ + @java.lang.Override + public int getScRetran() { + return scRetran_; + } + + public static final int CONNSETUPTM_FIELD_NUMBER = 35; + private int connSetupTm_; + /** + *
+     **
+     * 会话建立时间
+     * 
+ * + * int32 connSetupTm = 35; + * @return The connSetupTm. + */ + @java.lang.Override + public int getConnSetupTm() { + return connSetupTm_; + } + + public static final int NEWSESSION_FIELD_NUMBER = 36; + private int newSession_; + /** + *
+     **
+     * 新建会话数
+     * 
+ * + * int32 newSession = 36; + * @return The newSession. + */ + @java.lang.Override + public int getNewSession() { + return newSession_; + } + + public static final int CSALERT_FIELD_NUMBER = 37; + private int csAlert_; + /** + * int32 csAlert = 37; + * @return The csAlert. + */ + @java.lang.Override + public int getCsAlert() { + return csAlert_; + } + + public static final int SCALERT_FIELD_NUMBER = 38; + private int scAlert_; + /** + * int32 scAlert = 38; + * @return The scAlert. + */ + @java.lang.Override + public int getScAlert() { + return scAlert_; + } + + public static final int PROTOCAL_FIELD_NUMBER = 39; + private volatile java.lang.Object protocal_; + /** + * string protocal = 39; + * @return The protocal. + */ + @java.lang.Override + public java.lang.String getProtocal() { + java.lang.Object ref = protocal_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + protocal_ = s; + return s; + } + } + /** + * string protocal = 39; + * @return The bytes for protocal. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getProtocalBytes() { + java.lang.Object ref = protocal_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + protocal_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (tableID_ != 0) { + output.writeInt32(1, tableID_); + } + if (probeIf_ != 0) { + output.writeInt32(2, probeIf_); + } + if (requestPort_ != 0) { + output.writeInt32(3, requestPort_); + } + if (responsePort_ != 0) { + output.writeInt32(4, responsePort_); + } + if (requestIp_ != 0) { + output.writeInt32(5, requestIp_); + } + if (responseIp_ != 0) { + output.writeInt32(6, responseIp_); + } + if (srcMac_ != 0L) { + output.writeInt64(7, srcMac_); + } + if (dstMac_ != 0L) { + output.writeInt64(8, dstMac_); + } + if (vlanId_ != 0) { + output.writeInt32(9, vlanId_); + } + if (tvSec_ != 0) { + output.writeInt32(10, tvSec_); + } + if (tvUsec_ != 0) { + output.writeInt32(11, tvUsec_); + } + if (startTm_ != 0) { + output.writeInt32(12, startTm_); + } + if (totalBytes_ != 0) { + output.writeInt32(13, totalBytes_); + } + if (totalPackets_ != 0) { + output.writeInt32(14, totalPackets_); + } + if (totalDropPackets_ != 0) { + output.writeInt32(15, totalDropPackets_); + } + if (retranTimeDelay_ != 0) { + output.writeInt32(16, retranTimeDelay_); + } + if (clientRtt_ != 0) { + output.writeInt32(17, clientRtt_); + } + if (serverRtt_ != 0) { + output.writeInt32(18, serverRtt_); + } + if (userResponseTime_ != 0) { + output.writeInt32(19, userResponseTime_); + } + if (serverResponseTime_ != 0) { + output.writeInt32(20, serverResponseTime_); + } + if (conFail_ != 0) { + output.writeInt32(21, conFail_); + } + if (bytesIn_ != 0) { + output.writeInt32(23, bytesIn_); + } + if (bytesOut_ != 0) { + output.writeInt32(24, bytesOut_); + } + if (timeFlag_ != 0) { + output.writeInt32(25, timeFlag_); + } + if (endTm_ != 0) { + output.writeInt32(26, endTm_); + } + if (endTmUsec_ != 0) { + output.writeInt32(27, endTmUsec_); + } + if (responNum_ != 0) { + output.writeInt32(28, responNum_); + } + if (csWindow_ != 0) { + output.writeInt32(29, csWindow_); + } + if (scWindow_ != 0) { + output.writeInt32(30, scWindow_); + } + if (csReset_ != 0) { + output.writeInt32(31, csReset_); + } + if (scReset_ != 0) { + output.writeInt32(32, scReset_); + } + if (csRetran_ != 0) { + output.writeInt32(33, csRetran_); + } + if (scRetran_ != 0) { + output.writeInt32(34, scRetran_); + } + if (connSetupTm_ != 0) { + output.writeInt32(35, connSetupTm_); + } + if (newSession_ != 0) { + output.writeInt32(36, newSession_); + } + if (csAlert_ != 0) { + output.writeInt32(37, csAlert_); + } + if (scAlert_ != 0) { + output.writeInt32(38, scAlert_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(protocal_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 39, protocal_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (tableID_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, tableID_); + } + if (probeIf_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, probeIf_); + } + if (requestPort_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, requestPort_); + } + if (responsePort_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, responsePort_); + } + if (requestIp_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, requestIp_); + } + if (responseIp_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, responseIp_); + } + if (srcMac_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(7, srcMac_); + } + if (dstMac_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(8, dstMac_); + } + if (vlanId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(9, vlanId_); + } + if (tvSec_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(10, tvSec_); + } + if (tvUsec_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(11, tvUsec_); + } + if (startTm_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(12, startTm_); + } + if (totalBytes_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(13, totalBytes_); + } + if (totalPackets_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(14, totalPackets_); + } + if (totalDropPackets_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(15, totalDropPackets_); + } + if (retranTimeDelay_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(16, retranTimeDelay_); + } + if (clientRtt_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(17, clientRtt_); + } + if (serverRtt_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(18, serverRtt_); + } + if (userResponseTime_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(19, userResponseTime_); + } + if (serverResponseTime_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(20, serverResponseTime_); + } + if (conFail_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(21, conFail_); + } + if (bytesIn_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(23, bytesIn_); + } + if (bytesOut_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(24, bytesOut_); + } + if (timeFlag_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(25, timeFlag_); + } + if (endTm_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(26, endTm_); + } + if (endTmUsec_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(27, endTmUsec_); + } + if (responNum_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(28, responNum_); + } + if (csWindow_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(29, csWindow_); + } + if (scWindow_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(30, scWindow_); + } + if (csReset_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(31, csReset_); + } + if (scReset_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(32, scReset_); + } + if (csRetran_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(33, csRetran_); + } + if (scRetran_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(34, scRetran_); + } + if (connSetupTm_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(35, connSetupTm_); + } + if (newSession_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(36, newSession_); + } + if (csAlert_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(37, csAlert_); + } + if (scAlert_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(38, scAlert_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(protocal_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(39, protocal_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow)) { + return super.equals(obj); + } + com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow other = (com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow) obj; + + if (getTableID() + != other.getTableID()) return false; + if (getProbeIf() + != other.getProbeIf()) return false; + if (getRequestPort() + != other.getRequestPort()) return false; + if (getResponsePort() + != other.getResponsePort()) return false; + if (getRequestIp() + != other.getRequestIp()) return false; + if (getResponseIp() + != other.getResponseIp()) return false; + if (getSrcMac() + != other.getSrcMac()) return false; + if (getDstMac() + != other.getDstMac()) return false; + if (getVlanId() + != other.getVlanId()) return false; + if (getTvSec() + != other.getTvSec()) return false; + if (getTvUsec() + != other.getTvUsec()) return false; + if (getStartTm() + != other.getStartTm()) return false; + if (getTotalBytes() + != other.getTotalBytes()) return false; + if (getTotalPackets() + != other.getTotalPackets()) return false; + if (getTotalDropPackets() + != other.getTotalDropPackets()) return false; + if (getRetranTimeDelay() + != other.getRetranTimeDelay()) return false; + if (getClientRtt() + != other.getClientRtt()) return false; + if (getServerRtt() + != other.getServerRtt()) return false; + if (getUserResponseTime() + != other.getUserResponseTime()) return false; + if (getServerResponseTime() + != other.getServerResponseTime()) return false; + if (getConFail() + != other.getConFail()) return false; + if (getBytesIn() + != other.getBytesIn()) return false; + if (getBytesOut() + != other.getBytesOut()) return false; + if (getTimeFlag() + != other.getTimeFlag()) return false; + if (getEndTm() + != other.getEndTm()) return false; + if (getEndTmUsec() + != other.getEndTmUsec()) return false; + if (getResponNum() + != other.getResponNum()) return false; + if (getCsWindow() + != other.getCsWindow()) return false; + if (getScWindow() + != other.getScWindow()) return false; + if (getCsReset() + != other.getCsReset()) return false; + if (getScReset() + != other.getScReset()) return false; + if (getCsRetran() + != other.getCsRetran()) return false; + if (getScRetran() + != other.getScRetran()) return false; + if (getConnSetupTm() + != other.getConnSetupTm()) return false; + if (getNewSession() + != other.getNewSession()) return false; + if (getCsAlert() + != other.getCsAlert()) return false; + if (getScAlert() + != other.getScAlert()) return false; + if (!getProtocal() + .equals(other.getProtocal())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TABLEID_FIELD_NUMBER; + hash = (53 * hash) + getTableID(); + hash = (37 * hash) + PROBEIF_FIELD_NUMBER; + hash = (53 * hash) + getProbeIf(); + hash = (37 * hash) + REQUESTPORT_FIELD_NUMBER; + hash = (53 * hash) + getRequestPort(); + hash = (37 * hash) + RESPONSEPORT_FIELD_NUMBER; + hash = (53 * hash) + getResponsePort(); + hash = (37 * hash) + REQUESTIP_FIELD_NUMBER; + hash = (53 * hash) + getRequestIp(); + hash = (37 * hash) + RESPONSEIP_FIELD_NUMBER; + hash = (53 * hash) + getResponseIp(); + hash = (37 * hash) + SRCMAC_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSrcMac()); + hash = (37 * hash) + DSTMAC_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getDstMac()); + hash = (37 * hash) + VLANID_FIELD_NUMBER; + hash = (53 * hash) + getVlanId(); + hash = (37 * hash) + TVSEC_FIELD_NUMBER; + hash = (53 * hash) + getTvSec(); + hash = (37 * hash) + TVUSEC_FIELD_NUMBER; + hash = (53 * hash) + getTvUsec(); + hash = (37 * hash) + STARTTM_FIELD_NUMBER; + hash = (53 * hash) + getStartTm(); + hash = (37 * hash) + TOTALBYTES_FIELD_NUMBER; + hash = (53 * hash) + getTotalBytes(); + hash = (37 * hash) + TOTALPACKETS_FIELD_NUMBER; + hash = (53 * hash) + getTotalPackets(); + hash = (37 * hash) + TOTALDROPPACKETS_FIELD_NUMBER; + hash = (53 * hash) + getTotalDropPackets(); + hash = (37 * hash) + RETRANTIMEDELAY_FIELD_NUMBER; + hash = (53 * hash) + getRetranTimeDelay(); + hash = (37 * hash) + CLIENTRTT_FIELD_NUMBER; + hash = (53 * hash) + getClientRtt(); + hash = (37 * hash) + SERVERRTT_FIELD_NUMBER; + hash = (53 * hash) + getServerRtt(); + hash = (37 * hash) + USERRESPONSETIME_FIELD_NUMBER; + hash = (53 * hash) + getUserResponseTime(); + hash = (37 * hash) + SERVERRESPONSETIME_FIELD_NUMBER; + hash = (53 * hash) + getServerResponseTime(); + hash = (37 * hash) + CONFAIL_FIELD_NUMBER; + hash = (53 * hash) + getConFail(); + hash = (37 * hash) + BYTESIN_FIELD_NUMBER; + hash = (53 * hash) + getBytesIn(); + hash = (37 * hash) + BYTESOUT_FIELD_NUMBER; + hash = (53 * hash) + getBytesOut(); + hash = (37 * hash) + TIMEFLAG_FIELD_NUMBER; + hash = (53 * hash) + getTimeFlag(); + hash = (37 * hash) + ENDTM_FIELD_NUMBER; + hash = (53 * hash) + getEndTm(); + hash = (37 * hash) + ENDTMUSEC_FIELD_NUMBER; + hash = (53 * hash) + getEndTmUsec(); + hash = (37 * hash) + RESPONNUM_FIELD_NUMBER; + hash = (53 * hash) + getResponNum(); + hash = (37 * hash) + CSWINDOW_FIELD_NUMBER; + hash = (53 * hash) + getCsWindow(); + hash = (37 * hash) + SCWINDOW_FIELD_NUMBER; + hash = (53 * hash) + getScWindow(); + hash = (37 * hash) + CSRESET_FIELD_NUMBER; + hash = (53 * hash) + getCsReset(); + hash = (37 * hash) + SCRESET_FIELD_NUMBER; + hash = (53 * hash) + getScReset(); + hash = (37 * hash) + CSRETRAN_FIELD_NUMBER; + hash = (53 * hash) + getCsRetran(); + hash = (37 * hash) + SCRETRAN_FIELD_NUMBER; + hash = (53 * hash) + getScRetran(); + hash = (37 * hash) + CONNSETUPTM_FIELD_NUMBER; + hash = (53 * hash) + getConnSetupTm(); + hash = (37 * hash) + NEWSESSION_FIELD_NUMBER; + hash = (53 * hash) + getNewSession(); + hash = (37 * hash) + CSALERT_FIELD_NUMBER; + hash = (53 * hash) + getCsAlert(); + hash = (37 * hash) + SCALERT_FIELD_NUMBER; + hash = (53 * hash) + getScAlert(); + hash = (37 * hash) + PROTOCAL_FIELD_NUMBER; + hash = (53 * hash) + getProtocal().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.yuandian.dataflow.proto.ApmBaseDataFlow} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.yuandian.dataflow.proto.ApmBaseDataFlow) + com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.internal_static_com_yuandian_dataflow_proto_ApmBaseDataFlow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.internal_static_com_yuandian_dataflow_proto_ApmBaseDataFlow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow.class, com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow.Builder.class); + } + + // Construct using com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + tableID_ = 0; + + probeIf_ = 0; + + requestPort_ = 0; + + responsePort_ = 0; + + requestIp_ = 0; + + responseIp_ = 0; + + srcMac_ = 0L; + + dstMac_ = 0L; + + vlanId_ = 0; + + tvSec_ = 0; + + tvUsec_ = 0; + + startTm_ = 0; + + totalBytes_ = 0; + + totalPackets_ = 0; + + totalDropPackets_ = 0; + + retranTimeDelay_ = 0; + + clientRtt_ = 0; + + serverRtt_ = 0; + + userResponseTime_ = 0; + + serverResponseTime_ = 0; + + conFail_ = 0; + + bytesIn_ = 0; + + bytesOut_ = 0; + + timeFlag_ = 0; + + endTm_ = 0; + + endTmUsec_ = 0; + + responNum_ = 0; + + csWindow_ = 0; + + scWindow_ = 0; + + csReset_ = 0; + + scReset_ = 0; + + csRetran_ = 0; + + scRetran_ = 0; + + connSetupTm_ = 0; + + newSession_ = 0; + + csAlert_ = 0; + + scAlert_ = 0; + + protocal_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.internal_static_com_yuandian_dataflow_proto_ApmBaseDataFlow_descriptor; + } + + @java.lang.Override + public com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow getDefaultInstanceForType() { + return com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow.getDefaultInstance(); + } + + @java.lang.Override + public com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow build() { + com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow buildPartial() { + com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow result = new com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow(this); + result.tableID_ = tableID_; + result.probeIf_ = probeIf_; + result.requestPort_ = requestPort_; + result.responsePort_ = responsePort_; + result.requestIp_ = requestIp_; + result.responseIp_ = responseIp_; + result.srcMac_ = srcMac_; + result.dstMac_ = dstMac_; + result.vlanId_ = vlanId_; + result.tvSec_ = tvSec_; + result.tvUsec_ = tvUsec_; + result.startTm_ = startTm_; + result.totalBytes_ = totalBytes_; + result.totalPackets_ = totalPackets_; + result.totalDropPackets_ = totalDropPackets_; + result.retranTimeDelay_ = retranTimeDelay_; + result.clientRtt_ = clientRtt_; + result.serverRtt_ = serverRtt_; + result.userResponseTime_ = userResponseTime_; + result.serverResponseTime_ = serverResponseTime_; + result.conFail_ = conFail_; + result.bytesIn_ = bytesIn_; + result.bytesOut_ = bytesOut_; + result.timeFlag_ = timeFlag_; + result.endTm_ = endTm_; + result.endTmUsec_ = endTmUsec_; + result.responNum_ = responNum_; + result.csWindow_ = csWindow_; + result.scWindow_ = scWindow_; + result.csReset_ = csReset_; + result.scReset_ = scReset_; + result.csRetran_ = csRetran_; + result.scRetran_ = scRetran_; + result.connSetupTm_ = connSetupTm_; + result.newSession_ = newSession_; + result.csAlert_ = csAlert_; + result.scAlert_ = scAlert_; + result.protocal_ = protocal_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow) { + return mergeFrom((com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow other) { + if (other == com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow.getDefaultInstance()) return this; + if (other.getTableID() != 0) { + setTableID(other.getTableID()); + } + if (other.getProbeIf() != 0) { + setProbeIf(other.getProbeIf()); + } + if (other.getRequestPort() != 0) { + setRequestPort(other.getRequestPort()); + } + if (other.getResponsePort() != 0) { + setResponsePort(other.getResponsePort()); + } + if (other.getRequestIp() != 0) { + setRequestIp(other.getRequestIp()); + } + if (other.getResponseIp() != 0) { + setResponseIp(other.getResponseIp()); + } + if (other.getSrcMac() != 0L) { + setSrcMac(other.getSrcMac()); + } + if (other.getDstMac() != 0L) { + setDstMac(other.getDstMac()); + } + if (other.getVlanId() != 0) { + setVlanId(other.getVlanId()); + } + if (other.getTvSec() != 0) { + setTvSec(other.getTvSec()); + } + if (other.getTvUsec() != 0) { + setTvUsec(other.getTvUsec()); + } + if (other.getStartTm() != 0) { + setStartTm(other.getStartTm()); + } + if (other.getTotalBytes() != 0) { + setTotalBytes(other.getTotalBytes()); + } + if (other.getTotalPackets() != 0) { + setTotalPackets(other.getTotalPackets()); + } + if (other.getTotalDropPackets() != 0) { + setTotalDropPackets(other.getTotalDropPackets()); + } + if (other.getRetranTimeDelay() != 0) { + setRetranTimeDelay(other.getRetranTimeDelay()); + } + if (other.getClientRtt() != 0) { + setClientRtt(other.getClientRtt()); + } + if (other.getServerRtt() != 0) { + setServerRtt(other.getServerRtt()); + } + if (other.getUserResponseTime() != 0) { + setUserResponseTime(other.getUserResponseTime()); + } + if (other.getServerResponseTime() != 0) { + setServerResponseTime(other.getServerResponseTime()); + } + if (other.getConFail() != 0) { + setConFail(other.getConFail()); + } + if (other.getBytesIn() != 0) { + setBytesIn(other.getBytesIn()); + } + if (other.getBytesOut() != 0) { + setBytesOut(other.getBytesOut()); + } + if (other.getTimeFlag() != 0) { + setTimeFlag(other.getTimeFlag()); + } + if (other.getEndTm() != 0) { + setEndTm(other.getEndTm()); + } + if (other.getEndTmUsec() != 0) { + setEndTmUsec(other.getEndTmUsec()); + } + if (other.getResponNum() != 0) { + setResponNum(other.getResponNum()); + } + if (other.getCsWindow() != 0) { + setCsWindow(other.getCsWindow()); + } + if (other.getScWindow() != 0) { + setScWindow(other.getScWindow()); + } + if (other.getCsReset() != 0) { + setCsReset(other.getCsReset()); + } + if (other.getScReset() != 0) { + setScReset(other.getScReset()); + } + if (other.getCsRetran() != 0) { + setCsRetran(other.getCsRetran()); + } + if (other.getScRetran() != 0) { + setScRetran(other.getScRetran()); + } + if (other.getConnSetupTm() != 0) { + setConnSetupTm(other.getConnSetupTm()); + } + if (other.getNewSession() != 0) { + setNewSession(other.getNewSession()); + } + if (other.getCsAlert() != 0) { + setCsAlert(other.getCsAlert()); + } + if (other.getScAlert() != 0) { + setScAlert(other.getScAlert()); + } + if (!other.getProtocal().isEmpty()) { + protocal_ = other.protocal_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int tableID_ ; + /** + * int32 tableID = 1; + * @return The tableID. + */ + @java.lang.Override + public int getTableID() { + return tableID_; + } + /** + * int32 tableID = 1; + * @param value The tableID to set. + * @return This builder for chaining. + */ + public Builder setTableID(int value) { + + tableID_ = value; + onChanged(); + return this; + } + /** + * int32 tableID = 1; + * @return This builder for chaining. + */ + public Builder clearTableID() { + + tableID_ = 0; + onChanged(); + return this; + } + + private int probeIf_ ; + /** + *
+       *四元组
+       * 
+ * + * int32 probeIf = 2; + * @return The probeIf. + */ + @java.lang.Override + public int getProbeIf() { + return probeIf_; + } + /** + *
+       *四元组
+       * 
+ * + * int32 probeIf = 2; + * @param value The probeIf to set. + * @return This builder for chaining. + */ + public Builder setProbeIf(int value) { + + probeIf_ = value; + onChanged(); + return this; + } + /** + *
+       *四元组
+       * 
+ * + * int32 probeIf = 2; + * @return This builder for chaining. + */ + public Builder clearProbeIf() { + + probeIf_ = 0; + onChanged(); + return this; + } + + private int requestPort_ ; + /** + *
+       **
+       * 请求端口
+       * 
+ * + * int32 requestPort = 3; + * @return The requestPort. + */ + @java.lang.Override + public int getRequestPort() { + return requestPort_; + } + /** + *
+       **
+       * 请求端口
+       * 
+ * + * int32 requestPort = 3; + * @param value The requestPort to set. + * @return This builder for chaining. + */ + public Builder setRequestPort(int value) { + + requestPort_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 请求端口
+       * 
+ * + * int32 requestPort = 3; + * @return This builder for chaining. + */ + public Builder clearRequestPort() { + + requestPort_ = 0; + onChanged(); + return this; + } + + private int responsePort_ ; + /** + *
+       **
+       * 响应端口
+       * 
+ * + * int32 responsePort = 4; + * @return The responsePort. + */ + @java.lang.Override + public int getResponsePort() { + return responsePort_; + } + /** + *
+       **
+       * 响应端口
+       * 
+ * + * int32 responsePort = 4; + * @param value The responsePort to set. + * @return This builder for chaining. + */ + public Builder setResponsePort(int value) { + + responsePort_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 响应端口
+       * 
+ * + * int32 responsePort = 4; + * @return This builder for chaining. + */ + public Builder clearResponsePort() { + + responsePort_ = 0; + onChanged(); + return this; + } + + private int requestIp_ ; + /** + *
+       **
+       * 请求IP
+       * 
+ * + * int32 requestIp = 5; + * @return The requestIp. + */ + @java.lang.Override + public int getRequestIp() { + return requestIp_; + } + /** + *
+       **
+       * 请求IP
+       * 
+ * + * int32 requestIp = 5; + * @param value The requestIp to set. + * @return This builder for chaining. + */ + public Builder setRequestIp(int value) { + + requestIp_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 请求IP
+       * 
+ * + * int32 requestIp = 5; + * @return This builder for chaining. + */ + public Builder clearRequestIp() { + + requestIp_ = 0; + onChanged(); + return this; + } + + private int responseIp_ ; + /** + *
+       **
+       * 响应Ip
+       * 
+ * + * int32 responseIp = 6; + * @return The responseIp. + */ + @java.lang.Override + public int getResponseIp() { + return responseIp_; + } + /** + *
+       **
+       * 响应Ip
+       * 
+ * + * int32 responseIp = 6; + * @param value The responseIp to set. + * @return This builder for chaining. + */ + public Builder setResponseIp(int value) { + + responseIp_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 响应Ip
+       * 
+ * + * int32 responseIp = 6; + * @return This builder for chaining. + */ + public Builder clearResponseIp() { + + responseIp_ = 0; + onChanged(); + return this; + } + + private long srcMac_ ; + /** + *
+       **
+       * 源mac
+       * 
+ * + * int64 srcMac = 7; + * @return The srcMac. + */ + @java.lang.Override + public long getSrcMac() { + return srcMac_; + } + /** + *
+       **
+       * 源mac
+       * 
+ * + * int64 srcMac = 7; + * @param value The srcMac to set. + * @return This builder for chaining. + */ + public Builder setSrcMac(long value) { + + srcMac_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 源mac
+       * 
+ * + * int64 srcMac = 7; + * @return This builder for chaining. + */ + public Builder clearSrcMac() { + + srcMac_ = 0L; + onChanged(); + return this; + } + + private long dstMac_ ; + /** + *
+       **
+       * 目的mac
+       * 
+ * + * int64 dstMac = 8; + * @return The dstMac. + */ + @java.lang.Override + public long getDstMac() { + return dstMac_; + } + /** + *
+       **
+       * 目的mac
+       * 
+ * + * int64 dstMac = 8; + * @param value The dstMac to set. + * @return This builder for chaining. + */ + public Builder setDstMac(long value) { + + dstMac_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 目的mac
+       * 
+ * + * int64 dstMac = 8; + * @return This builder for chaining. + */ + public Builder clearDstMac() { + + dstMac_ = 0L; + onChanged(); + return this; + } + + private int vlanId_ ; + /** + *
+       **
+       * 链路编号
+       * 
+ * + * int32 vlanId = 9; + * @return The vlanId. + */ + @java.lang.Override + public int getVlanId() { + return vlanId_; + } + /** + *
+       **
+       * 链路编号
+       * 
+ * + * int32 vlanId = 9; + * @param value The vlanId to set. + * @return This builder for chaining. + */ + public Builder setVlanId(int value) { + + vlanId_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 链路编号
+       * 
+ * + * int32 vlanId = 9; + * @return This builder for chaining. + */ + public Builder clearVlanId() { + + vlanId_ = 0; + onChanged(); + return this; + } + + private int tvSec_ ; + /** + * int32 tvSec = 10; + * @return The tvSec. + */ + @java.lang.Override + public int getTvSec() { + return tvSec_; + } + /** + * int32 tvSec = 10; + * @param value The tvSec to set. + * @return This builder for chaining. + */ + public Builder setTvSec(int value) { + + tvSec_ = value; + onChanged(); + return this; + } + /** + * int32 tvSec = 10; + * @return This builder for chaining. + */ + public Builder clearTvSec() { + + tvSec_ = 0; + onChanged(); + return this; + } + + private int tvUsec_ ; + /** + * int32 tvUsec = 11; + * @return The tvUsec. + */ + @java.lang.Override + public int getTvUsec() { + return tvUsec_; + } + /** + * int32 tvUsec = 11; + * @param value The tvUsec to set. + * @return This builder for chaining. + */ + public Builder setTvUsec(int value) { + + tvUsec_ = value; + onChanged(); + return this; + } + /** + * int32 tvUsec = 11; + * @return This builder for chaining. + */ + public Builder clearTvUsec() { + + tvUsec_ = 0; + onChanged(); + return this; + } + + private int startTm_ ; + /** + *
+       **
+       * 开始时间
+       * 
+ * + * int32 startTm = 12; + * @return The startTm. + */ + @java.lang.Override + public int getStartTm() { + return startTm_; + } + /** + *
+       **
+       * 开始时间
+       * 
+ * + * int32 startTm = 12; + * @param value The startTm to set. + * @return This builder for chaining. + */ + public Builder setStartTm(int value) { + + startTm_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 开始时间
+       * 
+ * + * int32 startTm = 12; + * @return This builder for chaining. + */ + public Builder clearStartTm() { + + startTm_ = 0; + onChanged(); + return this; + } + + private int totalBytes_ ; + /** + *
+       **
+       * 总字节数
+       * 
+ * + * int32 totalBytes = 13; + * @return The totalBytes. + */ + @java.lang.Override + public int getTotalBytes() { + return totalBytes_; + } + /** + *
+       **
+       * 总字节数
+       * 
+ * + * int32 totalBytes = 13; + * @param value The totalBytes to set. + * @return This builder for chaining. + */ + public Builder setTotalBytes(int value) { + + totalBytes_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 总字节数
+       * 
+ * + * int32 totalBytes = 13; + * @return This builder for chaining. + */ + public Builder clearTotalBytes() { + + totalBytes_ = 0; + onChanged(); + return this; + } + + private int totalPackets_ ; + /** + *
+       **
+       * 总包数
+       * 
+ * + * int32 totalPackets = 14; + * @return The totalPackets. + */ + @java.lang.Override + public int getTotalPackets() { + return totalPackets_; + } + /** + *
+       **
+       * 总包数
+       * 
+ * + * int32 totalPackets = 14; + * @param value The totalPackets to set. + * @return This builder for chaining. + */ + public Builder setTotalPackets(int value) { + + totalPackets_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 总包数
+       * 
+ * + * int32 totalPackets = 14; + * @return This builder for chaining. + */ + public Builder clearTotalPackets() { + + totalPackets_ = 0; + onChanged(); + return this; + } + + private int totalDropPackets_ ; + /** + *
+       **
+       * 总丢包数
+       * 
+ * + * int32 totalDropPackets = 15; + * @return The totalDropPackets. + */ + @java.lang.Override + public int getTotalDropPackets() { + return totalDropPackets_; + } + /** + *
+       **
+       * 总丢包数
+       * 
+ * + * int32 totalDropPackets = 15; + * @param value The totalDropPackets to set. + * @return This builder for chaining. + */ + public Builder setTotalDropPackets(int value) { + + totalDropPackets_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 总丢包数
+       * 
+ * + * int32 totalDropPackets = 15; + * @return This builder for chaining. + */ + public Builder clearTotalDropPackets() { + + totalDropPackets_ = 0; + onChanged(); + return this; + } + + private int retranTimeDelay_ ; + /** + *
+       **
+       * 重传延时
+       * 
+ * + * int32 retranTimeDelay = 16; + * @return The retranTimeDelay. + */ + @java.lang.Override + public int getRetranTimeDelay() { + return retranTimeDelay_; + } + /** + *
+       **
+       * 重传延时
+       * 
+ * + * int32 retranTimeDelay = 16; + * @param value The retranTimeDelay to set. + * @return This builder for chaining. + */ + public Builder setRetranTimeDelay(int value) { + + retranTimeDelay_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 重传延时
+       * 
+ * + * int32 retranTimeDelay = 16; + * @return This builder for chaining. + */ + public Builder clearRetranTimeDelay() { + + retranTimeDelay_ = 0; + onChanged(); + return this; + } + + private int clientRtt_ ; + /** + *
+       **
+       * 客户端rtt
+       * 
+ * + * int32 clientRtt = 17; + * @return The clientRtt. + */ + @java.lang.Override + public int getClientRtt() { + return clientRtt_; + } + /** + *
+       **
+       * 客户端rtt
+       * 
+ * + * int32 clientRtt = 17; + * @param value The clientRtt to set. + * @return This builder for chaining. + */ + public Builder setClientRtt(int value) { + + clientRtt_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 客户端rtt
+       * 
+ * + * int32 clientRtt = 17; + * @return This builder for chaining. + */ + public Builder clearClientRtt() { + + clientRtt_ = 0; + onChanged(); + return this; + } + + private int serverRtt_ ; + /** + *
+       **
+       * 服务端Rtt
+       * 
+ * + * int32 serverRtt = 18; + * @return The serverRtt. + */ + @java.lang.Override + public int getServerRtt() { + return serverRtt_; + } + /** + *
+       **
+       * 服务端Rtt
+       * 
+ * + * int32 serverRtt = 18; + * @param value The serverRtt to set. + * @return This builder for chaining. + */ + public Builder setServerRtt(int value) { + + serverRtt_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 服务端Rtt
+       * 
+ * + * int32 serverRtt = 18; + * @return This builder for chaining. + */ + public Builder clearServerRtt() { + + serverRtt_ = 0; + onChanged(); + return this; + } + + private int userResponseTime_ ; + /** + *
+       **
+       * 用户响应时间
+       * 
+ * + * int32 userResponseTime = 19; + * @return The userResponseTime. + */ + @java.lang.Override + public int getUserResponseTime() { + return userResponseTime_; + } + /** + *
+       **
+       * 用户响应时间
+       * 
+ * + * int32 userResponseTime = 19; + * @param value The userResponseTime to set. + * @return This builder for chaining. + */ + public Builder setUserResponseTime(int value) { + + userResponseTime_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 用户响应时间
+       * 
+ * + * int32 userResponseTime = 19; + * @return This builder for chaining. + */ + public Builder clearUserResponseTime() { + + userResponseTime_ = 0; + onChanged(); + return this; + } + + private int serverResponseTime_ ; + /** + *
+       **
+       * 服务响应时间
+       * 
+ * + * int32 serverResponseTime = 20; + * @return The serverResponseTime. + */ + @java.lang.Override + public int getServerResponseTime() { + return serverResponseTime_; + } + /** + *
+       **
+       * 服务响应时间
+       * 
+ * + * int32 serverResponseTime = 20; + * @param value The serverResponseTime to set. + * @return This builder for chaining. + */ + public Builder setServerResponseTime(int value) { + + serverResponseTime_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 服务响应时间
+       * 
+ * + * int32 serverResponseTime = 20; + * @return This builder for chaining. + */ + public Builder clearServerResponseTime() { + + serverResponseTime_ = 0; + onChanged(); + return this; + } + + private int conFail_ ; + /** + *
+       **
+       * tcp回话连接失败数
+       * 
+ * + * int32 conFail = 21; + * @return The conFail. + */ + @java.lang.Override + public int getConFail() { + return conFail_; + } + /** + *
+       **
+       * tcp回话连接失败数
+       * 
+ * + * int32 conFail = 21; + * @param value The conFail to set. + * @return This builder for chaining. + */ + public Builder setConFail(int value) { + + conFail_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * tcp回话连接失败数
+       * 
+ * + * int32 conFail = 21; + * @return This builder for chaining. + */ + public Builder clearConFail() { + + conFail_ = 0; + onChanged(); + return this; + } + + private int bytesIn_ ; + /** + *
+       **
+       * 服务端总字节数
+       * 
+ * + * int32 bytesIn = 23; + * @return The bytesIn. + */ + @java.lang.Override + public int getBytesIn() { + return bytesIn_; + } + /** + *
+       **
+       * 服务端总字节数
+       * 
+ * + * int32 bytesIn = 23; + * @param value The bytesIn to set. + * @return This builder for chaining. + */ + public Builder setBytesIn(int value) { + + bytesIn_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 服务端总字节数
+       * 
+ * + * int32 bytesIn = 23; + * @return This builder for chaining. + */ + public Builder clearBytesIn() { + + bytesIn_ = 0; + onChanged(); + return this; + } + + private int bytesOut_ ; + /** + *
+       **
+       * 客户端总字节数
+       * 
+ * + * int32 bytesOut = 24; + * @return The bytesOut. + */ + @java.lang.Override + public int getBytesOut() { + return bytesOut_; + } + /** + *
+       **
+       * 客户端总字节数
+       * 
+ * + * int32 bytesOut = 24; + * @param value The bytesOut to set. + * @return This builder for chaining. + */ + public Builder setBytesOut(int value) { + + bytesOut_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 客户端总字节数
+       * 
+ * + * int32 bytesOut = 24; + * @return This builder for chaining. + */ + public Builder clearBytesOut() { + + bytesOut_ = 0; + onChanged(); + return this; + } + + private int timeFlag_ ; + /** + *
+       **
+       * 探针推送时间
+       * 
+ * + * int32 timeFlag = 25; + * @return The timeFlag. + */ + @java.lang.Override + public int getTimeFlag() { + return timeFlag_; + } + /** + *
+       **
+       * 探针推送时间
+       * 
+ * + * int32 timeFlag = 25; + * @param value The timeFlag to set. + * @return This builder for chaining. + */ + public Builder setTimeFlag(int value) { + + timeFlag_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 探针推送时间
+       * 
+ * + * int32 timeFlag = 25; + * @return This builder for chaining. + */ + public Builder clearTimeFlag() { + + timeFlag_ = 0; + onChanged(); + return this; + } + + private int endTm_ ; + /** + *
+       **
+       * 结束时间
+       * 
+ * + * int32 endTm = 26; + * @return The endTm. + */ + @java.lang.Override + public int getEndTm() { + return endTm_; + } + /** + *
+       **
+       * 结束时间
+       * 
+ * + * int32 endTm = 26; + * @param value The endTm to set. + * @return This builder for chaining. + */ + public Builder setEndTm(int value) { + + endTm_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 结束时间
+       * 
+ * + * int32 endTm = 26; + * @return This builder for chaining. + */ + public Builder clearEndTm() { + + endTm_ = 0; + onChanged(); + return this; + } + + private int endTmUsec_ ; + /** + *
+       **
+       * 结束时间微秒
+       * 
+ * + * int32 endTmUsec = 27; + * @return The endTmUsec. + */ + @java.lang.Override + public int getEndTmUsec() { + return endTmUsec_; + } + /** + *
+       **
+       * 结束时间微秒
+       * 
+ * + * int32 endTmUsec = 27; + * @param value The endTmUsec to set. + * @return This builder for chaining. + */ + public Builder setEndTmUsec(int value) { + + endTmUsec_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 结束时间微秒
+       * 
+ * + * int32 endTmUsec = 27; + * @return This builder for chaining. + */ + public Builder clearEndTmUsec() { + + endTmUsec_ = 0; + onChanged(); + return this; + } + + private int responNum_ ; + /** + *
+       **
+       * 总响应数
+       * 
+ * + * int32 responNum = 28; + * @return The responNum. + */ + @java.lang.Override + public int getResponNum() { + return responNum_; + } + /** + *
+       **
+       * 总响应数
+       * 
+ * + * int32 responNum = 28; + * @param value The responNum to set. + * @return This builder for chaining. + */ + public Builder setResponNum(int value) { + + responNum_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 总响应数
+       * 
+ * + * int32 responNum = 28; + * @return This builder for chaining. + */ + public Builder clearResponNum() { + + responNum_ = 0; + onChanged(); + return this; + } + + private int csWindow_ ; + /** + *
+       **
+       * 客户端零窗口数
+       * 
+ * + * int32 csWindow = 29; + * @return The csWindow. + */ + @java.lang.Override + public int getCsWindow() { + return csWindow_; + } + /** + *
+       **
+       * 客户端零窗口数
+       * 
+ * + * int32 csWindow = 29; + * @param value The csWindow to set. + * @return This builder for chaining. + */ + public Builder setCsWindow(int value) { + + csWindow_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 客户端零窗口数
+       * 
+ * + * int32 csWindow = 29; + * @return This builder for chaining. + */ + public Builder clearCsWindow() { + + csWindow_ = 0; + onChanged(); + return this; + } + + private int scWindow_ ; + /** + *
+       **
+       * 服务端零窗口数
+       * 
+ * + * int32 scWindow = 30; + * @return The scWindow. + */ + @java.lang.Override + public int getScWindow() { + return scWindow_; + } + /** + *
+       **
+       * 服务端零窗口数
+       * 
+ * + * int32 scWindow = 30; + * @param value The scWindow to set. + * @return This builder for chaining. + */ + public Builder setScWindow(int value) { + + scWindow_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 服务端零窗口数
+       * 
+ * + * int32 scWindow = 30; + * @return This builder for chaining. + */ + public Builder clearScWindow() { + + scWindow_ = 0; + onChanged(); + return this; + } + + private int csReset_ ; + /** + *
+       **
+       * 客户端重置数
+       * 
+ * + * int32 csReset = 31; + * @return The csReset. + */ + @java.lang.Override + public int getCsReset() { + return csReset_; + } + /** + *
+       **
+       * 客户端重置数
+       * 
+ * + * int32 csReset = 31; + * @param value The csReset to set. + * @return This builder for chaining. + */ + public Builder setCsReset(int value) { + + csReset_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 客户端重置数
+       * 
+ * + * int32 csReset = 31; + * @return This builder for chaining. + */ + public Builder clearCsReset() { + + csReset_ = 0; + onChanged(); + return this; + } + + private int scReset_ ; + /** + *
+       **
+       * 服务端重置数
+       * 
+ * + * int32 scReset = 32; + * @return The scReset. + */ + @java.lang.Override + public int getScReset() { + return scReset_; + } + /** + *
+       **
+       * 服务端重置数
+       * 
+ * + * int32 scReset = 32; + * @param value The scReset to set. + * @return This builder for chaining. + */ + public Builder setScReset(int value) { + + scReset_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 服务端重置数
+       * 
+ * + * int32 scReset = 32; + * @return This builder for chaining. + */ + public Builder clearScReset() { + + scReset_ = 0; + onChanged(); + return this; + } + + private int csRetran_ ; + /** + *
+       **
+       * 客户端重传数
+       * 
+ * + * int32 csRetran = 33; + * @return The csRetran. + */ + @java.lang.Override + public int getCsRetran() { + return csRetran_; + } + /** + *
+       **
+       * 客户端重传数
+       * 
+ * + * int32 csRetran = 33; + * @param value The csRetran to set. + * @return This builder for chaining. + */ + public Builder setCsRetran(int value) { + + csRetran_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 客户端重传数
+       * 
+ * + * int32 csRetran = 33; + * @return This builder for chaining. + */ + public Builder clearCsRetran() { + + csRetran_ = 0; + onChanged(); + return this; + } + + private int scRetran_ ; + /** + *
+       **
+       * 服务端重传数
+       * 
+ * + * int32 scRetran = 34; + * @return The scRetran. + */ + @java.lang.Override + public int getScRetran() { + return scRetran_; + } + /** + *
+       **
+       * 服务端重传数
+       * 
+ * + * int32 scRetran = 34; + * @param value The scRetran to set. + * @return This builder for chaining. + */ + public Builder setScRetran(int value) { + + scRetran_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 服务端重传数
+       * 
+ * + * int32 scRetran = 34; + * @return This builder for chaining. + */ + public Builder clearScRetran() { + + scRetran_ = 0; + onChanged(); + return this; + } + + private int connSetupTm_ ; + /** + *
+       **
+       * 会话建立时间
+       * 
+ * + * int32 connSetupTm = 35; + * @return The connSetupTm. + */ + @java.lang.Override + public int getConnSetupTm() { + return connSetupTm_; + } + /** + *
+       **
+       * 会话建立时间
+       * 
+ * + * int32 connSetupTm = 35; + * @param value The connSetupTm to set. + * @return This builder for chaining. + */ + public Builder setConnSetupTm(int value) { + + connSetupTm_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 会话建立时间
+       * 
+ * + * int32 connSetupTm = 35; + * @return This builder for chaining. + */ + public Builder clearConnSetupTm() { + + connSetupTm_ = 0; + onChanged(); + return this; + } + + private int newSession_ ; + /** + *
+       **
+       * 新建会话数
+       * 
+ * + * int32 newSession = 36; + * @return The newSession. + */ + @java.lang.Override + public int getNewSession() { + return newSession_; + } + /** + *
+       **
+       * 新建会话数
+       * 
+ * + * int32 newSession = 36; + * @param value The newSession to set. + * @return This builder for chaining. + */ + public Builder setNewSession(int value) { + + newSession_ = value; + onChanged(); + return this; + } + /** + *
+       **
+       * 新建会话数
+       * 
+ * + * int32 newSession = 36; + * @return This builder for chaining. + */ + public Builder clearNewSession() { + + newSession_ = 0; + onChanged(); + return this; + } + + private int csAlert_ ; + /** + * int32 csAlert = 37; + * @return The csAlert. + */ + @java.lang.Override + public int getCsAlert() { + return csAlert_; + } + /** + * int32 csAlert = 37; + * @param value The csAlert to set. + * @return This builder for chaining. + */ + public Builder setCsAlert(int value) { + + csAlert_ = value; + onChanged(); + return this; + } + /** + * int32 csAlert = 37; + * @return This builder for chaining. + */ + public Builder clearCsAlert() { + + csAlert_ = 0; + onChanged(); + return this; + } + + private int scAlert_ ; + /** + * int32 scAlert = 38; + * @return The scAlert. + */ + @java.lang.Override + public int getScAlert() { + return scAlert_; + } + /** + * int32 scAlert = 38; + * @param value The scAlert to set. + * @return This builder for chaining. + */ + public Builder setScAlert(int value) { + + scAlert_ = value; + onChanged(); + return this; + } + /** + * int32 scAlert = 38; + * @return This builder for chaining. + */ + public Builder clearScAlert() { + + scAlert_ = 0; + onChanged(); + return this; + } + + private java.lang.Object protocal_ = ""; + /** + * string protocal = 39; + * @return The protocal. + */ + public java.lang.String getProtocal() { + java.lang.Object ref = protocal_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + protocal_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string protocal = 39; + * @return The bytes for protocal. + */ + public com.google.protobuf.ByteString + getProtocalBytes() { + java.lang.Object ref = protocal_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + protocal_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string protocal = 39; + * @param value The protocal to set. + * @return This builder for chaining. + */ + public Builder setProtocal( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + protocal_ = value; + onChanged(); + return this; + } + /** + * string protocal = 39; + * @return This builder for chaining. + */ + public Builder clearProtocal() { + + protocal_ = getDefaultInstance().getProtocal(); + onChanged(); + return this; + } + /** + * string protocal = 39; + * @param value The bytes for protocal to set. + * @return This builder for chaining. + */ + public Builder setProtocalBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + protocal_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.yuandian.dataflow.proto.ApmBaseDataFlow) + } + + // @@protoc_insertion_point(class_scope:com.yuandian.dataflow.proto.ApmBaseDataFlow) + private static final com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow(); + } + + public static com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ApmBaseDataFlow parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ApmBaseDataFlow(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.ApmBaseDataFlow getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_yuandian_dataflow_proto_ApmBaseDataFlow_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_yuandian_dataflow_proto_ApmBaseDataFlow_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\025ApmBaseDataFlow.proto\022\033com.yuandian.da" + + "taflow.proto\"\340\005\n\017ApmBaseDataFlow\022\017\n\007tabl" + + "eID\030\001 \001(\005\022\017\n\007probeIf\030\002 \001(\005\022\023\n\013requestPor" + + "t\030\003 \001(\005\022\024\n\014responsePort\030\004 \001(\005\022\021\n\trequest" + + "Ip\030\005 \001(\005\022\022\n\nresponseIp\030\006 \001(\005\022\016\n\006srcMac\030\007" + + " \001(\003\022\016\n\006dstMac\030\010 \001(\003\022\016\n\006vlanId\030\t \001(\005\022\r\n\005" + + "tvSec\030\n \001(\005\022\016\n\006tvUsec\030\013 \001(\005\022\017\n\007startTm\030\014" + + " \001(\005\022\022\n\ntotalBytes\030\r \001(\005\022\024\n\014totalPackets" + + "\030\016 \001(\005\022\030\n\020totalDropPackets\030\017 \001(\005\022\027\n\017retr" + + "anTimeDelay\030\020 \001(\005\022\021\n\tclientRtt\030\021 \001(\005\022\021\n\t" + + "serverRtt\030\022 \001(\005\022\030\n\020userResponseTime\030\023 \001(" + + "\005\022\032\n\022serverResponseTime\030\024 \001(\005\022\017\n\007conFail" + + "\030\025 \001(\005\022\017\n\007bytesIn\030\027 \001(\005\022\020\n\010bytesOut\030\030 \001(" + + "\005\022\020\n\010timeFlag\030\031 \001(\005\022\r\n\005endTm\030\032 \001(\005\022\021\n\ten" + + "dTmUsec\030\033 \001(\005\022\021\n\tresponNum\030\034 \001(\005\022\020\n\010csWi" + + "ndow\030\035 \001(\005\022\020\n\010scWindow\030\036 \001(\005\022\017\n\007csReset\030" + + "\037 \001(\005\022\017\n\007scReset\030 \001(\005\022\020\n\010csRetran\030! \001(\005" + + "\022\020\n\010scRetran\030\" \001(\005\022\023\n\013connSetupTm\030# \001(\005\022" + + "\022\n\nnewSession\030$ \001(\005\022\017\n\007csAlert\030% \001(\005\022\017\n\007" + + "scAlert\030& \001(\005\022\020\n\010protocal\030\' \001(\tb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_com_yuandian_dataflow_proto_ApmBaseDataFlow_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_yuandian_dataflow_proto_ApmBaseDataFlow_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_yuandian_dataflow_proto_ApmBaseDataFlow_descriptor, + new java.lang.String[] { "TableID", "ProbeIf", "RequestPort", "ResponsePort", "RequestIp", "ResponseIp", "SrcMac", "DstMac", "VlanId", "TvSec", "TvUsec", "StartTm", "TotalBytes", "TotalPackets", "TotalDropPackets", "RetranTimeDelay", "ClientRtt", "ServerRtt", "UserResponseTime", "ServerResponseTime", "ConFail", "BytesIn", "BytesOut", "TimeFlag", "EndTm", "EndTmUsec", "ResponNum", "CsWindow", "ScWindow", "CsReset", "ScReset", "CsRetran", "ScRetran", "ConnSetupTm", "NewSession", "CsAlert", "ScAlert", "Protocal", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/com/yuandian/dataflow/proto/Base.java b/src/main/java/com/yuandian/dataflow/proto/Base.java new file mode 100644 index 0000000..b2fec80 --- /dev/null +++ b/src/main/java/com/yuandian/dataflow/proto/Base.java @@ -0,0 +1,2077 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Base.proto + +package com.yuandian.dataflow.proto; + +public final class Base { + private Base() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.yuandian.dataflow.proto.Response) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 code = 1; + * @return The code. + */ + int getCode(); + + /** + * int32 message = 2; + * @return The message. + */ + int getMessage(); + + /** + * repeated .google.protobuf.Any packets = 4; + */ + java.util.List + getPacketsList(); + /** + * repeated .google.protobuf.Any packets = 4; + */ + com.google.protobuf.Any getPackets(int index); + /** + * repeated .google.protobuf.Any packets = 4; + */ + int getPacketsCount(); + /** + * repeated .google.protobuf.Any packets = 4; + */ + java.util.List + getPacketsOrBuilderList(); + /** + * repeated .google.protobuf.Any packets = 4; + */ + com.google.protobuf.AnyOrBuilder getPacketsOrBuilder( + int index); + } + /** + * Protobuf type {@code com.yuandian.dataflow.proto.Response} + */ + public static final class Response extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.yuandian.dataflow.proto.Response) + ResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use Response.newBuilder() to construct. + private Response(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Response() { + packets_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Response(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Response( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + code_ = input.readInt32(); + break; + } + case 16: { + + message_ = input.readInt32(); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + packets_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + packets_.add( + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + packets_ = java.util.Collections.unmodifiableList(packets_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.yuandian.dataflow.proto.Base.internal_static_com_yuandian_dataflow_proto_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.yuandian.dataflow.proto.Base.internal_static_com_yuandian_dataflow_proto_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.yuandian.dataflow.proto.Base.Response.class, com.yuandian.dataflow.proto.Base.Response.Builder.class); + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_; + /** + * int32 code = 1; + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + private int message_; + /** + * int32 message = 2; + * @return The message. + */ + @java.lang.Override + public int getMessage() { + return message_; + } + + public static final int PACKETS_FIELD_NUMBER = 4; + private java.util.List packets_; + /** + * repeated .google.protobuf.Any packets = 4; + */ + @java.lang.Override + public java.util.List getPacketsList() { + return packets_; + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + @java.lang.Override + public java.util.List + getPacketsOrBuilderList() { + return packets_; + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + @java.lang.Override + public int getPacketsCount() { + return packets_.size(); + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + @java.lang.Override + public com.google.protobuf.Any getPackets(int index) { + return packets_.get(index); + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getPacketsOrBuilder( + int index) { + return packets_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (code_ != 0) { + output.writeInt32(1, code_); + } + if (message_ != 0) { + output.writeInt32(2, message_); + } + for (int i = 0; i < packets_.size(); i++) { + output.writeMessage(4, packets_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, code_); + } + if (message_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, message_); + } + for (int i = 0; i < packets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, packets_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.yuandian.dataflow.proto.Base.Response)) { + return super.equals(obj); + } + com.yuandian.dataflow.proto.Base.Response other = (com.yuandian.dataflow.proto.Base.Response) obj; + + if (getCode() + != other.getCode()) return false; + if (getMessage() + != other.getMessage()) return false; + if (!getPacketsList() + .equals(other.getPacketsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage(); + if (getPacketsCount() > 0) { + hash = (37 * hash) + PACKETS_FIELD_NUMBER; + hash = (53 * hash) + getPacketsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.yuandian.dataflow.proto.Base.Response parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.yuandian.dataflow.proto.Base.Response parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.yuandian.dataflow.proto.Base.Response parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.yuandian.dataflow.proto.Base.Response parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.yuandian.dataflow.proto.Base.Response parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.yuandian.dataflow.proto.Base.Response parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.yuandian.dataflow.proto.Base.Response parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.yuandian.dataflow.proto.Base.Response parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.yuandian.dataflow.proto.Base.Response parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.yuandian.dataflow.proto.Base.Response parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.yuandian.dataflow.proto.Base.Response parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.yuandian.dataflow.proto.Base.Response parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.yuandian.dataflow.proto.Base.Response prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.yuandian.dataflow.proto.Response} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.yuandian.dataflow.proto.Response) + com.yuandian.dataflow.proto.Base.ResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.yuandian.dataflow.proto.Base.internal_static_com_yuandian_dataflow_proto_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.yuandian.dataflow.proto.Base.internal_static_com_yuandian_dataflow_proto_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.yuandian.dataflow.proto.Base.Response.class, com.yuandian.dataflow.proto.Base.Response.Builder.class); + } + + // Construct using com.yuandian.dataflow.proto.Base.Response.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getPacketsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + code_ = 0; + + message_ = 0; + + if (packetsBuilder_ == null) { + packets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + packetsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.yuandian.dataflow.proto.Base.internal_static_com_yuandian_dataflow_proto_Response_descriptor; + } + + @java.lang.Override + public com.yuandian.dataflow.proto.Base.Response getDefaultInstanceForType() { + return com.yuandian.dataflow.proto.Base.Response.getDefaultInstance(); + } + + @java.lang.Override + public com.yuandian.dataflow.proto.Base.Response build() { + com.yuandian.dataflow.proto.Base.Response result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.yuandian.dataflow.proto.Base.Response buildPartial() { + com.yuandian.dataflow.proto.Base.Response result = new com.yuandian.dataflow.proto.Base.Response(this); + int from_bitField0_ = bitField0_; + result.code_ = code_; + result.message_ = message_; + if (packetsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + packets_ = java.util.Collections.unmodifiableList(packets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.packets_ = packets_; + } else { + result.packets_ = packetsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.yuandian.dataflow.proto.Base.Response) { + return mergeFrom((com.yuandian.dataflow.proto.Base.Response)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.yuandian.dataflow.proto.Base.Response other) { + if (other == com.yuandian.dataflow.proto.Base.Response.getDefaultInstance()) return this; + if (other.getCode() != 0) { + setCode(other.getCode()); + } + if (other.getMessage() != 0) { + setMessage(other.getMessage()); + } + if (packetsBuilder_ == null) { + if (!other.packets_.isEmpty()) { + if (packets_.isEmpty()) { + packets_ = other.packets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePacketsIsMutable(); + packets_.addAll(other.packets_); + } + onChanged(); + } + } else { + if (!other.packets_.isEmpty()) { + if (packetsBuilder_.isEmpty()) { + packetsBuilder_.dispose(); + packetsBuilder_ = null; + packets_ = other.packets_; + bitField0_ = (bitField0_ & ~0x00000001); + packetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPacketsFieldBuilder() : null; + } else { + packetsBuilder_.addAllMessages(other.packets_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.yuandian.dataflow.proto.Base.Response parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.yuandian.dataflow.proto.Base.Response) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int code_ ; + /** + * int32 code = 1; + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + /** + * int32 code = 1; + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(int value) { + + code_ = value; + onChanged(); + return this; + } + /** + * int32 code = 1; + * @return This builder for chaining. + */ + public Builder clearCode() { + + code_ = 0; + onChanged(); + return this; + } + + private int message_ ; + /** + * int32 message = 2; + * @return The message. + */ + @java.lang.Override + public int getMessage() { + return message_; + } + /** + * int32 message = 2; + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(int value) { + + message_ = value; + onChanged(); + return this; + } + /** + * int32 message = 2; + * @return This builder for chaining. + */ + public Builder clearMessage() { + + message_ = 0; + onChanged(); + return this; + } + + private java.util.List packets_ = + java.util.Collections.emptyList(); + private void ensurePacketsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + packets_ = new java.util.ArrayList(packets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> packetsBuilder_; + + /** + * repeated .google.protobuf.Any packets = 4; + */ + public java.util.List getPacketsList() { + if (packetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(packets_); + } else { + return packetsBuilder_.getMessageList(); + } + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + public int getPacketsCount() { + if (packetsBuilder_ == null) { + return packets_.size(); + } else { + return packetsBuilder_.getCount(); + } + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + public com.google.protobuf.Any getPackets(int index) { + if (packetsBuilder_ == null) { + return packets_.get(index); + } else { + return packetsBuilder_.getMessage(index); + } + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + public Builder setPackets( + int index, com.google.protobuf.Any value) { + if (packetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePacketsIsMutable(); + packets_.set(index, value); + onChanged(); + } else { + packetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + public Builder setPackets( + int index, com.google.protobuf.Any.Builder builderForValue) { + if (packetsBuilder_ == null) { + ensurePacketsIsMutable(); + packets_.set(index, builderForValue.build()); + onChanged(); + } else { + packetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + public Builder addPackets(com.google.protobuf.Any value) { + if (packetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePacketsIsMutable(); + packets_.add(value); + onChanged(); + } else { + packetsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + public Builder addPackets( + int index, com.google.protobuf.Any value) { + if (packetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePacketsIsMutable(); + packets_.add(index, value); + onChanged(); + } else { + packetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + public Builder addPackets( + com.google.protobuf.Any.Builder builderForValue) { + if (packetsBuilder_ == null) { + ensurePacketsIsMutable(); + packets_.add(builderForValue.build()); + onChanged(); + } else { + packetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + public Builder addPackets( + int index, com.google.protobuf.Any.Builder builderForValue) { + if (packetsBuilder_ == null) { + ensurePacketsIsMutable(); + packets_.add(index, builderForValue.build()); + onChanged(); + } else { + packetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + public Builder addAllPackets( + java.lang.Iterable values) { + if (packetsBuilder_ == null) { + ensurePacketsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, packets_); + onChanged(); + } else { + packetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + public Builder clearPackets() { + if (packetsBuilder_ == null) { + packets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + packetsBuilder_.clear(); + } + return this; + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + public Builder removePackets(int index) { + if (packetsBuilder_ == null) { + ensurePacketsIsMutable(); + packets_.remove(index); + onChanged(); + } else { + packetsBuilder_.remove(index); + } + return this; + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + public com.google.protobuf.Any.Builder getPacketsBuilder( + int index) { + return getPacketsFieldBuilder().getBuilder(index); + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + public com.google.protobuf.AnyOrBuilder getPacketsOrBuilder( + int index) { + if (packetsBuilder_ == null) { + return packets_.get(index); } else { + return packetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + public java.util.List + getPacketsOrBuilderList() { + if (packetsBuilder_ != null) { + return packetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(packets_); + } + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + public com.google.protobuf.Any.Builder addPacketsBuilder() { + return getPacketsFieldBuilder().addBuilder( + com.google.protobuf.Any.getDefaultInstance()); + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + public com.google.protobuf.Any.Builder addPacketsBuilder( + int index) { + return getPacketsFieldBuilder().addBuilder( + index, com.google.protobuf.Any.getDefaultInstance()); + } + /** + * repeated .google.protobuf.Any packets = 4; + */ + public java.util.List + getPacketsBuilderList() { + return getPacketsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> + getPacketsFieldBuilder() { + if (packetsBuilder_ == null) { + packetsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( + packets_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + packets_ = null; + } + return packetsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.yuandian.dataflow.proto.Response) + } + + // @@protoc_insertion_point(class_scope:com.yuandian.dataflow.proto.Response) + private static final com.yuandian.dataflow.proto.Base.Response DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.yuandian.dataflow.proto.Base.Response(); + } + + public static com.yuandian.dataflow.proto.Base.Response getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Response parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Response(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.yuandian.dataflow.proto.Base.Response getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface RequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.yuandian.dataflow.proto.Request) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * 请求类型.  默认 为 1.  暂无意义
+     * 
+ * + * int32 type = 1; + * @return The type. + */ + int getType(); + + /** + * repeated .google.protobuf.Any param = 2; + */ + java.util.List + getParamList(); + /** + * repeated .google.protobuf.Any param = 2; + */ + com.google.protobuf.Any getParam(int index); + /** + * repeated .google.protobuf.Any param = 2; + */ + int getParamCount(); + /** + * repeated .google.protobuf.Any param = 2; + */ + java.util.List + getParamOrBuilderList(); + /** + * repeated .google.protobuf.Any param = 2; + */ + com.google.protobuf.AnyOrBuilder getParamOrBuilder( + int index); + + /** + *
+     * 请求版本.  区分版本. 非必要时不使用 
+     * 
+ * + * string version = 3; + * @return The version. + */ + java.lang.String getVersion(); + /** + *
+     * 请求版本.  区分版本. 非必要时不使用 
+     * 
+ * + * string version = 3; + * @return The bytes for version. + */ + com.google.protobuf.ByteString + getVersionBytes(); + } + /** + * Protobuf type {@code com.yuandian.dataflow.proto.Request} + */ + public static final class Request extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.yuandian.dataflow.proto.Request) + RequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use Request.newBuilder() to construct. + private Request(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Request() { + param_ = java.util.Collections.emptyList(); + version_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Request(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Request( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + type_ = input.readInt32(); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + param_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + param_.add( + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry)); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + version_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + param_ = java.util.Collections.unmodifiableList(param_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.yuandian.dataflow.proto.Base.internal_static_com_yuandian_dataflow_proto_Request_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.yuandian.dataflow.proto.Base.internal_static_com_yuandian_dataflow_proto_Request_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.yuandian.dataflow.proto.Base.Request.class, com.yuandian.dataflow.proto.Base.Request.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + *
+     * 请求类型.  默认 为 1.  暂无意义
+     * 
+ * + * int32 type = 1; + * @return The type. + */ + @java.lang.Override + public int getType() { + return type_; + } + + public static final int PARAM_FIELD_NUMBER = 2; + private java.util.List param_; + /** + * repeated .google.protobuf.Any param = 2; + */ + @java.lang.Override + public java.util.List getParamList() { + return param_; + } + /** + * repeated .google.protobuf.Any param = 2; + */ + @java.lang.Override + public java.util.List + getParamOrBuilderList() { + return param_; + } + /** + * repeated .google.protobuf.Any param = 2; + */ + @java.lang.Override + public int getParamCount() { + return param_.size(); + } + /** + * repeated .google.protobuf.Any param = 2; + */ + @java.lang.Override + public com.google.protobuf.Any getParam(int index) { + return param_.get(index); + } + /** + * repeated .google.protobuf.Any param = 2; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getParamOrBuilder( + int index) { + return param_.get(index); + } + + public static final int VERSION_FIELD_NUMBER = 3; + private volatile java.lang.Object version_; + /** + *
+     * 请求版本.  区分版本. 非必要时不使用 
+     * 
+ * + * string version = 3; + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } + } + /** + *
+     * 请求版本.  区分版本. 非必要时不使用 
+     * 
+ * + * string version = 3; + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (type_ != 0) { + output.writeInt32(1, type_); + } + for (int i = 0; i < param_.size(); i++) { + output.writeMessage(2, param_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, version_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, type_); + } + for (int i = 0; i < param_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, param_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, version_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.yuandian.dataflow.proto.Base.Request)) { + return super.equals(obj); + } + com.yuandian.dataflow.proto.Base.Request other = (com.yuandian.dataflow.proto.Base.Request) obj; + + if (getType() + != other.getType()) return false; + if (!getParamList() + .equals(other.getParamList())) return false; + if (!getVersion() + .equals(other.getVersion())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType(); + if (getParamCount() > 0) { + hash = (37 * hash) + PARAM_FIELD_NUMBER; + hash = (53 * hash) + getParamList().hashCode(); + } + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.yuandian.dataflow.proto.Base.Request parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.yuandian.dataflow.proto.Base.Request parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.yuandian.dataflow.proto.Base.Request parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.yuandian.dataflow.proto.Base.Request parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.yuandian.dataflow.proto.Base.Request parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.yuandian.dataflow.proto.Base.Request parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.yuandian.dataflow.proto.Base.Request parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.yuandian.dataflow.proto.Base.Request parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.yuandian.dataflow.proto.Base.Request parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.yuandian.dataflow.proto.Base.Request parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.yuandian.dataflow.proto.Base.Request parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.yuandian.dataflow.proto.Base.Request parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.yuandian.dataflow.proto.Base.Request prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.yuandian.dataflow.proto.Request} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.yuandian.dataflow.proto.Request) + com.yuandian.dataflow.proto.Base.RequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.yuandian.dataflow.proto.Base.internal_static_com_yuandian_dataflow_proto_Request_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.yuandian.dataflow.proto.Base.internal_static_com_yuandian_dataflow_proto_Request_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.yuandian.dataflow.proto.Base.Request.class, com.yuandian.dataflow.proto.Base.Request.Builder.class); + } + + // Construct using com.yuandian.dataflow.proto.Base.Request.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getParamFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = 0; + + if (paramBuilder_ == null) { + param_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + paramBuilder_.clear(); + } + version_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.yuandian.dataflow.proto.Base.internal_static_com_yuandian_dataflow_proto_Request_descriptor; + } + + @java.lang.Override + public com.yuandian.dataflow.proto.Base.Request getDefaultInstanceForType() { + return com.yuandian.dataflow.proto.Base.Request.getDefaultInstance(); + } + + @java.lang.Override + public com.yuandian.dataflow.proto.Base.Request build() { + com.yuandian.dataflow.proto.Base.Request result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.yuandian.dataflow.proto.Base.Request buildPartial() { + com.yuandian.dataflow.proto.Base.Request result = new com.yuandian.dataflow.proto.Base.Request(this); + int from_bitField0_ = bitField0_; + result.type_ = type_; + if (paramBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + param_ = java.util.Collections.unmodifiableList(param_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.param_ = param_; + } else { + result.param_ = paramBuilder_.build(); + } + result.version_ = version_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.yuandian.dataflow.proto.Base.Request) { + return mergeFrom((com.yuandian.dataflow.proto.Base.Request)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.yuandian.dataflow.proto.Base.Request other) { + if (other == com.yuandian.dataflow.proto.Base.Request.getDefaultInstance()) return this; + if (other.getType() != 0) { + setType(other.getType()); + } + if (paramBuilder_ == null) { + if (!other.param_.isEmpty()) { + if (param_.isEmpty()) { + param_ = other.param_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureParamIsMutable(); + param_.addAll(other.param_); + } + onChanged(); + } + } else { + if (!other.param_.isEmpty()) { + if (paramBuilder_.isEmpty()) { + paramBuilder_.dispose(); + paramBuilder_ = null; + param_ = other.param_; + bitField0_ = (bitField0_ & ~0x00000001); + paramBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getParamFieldBuilder() : null; + } else { + paramBuilder_.addAllMessages(other.param_); + } + } + } + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.yuandian.dataflow.proto.Base.Request parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.yuandian.dataflow.proto.Base.Request) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int type_ ; + /** + *
+       * 请求类型.  默认 为 1.  暂无意义
+       * 
+ * + * int32 type = 1; + * @return The type. + */ + @java.lang.Override + public int getType() { + return type_; + } + /** + *
+       * 请求类型.  默认 为 1.  暂无意义
+       * 
+ * + * int32 type = 1; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(int value) { + + type_ = value; + onChanged(); + return this; + } + /** + *
+       * 请求类型.  默认 为 1.  暂无意义
+       * 
+ * + * int32 type = 1; + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private java.util.List param_ = + java.util.Collections.emptyList(); + private void ensureParamIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + param_ = new java.util.ArrayList(param_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> paramBuilder_; + + /** + * repeated .google.protobuf.Any param = 2; + */ + public java.util.List getParamList() { + if (paramBuilder_ == null) { + return java.util.Collections.unmodifiableList(param_); + } else { + return paramBuilder_.getMessageList(); + } + } + /** + * repeated .google.protobuf.Any param = 2; + */ + public int getParamCount() { + if (paramBuilder_ == null) { + return param_.size(); + } else { + return paramBuilder_.getCount(); + } + } + /** + * repeated .google.protobuf.Any param = 2; + */ + public com.google.protobuf.Any getParam(int index) { + if (paramBuilder_ == null) { + return param_.get(index); + } else { + return paramBuilder_.getMessage(index); + } + } + /** + * repeated .google.protobuf.Any param = 2; + */ + public Builder setParam( + int index, com.google.protobuf.Any value) { + if (paramBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParamIsMutable(); + param_.set(index, value); + onChanged(); + } else { + paramBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .google.protobuf.Any param = 2; + */ + public Builder setParam( + int index, com.google.protobuf.Any.Builder builderForValue) { + if (paramBuilder_ == null) { + ensureParamIsMutable(); + param_.set(index, builderForValue.build()); + onChanged(); + } else { + paramBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .google.protobuf.Any param = 2; + */ + public Builder addParam(com.google.protobuf.Any value) { + if (paramBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParamIsMutable(); + param_.add(value); + onChanged(); + } else { + paramBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .google.protobuf.Any param = 2; + */ + public Builder addParam( + int index, com.google.protobuf.Any value) { + if (paramBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParamIsMutable(); + param_.add(index, value); + onChanged(); + } else { + paramBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .google.protobuf.Any param = 2; + */ + public Builder addParam( + com.google.protobuf.Any.Builder builderForValue) { + if (paramBuilder_ == null) { + ensureParamIsMutable(); + param_.add(builderForValue.build()); + onChanged(); + } else { + paramBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .google.protobuf.Any param = 2; + */ + public Builder addParam( + int index, com.google.protobuf.Any.Builder builderForValue) { + if (paramBuilder_ == null) { + ensureParamIsMutable(); + param_.add(index, builderForValue.build()); + onChanged(); + } else { + paramBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .google.protobuf.Any param = 2; + */ + public Builder addAllParam( + java.lang.Iterable values) { + if (paramBuilder_ == null) { + ensureParamIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, param_); + onChanged(); + } else { + paramBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .google.protobuf.Any param = 2; + */ + public Builder clearParam() { + if (paramBuilder_ == null) { + param_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + paramBuilder_.clear(); + } + return this; + } + /** + * repeated .google.protobuf.Any param = 2; + */ + public Builder removeParam(int index) { + if (paramBuilder_ == null) { + ensureParamIsMutable(); + param_.remove(index); + onChanged(); + } else { + paramBuilder_.remove(index); + } + return this; + } + /** + * repeated .google.protobuf.Any param = 2; + */ + public com.google.protobuf.Any.Builder getParamBuilder( + int index) { + return getParamFieldBuilder().getBuilder(index); + } + /** + * repeated .google.protobuf.Any param = 2; + */ + public com.google.protobuf.AnyOrBuilder getParamOrBuilder( + int index) { + if (paramBuilder_ == null) { + return param_.get(index); } else { + return paramBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .google.protobuf.Any param = 2; + */ + public java.util.List + getParamOrBuilderList() { + if (paramBuilder_ != null) { + return paramBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(param_); + } + } + /** + * repeated .google.protobuf.Any param = 2; + */ + public com.google.protobuf.Any.Builder addParamBuilder() { + return getParamFieldBuilder().addBuilder( + com.google.protobuf.Any.getDefaultInstance()); + } + /** + * repeated .google.protobuf.Any param = 2; + */ + public com.google.protobuf.Any.Builder addParamBuilder( + int index) { + return getParamFieldBuilder().addBuilder( + index, com.google.protobuf.Any.getDefaultInstance()); + } + /** + * repeated .google.protobuf.Any param = 2; + */ + public java.util.List + getParamBuilderList() { + return getParamFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> + getParamFieldBuilder() { + if (paramBuilder_ == null) { + paramBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( + param_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + param_ = null; + } + return paramBuilder_; + } + + private java.lang.Object version_ = ""; + /** + *
+       * 请求版本.  区分版本. 非必要时不使用 
+       * 
+ * + * string version = 3; + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * 请求版本.  区分版本. 非必要时不使用 
+       * 
+ * + * string version = 3; + * @return The bytes for version. + */ + public com.google.protobuf.ByteString + getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * 请求版本.  区分版本. 非必要时不使用 
+       * 
+ * + * string version = 3; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value; + onChanged(); + return this; + } + /** + *
+       * 请求版本.  区分版本. 非必要时不使用 
+       * 
+ * + * string version = 3; + * @return This builder for chaining. + */ + public Builder clearVersion() { + + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + *
+       * 请求版本.  区分版本. 非必要时不使用 
+       * 
+ * + * string version = 3; + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + version_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.yuandian.dataflow.proto.Request) + } + + // @@protoc_insertion_point(class_scope:com.yuandian.dataflow.proto.Request) + private static final com.yuandian.dataflow.proto.Base.Request DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.yuandian.dataflow.proto.Base.Request(); + } + + public static com.yuandian.dataflow.proto.Base.Request getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Request parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Request(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.yuandian.dataflow.proto.Base.Request getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_yuandian_dataflow_proto_Response_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_yuandian_dataflow_proto_Response_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_yuandian_dataflow_proto_Request_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_yuandian_dataflow_proto_Request_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\nBase.proto\022\033com.yuandian.dataflow.prot" + + "o\032\031google/protobuf/any.proto\032\025ApmBaseDat" + + "aFlow.proto\"P\n\010Response\022\014\n\004code\030\001 \001(\005\022\017\n" + + "\007message\030\002 \001(\005\022%\n\007packets\030\004 \003(\0132\024.google" + + ".protobuf.Any\"M\n\007Request\022\014\n\004type\030\001 \001(\005\022#" + + "\n\005param\030\002 \003(\0132\024.google.protobuf.Any\022\017\n\007v" + + "ersion\030\003 \001(\t2s\n\024CollectPacketsServer\022[\n\n" + + "GetPackets\022$.com.yuandian.dataflow.proto" + + ".Request\032%.com.yuandian.dataflow.proto.R" + + "esponse0\001B\037\n\033com.yuandian.dataflow.proto" + + "P\000b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.AnyProto.getDescriptor(), + com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.getDescriptor(), + }); + internal_static_com_yuandian_dataflow_proto_Response_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_yuandian_dataflow_proto_Response_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_yuandian_dataflow_proto_Response_descriptor, + new java.lang.String[] { "Code", "Message", "Packets", }); + internal_static_com_yuandian_dataflow_proto_Request_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_com_yuandian_dataflow_proto_Request_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_yuandian_dataflow_proto_Request_descriptor, + new java.lang.String[] { "Type", "Param", "Version", }); + com.google.protobuf.AnyProto.getDescriptor(); + com.yuandian.dataflow.proto.ApmBaseDataFlowOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/com/yuandian/dataflow/proto/CollectPacketsServerGrpc.java b/src/main/java/com/yuandian/dataflow/proto/CollectPacketsServerGrpc.java new file mode 100644 index 0000000..4a0e0f5 --- /dev/null +++ b/src/main/java/com/yuandian/dataflow/proto/CollectPacketsServerGrpc.java @@ -0,0 +1,269 @@ +package com.yuandian.dataflow.proto; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.46.0)", + comments = "Source: Base.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class CollectPacketsServerGrpc { + + private CollectPacketsServerGrpc() {} + + public static final String SERVICE_NAME = "com.yuandian.dataflow.proto.CollectPacketsServer"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getGetPacketsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPackets", + requestType = com.yuandian.dataflow.proto.Base.Request.class, + responseType = com.yuandian.dataflow.proto.Base.Response.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getGetPacketsMethod() { + io.grpc.MethodDescriptor getGetPacketsMethod; + if ((getGetPacketsMethod = CollectPacketsServerGrpc.getGetPacketsMethod) == null) { + synchronized (CollectPacketsServerGrpc.class) { + if ((getGetPacketsMethod = CollectPacketsServerGrpc.getGetPacketsMethod) == null) { + CollectPacketsServerGrpc.getGetPacketsMethod = getGetPacketsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPackets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.yuandian.dataflow.proto.Base.Request.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.yuandian.dataflow.proto.Base.Response.getDefaultInstance())) + .setSchemaDescriptor(new CollectPacketsServerMethodDescriptorSupplier("GetPackets")) + .build(); + } + } + } + return getGetPacketsMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static CollectPacketsServerStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CollectPacketsServerStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CollectPacketsServerStub(channel, callOptions); + } + }; + return CollectPacketsServerStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CollectPacketsServerBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CollectPacketsServerBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CollectPacketsServerBlockingStub(channel, callOptions); + } + }; + return CollectPacketsServerBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static CollectPacketsServerFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CollectPacketsServerFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CollectPacketsServerFutureStub(channel, callOptions); + } + }; + return CollectPacketsServerFutureStub.newStub(factory, channel); + } + + /** + */ + public static abstract class CollectPacketsServerImplBase implements io.grpc.BindableService { + + /** + */ + public void getPackets(com.yuandian.dataflow.proto.Base.Request request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPacketsMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetPacketsMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.yuandian.dataflow.proto.Base.Request, + com.yuandian.dataflow.proto.Base.Response>( + this, METHODID_GET_PACKETS))) + .build(); + } + } + + /** + */ + public static final class CollectPacketsServerStub extends io.grpc.stub.AbstractAsyncStub { + private CollectPacketsServerStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CollectPacketsServerStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CollectPacketsServerStub(channel, callOptions); + } + + /** + */ + public void getPackets(com.yuandian.dataflow.proto.Base.Request request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getGetPacketsMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class CollectPacketsServerBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private CollectPacketsServerBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CollectPacketsServerBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CollectPacketsServerBlockingStub(channel, callOptions); + } + + /** + */ + public java.util.Iterator getPackets( + com.yuandian.dataflow.proto.Base.Request request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getGetPacketsMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class CollectPacketsServerFutureStub extends io.grpc.stub.AbstractFutureStub { + private CollectPacketsServerFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CollectPacketsServerFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CollectPacketsServerFutureStub(channel, callOptions); + } + } + + private static final int METHODID_GET_PACKETS = 0; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final CollectPacketsServerImplBase serviceImpl; + private final int methodId; + + MethodHandlers(CollectPacketsServerImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_PACKETS: + serviceImpl.getPackets((com.yuandian.dataflow.proto.Base.Request) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class CollectPacketsServerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CollectPacketsServerBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.yuandian.dataflow.proto.Base.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CollectPacketsServer"); + } + } + + private static final class CollectPacketsServerFileDescriptorSupplier + extends CollectPacketsServerBaseDescriptorSupplier { + CollectPacketsServerFileDescriptorSupplier() {} + } + + private static final class CollectPacketsServerMethodDescriptorSupplier + extends CollectPacketsServerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + CollectPacketsServerMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (CollectPacketsServerGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CollectPacketsServerFileDescriptorSupplier()) + .addMethod(getGetPacketsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/src/main/java/com/yuandian/dataflow/proto/decode/ApmBaseDataFlow.java b/src/main/java/com/yuandian/dataflow/proto/decode/ApmBaseDataFlow.java deleted file mode 100644 index f779ce2..0000000 --- a/src/main/java/com/yuandian/dataflow/proto/decode/ApmBaseDataFlow.java +++ /dev/null @@ -1,289 +0,0 @@ -package com.yuandian.dataflow.proto.decode; - - -import java.io.BufferedReader; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * @author User - * - */ -public class ApmBaseDataFlow extends PacketBase { - private static Logger logger = LoggerFactory.getLogger(ApmBaseDataFlow.class); - public static int SIZE = 156;//88;// - /** - * 抓包口 - */ - public long probeIf; - - - //四元组 - /** - * 请求端口 - */ - public int requestPort; - /** - * 响应端口 - */ - public int responsePort; - /** - * 请求IP - */ - public long requestIp; - /** - * 响应Ip - */ - public long responseIp; - - /** - * 源mac - */ - public long srcMac; - - /** - * 目的mac - */ - public long dstMac; - - /** - * 链路编号 - */ - public long vlanId; - - public long tvSec; - public long tvUsec; - - /** - * 开始时间 - */ - public long startTm; - - /** - * 总字节数 - */ - public long totalBytes; - - /** - * 总包数 - */ - public long totalPackets; - /** - * 总丢包数 - */ - public long totalDropPackets; - /** - * 重传延时 - */ - public long retranTimeDelay; - /** - * 客户端rtt - */ - public long clientRtt; - - /** - * 服务端Rtt - */ - public long serverRtt; - - - /** - * 用户响应时间 - */ - public long userResponseTime; - /** - * 服务响应时间 - */ - public long serverResponseTime; - /** - * tcp回话连接失败数 - */ - public long conFail; - - /** - * 会话重置数 - */ -// public long reset; - - /** - * 服务端总字节数 - */ - public long bytesIn; - /** - * 客户端总字节数 - */ - public long bytesOut; - /** - * 探针推送时间 - */ - public long timeFlag; - - /** - * 结束时间 - */ - public long endTm; - - /** - * 结束时间微秒 - */ - public long endTmUsec; - - /** - * 总响应数 - */ - public long responNum; - /** - * 客户端零窗口数 - */ - public long csWindow; - /** - * 服务端零窗口数 - */ - public long scWindow; - /** - * 客户端重置数 - */ - public long csReset; - /** - * 服务端重置数 - */ - public long scReset; - /** - * 客户端重传数 - */ - public long csRetran; - /** - * 服务端重传数 - */ - public long scRetran; - /** - * 会话建立时间 - */ - public long connSetupTm; - /** - * 新建会话数 - */ - public long newSession; - - public long csAlert; - - public long scAlert; - - public String protocal; - - - - @Override - public PacketBase Parse(PacketHeader header,ByteBuffer data) throws Exception { - ApmBaseDataFlow oneData = new ApmBaseDataFlow(); - - oneData.setPacketHeader(header); - - oneData.probeIf = data.getLong(4); - - - oneData.requestPort = data.getInt( 2); - - oneData.responsePort = data.getInt( 2); - - oneData.requestIp = data.getLong(4); - - oneData.responseIp = data.getLong(4); - - - oneData.srcMac = data.getLong(6); - - oneData.dstMac = data.getLong(6); - - oneData.vlanId = data.getLong(4); - - - oneData.tvSec = data.getLong(4); - - oneData.tvUsec = data.getLong(4); - - -// oneData.startTm = data.getLong(8); - - - oneData.totalBytes = data.getLong(4); - - oneData.totalPackets = data.getLong(4); - - oneData.totalDropPackets = data.getLong(4); - - oneData.retranTimeDelay = data.getLong(4); - - oneData.clientRtt = data.getLong(4); - - //服务端Rtt - oneData.serverRtt = data.getLong(4); - - oneData.userResponseTime = data.getLong(4); - - oneData.serverResponseTime = data.getLong(4); - - oneData.conFail = data.getLong(4); - - -// oneData.reset = data.getLong(4); - - oneData.bytesIn = data.getLong(4); - - oneData.bytesOut = data.getLong(4); - - oneData.timeFlag = data.getLong(4); - - - oneData.endTm = data.getLong(4); - - oneData.endTmUsec = data.getLong(4); - - - oneData.responNum = data.getLong(4); - - oneData.csWindow = data.getLong(4); - - oneData.scWindow = data.getLong(4); - - oneData.csReset = data.getLong(4); - - oneData.scReset = data.getLong(4); - - oneData.csRetran = data.getLong(4); - - oneData.scRetran = data.getLong(4); - - oneData.connSetupTm = data.getLong(4); - - oneData.newSession = data.getLong(4); - - oneData.csAlert = data.getLong(4); - - oneData.scAlert = data.getLong(4); - - oneData.protocal = data.slice().toString() ; - - return oneData; - } - - @Override - public String[] getData() { - return null; - } - - @Override - public int getInterfaceNumber() { - return 0; - } - - @Override - public int getUnitPacketLength() { - return 0; - } - -} diff --git a/src/main/java/com/yuandian/dataflow/proto/decode/AppFlow.java b/src/main/java/com/yuandian/dataflow/proto/decode/AppFlow.java deleted file mode 100644 index 050302c..0000000 --- a/src/main/java/com/yuandian/dataflow/proto/decode/AppFlow.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.yuandian.dataflow.proto.decode; -import java.nio.ByteBuffer; - - -public class AppFlow extends PacketBase { - public static int SIZE = 104; - public long srcIp; - public int srcPort; - public long dstIp; - public int dstPort; - public long startTvSec; - public long startTvUsec; - public long lastTvSec; - public long lastTvUsec; - public long endTvSec; - public long endTvUsec; - public int inputPackets; - public int outputPackets; - public int inputBytes; - public int outputBytes; - public String protocaol; - public int appId; - public int appGroupId; - public int probeIf; - public int appStyle; - public long timeFlag; - public int vlanId; - public int mplsLable; - public int tos; - - - @Override - public PacketBase Parse(PacketHeader header,ByteBuffer data) - throws Exception { - AppFlow nlf = new AppFlow(); - nlf.srcIp = data.getInt(4); - - nlf.srcPort = data.getInt(2); - - nlf.dstIp = data.getInt(4); - - nlf.dstPort = data.getInt(2); - - nlf.startTvSec = data.getLong(4); - - nlf.startTvUsec = data.getLong(4); - - nlf.lastTvSec = data.getLong(4); - - nlf.lastTvUsec = data.getLong(4); - - nlf.endTvSec = data.getLong(4); - - nlf.endTvUsec = data.getLong(4); - - nlf.inputPackets = data.getInt(4); - - nlf.outputPackets = data.getInt(4); - - nlf.inputBytes = data.getInt(4); - - nlf.outputBytes = data.getInt(4); - - nlf.protocaol = data.alignedSlice(20).toString(); - - nlf.appId = data.getInt(4); - - nlf.appGroupId = data.getInt(4); - - nlf.probeIf = data.getInt(4); - - nlf.appStyle = data.getInt(4); - - nlf.timeFlag = data.getLong(4); - - nlf.vlanId = data.getInt(4); - - nlf.mplsLable = data.getInt(4); - - nlf.tos = data.getInt(4); - - return nlf; - } - - @Override - public int getUnitPacketLength() { - return 0; - } - - @Override - public String[] getData() { - return null; - } - - @Override - public int getInterfaceNumber() { - return 0; - } - -} diff --git a/src/main/java/com/yuandian/dataflow/proto/decode/BacktrackingFlow.java b/src/main/java/com/yuandian/dataflow/proto/decode/BacktrackingFlow.java deleted file mode 100644 index 6cf81ba..0000000 --- a/src/main/java/com/yuandian/dataflow/proto/decode/BacktrackingFlow.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.yuandian.dataflow.proto.decode; - -import java.nio.ByteBuffer; - -/** - * @author User - * - */ -public class BacktrackingFlow extends PacketBase{ - public static int SIZE = 108; - //tuple StatisTuple10 56 10元组信息 - private long macSrc; //源MAC 8 - private long macDst; //目的MAC 8 - private long ipSrc; //源IP 8 - private long ipDst; //目的IP 8 - private long portSrc; //源端口,如果没有,为-1 - private long portDst; //目标端口,如果没有,为-1 - private int l3Proto; //第三层协议ID,如果没有,为-1 - private int l4Proto; //第四层协议ID,如果没有,为-1 - private int tos; //Tos,如果没有,为-1 - private int vlanId; //vlan ID,如果没有,为-1 - - private long bytes; // 8 字节总数 - private long packets; // 8 数据包总数 - private long tcpSp; // 8 tcp同步包数 - private long tcpScpn;// 8 tcp同步确认包数 - private long tcpSrp; // 8 tcp同步重置包数 - private long appId; // 4 appID - private long appGroupId;// 4 app组ID - private long mplsLabel;// 4 - - - @Override - public PacketBase Parse(PacketHeader header,ByteBuffer data) throws Exception { - BacktrackingFlow backFlow = new BacktrackingFlow(); - backFlow.macSrc = data.getLong(8); //源MAC 8 - - backFlow.macDst = data.getLong(8); //目的MAC 8 - - backFlow.ipSrc = data.getLong(8); //源IP 8 - - backFlow.ipDst = data.getLong(8); //目的IP 8 - - backFlow.portSrc = data.getInt(4); //源端口,如果没有,为-1 - - backFlow.portDst = data.getInt(4); //目标端口,如果没有,为-1 - - backFlow.l3Proto = data.getInt(4); //第三层协议ID,如果没有,为-1 - - backFlow.l4Proto = data.getInt(4); //第四层协议ID,如果没有,为-1 - - backFlow.tos = data.getInt(4); //Tos,如果没有,为-1 - - backFlow.vlanId = data.getInt(4); //vlan ID,如果没有,为-1 - - - backFlow.bytes = data.getLong(8); // 8 字节总数 - - backFlow.packets = data.getLong(8); // 8 数据包总数 - - backFlow.tcpSp = data.getLong(8); // 8 tcp同步包数 - - backFlow.tcpScpn = data.getLong(8);// 8 tcp同步确认包数 - - backFlow.tcpSrp = data.getLong(8); // 8 tcp同步重置包数 - - backFlow.appId = data.getInt(4); // 4 appID - - backFlow.appGroupId = data.getInt(4);// 4 app组ID - - backFlow.mplsLabel = data.getInt(4);// 4 - - - return backFlow; - } - - @Override - public int getUnitPacketLength() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public String[] getData() { - // TODO Auto-generated method stub - return null; - } - - @Override - public int getInterfaceNumber() { - // TODO Auto-generated method stub - return 0; - } - -} diff --git a/src/main/java/com/yuandian/dataflow/proto/decode/BasicTrafficFlow.java b/src/main/java/com/yuandian/dataflow/proto/decode/BasicTrafficFlow.java deleted file mode 100644 index 60de0c3..0000000 --- a/src/main/java/com/yuandian/dataflow/proto/decode/BasicTrafficFlow.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.yuandian.dataflow.proto.decode; - -import java.nio.ByteBuffer; - -public class BasicTrafficFlow extends PacketBase { - public static int SIZE = 56; - public long capPort; - public int requestPort; - public int responsePort; - public long requestIp; - public long responseIp; - public long startTime; - public long totalBytes; - public long totalPackets; - public long spackets64; - public long spackets128; - public long spackets256; - public long spackets512; - public long spackets1024; - public long spackets; - public long sendTime; - - @Override - public PacketBase Parse(PacketHeader header,ByteBuffer data) throws Exception { - BasicTrafficFlow btf = new BasicTrafficFlow(); - btf.setPacketHeader(header); - - btf.capPort = data.getLong(4); - - data.position(data.position() + 12); - - btf.startTime = data.getLong(4); - - btf.totalBytes = data.getLong(4); - - btf.totalPackets = data.getLong(4); - - btf.spackets64 = data.getLong(4); - - btf.spackets128 = data.getLong(4); - - btf.spackets256 = data.getLong(4); - - btf.spackets512 = data.getLong(4); - - btf.spackets1024 = data.getLong(4); - - btf.spackets = data.getLong(4); - - btf.sendTime = data.getLong(4); - - return btf; - } - @Override - public String[] getData() { - // TODO Auto-generated method stub - return null; - } - @Override - public int getInterfaceNumber() { - // TODO Auto-generated method stub - return 0; - } - @Override - public int getUnitPacketLength() { - // TODO Auto-generated method stub - return 0; - } - - - - -} diff --git a/src/main/java/com/yuandian/dataflow/proto/decode/BusinessBodyData.java b/src/main/java/com/yuandian/dataflow/proto/decode/BusinessBodyData.java deleted file mode 100644 index d8e5f6f..0000000 --- a/src/main/java/com/yuandian/dataflow/proto/decode/BusinessBodyData.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.yuandian.dataflow.proto.decode; - - -public class BusinessBodyData { - - public String relvanceDataId; - public long request_ip; - public int request_port; - public long response_ip; - public int response_port; - - public long start_tv_sec;//开始时间秒 - public long start_tv_usec;//开始时间毫秒 - public long end_tv_sec;//结束时间秒 - public long end_tv_usec;//结束时间微妙 - - public String resource_code; - public String noParameterRecognition; - public String originalRecognition; - public String requestCookie; - - public String requestBodyContext; - public String responseBodyContext; - - public int filterId; - public String business_detail_mesg; - - -} diff --git a/src/main/java/com/yuandian/dataflow/proto/decode/BussFlowDb.java b/src/main/java/com/yuandian/dataflow/proto/decode/BussFlowDb.java deleted file mode 100644 index f21b54c..0000000 --- a/src/main/java/com/yuandian/dataflow/proto/decode/BussFlowDb.java +++ /dev/null @@ -1,231 +0,0 @@ -package com.yuandian.dataflow.proto.decode; - -import java.nio.ByteBuffer; - -// import com.ud.module.common.SystemConfigManager; - - - -public class BussFlowDb extends PacketBase { - private int UNIT_DATA_LENGTH = 3362; - - // redis资源归并,处理服务资源发现是需要设置识别串(正则表达式) - public String redisRegex; - - public String id; //id - public int msg_len; //消息长度 - public int msg_type; //消息类型 - public long src_mac; - public long dst_mac; - public int protocol; //协议名 - public String session_serial_number;//会话序列号 - public String buss_type;//业务服务资源编码(C_01) - public long request_ip;//Web客户端IP - public int request_port;//Web客户端端口 - public long response_ip;//Web服务器IP - public int response_port;//Web服务器端口 - public long start_tv_sec;//Web开始时间秒 - public long start_tv_usec;//开始时间毫秒 - public long end_tv_sec;//结束时间秒 - public long end_tv_usec;//结束时间微妙 - public String disc_resource_ident; //web:url mid:apiBody db:sql - public String name; //web:操作系统 midd:interfaceName db:db_name - //web midd - public String session_id;//sessionid - public int request_msg_length; //请求报文长度 - public String request_msg_detail; //请求报文详情 - public int response_msg_length; //响应报文长度 - public String response_msg_detail; //响应报文详情 - //web段 - public String reter_url; - public String x_requested_with; - public long req_method; //请求方式 - public String content_type; //请求类型 - public String accept; //jieshou - public int req_cookie_leng;//请求cookie报文长度 - public String req_cookie_detail;//请求cookie报文详情 - public long t_intodb_time; - public int load_or_step; //0: 页面 1:加载项 2:非web段数据 - public String business_detail_mesg; - public String bussiness_key_mesg; //关键字 格式:key=val|key=val.... - public int isUncomplete; //组包是否完全 0:组包完整 1:不完整 - public int deal_state=1; - public int server_res_code; - public long server_response_time; - public long client_translate_time; - public String browser; - public int server_start_tv_sec; - public long server_start_tv_usec; - public int server_end_tv_sec; - public long server_end_tv_usec; - public String probe_ip; - public long probe_if; - public long server_translate_time; - public long time_flag; - public String base_code; - public String ori_sql; - public String reserved; - public long bytes_in; - public long bytes_out; - public int package_in; - public int package_out; - public String dataId; - public int filterId; - @Override - public int getUnitPacketLength() { - // TODO Auto-generated method stub - return UNIT_DATA_LENGTH; - } - - @SuppressWarnings("unchecked") - public BussFlowDb Parse(PacketHeader header,ByteBuffer data) - throws Exception { - BussFlowDb buss = new BussFlowDb(); -// buss.m_Header = header; - - buss.msg_type = header.getTableID(); -// -// buss.msg_version = data.getInt(1); -// offset += 1; -// buss.msg_seq = data.getInt(4); -// -// buss.msg_len = header.getMsg_len(); -// - -// UNIT_DATA_LENGTH=msg_len; - buss.src_mac = data.getLong(8); - - buss.dst_mac = data.getLong(8); - - boolean macFilterFlag = false; - if(macFilterFlag && buss.src_mac!=0 && buss.dst_mac==0){ - return null; - } - - data.position(data.position() + 28); - - buss.protocol= data.getInt(4); - - buss.bytes_out = data.getLong(4); - - buss.bytes_in = data.getLong(4); - - buss.package_out = data.getInt(4); - - buss.package_in = data.getInt(4); - - - buss.session_serial_number = data.alignedSlice(24).toString(); - - - - buss.probe_if= data.getInt(); - - - data.position(data.position() + 24); - - buss.name = data.alignedSlice(64).toString(); - - buss.request_ip=data.getLong(); - - buss.request_port= data.getInt(); - - buss.response_ip=data.getLong(); - - buss.response_port= data.getInt(); - -// buss.deal_state= data.getInt(); - - buss.server_translate_time=data.getLong(); - - buss.client_translate_time=data.getLong(); - - buss.server_response_time=data.getLong(); - - buss.server_start_tv_sec= data.getInt(); - - buss.server_start_tv_usec=data.getLong(); - - //结束时间 - buss.server_end_tv_sec= data.getInt(); - - buss.server_end_tv_usec=data.getLong(); - - buss.start_tv_sec=data.getLong(); - - buss.start_tv_usec=data.getLong(); - - //结束时间 - buss.end_tv_sec=data.getLong(); - - buss.end_tv_usec=data.getLong(); - - buss.isUncomplete = data.getInt(4); - - buss.time_flag= data.getInt(4); - - int sqlLen = data.getInt(4); - - int detailMsgLen = data.getInt(4); - - buss.request_msg_length = data.getInt(4); - - buss.response_msg_length = data.getInt(4); - - int reservedLen = data.getInt(4); - - - buss.ori_sql = data.alignedSlice(sqlLen).toString(); - - buss.business_detail_mesg= data.alignedSlice( detailMsgLen).toString(); - - ; - buss.request_msg_detail = utils.ByteBufferUTF8String(data, buss.request_msg_length); - - buss.response_msg_detail = utils.ByteBufferUTF8String(data, buss.response_msg_length); - - buss.reserved = data.alignedSlice( reservedLen).toString(); - - return buss; - } - - - public String getBussType() { - return buss_type; - } - - @Override - public String[] getData() { - String data[] = new String[45]; - return data; - } - - @Override - public int getInterfaceNumber() { - return 0; - } - - // @Override - // public PacketBase Parse(PacketHeader header, ByteBuffer data) throws Exception { - // // TODO Auto-generated method stub - // return null; - // } - - /** - * 如果已经存在这个session_id(即key),则说明是重复数据,不再进行后续操作 - * @param buss - * @return 存在返回true 不存在返回false - */ - /*private boolean reduceByKey(BussFlowDb buss) { - String coding = CodingGeneration.md5GenCoding2(buss.ori_sql); - String key=buss.session_serial_number+"|"+buss.request_ip+"|"+buss.request_port+"|"+buss.response_ip+"|"+buss.response_port+"|"+coding+"|"+buss.business_detail_mesg; - - //分布式同步锁,如果存在该key或者锁已经被获取则返回false,设置 - if(redisTemplate.opsForValue().setIfAbsent(key, System.currentTimeMillis()+"")){ - redisTemplate.expire(key,SystemConfigManager.keyExistTime,TimeUnit.SECONDS); - return false; - } - - return true; - }*/ -} diff --git a/src/main/java/com/yuandian/dataflow/proto/decode/BussFlowExternal.java b/src/main/java/com/yuandian/dataflow/proto/decode/BussFlowExternal.java deleted file mode 100644 index 499e67a..0000000 --- a/src/main/java/com/yuandian/dataflow/proto/decode/BussFlowExternal.java +++ /dev/null @@ -1,137 +0,0 @@ -package com.yuandian.dataflow.proto.decode; - -import java.nio.ByteBuffer; -import java.util.Date; - - - - -public class BussFlowExternal extends PacketBase { - private final int UNIT_DATA_LENGTH =871; - - @Override - public int getUnitPacketLength() { - return UNIT_DATA_LENGTH; - } - - public BussFlowExternal Parse(PacketHeader header,ByteBuffer data) - throws Exception { - - - if (data.position() + UNIT_DATA_LENGTH > data.array().length) - throw new Exception("data length error!"); - - - BussFlowExternal buss = new BussFlowExternal(); -// buss.m_Header = header; - - buss.probe_if= data.getLong(4); - - buss.channel= data.alignedSlice(24).toString(); - - buss.interfaceid= data.alignedSlice(100).toString(); - - buss.systemName= data.alignedSlice(32).toString(); - - buss.net_type= data.alignedSlice(6).toString(); - - buss.net_segment = data.alignedSlice( 5).toString(); - - buss.session_id= data.alignedSlice(80).toString(); - - buss.phoneid= data.alignedSlice(12).toString(); - - - buss.request_ip= data.getLong(4); - - buss.request_port= data.getLong(4); - - buss.response_ip= data.getLong(4); - - buss.response_port= data.getLong(4); - - //开始时间 - buss.start_tv_sec= data.getLong(4); - - buss.start_tv_usec= data.getLong(4); - - //结束时间 - buss.end_tv_sec= data.getLong(4); - - buss.end_tv_usec= data.getLong(4); - - - buss.deal_state= data.getInt(4); - - buss.server_translate_time= data.getLong(8); - - buss.server_response_time= data.getLong(8); - - buss.begin_url= data.alignedSlice(100).toString(); - - buss.operating_sytem= data.alignedSlice(20).toString(); - - buss.server_res_code= data.getInt(2); - - buss.browser= data.alignedSlice(30).toString(); - - buss.business_detail_mesg= data.alignedSlice(200).toString(); - - buss.business_involve_msg = data.alignedSlice(200).toString(); - - isUncomplete = data.getInt( 4); - - buss.time_flag= data.getLong( 4); - - return buss; - } - - public String id; - public Long probe_if;//接口号 - public String channel;//营业厅渠道:前台或者分析服务器给出,渠道标识 - public String systemName; //外部系统名称 - public String interfaceid;// 业务接口编码 - public String session_id;//sessionid - public String phoneid;//受理手机号码 - public String net_type; - public String net_segment;//网段标识(客户-web) - public Long request_ip;//Web客户端IP - public Long request_port;//Web客户端端口 - public Long response_ip;//Web服务器IP - public Long response_port;//Web服务器端口 - - public Long start_tv_sec;//Web开始时间秒 - public Long start_tv_usec;//开始时间微秒 - public Long end_tv_sec;//结束时间秒 - public Long end_tv_usec;//结束时间微妙 - - public Integer deal_state;//Web操作成功/失败标识1成功0失败 - public Long server_translate_time;//Web服务器传输耗时 - public Long server_response_time;//Web服务器响应时间 - public String begin_url;//url - public String operating_sytem;//操作系统 - public Integer server_res_code; //Web系统返回码 - public String browser;//浏览器 - public String business_detail_mesg;//要获取的指标 - public Date insert_time;//插入时间 - public String business_involve_msg; //要关联的指标 - public Integer isUncomplete; - public Long time_flag; - - - @Override - public String[] getData() { - String data[] = new String[37]; - return data; - } - - @Override - public int getInterfaceNumber() { - - return Integer.parseInt(probe_if.toString()); - } - - - - -} diff --git a/src/main/java/com/yuandian/dataflow/proto/decode/BussFlowMidd.java b/src/main/java/com/yuandian/dataflow/proto/decode/BussFlowMidd.java deleted file mode 100644 index 5bbb336..0000000 --- a/src/main/java/com/yuandian/dataflow/proto/decode/BussFlowMidd.java +++ /dev/null @@ -1,250 +0,0 @@ -package com.yuandian.dataflow.proto.decode; - -import java.nio.ByteBuffer; -import java.util.concurrent.TimeUnit; - - - - - -public class BussFlowMidd extends PacketBase { - private int UNIT_DATA_LENGTH =3569; - - public String id; //id - public long src_mac; - public long dst_mac; - public int msg_len; //消息长度 - public int msg_type; //消息类型 - public int protocol; //协议名 - public String session_serial_number;//会话序列号 - public String buss_type;//业务服务资源编码(C_01) - public String net_segment;//网段标识(客户-web) - public long request_ip;//Web客户端IP - public int request_port;//Web客户端端口 - public long response_ip;//Web服务器IP - public int response_port;//Web服务器端口 - public long start_tv_sec;//Web开始时间秒 - public long start_tv_usec;//开始时间毫秒 - public long end_tv_sec;//结束时间秒 - public long end_tv_usec;//结束时间微妙 - public String disc_resource_ident; //web:url mid:apiBody db:sql - public String name; //web:操作系统 midd:interfaceName db:db_name - //web midd - public String session_id;//sessionid - public int request_msg_length; //请求报文长度 - public String request_msg_detail; //请求报文详情 - public int response_msg_length; //响应报文长度 - public String response_msg_detail; //响应报文详情 - //web段 - public String reter_url; - public String x_requested_with; - public long req_method; //请求方式 - public String content_type; //请求类型 - public String accept; //jieshou - public int req_cookie_leng;//请求cookie报文长度 - public String req_cookie_detail;//请求cookie报文详情 - public long t_intodb_time; - public int load_or_step; //0: 页面 1:加载项 2:非web段数据 - public String business_detail_mesg; - public String bussiness_key_mesg; //关键字 格式:key=val|key=val.... - public int isUncomplete; //组包是否完全 0:组包完整 1:不完整 - public int deal_state=1; - public int server_res_code; - public long server_response_time; - public long client_translate_time; - public String browser; - public int server_start_tv_sec; - public long server_start_tv_usec; - public int server_end_tv_sec; - public long server_end_tv_usec; - public String probe_ip; - public int probe_if; - public long server_translate_time; - public long time_flag; - public String channel; - public String base_code; - public String ori_api; - public String remain_data; - public long bytes_in; - public long bytes_out; - public int package_in; - public int package_out; - public String dataId; - public int filterId; - - @Override - public int getUnitPacketLength() { - // TODO Auto-generated method stub - return UNIT_DATA_LENGTH; - } - - public BussFlowMidd Parse(PacketHeader header,ByteBuffer data) - throws Exception { - BussFlowMidd buss = new BussFlowMidd(); -// buss.m_Header = header; - - buss.msg_type = header.getTableID(); - - buss.src_mac = data.getLong(8); - - buss.dst_mac = data.getLong(8); - var macFilterFlag = false ; - if(macFilterFlag && buss.src_mac!=0 && buss.dst_mac==0){ - return null; - } - - - - data.position( data.position() + 28); - - buss.protocol= data.getInt( 4); - - buss.bytes_out = data.getLong(4); - - buss.bytes_in = data.getLong(4); - - buss.package_out = data.getInt( 4); - - buss.package_in = data.getInt( 4); - - - buss.session_serial_number = data.alignedSlice( 24).toString(); - - data.position( data.position() + 4); -// buss.req_method = data.getLong(4); -// -// buss.content_type = data.alignedSlice( 40).toString(); -// offset += 40; -// buss.accept = data.alignedSlice( 40).toString(); -// offset += 40; - buss.probe_if= data.getInt(4); - -// buss.buss_type =data.alignedSlice(10).toString(); -// offset += 10; - buss.channel=data.alignedSlice(24).toString(); - -// buss.session_id=data.alignedSlice(36).toString(); -// offset += 36; -// buss.net_segment=data.alignedSlice(6).toString(); -// offset += 6; - buss.request_ip=data.getLong(); - - buss.request_port= data.getInt(4); - - buss.response_ip=data.getLong(); - - buss.response_port= data.getInt(4); - - //开始时间 - buss.start_tv_sec=data.getLong(); - - buss.start_tv_usec=data.getLong(); - - //结束时间 - buss.end_tv_sec=data.getLong(); - - buss.end_tv_usec=data.getLong(); - -// buss.deal_state= data.getInt(4); - - buss.server_res_code = data.getInt( 2); - - buss.server_translate_time=data.getLong(); - - - buss.server_start_tv_sec= data.getInt(4); - - buss.server_start_tv_usec=data.getLong(); - - //结束时间 - buss.server_end_tv_sec= data.getInt(4); - - buss.server_end_tv_usec=data.getLong(); - - - buss.server_response_time=data.getLong(); - - buss.client_translate_time=data.getLong(); - - buss.isUncomplete = data.getInt( 4); - - buss.time_flag= data.getInt( 4); - - int detailMsgLen = data.getInt( 4); - - int keyMsgLen = data.getInt( 4); - - int apiLen = data.getInt( 4); - - buss.request_msg_length = data.getInt( 4); - - buss.response_msg_length = data.getInt( 4); - - int remainLen = data.getInt( 4); - - - buss.business_detail_mesg=data.alignedSlice(detailMsgLen).toString(); - - buss.bussiness_key_mesg = data.alignedSlice( keyMsgLen).toString(); - - buss.ori_api=data.alignedSlice( apiLen).toString(); - - buss.request_msg_detail = utils.ByteBufferUTF8String(data, buss.request_msg_length); - - buss.response_msg_detail = utils.ByteBufferUTF8String(data, buss.response_msg_length); - data.position(data.position()+remainLen); - - - - /*if(SystemConfigManager.projectName.contains("GDYDBPM")){ - boolean exist=false; - if(SystemConfigManager.reduceFlag){ - - redisTemplate = (RedisTemplate) ApplicationContextUtil.getBean("redisTemplate"); - exist = reduceByKey(buss); - } - - //不存在就加入缓存 - if(!exist)return buss; - //存在就返回空 - return null; - }*/ - - return buss; - } - - public String getBussType() { - return buss_type; - } - - @Override - public String[] getData() { - String data[] = new String[35];//贵阳 - - return data; - } - - @Override - public int getInterfaceNumber() { - - return 0; - } - - /** - * 如果已经存在这个session_id(即key),则说明是重复数据,不再进行后续操作 - * @param buss - * @return - */ - /*private boolean reduceByKey(BussFlowMidd buss) { - String coding = CodingGeneration.md5GenCoding2(buss.ori_api); - String key=buss.session_serial_number+"|"+buss.request_ip+"|"+buss.request_port+"|"+buss.response_ip+"|"+buss.response_port+"|"+coding+"|"+buss.business_detail_mesg; - - //分布式同步锁,如果存在该key或者锁已经被获取则返回false,设置 - if(redisTemplate.opsForValue().setIfAbsent(key, System.currentTimeMillis()+"")){ - redisTemplate.expire(key,SystemConfigManager.keyExistTime,TimeUnit.SECONDS); - return false; - } - - return true; - }*/ -} diff --git a/src/main/java/com/yuandian/dataflow/proto/decode/BussFlowOrl.java b/src/main/java/com/yuandian/dataflow/proto/decode/BussFlowOrl.java deleted file mode 100644 index 44fe90b..0000000 --- a/src/main/java/com/yuandian/dataflow/proto/decode/BussFlowOrl.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.yuandian.dataflow.proto.decode; - -import java.nio.ByteBuffer; - -public class BussFlowOrl extends PacketBase { - - public int msg_type; - public int msg_version; - public int msg_seq; - public int msg_len; - public long request_mac; - public long response_mac; - public long request_ip; - public int request_port; - public long response_ip; - public int response_port; - public int probeif; - public int protocol; - public long start_tv_sec;//Web开始时间秒 - public long start_tv_usec;//开始时间毫秒 - public long end_tv_sec;//结束时间秒 - public long end_tv_usec;//结束时间微妙 - public int req_len; - public int res_len; - public int busi_msg_len; - public int key_msg_len; - public int detail_msg_len; - public int remain_len; - public String business_code; - public String sessionid; - public String req_data; - public String res_data; - public String busi_msg; - public String busi_key_msg; - public String busi_detail_msg; - public String remain_data; - - @Override - public PacketBase Parse(PacketHeader header,ByteBuffer data) throws Exception { - BussFlowOrl orl = new BussFlowOrl(); - orl.msg_type = header.getNowType(); - orl.request_mac =data.getLong(8); - - orl.response_mac =data.getLong(8); - - orl.request_ip =data.getLong(4); - - orl.request_port = data.getInt(4); - - orl.response_ip =data.getLong(4); - - orl.response_port = data.getInt(4); - - orl.probeif = data.getInt(4); - - orl.protocol = data.getInt(4); - - orl.start_tv_sec =data.getLong(4); - - orl.start_tv_usec =data.getLong(4); - - orl.end_tv_sec =data.getLong(4); - - orl.end_tv_usec =data.getLong(4); - - int req_len = data.getInt(4); - - int res_len = data.getInt(4); - - int busi_msg_len = data.getInt(4); - - int key_msg_len = data.getInt(4); - - int detail_msg_len = data.getInt(4); - - int remain_len = data.getInt(4); - - orl.business_code = data.alignedSlice( 32).toString(); - - orl.sessionid = data.alignedSlice( 80).toString(); - - orl.req_data = data.alignedSlice( req_len).toString(); - - orl.res_data = data.alignedSlice( res_len).toString(); - - orl.busi_msg = data.alignedSlice( busi_msg_len).toString(); - - orl.busi_key_msg = data.alignedSlice( key_msg_len).toString(); - - orl.busi_detail_msg = data.alignedSlice( detail_msg_len).toString(); - - orl.remain_data = data.alignedSlice( remain_len).toString(); - - return orl; - } - - @Override - public int getUnitPacketLength() { - return 0; - } - - @Override - public String[] getData() { - return new String[0]; - } - - @Override - public int getInterfaceNumber() { - return 0; - } -} diff --git a/src/main/java/com/yuandian/dataflow/proto/decode/BussFlowWeb.java b/src/main/java/com/yuandian/dataflow/proto/decode/BussFlowWeb.java deleted file mode 100644 index 5e4147c..0000000 --- a/src/main/java/com/yuandian/dataflow/proto/decode/BussFlowWeb.java +++ /dev/null @@ -1,353 +0,0 @@ -package com.yuandian.dataflow.proto.decode; - -import java.nio.ByteBuffer; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - - - -import com.yuandian.dataflow.proto.decode.PacketBase; -import com.yuandian.dataflow.proto.decode.PacketHeader; - - - - -public class BussFlowWeb extends PacketBase { - private Integer UNIT_DATA_LENGTH =6104; - - private static int i = 1; - @Override - public int getUnitPacketLength() { - return UNIT_DATA_LENGTH; - } - - @SuppressWarnings("unchecked") - public BussFlowWeb Parse(PacketHeader header,ByteBuffer data) - throws Exception { - i++; - BussFlowWeb buss = new BussFlowWeb(); -// buss.m_Header = header; - - buss.msg_type = header.getTableID(); -// offset += 4; -// buss.msg_version = data.getInt(1); -// offset += 1; -// buss.msg_seq = data.getInt(4); -// offset += 4; -// buss.msg_len = data.getInt(4); -// offset += 4; - - buss.src_mac = data.getLong(8); - - buss.dst_mac = data.getLong(8); - - - data.position(data.position()+20); - - buss.protocol=data.getInt(4); - - buss.bytes_out = data.getLong(4); - - buss.bytes_in = data.getLong(4); - - buss.package_out = data.getInt(4); - - buss.package_in = data.getInt(4); - - buss.session_serial_number = data.alignedSlice(24).toString(); //5268109200 - -// buss.recog_status = data.getInt(4); - - data.position(data.position()+4); - buss.req_method = data.getLong(4); //1 - - buss.content_type = data.alignedSlice(40).toString(); - - buss.accept = data.alignedSlice(40).toString(); //image/png, image/svg+xml, image/*;q=0.8 - - buss.probe_if=data.getInt(); - - buss.channel=data.alignedSlice(4).toString(); - - buss.session_id=data.alignedSlice(0).toString(); //7Ip6bYet8n0wfxeJMJtAm7v2FW76ZTImJVyNjbYoRbUdUf71QaxQ!-202316728 - - buss.request_ip=data.getLong(); //3232235850 - - buss.request_port=data.getInt(); //3309 - - buss.response_ip=data.getLong(); //1971882754 - - buss.response_port=data.getInt(); //80 - - //开始时间 - buss.start_tv_sec=data.getLong(); //1492473697 - - buss.start_tv_usec=data.getLong(); //459461 - - //结束时间 - buss.end_tv_sec=data.getLong(); //1492473697 - - buss.end_tv_usec=data.getLong(); //459490 - - - buss.server_translate_time=data.getLong(); - - - buss.server_start_tv_sec=data.getInt(); - - buss.server_start_tv_usec=data.getLong(); - - //结束时间 - buss.server_end_tv_sec=data.getInt(); - - buss.server_end_tv_usec=data.getLong(); - - - buss.server_response_time=data.getLong(); - - buss.client_translate_time=data.getLong(); - - - data.position(data.position()+24); - - buss.x_requested_with = data.alignedSlice(20).toString(); - - buss.operating_system=data.alignedSlice(0).toString(); //Windows NT 6.1 - - buss.server_res_code=data.getInt(); - - buss.browser=data.alignedSlice(0).toString(); - - buss.isUncomplete = data.getInt(4); - - buss.time_flag=data.getInt(4); - - int detailMsgLen = data.getInt(4); - - int keyMsgLen = data.getInt(4); - - int reqMsgLeng= data.getInt(4); - buss.request_msg_length =reqMsgLeng; - - int resMsgLength=data.getInt(4); - buss.response_msg_length = resMsgLength; - - int cookieLength=data.getInt(4); - buss.req_cookie_leng=cookieLength; - - int url_len=data.getInt(4); - - int refer_len=data.getInt(4); - - int remainLen = data.getInt(4); - - -// if (SystemConfigManager.systemCode.equals("JXYDBPM")) { -// buss.business_detail_mesg=JXYDBPMDetailMesgUtils.decodeValue(data.alignedSlice(etailMsgLen).toString()); -// } else { -// buss.business_detail_mesg=data.alignedSlice(etailMsgLen).toString(); -// } - buss.business_detail_mesg=data.alignedSlice(detailMsgLen).toString(); - - buss.bussiness_key_mesg = data.alignedSlice(keyMsgLen).toString(); - - buss.request_msg_detail = utils.ByteBufferUTF8String(data, reqMsgLeng); - - buss.response_msg_detail = utils.ByteBufferUTF8String(data, resMsgLength); - - buss.req_cookie_detail = data.alignedSlice(cookieLength).toString(); - - buss.ori_url=data.alignedSlice(url_len).toString(); // /images/index/220130.gif - if(buss.ori_url!=null && !"".equals(buss.ori_url.trim())){ - String result = buss.ori_url.replaceAll("\\?", "").replaceAll("\\/", "").replaceAll("\\*", "").replaceAll("\\=", "").replaceAll("\\&", "").replaceAll("\\+", ""); - if(isMessyCode(result)){//如果中文乱码 - // String withoutValue = URLUtil.getInsertURL(buss.ori_url, Constants.SPLIT_NULL).trim();//去参数值 - - // String result2 = withoutValue.replaceAll("\\?", "").replaceAll("\\/", "").replaceAll("\\*", "").replaceAll("\\=", "").replaceAll("\\&", "").replaceAll("\\+", ""); - // if(isMessyCode(result2)){//判断是否还乱码 - // buss.ori_url=""; - // }else{ - // buss.ori_url=withoutValue; - // } - }; - } - - buss.reter_url = data.alignedSlice(refer_len).toString(); // http://www.10086.cn/gd/index_200_200.html - - buss.remain_data = data.alignedSlice(remainLen).toString(); - - /*if(SystemConfigManager.projectName.contains("GDYDBPM")){ - boolean exist=false; - if(SystemConfigManager.reduceFlag){ - - redisTemplate = (RedisTemplate) ApplicationContextUtil.getBean("redisTemplate"); - exist = reduceByKey(buss); - } - - //不存在就加入缓存 - if(!exist)return buss; - //存在就返回空 - return null; - } - */ - - return buss; - } - - - /** - * 如果已经存在这个key,则说明是重复数据,不再进行后续操作 - * @param buss - * @return - */ - /*private boolean reduceByKey(BussFlowWeb buss) { - - - String coding = CodingGeneration.md5GenCoding2(buss.ori_url); - String key=buss.session_serial_number+"|"+buss.request_ip+"|"+buss.request_port+"|"+buss.response_ip+"|"+buss.response_port+"|"+coding+"|"+buss.business_detail_mesg; - - //分布式同步锁,如果存在该key或者锁已经被获取则返回false,设置 - - boolean flag=redisTemplate.opsForValue().setIfAbsent(key, System.currentTimeMillis()+""); - - if(flag){ - redisTemplate.expire(key,SystemConfigManager.keyExistTime,TimeUnit.SECONDS); - //原来不存在这条数据 - return false; - } - - return true; - }*/ - - /** - * 判断字符串是否是乱码 - * - * @param strName 字符串 - * @return 是否是乱码 - */ - - public static boolean isMessyCode(String strName) { - Pattern p = Pattern.compile("\\s*|\t*|\r*|\n*"); - Matcher m = p.matcher(strName); - String after = m.replaceAll("").replace("-", "").replace("|", ""); - String temp = after.replaceAll("\\p{P}", ""); - char[] ch = temp.trim().toCharArray(); - float chLength = 0 ; - float count = 0; - for (int i = 0; i < ch.length; i++) { - char c = ch[i]; - if (!Character.isLetterOrDigit(c)) { - if (!isChinese(c)) { - count = count + 1; - } - chLength++; - } - } - float result = count / chLength ; - if (result > 0.4) { - return true; - } else { - return false; - } - } - - private static boolean isChinese(char c) { - Character.UnicodeBlock ub = Character.UnicodeBlock.of(c); - if (ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS - || ub == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS - || ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A - || ub == Character.UnicodeBlock.GENERAL_PUNCTUATION - || ub == Character.UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION - || ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS) { - return true; - } - return false; - } - - public String id; //id - public int msg_len; //消息长度 - public int msg_type; //消息类型 - public long src_mac; - public long dst_mac; - public int protocol; //协议名 - public String session_serial_number;//会话序列号 - public String buss_type;//业务服务资源编码(C_01) -// public String net_segment;//网段标识(客户-web) - public long request_ip;//Web客户端IP - public int request_port;//Web客户端端口 - public long response_ip;//Web服务器IP - public int response_port;//Web服务器端口 - public long start_tv_sec;//Web开始时间秒 - public long start_tv_usec;//开始时间毫秒 - public long end_tv_sec;//结束时间秒 - public long end_tv_usec;//结束时间微妙 - public String disc_resource_ident; //web:url mid:apiBody db:sql - public String operating_system; //web:操作系统 midd:interfaceName db:db_name - //web midd - public String session_id;//sessionid - public int request_msg_length; //请求报文长度 - public String request_msg_detail; //请求报文详情 - public int response_msg_length; //响应报文长度 - public String response_msg_detail; //响应报文详情 - //web段 - public String reter_url; - public String x_requested_with; - public long req_method; //请求方式 - public String content_type; //请求类型 - public String accept; //jieshou - public int req_cookie_leng;//请求cookie报文长度 - public String req_cookie_detail;//请求cookie报文详情 - public long t_intodb_time; - public int load_or_step; //0: 页面 1:加载项 2:非web段数据 - public String business_detail_mesg; - public String bussiness_key_mesg; //关键字 格式:key=val|key=val.... - public int isUncomplete; //组包是否完全 0:组包完整 1:不完整 - public int deal_state=1; - public int server_res_code; - public long server_response_time; - public long client_translate_time; - public String browser; - public int server_start_tv_sec; - public long server_start_tv_usec; - public int server_end_tv_sec; - public long server_end_tv_usec; - public String probe_ip; - public int probe_if; - public long server_translate_time; - public long time_flag; - public String channel; - public String base_code; - public String ori_url; - public String remain_data; - public long bytes_in; - public long bytes_out; - public int package_in; - public int package_out; - - public String dataId; - - public int filterId; - - public String whiteCharacter; - - // tokenId - public String tokenId; - // 判断是否是首端资源( 2 ) - public Integer segmentId; - - @Override - public String[] getData() { - String data[] = new String[38]; - return data; - } - - public String getBussType() { - return buss_type; - } - - - @Override - public int getInterfaceNumber() { - return 0; - } -} diff --git a/src/main/java/com/yuandian/dataflow/proto/decode/DataBaseModel.java b/src/main/java/com/yuandian/dataflow/proto/decode/DataBaseModel.java deleted file mode 100644 index b56677c..0000000 --- a/src/main/java/com/yuandian/dataflow/proto/decode/DataBaseModel.java +++ /dev/null @@ -1,381 +0,0 @@ -package com.yuandian.dataflow.proto.decode; - - - -import java.io.Serializable; -import java.nio.ByteBuffer; -import java.util.Date; - -import io.netty.buffer.ByteBuf; - - - -/** - * 移植zjm流量信息接收类 - * Leehr - * - */ -public class DataBaseModel extends PacketBase implements Serializable{ - - - private static final long serialVersionUID = 1L; - - private static final String split=";"; - - private long mac_src; //源MAC - private long mac_dst; //目标MAC - private long ip_src; //源IP - private long ip_dst; //目标IP - private long port_src; //源端口,如果没有,为-1 - private long port_dst; //目标端口,如果没有,为-1 - private long l3_proto; //第三层协议ID,如果没有,为-1 - private long l4_proto; //第四层协议ID,如果没有,为-1 - private long tos; //Tos,一个字节,如果没有,为-1 - private long vlan_id; //vlan ID,如果没有,为-1 - - private long bytes; //字节总数 - private long packets; //数据包总数 - - private long packets_syn; //TCP同步包数 - private long packets_syn_ack; //TCP同步确认包数 - private long packets_syn_rst; //TCP同步重置包数 - - private long timestamp; //时间戳,秒 - - private long appid;//应用ID - private long app_group_id; - private long mpls_label; - - private long pkts_syn_rx; //tcp同步包,接收 - private long pkts_syn_ack_rx;//tcp同步确认包,接收 - private long pkts_syn_rst_rx; //tcp同步重置包,接收 - private long pkts_fin;//tcp终止包,接收 - private long pkts_rst;//tcp重置包,接收 - - private long bytes_rx;//字节收 - private long packets_rx;//数据包收 - - private long probe_time_sec; - private Date probe_time; - private Date createTime; - - public String getKey(){ - StringBuffer strb=new StringBuffer(); - strb.append(timestamp).append(split); - strb.append(mac_src).append(split); - strb.append(mac_dst).append(split); - strb.append(ip_src).append(split); - strb.append(ip_dst).append(split); - strb.append(port_src).append(split); - strb.append(port_dst).append(split); - strb.append(l3_proto).append(split); - strb.append(l4_proto).append(split); - strb.append(tos).append(split); - strb.append(vlan_id).append(split); - strb.append(appid); - return strb.toString(); - } - - public DataBaseModel Parse(ByteBuffer data)throws Exception { - - if (data.position() + 108 > data.array().length) - throw new Exception("data length error!"); - - DataBaseModel db = new DataBaseModel(); - db.mac_src = data.getLong( 8); - - db.mac_dst = data.getLong( 8); - - db.ip_src = data.getLong( 8); - - db.ip_dst = data.getLong( 8); - - db.port_src = data.getInt(4); - - db.port_dst = data.getInt(4); - - db.l3_proto = data.getInt(4); - - db.l4_proto = data.getInt(4); - - db.tos = data.getInt(4); - - db.vlan_id = data.getInt(4); - - db.bytes = data.getLong( 8); - - db.packets = data.getLong( 8); - - db.packets_syn = data.getLong( 8); - - - db.packets_syn_ack = data.getLong( 8); - - db.packets_syn_rst = data.getLong( 8); - - /** - * 2015-12-10txy 新增3个解析 - */ - db.appid=data.getLong( 4); - - db.app_group_id=data.getLong( 4); - - db.mpls_label=data.getLong( 4); - - return db; - } - - public String toString(){ - StringBuffer strb = new StringBuffer(); - strb.append(timestamp).append(","); - strb.append(mac_src).append(","); - strb.append(mac_dst).append(","); - strb.append(ip_src).append(","); - strb.append(ip_dst).append(","); - strb.append(port_src).append(","); - strb.append(port_dst).append(","); - strb.append(l3_proto).append(","); - strb.append(l4_proto).append(","); - strb.append(tos).append(","); - strb.append(vlan_id).append(","); - strb.append(appid).append(","); - strb.append(packets_syn).append(","); - strb.append(pkts_syn_rx).append(","); - strb.append(packets_syn_ack).append(","); - strb.append(pkts_syn_ack_rx).append(","); - strb.append(packets_syn_rst).append(","); - strb.append(pkts_syn_rst_rx).append(","); - strb.append(pkts_fin).append(","); - strb.append(pkts_rst).append(","); - strb.append(bytes).append(","); - strb.append(packets).append(","); - strb.append(bytes_rx).append(","); - strb.append(packets_rx).append(","); - strb.append(app_group_id).append(","); - strb.append(mpls_label).append("\n"); - return strb.toString(); - } - - - public long getProbeTimeSec() { - return probe_time_sec; - } - - public void setProbe_time_sec(long probe_time_sec) { - this.probe_time_sec = probe_time_sec; - } - - public Date getProbe_time() { - return probe_time; - } - - public void setProbe_time(Date probe_time) { - this.probe_time = probe_time; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public long getTimestamp() { - return timestamp; - } - public void setTimestamp(long timestamp) { - this.timestamp = timestamp; - } - public long getMac_src() { - return mac_src; - } - public void setMac_src(long macSrc) { - mac_src = macSrc; - } - public long getMac_dst() { - return mac_dst; - } - public void setMac_dst(long macDst) { - mac_dst = macDst; - } - public long getIp_src() { - return ip_src; - } - public void setIp_src(long ipSrc) { - ip_src = ipSrc; - } - public long getIp_dst() { - return ip_dst; - } - public void setIp_dst(long ipDst) { - ip_dst = ipDst; - } - public long getPort_src() { - return port_src; - } - public void setPort_src(long portSrc) { - port_src = portSrc; - } - public long getPort_dst() { - return port_dst; - } - public void setPort_dst(long portDst) { - port_dst = portDst; - } - public long getL3_proto() { - return l3_proto; - } - public void setL3_proto(long l3Proto) { - l3_proto = l3Proto; - } - public long getL4_proto() { - return l4_proto; - } - public void setL4_proto(long l4Proto) { - l4_proto = l4Proto; - } - public long getTos() { - return tos; - } - public void setTos(long tos) { - this.tos = tos; - } - public long getVlan_id() { - return vlan_id; - } - public void setVlan_id(long vlanId) { - vlan_id = vlanId; - } - public long getAppid() { - return appid; - } - public void setAppid(long appid) { - this.appid = appid; - } - - public long getPkts_syn_rx() { - return pkts_syn_rx; - } - public void setPkts_syn_rx(long pktsSynRx) { - pkts_syn_rx = pktsSynRx; - } - - public long getPkts_syn_ack_rx() { - return pkts_syn_ack_rx; - } - public void setPkts_syn_ack_rx(long pktsSynAckRx) { - pkts_syn_ack_rx = pktsSynAckRx; - } - - public long getPkts_syn_rst_rx() { - return pkts_syn_rst_rx; - } - public void setPkts_syn_rst_rx(long pktsSynRstRx) { - pkts_syn_rst_rx = pktsSynRstRx; - } - public long getPkts_fin() { - return pkts_fin; - } - public void setPkts_fin(long pktsFin) { - pkts_fin = pktsFin; - } - public long getPkts_rst() { - return pkts_rst; - } - public void setPkts_rst(long pktsRst) { - pkts_rst = pktsRst; - } - public long getBytes() { - return bytes; - } - public void setBytes(long bytes) { - this.bytes = bytes; - } - public long getPackets() { - return packets; - } - public void setPackets(long packets) { - this.packets = packets; - } - public long getBytes_rx() { - return bytes_rx; - } - public void setBytes_rx(long bytesRx) { - bytes_rx = bytesRx; - } - public long getPackets_rx() { - return packets_rx; - } - public void setPackets_rx(long packetsRx) { - packets_rx = packetsRx; - } - - public long getPackets_syn() { - return packets_syn; - } - - public void setPackets_syn(long packetsSyn) { - packets_syn = packetsSyn; - } - - public long getPackets_syn_ack() { - return packets_syn_ack; - } - - public void setPackets_syn_ack(long packetsSynAck) { - packets_syn_ack = packetsSynAck; - } - - public long getPackets_syn_rst() { - return packets_syn_rst; - } - - public void setPackets_syn_rst(long packetsSynRst) { - packets_syn_rst = packetsSynRst; - } - - public long getApp_group_id() { - return app_group_id; - } - - public void setApp_group_id(long app_group_id) { - this.app_group_id = app_group_id; - } - - public long getMpls_label() { - return mpls_label; - } - - public void setMpls_label(long mpls_label) { - this.mpls_label = mpls_label; - } - - public static String getSplit() { - return split; - } - - @Override - public PacketBase Parse(PacketHeader header,ByteBuffer data) - throws Exception { - return null; - } - - @Override - public int getUnitPacketLength() { - return 0; - } - - @Override - public String[] getData() { - return null; - } - - @Override - public int getInterfaceNumber() { - return 0; - } - - - -} diff --git a/src/main/java/com/yuandian/dataflow/proto/decode/DataFlow.java b/src/main/java/com/yuandian/dataflow/proto/decode/DataFlow.java deleted file mode 100644 index 05bd36f..0000000 --- a/src/main/java/com/yuandian/dataflow/proto/decode/DataFlow.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.yuandian.dataflow.proto.decode; - -import java.nio.ByteBuffer; - -public class DataFlow extends PacketBase { - private final int UNIT_DATA_LENGTH = 157;//贵阳 - public String id; - - public Integer msg_type; //消息类型 - public Integer msg_version; //消息版本 - public Integer msg_seq; //序列号 - public Integer msg_len; //消息长度 - public Integer probe_if; //接口号 - public Long timestamp; //时间戳 - public Long mac_src; //源物理地址 - public Long mac_dst; //目的物理地址 - public Integer vlan_id; //vlan_id - public Long l3_proto; //l3层协议 - public Long l4_proto; //l4层协议 - public Integer tos; //tos - public Integer retran_count; //重传次数 - public Integer reset_count; //重置次数 - public Integer zerowin_count; //零窗口次数 - public Integer protocol; //协议名 - public Long seq; - public Long ack; - public Integer recog_status; //识别类型标识 - public Long bytes; //总字节 - public Long packets; //总包数 - public Integer start_tv_sec;//Web开始时间秒 - public Long start_tv_usec;//开始时间毫秒 - public Integer end_tv_sec;//结束时间秒 - public Long end_tv_usec;//结束时间微妙 - public Integer server_start_tv_sec;//服务器响应开始时间秒 - public Long server_start_tv_usec;//服务器响应开始时间毫秒 - public Integer server_end_tv_sec;//服务器响应结束时间秒 - public Long server_end_tv_usec;//服务器响应结束时间微妙 - - public Long server_response_time;//Web服务器响应时间 - public Long client_translate_time;//Web客户端传输耗时 - public Long server_translate_time;//Web服务器传输耗时 - - public Long bytes_in; - public Long bytes_out; - public Long packets_in; - public Long packets_out; - public Long ip_src; //源IP - public Long ip_dst; //目的IP - public Long port_src; //源端口 - public Long port_dst; //目的端口 - public Long probeIP; //探针IP - - public Long intodb_time; - public Long count = 1L; - - - - @Override - public PacketBase Parse(PacketHeader header,ByteBuffer data) throws Exception { - if (data.position() + UNIT_DATA_LENGTH > data.array().length) - throw new Exception("data length error!"); - DataFlow dflow = new DataFlow(); -// dflow.m_Header = header; - - dflow.msg_type = header.getTableID(); - - dflow.ip_src = data.getLong(4); - - dflow.ip_dst = data.getLong(4); - - - - data.position(data.position()+4); - - dflow.probe_if = data.getInt(4); - - - - - - - data.position(data.position() + 32 + 12 + 12 + 8 ); - - dflow.bytes_in = data.getLong(4); - - dflow.bytes_out = data.getLong(4); - - dflow.packets_in = data.getLong(4); - - dflow.packets_out = data.getLong(4); - - dflow.bytes = data.getLong(4); - - dflow.packets = data.getLong(4); - - data.position(data.position() + 12 + 12 + 16 + 16 ); - return dflow; - } - @Override - public int getUnitPacketLength() { - return UNIT_DATA_LENGTH; - } - @Override - public String[] getData() { - String data[] = new String[45]; - return data; - } - @Override - public int getInterfaceNumber() { - return Integer.parseInt(probe_if.toString()); - } -} diff --git a/src/main/java/com/yuandian/dataflow/proto/decode/PacketBase.java b/src/main/java/com/yuandian/dataflow/proto/decode/PacketBase.java deleted file mode 100644 index 9019563..0000000 --- a/src/main/java/com/yuandian/dataflow/proto/decode/PacketBase.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.yuandian.dataflow.proto.decode; -import java.nio.ByteBuffer; - -import lombok.ToString; - -@ToString -public abstract class PacketBase { - - protected PacketHeader m_Header = null; - - public PacketHeader getPacketHead(){ - return m_Header; - } - - public void setPacketHeader(PacketHeader header) - { - this.m_Header = header; - } - - //抽象方法,每个数据操作类实现不一样 - public abstract PacketBase Parse(PacketHeader header,ByteBuffer data) throws Exception; - - public abstract int getUnitPacketLength(); - - public abstract String[] getData(); - - public abstract int getInterfaceNumber(); - - - public static PacketBase createPacketBase(PacketHeader packetHeader) { - // 获取报文头 - - // 响应表ID - int table_id = packetHeader.getTableID(); - switch (table_id) { - case 17: - AppFlow appFlow = new AppFlow(); - appFlow.setPacketHeader(packetHeader); - return appFlow; - case 18: - QoeFlow qoeFlow = new QoeFlow(); - qoeFlow.setPacketHeader(packetHeader); - return qoeFlow; - case 20: - SstFlow sstFlow = new SstFlow(); - sstFlow.setPacketHeader(packetHeader); - return sstFlow; - case 22: - BussFlowWeb tBusiness = new BussFlowWeb(); - tBusiness.setPacketHeader(packetHeader); - return tBusiness; - case 23: - BussFlowMidd secondBusiness = new BussFlowMidd(); - secondBusiness.setPacketHeader(packetHeader); - return secondBusiness; - case 24: - BussFlowDb thirdBusiness = new BussFlowDb(); - thirdBusiness.setPacketHeader(packetHeader); - return thirdBusiness; - case 25: - BussFlowOrl tExternalBusiness = new BussFlowOrl(); - tExternalBusiness.setPacketHeader(packetHeader); - return tExternalBusiness; - case 27: - DataFlow dataFlow = new DataFlow(); - dataFlow.setPacketHeader(packetHeader); - return dataFlow; - case 28: - ApmBaseDataFlow apmBaseDataFlow = new ApmBaseDataFlow(); - apmBaseDataFlow.setPacketHeader(packetHeader); - return apmBaseDataFlow; - case 29: - BasicTrafficFlow BasicTrafficFlow = new BasicTrafficFlow(); - BasicTrafficFlow.setPacketHeader(packetHeader); - return BasicTrafficFlow; - default: - return null; - } - } -} diff --git a/src/main/java/com/yuandian/dataflow/proto/decode/PacketHeader.java b/src/main/java/com/yuandian/dataflow/proto/decode/PacketHeader.java deleted file mode 100644 index 010c755..0000000 --- a/src/main/java/com/yuandian/dataflow/proto/decode/PacketHeader.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * description - * - * @author eson - *2022年6月07日-11:09:21 - */ -package com.yuandian.dataflow.proto.decode; - -import java.io.DataInputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; - -/** - * description - * - * @author eson - *2022年6月07日-11:09:21 - */ -@Getter -@Setter -@ToString -public class PacketHeader { - - private int tableID = -1; //数据类型 - private int recCount = 0; //数据总条数 - private int msgLen; //数据报文总长度,60010端口为压缩后长度 - private long timestamp; //60010端口发送数据时间 - private int probeIf; //60010端口抓包口 - private int umcomprLen;//60010端口数据报文压缩前长度 - private int nowType; //记录25类型数据数据当前数据类型 22 23 24 - - public PacketHeader(DataInputStream data) throws Exception { - this.tableID = ByteBuffer.wrap( data.readNBytes(4)).order(ByteOrder.LITTLE_ENDIAN).getInt();//22 - this.recCount = ByteBuffer.wrap( data.readNBytes(4)).order(ByteOrder.LITTLE_ENDIAN).getInt();//4000 - this.msgLen = ByteBuffer.wrap( data.readNBytes(4)).order(ByteOrder.LITTLE_ENDIAN).getInt(); - } - - public void parseNextHeader_60010(DataInputStream data) throws Exception { - this.timestamp = ByteBuffer.wrap( data.readNBytes(4)).order(ByteOrder.LITTLE_ENDIAN).getLong(); - this.probeIf =ByteBuffer.wrap( data.readNBytes(4)).order(ByteOrder.LITTLE_ENDIAN).getInt(); - this.umcomprLen = ByteBuffer.wrap( data.readNBytes(4)).order(ByteOrder.LITTLE_ENDIAN).getInt(); - } - - public static int PacketCode(DataInputStream data) throws IOException { - var buf = ByteBuffer.wrap( data.readNBytes(4)).order(ByteOrder.LITTLE_ENDIAN); - return buf.getInt(); - } - - -} diff --git a/src/main/java/com/yuandian/dataflow/proto/decode/QoeFlow.java b/src/main/java/com/yuandian/dataflow/proto/decode/QoeFlow.java deleted file mode 100644 index 1efcf1d..0000000 --- a/src/main/java/com/yuandian/dataflow/proto/decode/QoeFlow.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * - */ -package com.yuandian.dataflow.proto.decode; - -import java.nio.ByteBuffer; - -import io.netty.buffer.ByteBuf; - -/** - * @author l - * 网络性能流 - */ -public class QoeFlow extends PacketBase { - private String qoe_Flow_Id; - public static int SIZE = 38*4; -// 字段类型 字段 原始类型 字节数 说明 -public int srcIp; //uint32_t 4 源ip地址 -public int dstIp; //uint32_t 4 目的ip地址 -public int stvSec; //uint32_t 4 开始时间秒 -public int stvUsec; //uint32_t 4 开始时间微秒 -public int ltvSec; //uint32_t 4 最后更新时间秒 -public int ltvUsec; //uint32_t 4 最后更新时间微秒 -public int dst2ResponNum; //uint32_t 4 响应总量 -public int dst2Fast; //uint32_t 4 -public int dst2FastExpected; //uint32_t 4 -public int dst2ExpectedDegrated; //uint32_t 4 -public int dst2DegratedService; //uint32_t 4 -public int dst2ServiceAvailability; //uint32_t 4 -public int dst2ResponTimeout; //uint32_t 4 响应超时数 -public int dst2ResponSuccess; //uint32_t 4 响应成功数 -public int dst2ResponFail; //uint32_t 4 响应失败数 -public int dst2ResponPeek; //uint32_t 4 峰值响应时间 -public int dst2ResponAverage; //uint32_t 4 响应时间均值 -public int csWindow; //uint32_t 4 -public int scWindow; //uint32_t 4 -public int csReset; //uint32_t 4 -public int scReset; //uint32_t 4 -public int csRetran; //uint32_t 4 -public int scRetran; //uint32_t 4 -public int appId; //uint32_t 4 Aphid -public int appGroupId; //uint32_t 4 app组id -public int probeIf; //uint32_t 4 探针接口id -public int appStyle; //uint32_t 4 -public int timeFlag; //uint32_t 4 发送时间戳 -public int connSetupTm; //uint32_t 4 链接建立时间 -public int dataTransferTm; //uint32_t 4 数据传输时间 -public int retransDelayTm; //uint32_t 4 数据重传时延 -public int networkInbound; //uint32_t 4 网络响应时间(c->s) -public int networkOutbound; //uint32_t 4 网络响应时间(s->c) -public int newSession; //uint32_t 4 新会话数 -public int userEvents; //uint32_t 4 用户事件 -public int serverEvents; //uint32_t 4 服务事件 -public int connSetupPeek; //uint32_t 4 连接建立时间峰值 -public int vlanId; //uint32_t 4 - - - -@Override -public QoeFlow Parse(PacketHeader header,ByteBuffer data) throws Exception { - QoeFlow qoeFlow = new QoeFlow(); - qoeFlow.srcIp=data.getInt( 4); - - qoeFlow.dstIp=data.getInt( 4); - - qoeFlow.stvSec=data.getInt( 4); - - qoeFlow.stvUsec=data.getInt( 4); - - qoeFlow.ltvSec=data.getInt( 4); - - qoeFlow.ltvUsec=data.getInt( 4); - - qoeFlow.dst2ResponNum=data.getInt( 4); - - qoeFlow.dst2Fast=data.getInt( 4); - - qoeFlow.dst2FastExpected=data.getInt( 4); - - qoeFlow.dst2ExpectedDegrated=data.getInt( 4); - - qoeFlow.dst2DegratedService=data.getInt( 4); - - qoeFlow.dst2ServiceAvailability=data.getInt( 4); - - qoeFlow.dst2ResponTimeout=data.getInt( 4); - - qoeFlow.dst2ResponSuccess=data.getInt( 4); - - qoeFlow.dst2ResponFail=data.getInt( 4); - - qoeFlow.dst2ResponPeek=data.getInt( 4); - - qoeFlow.dst2ResponAverage=data.getInt( 4); - - qoeFlow.csWindow=data.getInt( 4); - - qoeFlow.scWindow=data.getInt( 4); - - qoeFlow.csReset=data.getInt( 4); - - qoeFlow.scReset=data.getInt( 4); - - qoeFlow.csRetran=data.getInt( 4); - - qoeFlow.scRetran=data.getInt( 4); - - qoeFlow.appId=data.getInt( 4); - - qoeFlow.appGroupId=data.getInt( 4); - - qoeFlow.probeIf=data.getInt( 4); - - qoeFlow.appStyle=data.getInt( 4); - - qoeFlow.timeFlag=data.getInt( 4); - - qoeFlow.connSetupTm=data.getInt( 4); - - qoeFlow.dataTransferTm=data.getInt( 4); - - qoeFlow.retransDelayTm=data.getInt( 4); - - qoeFlow.networkInbound=data.getInt( 4); - - qoeFlow.networkOutbound=data.getInt( 4); - - qoeFlow.newSession=data.getInt( 4); - - qoeFlow.userEvents=data.getInt( 4); - - qoeFlow.serverEvents=data.getInt( 4); - - qoeFlow.connSetupPeek=data.getInt( 4); - - qoeFlow.vlanId=data.getInt( 4); - - return qoeFlow; -} -@Override -public int getUnitPacketLength() { - // TODO Auto-generated method stub - return 0; -} -@Override -public String[] getData() { - // TODO Auto-generated method stub - return null; -} -@Override -public int getInterfaceNumber() { - // TODO Auto-generated method stub - return 0; -} - -} diff --git a/src/main/java/com/yuandian/dataflow/proto/decode/SstFlow.java b/src/main/java/com/yuandian/dataflow/proto/decode/SstFlow.java deleted file mode 100644 index 61d23ad..0000000 --- a/src/main/java/com/yuandian/dataflow/proto/decode/SstFlow.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.yuandian.dataflow.proto.decode; - -import java.nio.ByteBuffer; -import java.util.Date; - - - -public class SstFlow extends PacketBase{ - - public static int SIZE = 108; - - public long mac_src; //源MAC - public long mac_dst; //目标MAC - public long ip_src; //源IP - public long ip_dst; //目标IP - public int port_src; //源端口,如果没有,为-1 - public int port_dst; //目标端口,如果没有,为-1 - public int l3_proto; //第三层协议ID,如果没有,为-1 - public int l4_proto; //第四层协议ID,如果没有,为-1 - public int tos; //Tos,一个字节,如果没有,为-1 - public int vlan_id; //vlan ID,如果没有,为-1 - - public long bytes; //字节总数 - public long packets; //数据包总数 - - public long packets_syn; //TCP同步包数 - public long packets_syn_ack; //TCP同步确认包数 - public long packets_syn_rst; //TCP同步重置包数 - - public long timestamp; //时间戳,秒 - - public long appid;//应用ID - public long app_group_id; - public int mpls_label; - - public long pkts_syn_rx; //tcp同步包,接收 - public long pkts_syn_ack_rx;//tcp同步确认包,接收 - public long pkts_syn_rst_rx; //tcp同步重置包,接收 - public long pkts_fin;//tcp终止包,接收 - public long pkts_rst;//tcp重置包,接收 - - public long bytes_rx;//字节收 - public long packets_rx;//数据包收 - - public long probe_time_sec; - public Date probe_time; - public Date createTime; - - public int probe_if; - - @Override - public PacketBase Parse(PacketHeader header,ByteBuffer data) - throws Exception { - SstFlow sstFlow = new SstFlow(); - sstFlow.mac_src = data.getLong(8); - - sstFlow.mac_dst = data.getLong(8); - - sstFlow.ip_src = data.getLong(8); - - sstFlow.ip_dst = data.getLong(8); - - sstFlow.port_src = data.getInt(4); - - sstFlow.port_dst = data.getInt(4); - - sstFlow.l3_proto = data.getInt(4); - - sstFlow.l4_proto = data.getInt(4); - - sstFlow.tos = data.getInt(4); - - sstFlow.vlan_id = data.getInt(4); - - - sstFlow.bytes = data.getLong(8); - - sstFlow.packets = data.getLong(8); - - sstFlow.packets_syn = data.getLong(8); - - sstFlow.packets_syn_ack = data.getLong(8); - - sstFlow.packets_syn_rst = data.getLong(8); - - sstFlow.appid = data.getInt(4); - - sstFlow.app_group_id = data.getInt(4); - - sstFlow.mpls_label = data.getInt(4); - - sstFlow.timestamp = header.getTimestamp(); - sstFlow.probe_if = header.getProbeIf(); - return sstFlow; - } - - @Override - public int getUnitPacketLength() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public String[] getData() { - // TODO Auto-generated method stub - return null; - } - - @Override - public int getInterfaceNumber() { - // TODO Auto-generated method stub - return 0; - } - -} diff --git a/src/main/java/com/yuandian/dataflow/proto/decode/utils.java b/src/main/java/com/yuandian/dataflow/proto/decode/utils.java deleted file mode 100644 index 41a66b4..0000000 --- a/src/main/java/com/yuandian/dataflow/proto/decode/utils.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * description - * - * @author eson - *2022年6月07日-16:18:34 - */ -package com.yuandian.dataflow.proto.decode; - -import java.io.UnsupportedEncodingException; -import java.nio.ByteBuffer; - -/** - * description - * - * @author eson - *2022年6月07日-16:18:34 - */ -public class utils { - public static String ByteBufferUTF8String(ByteBuffer data, int length) throws UnsupportedEncodingException { - return new String( data.alignedSlice(length).array(), "utf-8"); - } -} diff --git a/src/main/proto/ApmBaseDataFlow.proto b/src/main/proto/ApmBaseDataFlow.proto new file mode 100644 index 0000000..cb3c060 --- /dev/null +++ b/src/main/proto/ApmBaseDataFlow.proto @@ -0,0 +1,168 @@ +syntax = "proto3"; + +package com.yuandian.dataflow.proto; + +message ApmBaseDataFlow { + + int32 tableID = 1; + + int32 probeIf = 2; + //四元组 + /** + * 请求端口 + */ + int32 requestPort = 3; + /** + * 响应端口 + */ + int32 responsePort = 4; + /** + * 请求IP + */ + int32 requestIp = 5; + /** + * 响应Ip + */ + int32 responseIp = 6; + + /** + * 源mac + */ + int64 srcMac = 7; + + /** + * 目的mac + */ + int64 dstMac = 8; + + /** + * 链路编号 + */ + int32 vlanId = 9; + + int32 tvSec = 10; + + int32 tvUsec = 11; + + /** + * 开始时间 + */ + int32 startTm = 12; + + /** + * 总字节数 + */ + int32 totalBytes = 13; + + /** + * 总包数 + */ + int32 totalPackets = 14; + /** + * 总丢包数 + */ + int32 totalDropPackets = 15; + /** + * 重传延时 + */ + int32 retranTimeDelay = 16; + /** + * 客户端rtt + */ + int32 clientRtt = 17; + + /** + * 服务端Rtt + */ + int32 serverRtt = 18; + + + /** + * 用户响应时间 + */ + int32 userResponseTime = 19; + /** + * 服务响应时间 + */ + int32 serverResponseTime = 20; + + + /** + * tcp回话连接失败数 + */ + int32 conFail = 21; + + /** + * 会话重置数 + */ + // long reset = 22; + + /** + * 服务端总字节数 + */ + int32 bytesIn = 23; + /** + * 客户端总字节数 + */ + int32 bytesOut = 24; + /** + * 探针推送时间 + */ + int32 timeFlag = 25; + + /** + * 结束时间 + */ + int32 endTm = 26; + + /** + * 结束时间微秒 + */ + int32 endTmUsec = 27; + + /** + * 总响应数 + */ + int32 responNum = 28; + /** + * 客户端零窗口数 + */ + int32 csWindow = 29; + /** + * 服务端零窗口数 + */ + int32 scWindow = 30; + /** + * 客户端重置数 + */ + int32 csReset = 31; + /** + * 服务端重置数 + */ + int32 scReset = 32; + /** + * 客户端重传数 + */ + int32 csRetran = 33; + /** + * 服务端重传数 + */ + int32 scRetran = 34; + /** + * 会话建立时间 + */ + int32 connSetupTm = 35; + /** + * 新建会话数 + */ + int32 newSession = 36; + + int32 csAlert = 37; + + int32 scAlert = 38; + + string protocal = 39; +} + + + diff --git a/src/main/proto/Base.proto b/src/main/proto/Base.proto new file mode 100644 index 0000000..f75a397 --- /dev/null +++ b/src/main/proto/Base.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +import "google/protobuf/any.proto"; +import "ApmBaseDataFlow.proto"; + +option java_multiple_files = false; //不要拆分成多个文件 +option java_package = "com.yuandian.dataflow.proto"; + +package com.yuandian.dataflow.proto; + +message Response { + int32 code = 1; + int32 message = 2; + repeated google.protobuf.Any packets = 4; +} + +message Request { + int32 type = 1; // 请求类型. 默认 为 1. 暂无意义 + repeated google.protobuf.Any param = 2; + string version = 3; // 请求版本. 区分版本. 非必要时不使用 +} + +service CollectPacketsServer { + rpc GetPackets (Request) returns (stream Response); +}