最近在做socket通信中用到了关于序列化工具选型的问题,在调研过程中开始趋向于用protobuf,可以省去了编解码的过程。能够实现快速开发,且只需要维护一份协议文件即可。
但是调研过程中发现了protobuf的一些弊端,比如需要生成相应的文件类,和业务绑定太紧密,所以在看了AVRO之后发现它完美解决了这个问题。
下面记录下对这两种序列化工具的入门与测评。
一、protobuf基本操作
protobuf简介:
1
|
Protocol Buffers (a.k.a., protobuf) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data. |
protobuf是google提供的一种跨语言、跨平台、可扩展的序列化工具。
1.1定义协议文件(部分字段)(TCPLog.proto):
1
2
3
4
5
6
|
syntax = "proto2"; message TCPLog{ optional int32 total_byteps = 1; optional int64 flow_start_time =2; optional int64 date =3; } |
1.2生成对应的Java类:
生成过程可以使用ecplise 的插件 或者 直接在控制台中使用命令生成。
命令行中生成规则如下:
1
|
protoc.exe -I=proto的输入目录 --java_out=java类输出目录 proto的输入目录包括包括proto文件 |
生成java类如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
|
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: TCPLog.proto public final class TCPLogOuterClass { private TCPLogOuterClass() {} 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 TCPLogOrBuilder extends // @@protoc_insertion_point(interface_extends:TCPLog) com.google.protobuf.MessageOrBuilder { /** * < code >optional int32 total_byteps = 1;</ code > */ boolean hasTotalByteps(); /** * < code >optional int32 total_byteps = 1;</ code > */ int getTotalByteps(); /** * < code >optional int64 flow_start_time = 2;</ code > */ boolean hasFlowStartTime(); /** * < code >optional int64 flow_start_time = 2;</ code > */ long getFlowStartTime(); /** * < code >optional int64 date = 3;</ code > */ boolean hasDate(); /** * < code >optional int64 date = 3;</ code > */ long getDate(); /** * < code >optional int64 server_total_packet = 4;</ code > */ boolean hasServerTotalPacket(); /** * < code >optional int64 server_total_packet = 4;</ code > */ long getServerTotalPacket(); /** * < code >optional int64 client_total_byte = 5;</ code > */ boolean hasClientTotalByte(); /** * < code >optional int64 client_total_byte = 5;</ code > */ long getClientTotalByte(); /** * < code >optional int32 link_id = 6;</ code > */ boolean hasLinkId(); /** * < code >optional int32 link_id = 6;</ code > */ int getLinkId(); /** * < code >optional int64 total_byte = 7;</ code > */ boolean hasTotalByte(); /** * < code >optional int64 total_byte = 7;</ code > */ long getTotalByte(); /** * < code >optional int64 flow_end_time = 8;</ code > */ boolean hasFlowEndTime(); /** * < code >optional int64 flow_end_time = 8;</ code > */ long getFlowEndTime(); /** * < code >optional int32 client_port = 9;</ code > */ boolean hasClientPort(); /** * < code >optional int32 client_port = 9;</ code > */ int getClientPort(); /** * < code >optional int32 protocol = 10;</ code > */ boolean hasProtocol(); /** * < code >optional int32 protocol = 10;</ code > */ int getProtocol(); /** * < code >optional int64 total_packet = 11;</ code > */ boolean hasTotalPacket(); /** * < code >optional int64 total_packet = 11;</ code > */ long getTotalPacket(); /** * < code >optional int64 flow_duration = 12;</ code > */ boolean hasFlowDuration(); /** * < code >optional int64 flow_duration = 12;</ code > */ long getFlowDuration(); /** * < code >optional string id = 13;</ code > */ boolean hasId(); /** * < code >optional string id = 13;</ code > */ java.lang.String getId(); /** * < code >optional string id = 13;</ code > */ com.google.protobuf.ByteString getIdBytes(); /** * < code >optional string server_ip_addr = 14;</ code > */ boolean hasServerIpAddr(); /** * < code >optional string server_ip_addr = 14;</ code > */ java.lang.String getServerIpAddr(); /** * < code >optional string server_ip_addr = 14;</ code > */ com.google.protobuf.ByteString getServerIpAddrBytes(); /** * < code >optional string direction_mask = 15;</ code > */ boolean hasDirectionMask(); /** * < code >optional string direction_mask = 15;</ code > */ java.lang.String getDirectionMask(); /** * < code >optional string direction_mask = 15;</ code > */ com.google.protobuf.ByteString getDirectionMaskBytes(); /** * < code >optional int32 app = 16;</ code > */ boolean hasApp(); /** * < code >optional int32 app = 16;</ code > */ int getApp(); /** * < code >optional int32 client_country_id = 17;</ code > */ boolean hasClientCountryId(); /** * < code >optional int32 client_country_id = 17;</ code > */ int getClientCountryId(); /** * < code >optional int32 client_netsegment_id = 18;</ code > */ boolean hasClientNetsegmentId(); /** * < code >optional int32 client_netsegment_id = 18;</ code > */ int getClientNetsegmentId(); /** * < code >optional int64 client_total_packet = 19;</ code > */ boolean hasClientTotalPacket(); /** * < code >optional int64 client_total_packet = 19;</ code > */ long getClientTotalPacket(); /** * < code >optional string client_ip_addr = 20;</ code > */ boolean hasClientIpAddr(); /** * < code >optional string client_ip_addr = 20;</ code > */ java.lang.String getClientIpAddr(); /** * < code >optional string client_ip_addr = 20;</ code > */ com.google.protobuf.ByteString getClientIpAddrBytes(); /** * < code >optional int32 tcp_status = 21;</ code > */ boolean hasTcpStatus(); /** * < code >optional int32 tcp_status = 21;</ code > */ int getTcpStatus(); /** * < code >optional int32 server_country_id = 22;</ code > */ boolean hasServerCountryId(); /** * < code >optional int32 server_country_id = 22;</ code > */ int getServerCountryId(); /** * < code >optional int32 server_netsegment_id = 23;</ code > */ boolean hasServerNetsegmentId(); /** * < code >optional int32 server_netsegment_id = 23;</ code > */ int getServerNetsegmentId(); /** * < code >optional int64 avg_pkt_size = 24;</ code > */ boolean hasAvgPktSize(); /** * < code >optional int64 avg_pkt_size = 24;</ code > */ long getAvgPktSize(); /** * < code >optional int32 server_port = 25;</ code > */ boolean hasServerPort(); /** * < code >optional int32 server_port = 25;</ code > */ int getServerPort(); /** * < code >optional int64 server_total_byte = 26;</ code > */ boolean hasServerTotalByte(); /** * < code >optional int64 server_total_byte = 26;</ code > */ long getServerTotalByte(); /** * < code >optional int32 total_packetps = 27;</ code > */ boolean hasTotalPacketps(); /** * < code >optional int32 total_packetps = 27;</ code > */ int getTotalPacketps(); } /** * Protobuf type {@code TCPLog} */ public static final class TCPLog extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:TCPLog) TCPLogOrBuilder { // Use TCPLog.newBuilder() to construct. private TCPLog(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private TCPLog() { totalByteps_ = 0; flowStartTime_ = 0L; date_ = 0L; serverTotalPacket_ = 0L; clientTotalByte_ = 0L; linkId_ = 0; totalByte_ = 0L; flowEndTime_ = 0L; clientPort_ = 0; protocol_ = 0; totalPacket_ = 0L; flowDuration_ = 0L; id_ = ""; serverIpAddr_ = ""; directionMask_ = ""; app_ = 0; clientCountryId_ = 0; clientNetsegmentId_ = 0; clientTotalPacket_ = 0L; clientIpAddr_ = ""; tcpStatus_ = 0; serverCountryId_ = 0; serverNetsegmentId_ = 0; avgPktSize_ = 0L; serverPort_ = 0; serverTotalByte_ = 0L; totalPacketps_ = 0; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private TCPLog( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); 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; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } break; } case 8: { bitField0_ |= 0x00000001; totalByteps_ = input.readInt32(); break; } case 16: { bitField0_ |= 0x00000002; flowStartTime_ = input.readInt64(); break; } case 24: { bitField0_ |= 0x00000004; date_ = input.readInt64(); break; } case 32: { bitField0_ |= 0x00000008; serverTotalPacket_ = input.readInt64(); break; } case 40: { bitField0_ |= 0x00000010; clientTotalByte_ = input.readInt64(); break; } case 48: { bitField0_ |= 0x00000020; linkId_ = input.readInt32(); break; } case 56: { bitField0_ |= 0x00000040; totalByte_ = input.readInt64(); break; } case 64: { bitField0_ |= 0x00000080; flowEndTime_ = input.readInt64(); break; } case 72: { bitField0_ |= 0x00000100; clientPort_ = input.readInt32(); break; } case 80: { bitField0_ |= 0x00000200; protocol_ = input.readInt32(); break; } case 88: { bitField0_ |= 0x00000400; totalPacket_ = input.readInt64(); break; } case 96: { bitField0_ |= 0x00000800; flowDuration_ = input.readInt64(); break; } case 106: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00001000; id_ = bs; break; } case 114: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00002000; serverIpAddr_ = bs; break; } case 122: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00004000; directionMask_ = bs; break; } case 128: { bitField0_ |= 0x00008000; app_ = input.readInt32(); break; } case 136: { bitField0_ |= 0x00010000; clientCountryId_ = input.readInt32(); break; } case 144: { bitField0_ |= 0x00020000; clientNetsegmentId_ = input.readInt32(); break; } case 152: { bitField0_ |= 0x00040000; clientTotalPacket_ = input.readInt64(); break; } case 162: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00080000; clientIpAddr_ = bs; break; } case 168: { bitField0_ |= 0x00100000; tcpStatus_ = input.readInt32(); break; } case 176: { bitField0_ |= 0x00200000; serverCountryId_ = input.readInt32(); break; } case 184: { bitField0_ |= 0x00400000; serverNetsegmentId_ = input.readInt32(); break; } case 192: { bitField0_ |= 0x00800000; avgPktSize_ = input.readInt64(); break; } case 200: { bitField0_ |= 0x01000000; serverPort_ = input.readInt32(); break; } case 208: { bitField0_ |= 0x02000000; serverTotalByte_ = input.readInt64(); break; } case 216: { bitField0_ |= 0x04000000; totalPacketps_ = input.readInt32(); break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.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 TCPLogOuterClass.internal_static_TCPLog_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return TCPLogOuterClass.internal_static_TCPLog_fieldAccessorTable .ensureFieldAccessorsInitialized( TCPLogOuterClass.TCPLog.class, TCPLogOuterClass.TCPLog.Builder.class); } private int bitField0_; public static final int TOTAL_BYTEPS_FIELD_NUMBER = 1; private int totalByteps_; /** * < code >optional int32 total_byteps = 1;</ code > */ public boolean hasTotalByteps() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * < code >optional int32 total_byteps = 1;</ code > */ public int getTotalByteps() { return totalByteps_; } public static final int FLOW_START_TIME_FIELD_NUMBER = 2; private long flowStartTime_; /** * < code >optional int64 flow_start_time = 2;</ code > */ public boolean hasFlowStartTime() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * < code >optional int64 flow_start_time = 2;</ code > */ public long getFlowStartTime() { return flowStartTime_; } public static final int DATE_FIELD_NUMBER = 3; private long date_; /** * < code >optional int64 date = 3;</ code > */ public boolean hasDate() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * < code >optional int64 date = 3;</ code > */ public long getDate() { return date_; } public static final int SERVER_TOTAL_PACKET_FIELD_NUMBER = 4; private long serverTotalPacket_; /** * < code >optional int64 server_total_packet = 4;</ code > */ public boolean hasServerTotalPacket() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** * < code >optional int64 server_total_packet = 4;</ code > */ public long getServerTotalPacket() { return serverTotalPacket_; } public static final int CLIENT_TOTAL_BYTE_FIELD_NUMBER = 5; private long clientTotalByte_; /** * < code >optional int64 client_total_byte = 5;</ code > */ public boolean hasClientTotalByte() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** * < code >optional int64 client_total_byte = 5;</ code > */ public long getClientTotalByte() { return clientTotalByte_; } public static final int LINK_ID_FIELD_NUMBER = 6; private int linkId_; /** * < code >optional int32 link_id = 6;</ code > */ public boolean hasLinkId() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** * < code >optional int32 link_id = 6;</ code > */ public int getLinkId() { return linkId_; } public static final int TOTAL_BYTE_FIELD_NUMBER = 7; private long totalByte_; /** * < code >optional int64 total_byte = 7;</ code > */ public boolean hasTotalByte() { return ((bitField0_ & 0x00000040) == 0x00000040); } /** * < code >optional int64 total_byte = 7;</ code > */ public long getTotalByte() { return totalByte_; } public static final int FLOW_END_TIME_FIELD_NUMBER = 8; private long flowEndTime_; /** * < code >optional int64 flow_end_time = 8;</ code > */ public boolean hasFlowEndTime() { return ((bitField0_ & 0x00000080) == 0x00000080); } /** * < code >optional int64 flow_end_time = 8;</ code > */ public long getFlowEndTime() { return flowEndTime_; } public static final int CLIENT_PORT_FIELD_NUMBER = 9; private int clientPort_; /** * < code >optional int32 client_port = 9;</ code > */ public boolean hasClientPort() { return ((bitField0_ & 0x00000100) == 0x00000100); } /** * < code >optional int32 client_port = 9;</ code > */ public int getClientPort() { return clientPort_; } public static final int PROTOCOL_FIELD_NUMBER = 10; private int protocol_; /** * < code >optional int32 protocol = 10;</ code > */ public boolean hasProtocol() { return ((bitField0_ & 0x00000200) == 0x00000200); } /** * < code >optional int32 protocol = 10;</ code > */ public int getProtocol() { return protocol_; } public static final int TOTAL_PACKET_FIELD_NUMBER = 11; private long totalPacket_; /** * < code >optional int64 total_packet = 11;</ code > */ public boolean hasTotalPacket() { return ((bitField0_ & 0x00000400) == 0x00000400); } /** * < code >optional int64 total_packet = 11;</ code > */ public long getTotalPacket() { return totalPacket_; } public static final int FLOW_DURATION_FIELD_NUMBER = 12; private long flowDuration_; /** * < code >optional int64 flow_duration = 12;</ code > */ public boolean hasFlowDuration() { return ((bitField0_ & 0x00000800) == 0x00000800); } /** * < code >optional int64 flow_duration = 12;</ code > */ public long getFlowDuration() { return flowDuration_; } public static final int ID_FIELD_NUMBER = 13; private volatile java.lang.Object id_; /** * < code >optional string id = 13;</ code > */ public boolean hasId() { return ((bitField0_ & 0x00001000) == 0x00001000); } /** * < code >optional string id = 13;</ code > */ public java.lang.String getId() { java.lang.Object ref = id_; 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(); if (bs.isValidUtf8()) { id_ = s; } return s; } } /** * < code >optional string id = 13;</ code > */ public com.google.protobuf.ByteString getIdBytes() { java.lang.Object ref = id_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); id_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int SERVER_IP_ADDR_FIELD_NUMBER = 14; private volatile java.lang.Object serverIpAddr_; /** * < code >optional string server_ip_addr = 14;</ code > */ public boolean hasServerIpAddr() { return ((bitField0_ & 0x00002000) == 0x00002000); } /** * < code >optional string server_ip_addr = 14;</ code > */ public java.lang.String getServerIpAddr() { java.lang.Object ref = serverIpAddr_; 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(); if (bs.isValidUtf8()) { serverIpAddr_ = s; } return s; } } /** * < code >optional string server_ip_addr = 14;</ code > */ public com.google.protobuf.ByteString getServerIpAddrBytes() { java.lang.Object ref = serverIpAddr_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); serverIpAddr_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int DIRECTION_MASK_FIELD_NUMBER = 15; private volatile java.lang.Object directionMask_; /** * < code >optional string direction_mask = 15;</ code > */ public boolean hasDirectionMask() { return ((bitField0_ & 0x00004000) == 0x00004000); } /** * < code >optional string direction_mask = 15;</ code > */ public java.lang.String getDirectionMask() { java.lang.Object ref = directionMask_; 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(); if (bs.isValidUtf8()) { directionMask_ = s; } return s; } } /** * < code >optional string direction_mask = 15;</ code > */ public com.google.protobuf.ByteString getDirectionMaskBytes() { java.lang.Object ref = directionMask_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); directionMask_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int APP_FIELD_NUMBER = 16; private int app_; /** * < code >optional int32 app = 16;</ code > */ public boolean hasApp() { return ((bitField0_ & 0x00008000) == 0x00008000); } /** * < code >optional int32 app = 16;</ code > */ public int getApp() { return app_; } public static final int CLIENT_COUNTRY_ID_FIELD_NUMBER = 17; private int clientCountryId_; /** * < code >optional int32 client_country_id = 17;</ code > */ public boolean hasClientCountryId() { return ((bitField0_ & 0x00010000) == 0x00010000); } /** * < code >optional int32 client_country_id = 17;</ code > */ public int getClientCountryId() { return clientCountryId_; } public static final int CLIENT_NETSEGMENT_ID_FIELD_NUMBER = 18; private int clientNetsegmentId_; /** * < code >optional int32 client_netsegment_id = 18;</ code > */ public boolean hasClientNetsegmentId() { return ((bitField0_ & 0x00020000) == 0x00020000); } /** * < code >optional int32 client_netsegment_id = 18;</ code > */ public int getClientNetsegmentId() { return clientNetsegmentId_; } public static final int CLIENT_TOTAL_PACKET_FIELD_NUMBER = 19; private long clientTotalPacket_; /** * < code >optional int64 client_total_packet = 19;</ code > */ public boolean hasClientTotalPacket() { return ((bitField0_ & 0x00040000) == 0x00040000); } /** * < code >optional int64 client_total_packet = 19;</ code > */ public long getClientTotalPacket() { return clientTotalPacket_; } public static final int CLIENT_IP_ADDR_FIELD_NUMBER = 20; private volatile java.lang.Object clientIpAddr_; /** * < code >optional string client_ip_addr = 20;</ code > */ public boolean hasClientIpAddr() { return ((bitField0_ & 0x00080000) == 0x00080000); } /** * < code >optional string client_ip_addr = 20;</ code > */ public java.lang.String getClientIpAddr() { java.lang.Object ref = clientIpAddr_; 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(); if (bs.isValidUtf8()) { clientIpAddr_ = s; } return s; } } /** * < code >optional string client_ip_addr = 20;</ code > */ public com.google.protobuf.ByteString getClientIpAddrBytes() { java.lang.Object ref = clientIpAddr_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); clientIpAddr_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int TCP_STATUS_FIELD_NUMBER = 21; private int tcpStatus_; /** * < code >optional int32 tcp_status = 21;</ code > */ public boolean hasTcpStatus() { return ((bitField0_ & 0x00100000) == 0x00100000); } /** * < code >optional int32 tcp_status = 21;</ code > */ public int getTcpStatus() { return tcpStatus_; } public static final int SERVER_COUNTRY_ID_FIELD_NUMBER = 22; private int serverCountryId_; /** * < code >optional int32 server_country_id = 22;</ code > */ public boolean hasServerCountryId() { return ((bitField0_ & 0x00200000) == 0x00200000); } /** * < code >optional int32 server_country_id = 22;</ code > */ public int getServerCountryId() { return serverCountryId_; } public static final int SERVER_NETSEGMENT_ID_FIELD_NUMBER = 23; private int serverNetsegmentId_; /** * < code >optional int32 server_netsegment_id = 23;</ code > */ public boolean hasServerNetsegmentId() { return ((bitField0_ & 0x00400000) == 0x00400000); } /** * < code >optional int32 server_netsegment_id = 23;</ code > */ public int getServerNetsegmentId() { return serverNetsegmentId_; } public static final int AVG_PKT_SIZE_FIELD_NUMBER = 24; private long avgPktSize_; /** * < code >optional int64 avg_pkt_size = 24;</ code > */ public boolean hasAvgPktSize() { return ((bitField0_ & 0x00800000) == 0x00800000); } /** * < code >optional int64 avg_pkt_size = 24;</ code > */ public long getAvgPktSize() { return avgPktSize_; } public static final int SERVER_PORT_FIELD_NUMBER = 25; private int serverPort_; /** * < code >optional int32 server_port = 25;</ code > */ public boolean hasServerPort() { return ((bitField0_ & 0x01000000) == 0x01000000); } /** * < code >optional int32 server_port = 25;</ code > */ public int getServerPort() { return serverPort_; } public static final int SERVER_TOTAL_BYTE_FIELD_NUMBER = 26; private long serverTotalByte_; /** * < code >optional int64 server_total_byte = 26;</ code > */ public boolean hasServerTotalByte() { return ((bitField0_ & 0x02000000) == 0x02000000); } /** * < code >optional int64 server_total_byte = 26;</ code > */ public long getServerTotalByte() { return serverTotalByte_; } public static final int TOTAL_PACKETPS_FIELD_NUMBER = 27; private int totalPacketps_; /** * < code >optional int32 total_packetps = 27;</ code > */ public boolean hasTotalPacketps() { return ((bitField0_ & 0x04000000) == 0x04000000); } /** * < code >optional int32 total_packetps = 27;</ code > */ public int getTotalPacketps() { return totalPacketps_; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(1, totalByteps_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeInt64(2, flowStartTime_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeInt64(3, date_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeInt64(4, serverTotalPacket_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeInt64(5, clientTotalByte_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { output.writeInt32(6, linkId_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { output.writeInt64(7, totalByte_); } if (((bitField0_ & 0x00000080) == 0x00000080)) { output.writeInt64(8, flowEndTime_); } if (((bitField0_ & 0x00000100) == 0x00000100)) { output.writeInt32(9, clientPort_); } if (((bitField0_ & 0x00000200) == 0x00000200)) { output.writeInt32(10, protocol_); } if (((bitField0_ & 0x00000400) == 0x00000400)) { output.writeInt64(11, totalPacket_); } if (((bitField0_ & 0x00000800) == 0x00000800)) { output.writeInt64(12, flowDuration_); } if (((bitField0_ & 0x00001000) == 0x00001000)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 13, id_); } if (((bitField0_ & 0x00002000) == 0x00002000)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 14, serverIpAddr_); } if (((bitField0_ & 0x00004000) == 0x00004000)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 15, directionMask_); } if (((bitField0_ & 0x00008000) == 0x00008000)) { output.writeInt32(16, app_); } if (((bitField0_ & 0x00010000) == 0x00010000)) { output.writeInt32(17, clientCountryId_); } if (((bitField0_ & 0x00020000) == 0x00020000)) { output.writeInt32(18, clientNetsegmentId_); } if (((bitField0_ & 0x00040000) == 0x00040000)) { output.writeInt64(19, clientTotalPacket_); } if (((bitField0_ & 0x00080000) == 0x00080000)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 20, clientIpAddr_); } if (((bitField0_ & 0x00100000) == 0x00100000)) { output.writeInt32(21, tcpStatus_); } if (((bitField0_ & 0x00200000) == 0x00200000)) { output.writeInt32(22, serverCountryId_); } if (((bitField0_ & 0x00400000) == 0x00400000)) { output.writeInt32(23, serverNetsegmentId_); } if (((bitField0_ & 0x00800000) == 0x00800000)) { output.writeInt64(24, avgPktSize_); } if (((bitField0_ & 0x01000000) == 0x01000000)) { output.writeInt32(25, serverPort_); } if (((bitField0_ & 0x02000000) == 0x02000000)) { output.writeInt64(26, serverTotalByte_); } if (((bitField0_ & 0x04000000) == 0x04000000)) { output.writeInt32(27, totalPacketps_); } unknownFields.writeTo(output); } public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(1, totalByteps_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(2, flowStartTime_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(3, date_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(4, serverTotalPacket_); } if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(5, clientTotalByte_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(6, linkId_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(7, totalByte_); } if (((bitField0_ & 0x00000080) == 0x00000080)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(8, flowEndTime_); } if (((bitField0_ & 0x00000100) == 0x00000100)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(9, clientPort_); } if (((bitField0_ & 0x00000200) == 0x00000200)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(10, protocol_); } if (((bitField0_ & 0x00000400) == 0x00000400)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(11, totalPacket_); } if (((bitField0_ & 0x00000800) == 0x00000800)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(12, flowDuration_); } if (((bitField0_ & 0x00001000) == 0x00001000)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, id_); } if (((bitField0_ & 0x00002000) == 0x00002000)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, serverIpAddr_); } if (((bitField0_ & 0x00004000) == 0x00004000)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, directionMask_); } if (((bitField0_ & 0x00008000) == 0x00008000)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(16, app_); } if (((bitField0_ & 0x00010000) == 0x00010000)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(17, clientCountryId_); } if (((bitField0_ & 0x00020000) == 0x00020000)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(18, clientNetsegmentId_); } if (((bitField0_ & 0x00040000) == 0x00040000)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(19, clientTotalPacket_); } if (((bitField0_ & 0x00080000) == 0x00080000)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(20, clientIpAddr_); } if (((bitField0_ & 0x00100000) == 0x00100000)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(21, tcpStatus_); } if (((bitField0_ & 0x00200000) == 0x00200000)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(22, serverCountryId_); } if (((bitField0_ & 0x00400000) == 0x00400000)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(23, serverNetsegmentId_); } if (((bitField0_ & 0x00800000) == 0x00800000)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(24, avgPktSize_); } if (((bitField0_ & 0x01000000) == 0x01000000)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(25, serverPort_); } if (((bitField0_ & 0x02000000) == 0x02000000)) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(26, serverTotalByte_); } if (((bitField0_ & 0x04000000) == 0x04000000)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(27, totalPacketps_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } private static final long serialVersionUID = 0L; @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof TCPLogOuterClass.TCPLog)) { return super.equals(obj); } TCPLogOuterClass.TCPLog other = (TCPLogOuterClass.TCPLog) obj; boolean result = true; result = result && (hasTotalByteps() == other.hasTotalByteps()); if (hasTotalByteps()) { result = result && (getTotalByteps() == other.getTotalByteps()); } result = result && (hasFlowStartTime() == other.hasFlowStartTime()); if (hasFlowStartTime()) { result = result && (getFlowStartTime() == other.getFlowStartTime()); } result = result && (hasDate() == other.hasDate()); if (hasDate()) { result = result && (getDate() == other.getDate()); } result = result && (hasServerTotalPacket() == other.hasServerTotalPacket()); if (hasServerTotalPacket()) { result = result && (getServerTotalPacket() == other.getServerTotalPacket()); } result = result && (hasClientTotalByte() == other.hasClientTotalByte()); if (hasClientTotalByte()) { result = result && (getClientTotalByte() == other.getClientTotalByte()); } result = result && (hasLinkId() == other.hasLinkId()); if (hasLinkId()) { result = result && (getLinkId() == other.getLinkId()); } result = result && (hasTotalByte() == other.hasTotalByte()); if (hasTotalByte()) { result = result && (getTotalByte() == other.getTotalByte()); } result = result && (hasFlowEndTime() == other.hasFlowEndTime()); if (hasFlowEndTime()) { result = result && (getFlowEndTime() == other.getFlowEndTime()); } result = result && (hasClientPort() == other.hasClientPort()); if (hasClientPort()) { result = result && (getClientPort() == other.getClientPort()); } result = result && (hasProtocol() == other.hasProtocol()); if (hasProtocol()) { result = result && (getProtocol() == other.getProtocol()); } result = result && (hasTotalPacket() == other.hasTotalPacket()); if (hasTotalPacket()) { result = result && (getTotalPacket() == other.getTotalPacket()); } result = result && (hasFlowDuration() == other.hasFlowDuration()); if (hasFlowDuration()) { result = result && (getFlowDuration() == other.getFlowDuration()); } result = result && (hasId() == other.hasId()); if (hasId()) { result = result && getId() .equals(other.getId()); } result = result && (hasServerIpAddr() == other.hasServerIpAddr()); if (hasServerIpAddr()) { result = result && getServerIpAddr() .equals(other.getServerIpAddr()); } result = result && (hasDirectionMask() == other.hasDirectionMask()); if (hasDirectionMask()) { result = result && getDirectionMask() .equals(other.getDirectionMask()); } result = result && (hasApp() == other.hasApp()); if (hasApp()) { result = result && (getApp() == other.getApp()); } result = result && (hasClientCountryId() == other.hasClientCountryId()); if (hasClientCountryId()) { result = result && (getClientCountryId() == other.getClientCountryId()); } result = result && (hasClientNetsegmentId() == other.hasClientNetsegmentId()); if (hasClientNetsegmentId()) { result = result && (getClientNetsegmentId() == other.getClientNetsegmentId()); } result = result && (hasClientTotalPacket() == other.hasClientTotalPacket()); if (hasClientTotalPacket()) { result = result && (getClientTotalPacket() == other.getClientTotalPacket()); } result = result && (hasClientIpAddr() == other.hasClientIpAddr()); if (hasClientIpAddr()) { result = result && getClientIpAddr() .equals(other.getClientIpAddr()); } result = result && (hasTcpStatus() == other.hasTcpStatus()); if (hasTcpStatus()) { result = result && (getTcpStatus() == other.getTcpStatus()); } result = result && (hasServerCountryId() == other.hasServerCountryId()); if (hasServerCountryId()) { result = result && (getServerCountryId() == other.getServerCountryId()); } result = result && (hasServerNetsegmentId() == other.hasServerNetsegmentId()); if (hasServerNetsegmentId()) { result = result && (getServerNetsegmentId() == other.getServerNetsegmentId()); } result = result && (hasAvgPktSize() == other.hasAvgPktSize()); if (hasAvgPktSize()) { result = result && (getAvgPktSize() == other.getAvgPktSize()); } result = result && (hasServerPort() == other.hasServerPort()); if (hasServerPort()) { result = result && (getServerPort() == other.getServerPort()); } result = result && (hasServerTotalByte() == other.hasServerTotalByte()); if (hasServerTotalByte()) { result = result && (getServerTotalByte() == other.getServerTotalByte()); } result = result && (hasTotalPacketps() == other.hasTotalPacketps()); if (hasTotalPacketps()) { result = result && (getTotalPacketps() == other.getTotalPacketps()); } result = result && unknownFields.equals(other.unknownFields); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasTotalByteps()) { hash = (37 * hash) + TOTAL_BYTEPS_FIELD_NUMBER; hash = (53 * hash) + getTotalByteps(); } if (hasFlowStartTime()) { hash = (37 * hash) + FLOW_START_TIME_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getFlowStartTime()); } if (hasDate()) { hash = (37 * hash) + DATE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getDate()); } if (hasServerTotalPacket()) { hash = (37 * hash) + SERVER_TOTAL_PACKET_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getServerTotalPacket()); } if (hasClientTotalByte()) { hash = (37 * hash) + CLIENT_TOTAL_BYTE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getClientTotalByte()); } if (hasLinkId()) { hash = (37 * hash) + LINK_ID_FIELD_NUMBER; hash = (53 * hash) + getLinkId(); } if (hasTotalByte()) { hash = (37 * hash) + TOTAL_BYTE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getTotalByte()); } if (hasFlowEndTime()) { hash = (37 * hash) + FLOW_END_TIME_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getFlowEndTime()); } if (hasClientPort()) { hash = (37 * hash) + CLIENT_PORT_FIELD_NUMBER; hash = (53 * hash) + getClientPort(); } if (hasProtocol()) { hash = (37 * hash) + PROTOCOL_FIELD_NUMBER; hash = (53 * hash) + getProtocol(); } if (hasTotalPacket()) { hash = (37 * hash) + TOTAL_PACKET_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getTotalPacket()); } if (hasFlowDuration()) { hash = (37 * hash) + FLOW_DURATION_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getFlowDuration()); } if (hasId()) { hash = (37 * hash) + ID_FIELD_NUMBER; hash = (53 * hash) + getId().hashCode(); } if (hasServerIpAddr()) { hash = (37 * hash) + SERVER_IP_ADDR_FIELD_NUMBER; hash = (53 * hash) + getServerIpAddr().hashCode(); } if (hasDirectionMask()) { hash = (37 * hash) + DIRECTION_MASK_FIELD_NUMBER; hash = (53 * hash) + getDirectionMask().hashCode(); } if (hasApp()) { hash = (37 * hash) + APP_FIELD_NUMBER; hash = (53 * hash) + getApp(); } if (hasClientCountryId()) { hash = (37 * hash) + CLIENT_COUNTRY_ID_FIELD_NUMBER; hash = (53 * hash) + getClientCountryId(); } if (hasClientNetsegmentId()) { hash = (37 * hash) + CLIENT_NETSEGMENT_ID_FIELD_NUMBER; hash = (53 * hash) + getClientNetsegmentId(); } if (hasClientTotalPacket()) { hash = (37 * hash) + CLIENT_TOTAL_PACKET_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getClientTotalPacket()); } if (hasClientIpAddr()) { hash = (37 * hash) + CLIENT_IP_ADDR_FIELD_NUMBER; hash = (53 * hash) + getClientIpAddr().hashCode(); } if (hasTcpStatus()) { hash = (37 * hash) + TCP_STATUS_FIELD_NUMBER; hash = (53 * hash) + getTcpStatus(); } if (hasServerCountryId()) { hash = (37 * hash) + SERVER_COUNTRY_ID_FIELD_NUMBER; hash = (53 * hash) + getServerCountryId(); } if (hasServerNetsegmentId()) { hash = (37 * hash) + SERVER_NETSEGMENT_ID_FIELD_NUMBER; hash = (53 * hash) + getServerNetsegmentId(); } if (hasAvgPktSize()) { hash = (37 * hash) + AVG_PKT_SIZE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getAvgPktSize()); } if (hasServerPort()) { hash = (37 * hash) + SERVER_PORT_FIELD_NUMBER; hash = (53 * hash) + getServerPort(); } if (hasServerTotalByte()) { hash = (37 * hash) + SERVER_TOTAL_BYTE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getServerTotalByte()); } if (hasTotalPacketps()) { hash = (37 * hash) + TOTAL_PACKETPS_FIELD_NUMBER; hash = (53 * hash) + getTotalPacketps(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static TCPLogOuterClass.TCPLog parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static TCPLogOuterClass.TCPLog parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static TCPLogOuterClass.TCPLog parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static TCPLogOuterClass.TCPLog parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static TCPLogOuterClass.TCPLog parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static TCPLogOuterClass.TCPLog parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static TCPLogOuterClass.TCPLog parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static TCPLogOuterClass.TCPLog 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 TCPLogOuterClass.TCPLog parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static TCPLogOuterClass.TCPLog 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 TCPLogOuterClass.TCPLog parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static TCPLogOuterClass.TCPLog parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(TCPLogOuterClass.TCPLog prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } 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 TCPLog} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder< Builder > implements // @@protoc_insertion_point(builder_implements:TCPLog) TCPLogOuterClass.TCPLogOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return TCPLogOuterClass.internal_static_TCPLog_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return TCPLogOuterClass.internal_static_TCPLog_fieldAccessorTable .ensureFieldAccessorsInitialized( TCPLogOuterClass.TCPLog.class, TCPLogOuterClass.TCPLog.Builder.class); } // Construct using TCPLogOuterClass.TCPLog.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } public Builder clear() { super.clear(); totalByteps_ = 0; bitField0_ = (bitField0_ & ~0x00000001); flowStartTime_ = 0L; bitField0_ = (bitField0_ & ~0x00000002); date_ = 0L; bitField0_ = (bitField0_ & ~0x00000004); serverTotalPacket_ = 0L; bitField0_ = (bitField0_ & ~0x00000008); clientTotalByte_ = 0L; bitField0_ = (bitField0_ & ~0x00000010); linkId_ = 0; bitField0_ = (bitField0_ & ~0x00000020); totalByte_ = 0L; bitField0_ = (bitField0_ & ~0x00000040); flowEndTime_ = 0L; bitField0_ = (bitField0_ & ~0x00000080); clientPort_ = 0; bitField0_ = (bitField0_ & ~0x00000100); protocol_ = 0; bitField0_ = (bitField0_ & ~0x00000200); totalPacket_ = 0L; bitField0_ = (bitField0_ & ~0x00000400); flowDuration_ = 0L; bitField0_ = (bitField0_ & ~0x00000800); id_ = ""; bitField0_ = (bitField0_ & ~0x00001000); serverIpAddr_ = ""; bitField0_ = (bitField0_ & ~0x00002000); directionMask_ = ""; bitField0_ = (bitField0_ & ~0x00004000); app_ = 0; bitField0_ = (bitField0_ & ~0x00008000); clientCountryId_ = 0; bitField0_ = (bitField0_ & ~0x00010000); clientNetsegmentId_ = 0; bitField0_ = (bitField0_ & ~0x00020000); clientTotalPacket_ = 0L; bitField0_ = (bitField0_ & ~0x00040000); clientIpAddr_ = ""; bitField0_ = (bitField0_ & ~0x00080000); tcpStatus_ = 0; bitField0_ = (bitField0_ & ~0x00100000); serverCountryId_ = 0; bitField0_ = (bitField0_ & ~0x00200000); serverNetsegmentId_ = 0; bitField0_ = (bitField0_ & ~0x00400000); avgPktSize_ = 0L; bitField0_ = (bitField0_ & ~0x00800000); serverPort_ = 0; bitField0_ = (bitField0_ & ~0x01000000); serverTotalByte_ = 0L; bitField0_ = (bitField0_ & ~0x02000000); totalPacketps_ = 0; bitField0_ = (bitField0_ & ~0x04000000); return this; } public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return TCPLogOuterClass.internal_static_TCPLog_descriptor; } public TCPLogOuterClass.TCPLog getDefaultInstanceForType() { return TCPLogOuterClass.TCPLog.getDefaultInstance(); } public TCPLogOuterClass.TCPLog build() { TCPLogOuterClass.TCPLog result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } public TCPLogOuterClass.TCPLog buildPartial() { TCPLogOuterClass.TCPLog result = new TCPLogOuterClass.TCPLog(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.totalByteps_ = totalByteps_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.flowStartTime_ = flowStartTime_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } result.date_ = date_; if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000008; } result.serverTotalPacket_ = serverTotalPacket_; if (((from_bitField0_ & 0x00000010) == 0x00000010)) { to_bitField0_ |= 0x00000010; } result.clientTotalByte_ = clientTotalByte_; if (((from_bitField0_ & 0x00000020) == 0x00000020)) { to_bitField0_ |= 0x00000020; } result.linkId_ = linkId_; if (((from_bitField0_ & 0x00000040) == 0x00000040)) { to_bitField0_ |= 0x00000040; } result.totalByte_ = totalByte_; if (((from_bitField0_ & 0x00000080) == 0x00000080)) { to_bitField0_ |= 0x00000080; } result.flowEndTime_ = flowEndTime_; if (((from_bitField0_ & 0x00000100) == 0x00000100)) { to_bitField0_ |= 0x00000100; } result.clientPort_ = clientPort_; if (((from_bitField0_ & 0x00000200) == 0x00000200)) { to_bitField0_ |= 0x00000200; } result.protocol_ = protocol_; if (((from_bitField0_ & 0x00000400) == 0x00000400)) { to_bitField0_ |= 0x00000400; } result.totalPacket_ = totalPacket_; if (((from_bitField0_ & 0x00000800) == 0x00000800)) { to_bitField0_ |= 0x00000800; } result.flowDuration_ = flowDuration_; if (((from_bitField0_ & 0x00001000) == 0x00001000)) { to_bitField0_ |= 0x00001000; } result.id_ = id_; if (((from_bitField0_ & 0x00002000) == 0x00002000)) { to_bitField0_ |= 0x00002000; } result.serverIpAddr_ = serverIpAddr_; if (((from_bitField0_ & 0x00004000) == 0x00004000)) { to_bitField0_ |= 0x00004000; } result.directionMask_ = directionMask_; if (((from_bitField0_ & 0x00008000) == 0x00008000)) { to_bitField0_ |= 0x00008000; } result.app_ = app_; if (((from_bitField0_ & 0x00010000) == 0x00010000)) { to_bitField0_ |= 0x00010000; } result.clientCountryId_ = clientCountryId_; if (((from_bitField0_ & 0x00020000) == 0x00020000)) { to_bitField0_ |= 0x00020000; } result.clientNetsegmentId_ = clientNetsegmentId_; if (((from_bitField0_ & 0x00040000) == 0x00040000)) { to_bitField0_ |= 0x00040000; } result.clientTotalPacket_ = clientTotalPacket_; if (((from_bitField0_ & 0x00080000) == 0x00080000)) { to_bitField0_ |= 0x00080000; } result.clientIpAddr_ = clientIpAddr_; if (((from_bitField0_ & 0x00100000) == 0x00100000)) { to_bitField0_ |= 0x00100000; } result.tcpStatus_ = tcpStatus_; if (((from_bitField0_ & 0x00200000) == 0x00200000)) { to_bitField0_ |= 0x00200000; } result.serverCountryId_ = serverCountryId_; if (((from_bitField0_ & 0x00400000) == 0x00400000)) { to_bitField0_ |= 0x00400000; } result.serverNetsegmentId_ = serverNetsegmentId_; if (((from_bitField0_ & 0x00800000) == 0x00800000)) { to_bitField0_ |= 0x00800000; } result.avgPktSize_ = avgPktSize_; if (((from_bitField0_ & 0x01000000) == 0x01000000)) { to_bitField0_ |= 0x01000000; } result.serverPort_ = serverPort_; if (((from_bitField0_ & 0x02000000) == 0x02000000)) { to_bitField0_ |= 0x02000000; } result.serverTotalByte_ = serverTotalByte_; if (((from_bitField0_ & 0x04000000) == 0x04000000)) { to_bitField0_ |= 0x04000000; } result.totalPacketps_ = totalPacketps_; result.bitField0_ = to_bitField0_; onBuilt(); return result; } public Builder clone() { return (Builder) super.clone(); } public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { return (Builder) super.setField(field, value); } public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) { return (Builder) super.setRepeatedField(field, index, value); } public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, Object value) { return (Builder) super.addRepeatedField(field, value); } public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof TCPLogOuterClass.TCPLog) { return mergeFrom((TCPLogOuterClass.TCPLog)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(TCPLogOuterClass.TCPLog other) { if (other == TCPLogOuterClass.TCPLog.getDefaultInstance()) return this; if (other.hasTotalByteps()) { setTotalByteps(other.getTotalByteps()); } if (other.hasFlowStartTime()) { setFlowStartTime(other.getFlowStartTime()); } if (other.hasDate()) { setDate(other.getDate()); } if (other.hasServerTotalPacket()) { setServerTotalPacket(other.getServerTotalPacket()); } if (other.hasClientTotalByte()) { setClientTotalByte(other.getClientTotalByte()); } if (other.hasLinkId()) { setLinkId(other.getLinkId()); } if (other.hasTotalByte()) { setTotalByte(other.getTotalByte()); } if (other.hasFlowEndTime()) { setFlowEndTime(other.getFlowEndTime()); } if (other.hasClientPort()) { setClientPort(other.getClientPort()); } if (other.hasProtocol()) { setProtocol(other.getProtocol()); } if (other.hasTotalPacket()) { setTotalPacket(other.getTotalPacket()); } if (other.hasFlowDuration()) { setFlowDuration(other.getFlowDuration()); } if (other.hasId()) { bitField0_ |= 0x00001000; id_ = other.id_; onChanged(); } if (other.hasServerIpAddr()) { bitField0_ |= 0x00002000; serverIpAddr_ = other.serverIpAddr_; onChanged(); } if (other.hasDirectionMask()) { bitField0_ |= 0x00004000; directionMask_ = other.directionMask_; onChanged(); } if (other.hasApp()) { setApp(other.getApp()); } if (other.hasClientCountryId()) { setClientCountryId(other.getClientCountryId()); } if (other.hasClientNetsegmentId()) { setClientNetsegmentId(other.getClientNetsegmentId()); } if (other.hasClientTotalPacket()) { setClientTotalPacket(other.getClientTotalPacket()); } if (other.hasClientIpAddr()) { bitField0_ |= 0x00080000; clientIpAddr_ = other.clientIpAddr_; onChanged(); } if (other.hasTcpStatus()) { setTcpStatus(other.getTcpStatus()); } if (other.hasServerCountryId()) { setServerCountryId(other.getServerCountryId()); } if (other.hasServerNetsegmentId()) { setServerNetsegmentId(other.getServerNetsegmentId()); } if (other.hasAvgPktSize()) { setAvgPktSize(other.getAvgPktSize()); } if (other.hasServerPort()) { setServerPort(other.getServerPort()); } if (other.hasServerTotalByte()) { setServerTotalByte(other.getServerTotalByte()); } if (other.hasTotalPacketps()) { setTotalPacketps(other.getTotalPacketps()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } public final boolean isInitialized() { return true; } public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { TCPLogOuterClass.TCPLog parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (TCPLogOuterClass.TCPLog) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private int totalByteps_ ; /** * < code >optional int32 total_byteps = 1;</ code > */ public boolean hasTotalByteps() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** * < code >optional int32 total_byteps = 1;</ code > */ public int getTotalByteps() { return totalByteps_; } /** * < code >optional int32 total_byteps = 1;</ code > */ public Builder setTotalByteps(int value) { bitField0_ |= 0x00000001; totalByteps_ = value; onChanged(); return this; } /** * < code >optional int32 total_byteps = 1;</ code > */ public Builder clearTotalByteps() { bitField0_ = (bitField0_ & ~0x00000001); totalByteps_ = 0; onChanged(); return this; } private long flowStartTime_ ; /** * < code >optional int64 flow_start_time = 2;</ code > */ public boolean hasFlowStartTime() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** * < code >optional int64 flow_start_time = 2;</ code > */ public long getFlowStartTime() { return flowStartTime_; } /** * < code >optional int64 flow_start_time = 2;</ code > */ public Builder setFlowStartTime(long value) { bitField0_ |= 0x00000002; flowStartTime_ = value; onChanged(); return this; } /** * < code >optional int64 flow_start_time = 2;</ code > */ public Builder clearFlowStartTime() { bitField0_ = (bitField0_ & ~0x00000002); flowStartTime_ = 0L; onChanged(); return this; } private long date_ ; /** * < code >optional int64 date = 3;</ code > */ public boolean hasDate() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** * < code >optional int64 date = 3;</ code > */ public long getDate() { return date_; } /** * < code >optional int64 date = 3;</ code > */ public Builder setDate(long value) { bitField0_ |= 0x00000004; date_ = value; onChanged(); return this; } /** * < code >optional int64 date = 3;</ code > */ public Builder clearDate() { bitField0_ = (bitField0_ & ~0x00000004); date_ = 0L; onChanged(); return this; } private long serverTotalPacket_ ; /** * < code >optional int64 server_total_packet = 4;</ code > */ public boolean hasServerTotalPacket() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** * < code >optional int64 server_total_packet = 4;</ code > */ public long getServerTotalPacket() { return serverTotalPacket_; } /** * < code >optional int64 server_total_packet = 4;</ code > */ public Builder setServerTotalPacket(long value) { bitField0_ |= 0x00000008; serverTotalPacket_ = value; onChanged(); return this; } /** * < code >optional int64 server_total_packet = 4;</ code > */ public Builder clearServerTotalPacket() { bitField0_ = (bitField0_ & ~0x00000008); serverTotalPacket_ = 0L; onChanged(); return this; } private long clientTotalByte_ ; /** * < code >optional int64 client_total_byte = 5;</ code > */ public boolean hasClientTotalByte() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** * < code >optional int64 client_total_byte = 5;</ code > */ public long getClientTotalByte() { return clientTotalByte_; } /** * < code >optional int64 client_total_byte = 5;</ code > */ public Builder setClientTotalByte(long value) { bitField0_ |= 0x00000010; clientTotalByte_ = value; onChanged(); return this; } /** * < code >optional int64 client_total_byte = 5;</ code > */ public Builder clearClientTotalByte() { bitField0_ = (bitField0_ & ~0x00000010); clientTotalByte_ = 0L; onChanged(); return this; } private int linkId_ ; /** * < code >optional int32 link_id = 6;</ code > */ public boolean hasLinkId() { return ((bitField0_ & 0x00000020) == 0x00000020); } /** * < code >optional int32 link_id = 6;</ code > */ public int getLinkId() { return linkId_; } /** * < code >optional int32 link_id = 6;</ code > */ public Builder setLinkId(int value) { bitField0_ |= 0x00000020; linkId_ = value; onChanged(); return this; } /** * < code >optional int32 link_id = 6;</ code > */ public Builder clearLinkId() { bitField0_ = (bitField0_ & ~0x00000020); linkId_ = 0; onChanged(); return this; } private long totalByte_ ; /** * < code >optional int64 total_byte = 7;</ code > */ public boolean hasTotalByte() { return ((bitField0_ & 0x00000040) == 0x00000040); } /** * < code >optional int64 total_byte = 7;</ code > */ public long getTotalByte() { return totalByte_; } /** * < code >optional int64 total_byte = 7;</ code > */ public Builder setTotalByte(long value) { bitField0_ |= 0x00000040; totalByte_ = value; onChanged(); return this; } /** * < code >optional int64 total_byte = 7;</ code > */ public Builder clearTotalByte() { bitField0_ = (bitField0_ & ~0x00000040); totalByte_ = 0L; onChanged(); return this; } private long flowEndTime_ ; /** * < code >optional int64 flow_end_time = 8;</ code > */ public boolean hasFlowEndTime() { return ((bitField0_ & 0x00000080) == 0x00000080); } /** * < code >optional int64 flow_end_time = 8;</ code > */ public long getFlowEndTime() { return flowEndTime_; } /** * < code >optional int64 flow_end_time = 8;</ code > */ public Builder setFlowEndTime(long value) { bitField0_ |= 0x00000080; flowEndTime_ = value; onChanged(); return this; } /** * < code >optional int64 flow_end_time = 8;</ code > */ public Builder clearFlowEndTime() { bitField0_ = (bitField0_ & ~0x00000080); flowEndTime_ = 0L; onChanged(); return this; } private int clientPort_ ; /** * < code >optional int32 client_port = 9;</ code > */ public boolean hasClientPort() { return ((bitField0_ & 0x00000100) == 0x00000100); } /** * < code >optional int32 client_port = 9;</ code > */ public int getClientPort() { return clientPort_; } /** * < code >optional int32 client_port = 9;</ code > */ public Builder setClientPort(int value) { bitField0_ |= 0x00000100; clientPort_ = value; onChanged(); return this; } /** * < code >optional int32 client_port = 9;</ code > */ public Builder clearClientPort() { bitField0_ = (bitField0_ & ~0x00000100); clientPort_ = 0; onChanged(); return this; } private int protocol_ ; /** * < code >optional int32 protocol = 10;</ code > */ public boolean hasProtocol() { return ((bitField0_ & 0x00000200) == 0x00000200); } /** * < code >optional int32 protocol = 10;</ code > */ public int getProtocol() { return protocol_; } /** * < code >optional int32 protocol = 10;</ code > */ public Builder setProtocol(int value) { bitField0_ |= 0x00000200; protocol_ = value; onChanged(); return this; } /** * < code >optional int32 protocol = 10;</ code > */ public Builder clearProtocol() { bitField0_ = (bitField0_ & ~0x00000200); protocol_ = 0; onChanged(); return this; } private long totalPacket_ ; /** * < code >optional int64 total_packet = 11;</ code > */ public boolean hasTotalPacket() { return ((bitField0_ & 0x00000400) == 0x00000400); } /** * < code >optional int64 total_packet = 11;</ code > */ public long getTotalPacket() { return totalPacket_; } /** * < code >optional int64 total_packet = 11;</ code > */ public Builder setTotalPacket(long value) { bitField0_ |= 0x00000400; totalPacket_ = value; onChanged(); return this; } /** * < code >optional int64 total_packet = 11;</ code > */ public Builder clearTotalPacket() { bitField0_ = (bitField0_ & ~0x00000400); totalPacket_ = 0L; onChanged(); return this; } private long flowDuration_ ; /** * < code >optional int64 flow_duration = 12;</ code > */ public boolean hasFlowDuration() { return ((bitField0_ & 0x00000800) == 0x00000800); } /** * < code >optional int64 flow_duration = 12;</ code > */ public long getFlowDuration() { return flowDuration_; } /** * < code >optional int64 flow_duration = 12;</ code > */ public Builder setFlowDuration(long value) { bitField0_ |= 0x00000800; flowDuration_ = value; onChanged(); return this; } /** * < code >optional int64 flow_duration = 12;</ code > */ public Builder clearFlowDuration() { bitField0_ = (bitField0_ & ~0x00000800); flowDuration_ = 0L; onChanged(); return this; } private java.lang.Object id_ = ""; /** * < code >optional string id = 13;</ code > */ public boolean hasId() { return ((bitField0_ & 0x00001000) == 0x00001000); } /** * < code >optional string id = 13;</ code > */ public java.lang.String getId() { java.lang.Object ref = id_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { id_ = s; } return s; } else { return (java.lang.String) ref; } } /** * < code >optional string id = 13;</ code > */ public com.google.protobuf.ByteString getIdBytes() { java.lang.Object ref = id_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); id_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * < code >optional string id = 13;</ code > */ public Builder setId( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00001000; id_ = value; onChanged(); return this; } /** * < code >optional string id = 13;</ code > */ public Builder clearId() { bitField0_ = (bitField0_ & ~0x00001000); id_ = getDefaultInstance().getId(); onChanged(); return this; } /** * < code >optional string id = 13;</ code > */ public Builder setIdBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00001000; id_ = value; onChanged(); return this; } private java.lang.Object serverIpAddr_ = ""; /** * < code >optional string server_ip_addr = 14;</ code > */ public boolean hasServerIpAddr() { return ((bitField0_ & 0x00002000) == 0x00002000); } /** * < code >optional string server_ip_addr = 14;</ code > */ public java.lang.String getServerIpAddr() { java.lang.Object ref = serverIpAddr_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { serverIpAddr_ = s; } return s; } else { return (java.lang.String) ref; } } /** * < code >optional string server_ip_addr = 14;</ code > */ public com.google.protobuf.ByteString getServerIpAddrBytes() { java.lang.Object ref = serverIpAddr_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); serverIpAddr_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * < code >optional string server_ip_addr = 14;</ code > */ public Builder setServerIpAddr( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00002000; serverIpAddr_ = value; onChanged(); return this; } /** * < code >optional string server_ip_addr = 14;</ code > */ public Builder clearServerIpAddr() { bitField0_ = (bitField0_ & ~0x00002000); serverIpAddr_ = getDefaultInstance().getServerIpAddr(); onChanged(); return this; } /** * < code >optional string server_ip_addr = 14;</ code > */ public Builder setServerIpAddrBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00002000; serverIpAddr_ = value; onChanged(); return this; } private java.lang.Object directionMask_ = ""; /** * < code >optional string direction_mask = 15;</ code > */ public boolean hasDirectionMask() { return ((bitField0_ & 0x00004000) == 0x00004000); } /** * < code >optional string direction_mask = 15;</ code > */ public java.lang.String getDirectionMask() { java.lang.Object ref = directionMask_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { directionMask_ = s; } return s; } else { return (java.lang.String) ref; } } /** * < code >optional string direction_mask = 15;</ code > */ public com.google.protobuf.ByteString getDirectionMaskBytes() { java.lang.Object ref = directionMask_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); directionMask_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * < code >optional string direction_mask = 15;</ code > */ public Builder setDirectionMask( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00004000; directionMask_ = value; onChanged(); return this; } /** * < code >optional string direction_mask = 15;</ code > */ public Builder clearDirectionMask() { bitField0_ = (bitField0_ & ~0x00004000); directionMask_ = getDefaultInstance().getDirectionMask(); onChanged(); return this; } /** * < code >optional string direction_mask = 15;</ code > */ public Builder setDirectionMaskBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00004000; directionMask_ = value; onChanged(); return this; } private int app_ ; /** * < code >optional int32 app = 16;</ code > */ public boolean hasApp() { return ((bitField0_ & 0x00008000) == 0x00008000); } /** * < code >optional int32 app = 16;</ code > */ public int getApp() { return app_; } /** * < code >optional int32 app = 16;</ code > */ public Builder setApp(int value) { bitField0_ |= 0x00008000; app_ = value; onChanged(); return this; } /** * < code >optional int32 app = 16;</ code > */ public Builder clearApp() { bitField0_ = (bitField0_ & ~0x00008000); app_ = 0; onChanged(); return this; } private int clientCountryId_ ; /** * < code >optional int32 client_country_id = 17;</ code > */ public boolean hasClientCountryId() { return ((bitField0_ & 0x00010000) == 0x00010000); } /** * < code >optional int32 client_country_id = 17;</ code > */ public int getClientCountryId() { return clientCountryId_; } /** * < code >optional int32 client_country_id = 17;</ code > */ public Builder setClientCountryId(int value) { bitField0_ |= 0x00010000; clientCountryId_ = value; onChanged(); return this; } /** * < code >optional int32 client_country_id = 17;</ code > */ public Builder clearClientCountryId() { bitField0_ = (bitField0_ & ~0x00010000); clientCountryId_ = 0; onChanged(); return this; } private int clientNetsegmentId_ ; /** * < code >optional int32 client_netsegment_id = 18;</ code > */ public boolean hasClientNetsegmentId() { return ((bitField0_ & 0x00020000) == 0x00020000); } /** * < code >optional int32 client_netsegment_id = 18;</ code > */ public int getClientNetsegmentId() { return clientNetsegmentId_; } /** * < code >optional int32 client_netsegment_id = 18;</ code > */ public Builder setClientNetsegmentId(int value) { bitField0_ |= 0x00020000; clientNetsegmentId_ = value; onChanged(); return this; } /** * < code >optional int32 client_netsegment_id = 18;</ code > */ public Builder clearClientNetsegmentId() { bitField0_ = (bitField0_ & ~0x00020000); clientNetsegmentId_ = 0; onChanged(); return this; } private long clientTotalPacket_ ; /** * < code >optional int64 client_total_packet = 19;</ code > */ public boolean hasClientTotalPacket() { return ((bitField0_ & 0x00040000) == 0x00040000); } /** * < code >optional int64 client_total_packet = 19;</ code > */ public long getClientTotalPacket() { return clientTotalPacket_; } /** * < code >optional int64 client_total_packet = 19;</ code > */ public Builder setClientTotalPacket(long value) { bitField0_ |= 0x00040000; clientTotalPacket_ = value; onChanged(); return this; } /** * < code >optional int64 client_total_packet = 19;</ code > */ public Builder clearClientTotalPacket() { bitField0_ = (bitField0_ & ~0x00040000); clientTotalPacket_ = 0L; onChanged(); return this; } private java.lang.Object clientIpAddr_ = ""; /** * < code >optional string client_ip_addr = 20;</ code > */ public boolean hasClientIpAddr() { return ((bitField0_ & 0x00080000) == 0x00080000); } /** * < code >optional string client_ip_addr = 20;</ code > */ public java.lang.String getClientIpAddr() { java.lang.Object ref = clientIpAddr_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { clientIpAddr_ = s; } return s; } else { return (java.lang.String) ref; } } /** * < code >optional string client_ip_addr = 20;</ code > */ public com.google.protobuf.ByteString getClientIpAddrBytes() { java.lang.Object ref = clientIpAddr_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); clientIpAddr_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * < code >optional string client_ip_addr = 20;</ code > */ public Builder setClientIpAddr( java.lang.String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00080000; clientIpAddr_ = value; onChanged(); return this; } /** * < code >optional string client_ip_addr = 20;</ code > */ public Builder clearClientIpAddr() { bitField0_ = (bitField0_ & ~0x00080000); clientIpAddr_ = getDefaultInstance().getClientIpAddr(); onChanged(); return this; } /** * < code >optional string client_ip_addr = 20;</ code > */ public Builder setClientIpAddrBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00080000; clientIpAddr_ = value; onChanged(); return this; } private int tcpStatus_ ; /** * < code >optional int32 tcp_status = 21;</ code > */ public boolean hasTcpStatus() { return ((bitField0_ & 0x00100000) == 0x00100000); } /** * < code >optional int32 tcp_status = 21;</ code > */ public int getTcpStatus() { return tcpStatus_; } /** * < code >optional int32 tcp_status = 21;</ code > */ public Builder setTcpStatus(int value) { bitField0_ |= 0x00100000; tcpStatus_ = value; onChanged(); return this; } /** * < code >optional int32 tcp_status = 21;</ code > */ public Builder clearTcpStatus() { bitField0_ = (bitField0_ & ~0x00100000); tcpStatus_ = 0; onChanged(); return this; } private int serverCountryId_ ; /** * < code >optional int32 server_country_id = 22;</ code > */ public boolean hasServerCountryId() { return ((bitField0_ & 0x00200000) == 0x00200000); } /** * < code >optional int32 server_country_id = 22;</ code > */ public int getServerCountryId() { return serverCountryId_; } /** * < code >optional int32 server_country_id = 22;</ code > */ public Builder setServerCountryId(int value) { bitField0_ |= 0x00200000; serverCountryId_ = value; onChanged(); return this; } /** * < code >optional int32 server_country_id = 22;</ code > */ public Builder clearServerCountryId() { bitField0_ = (bitField0_ & ~0x00200000); serverCountryId_ = 0; onChanged(); return this; } private int serverNetsegmentId_ ; /** * < code >optional int32 server_netsegment_id = 23;</ code > */ public boolean hasServerNetsegmentId() { return ((bitField0_ & 0x00400000) == 0x00400000); } /** * < code >optional int32 server_netsegment_id = 23;</ code > */ public int getServerNetsegmentId() { return serverNetsegmentId_; } /** * < code >optional int32 server_netsegment_id = 23;</ code > */ public Builder setServerNetsegmentId(int value) { bitField0_ |= 0x00400000; serverNetsegmentId_ = value; onChanged(); return this; } /** * < code >optional int32 server_netsegment_id = 23;</ code > */ public Builder clearServerNetsegmentId() { bitField0_ = (bitField0_ & ~0x00400000); serverNetsegmentId_ = 0; onChanged(); return this; } private long avgPktSize_ ; /** * < code >optional int64 avg_pkt_size = 24;</ code > */ public boolean hasAvgPktSize() { return ((bitField0_ & 0x00800000) == 0x00800000); } /** * < code >optional int64 avg_pkt_size = 24;</ code > */ public long getAvgPktSize() { return avgPktSize_; } /** * < code >optional int64 avg_pkt_size = 24;</ code > */ public Builder setAvgPktSize(long value) { bitField0_ |= 0x00800000; avgPktSize_ = value; onChanged(); return this; } /** * < code >optional int64 avg_pkt_size = 24;</ code > */ public Builder clearAvgPktSize() { bitField0_ = (bitField0_ & ~0x00800000); avgPktSize_ = 0L; onChanged(); return this; } private int serverPort_ ; /** * < code >optional int32 server_port = 25;</ code > */ public boolean hasServerPort() { return ((bitField0_ & 0x01000000) == 0x01000000); } /** * < code >optional int32 server_port = 25;</ code > */ public int getServerPort() { return serverPort_; } /** * < code >optional int32 server_port = 25;</ code > */ public Builder setServerPort(int value) { bitField0_ |= 0x01000000; serverPort_ = value; onChanged(); return this; } /** * < code >optional int32 server_port = 25;</ code > */ public Builder clearServerPort() { bitField0_ = (bitField0_ & ~0x01000000); serverPort_ = 0; onChanged(); return this; } private long serverTotalByte_ ; /** * < code >optional int64 server_total_byte = 26;</ code > */ public boolean hasServerTotalByte() { return ((bitField0_ & 0x02000000) == 0x02000000); } /** * < code >optional int64 server_total_byte = 26;</ code > */ public long getServerTotalByte() { return serverTotalByte_; } /** * < code >optional int64 server_total_byte = 26;</ code > */ public Builder setServerTotalByte(long value) { bitField0_ |= 0x02000000; serverTotalByte_ = value; onChanged(); return this; } /** * < code >optional int64 server_total_byte = 26;</ code > */ public Builder clearServerTotalByte() { bitField0_ = (bitField0_ & ~0x02000000); serverTotalByte_ = 0L; onChanged(); return this; } private int totalPacketps_ ; /** * < code >optional int32 total_packetps = 27;</ code > */ public boolean hasTotalPacketps() { return ((bitField0_ & 0x04000000) == 0x04000000); } /** * < code >optional int32 total_packetps = 27;</ code > */ public int getTotalPacketps() { return totalPacketps_; } /** * < code >optional int32 total_packetps = 27;</ code > */ public Builder setTotalPacketps(int value) { bitField0_ |= 0x04000000; totalPacketps_ = value; onChanged(); return this; } /** * < code >optional int32 total_packetps = 27;</ code > */ public Builder clearTotalPacketps() { bitField0_ = (bitField0_ & ~0x04000000); totalPacketps_ = 0; onChanged(); return this; } public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:TCPLog) } // @@protoc_insertion_point(class_scope:TCPLog) private static final TCPLogOuterClass.TCPLog DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new TCPLogOuterClass.TCPLog(); } public static TCPLogOuterClass.TCPLog getDefaultInstance() { return DEFAULT_INSTANCE; } @java.lang.Deprecated public static final com.google.protobuf.Parser< TCPLog > PARSER = new com.google.protobuf.AbstractParser< TCPLog >() { public TCPLog parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new TCPLog(input, extensionRegistry); } }; public static com.google.protobuf.Parser< TCPLog > parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser< TCPLog > getParserForType() { return PARSER; } public TCPLogOuterClass.TCPLog getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private static final com.google.protobuf.Descriptors.Descriptor internal_static_TCPLog_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_TCPLog_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\014TCPLog.proto\"\357\004\n\006TCPLog\022\024\n\014total_bytep" + "s\030\001 \001(\005\022\027\n\017flow_start_time\030\002 \001(\003\022\014\n\004date" + "\030\003 \001(\003\022\033\n\023server_total_packet\030\004 \001(\003\022\031\n\021c" + "lient_total_byte\030\005 \001(\003\022\017\n\007link_id\030\006 \001(\005\022" + "\022\n\ntotal_byte\030\007 \001(\003\022\025\n\rflow_end_time\030\010 \001" + "(\003\022\023\n\013client_port\030\t \001(\005\022\020\n\010protocol\030\n \001(" + "\005\022\024\n\014total_packet\030\013 \001(\003\022\025\n\rflow_duration" + "\030\014 \001(\003\022\n\n\002id\030\r \001(\t\022\026\n\016server_ip_addr\030\016 \001" + "(\t\022\026\n\016direction_mask\030\017 \001(\t\022\013\n\003app\030\020 \001(\005\022" + "\031\n\021client_country_id\030\021 \001(\005\022\034\n\024client_net", "segment_id\030\022 \001(\005\022\033\n\023client_total_packet\030" + "\023 \001(\003\022\026\n\016client_ip_addr\030\024 \001(\t\022\022\n\ntcp_sta" + "tus\030\025 \001(\005\022\031\n\021server_country_id\030\026 \001(\005\022\034\n\024" + "server_netsegment_id\030\027 \001(\005\022\024\n\014avg_pkt_si" + "ze\030\030 \001(\003\022\023\n\013server_port\030\031 \001(\005\022\031\n\021server_" + "total_byte\030\032 \001(\003\022\026\n\016total_packetps\030\033 \001(\005" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.Descriptors.FileDescriptor root) { descriptor = root; return null; } }; com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { }, assigner); internal_static_TCPLog_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_TCPLog_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_TCPLog_descriptor, new java.lang.String[] { "TotalByteps", "FlowStartTime", "Date", "ServerTotalPacket", "ClientTotalByte", "LinkId", "TotalByte", "FlowEndTime", "ClientPort", "Protocol", "TotalPacket", "FlowDuration", "Id", "ServerIpAddr", "DirectionMask", "App", "ClientCountryId", "ClientNetsegmentId", "ClientTotalPacket", "ClientIpAddr", "TcpStatus", "ServerCountryId", "ServerNetsegmentId", "AvgPktSize", "ServerPort", "ServerTotalByte", "TotalPacketps", }); } // @@protoc_insertion_point(outer_class_scope) } |
之后便可以使用该类进行序列化和反序列化。
具体示例代码如下》:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
import java.io.File; import java.io.FileOutputStream; public class ProtoTest3 { /** * @param args * @throws Exception * @author qiang(upupgo) */ public static void main(String[] args) throws Exception { //模拟将对象转成byte[],方便传输 TCPLogOuterClass.TCPLog.Builder builder = TCPLogOuterClass.TCPLog.newBuilder(); builder.setTotalByteps(1024); builder.setFlowStartTime(1502415717l); builder.setDate(1502415717l); //序列化到文件 TCPLogOuterClass.TCPLog tcpLog= builder.build(); FileOutputStream out = new FileOutputStream(new File("D:/pb")); out.write(tcpLog.toByteArray()); out.close(); //反序列化 TCPLogOuterClass.TCPLog tcp = TCPLogOuterClass.TCPLog.parseFrom(tcpLog.toByteArray()); System.out.println(tcp); } } |
二、AVRO序列化基本操作:
AVRO简介:
1
2
3
4
5
6
7
|
Apache Avro™ is a data serialization system. Avro provides: Rich data structures. A compact, fast, binary data format. A container file, to store persistent data. Remote procedure call (RPC). Simple integration with dynamic languages. Code generation is not required to read or write data files nor to use or implement RPC protocols. Code generation as an optional optimization, only worth implementing for statically typed languages. |
Avro是一个序列化系统。丰富的数据结构、快速压缩的二进制数据格式、数据持久化存储、RPC及动态语言集成。
2.1定义协议文件(TCPLog.avro)
1
2
3
4
5
6
7
8
9
10
|
{"namespace": "example.avro", "type": "record", "name": "TCPLog", "fields": [ {"name": "total_byteps", "type": "int"}, {"name": "flow_start_time", "type": "long"}, {"name": "date", "type": "long"} ] } |
avro和protobuf一样可以生成相应语言的类文件,或直接支持动态扩张。下面以Java语言不生成类说明:
具体序列化与反序列化操作代码如下:、
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
package avro; import java.io.File; import org.apache.avro.Schema; import org.apache.avro.file.DataFileReader; import org.apache.avro.file.DataFileWriter; import org.apache.avro.generic.GenericData; import org.apache.avro.generic.GenericDatumReader; import org.apache.avro.generic.GenericDatumWriter; import org.apache.avro.generic.GenericRecord; import org.apache.avro.io.DatumReader; import org.apache.avro.io.DatumWriter; /** * @date 2017年8月13日22:15:32 * @author qiang(upupgo) * */ public class AvroTest2 { public static void main(String[] args) throws Exception { String filePath = "D:/TCPLog.avsc"; Schema schema = new Schema.Parser().parse(new File(filePath)); GenericRecord tcpLog = new GenericData.Record(schema); tcpLog.put("total_byteps", 1024); tcpLog.put("flow_start_time", 1502415717L); tcpLog.put("date", 1502415717L); System.out.println(tcpLog); // Serialize user1 and tcpLog to disk File file = new File("D:/avro"); DatumWriter< GenericRecord > datumWriter = new GenericDatumWriter< GenericRecord >(schema); DataFileWriter< GenericRecord > dataFileWriter = new DataFileWriter< GenericRecord >(datumWriter); dataFileWriter.create(schema, file); long timestart = System.currentTimeMillis(); dataFileWriter.append(tcpLog); dataFileWriter.close(); long timeend = System.currentTimeMillis(); System.out.println(timeend-timestart); // Deserialize users from disk DatumReader< GenericRecord > datumReader = new GenericDatumReader< GenericRecord >(schema); DataFileReader< GenericRecord > dataFileReader = new DataFileReader<>(new File("d:/avro"), datumReader); GenericRecord tcpLogs = null; long timestart1 = System.currentTimeMillis(); while (dataFileReader.hasNext()) { // Reuse user object by passing it to next(). This saves us from // allocating and garbage collecting many objects for files with // many items. tcpLogs = dataFileReader.next(); // System.out.println("xx"+tcpLogs); } long timeend1 = System.currentTimeMillis(); System.out.println("Deserialize"+(timeend1-timestart1)); } } |
以下是通过对100W tcpLog序列化操作对比结论:
通过对比测试发现 avro的性能要不pb稍微好一些,且支持动态性。故技术选型上可以优先考虑。
以上是通过测试对比了pb与avro的一些性能差异,但是具体测试和机器和样本都有关系,可以参考。
以下是对比protobuf、avro、thrift的一些优缺点:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
Google protobuf: 优点 二进制消息,性能好/效率高(空间和时间效率都很不错) proto文件生成目标代码,简单易用 序列化反序列化直接对应程序中的数据类,不需要解析后在进行映射(XML,JSON都是这种方式) 支持向前兼容(新加字段采用默认值)和向后兼容(忽略新加字段),简化升级 支持多种语言(可以把proto文件看做IDL文件) Netty等一些框架集成 缺点 官方只支持C++,JAVA和Python语言绑定 二进制可读性差(貌似提供了Text_Fromat功能) 二进制不具有自描述特性 默认不具备动态特性(可以通过动态定义生成消息类型或者动态编译支持) 只涉及序列化和反序列化技术,不涉及RPC功能(类似XML或者JSON的解析器) Apache Thrift: 应用 Facebook的开源的日志收集系统(scribe: https://github.com/facebook/scribe) 淘宝的实时数据传输平台(TimeTunnel http://code.taobao.org/p/TimeTunnel/wiki/index) Evernote开放接口(https://github.com/evernote/evernote-thrift) Quora(http://www.quora.com/Apache-Thrift) HBase( http://abloz.com/hbase/book.html#thrift ) … 优点 支持非常多的语言绑定 thrift文件生成目标代码,简单易用 消息定义文件支持注释 数据结构与传输表现的分离,支持多种消息格式 包含完整的客户端/服务端堆栈,可快速实现RPC 支持同步和异步通信 缺点 和protobuf一样不支持动态特性 Apache Avro: 应用 Hadoop RPC (http://hadoop.apache.org/#What+Is+Apache+Hadoop%3F) 优点 二进制消息,性能好/效率高 使用JSON描述模式 模式和数据统一存储,消息自描述,不需要生成stub代码(支持生成IDL) RPC调用在握手阶段交换模式定义 包含完整的客户端/服务端堆栈,可快速实现RPC 支持同步和异步通信 支持动态消息 模式定义允许定义数据的排序(序列化时会遵循这个顺序) 提供了基于Jetty内核的服务基于Netty的服务 缺点 只支持Avro自己的序列化格式 语言绑定不如Thrift丰富 |
如有错误欢迎指正,如果对您有帮助也欢迎打赏 点赞 推荐 谢谢!^^
以上这篇浅谈序列化之protobuf与avro对比(Java)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持服务器之家。
原文链接:http://www.cnblogs.com/upupgo/archive/2017/08/13/7354504.html