diff --git a/collector/src/main/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFAgentStatMapper.java b/collector/src/main/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFAgentStatMapper.java index 231f3c536571..0843d3b6116e 100644 --- a/collector/src/main/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFAgentStatMapper.java +++ b/collector/src/main/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFAgentStatMapper.java @@ -29,6 +29,7 @@ public class TFAgentStatMapper { private static final TFJvmGcMapper tFJvmGcMapper = new TFJvmGcMapper(); private static final TFTransactionMapper tFTransactionMapper = new TFTransactionMapper(); private static final TFActiveTraceMapper tFActiveTraceMapper = new TFActiveTraceMapper(); + private static final TFResponseTimeMapper tFResponseTimeMapper = new TFResponseTimeMapper(); public List map(AgentStatBo agentStatBo) { final TreeMap tFAgentStatMap = new TreeMap<>(); @@ -39,9 +40,22 @@ public List map(AgentStatBo agentStatBo) { insertTFJvmGc(tFAgentStatMap, agentStatBo.getJvmGcBos(), agentId, startTimestamp); insertTFTransaction(tFAgentStatMap, agentStatBo.getTransactionBos(), agentId, startTimestamp); insertTFActiveTrace(tFAgentStatMap, agentStatBo.getActiveTraceBos(), agentId, startTimestamp); + insertTFResponseTime(tFAgentStatMap, agentStatBo.getResponseTimeBos(), agentId, startTimestamp); return new ArrayList<>(tFAgentStatMap.values()); } + private void insertTFResponseTime(TreeMap tFAgentStatMap, List responseTimeBoList, String agentId, long startTimestamp) { + if (responseTimeBoList == null) { + return; + } + + for (ResponseTimeBo responseTimeBo : responseTimeBoList) { + TFAgentStat tFAgentStat = getOrCreateTFAgentStat(tFAgentStatMap, responseTimeBo.getTimestamp(), agentId, startTimestamp); + tFAgentStat.setResponseTime(tFResponseTimeMapper.map(responseTimeBo)); + } + + } + private void insertTFActiveTrace(TreeMap tFAgentStatMap, List activeTraceBoList, String agentId, long startTimestamp) { if (activeTraceBoList == null) { return; diff --git a/collector/src/main/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFResponseTimeMapper.java b/collector/src/main/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFResponseTimeMapper.java new file mode 100644 index 000000000000..03ea0906a4c4 --- /dev/null +++ b/collector/src/main/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFResponseTimeMapper.java @@ -0,0 +1,31 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.navercorp.pinpoint.collector.mapper.thrift.stat; + +import com.navercorp.pinpoint.common.server.bo.stat.ResponseTimeBo; +import com.navercorp.pinpoint.thrift.dto.flink.TFResponseTime; + +/** + * @author minwoo.jung + */ +public class TFResponseTimeMapper { + + public TFResponseTime map(ResponseTimeBo responseTimeBo) { + TFResponseTime tFResponseTime = new TFResponseTime(); + tFResponseTime.setAvg(responseTimeBo.getAvg()); + return tFResponseTime; + } +} diff --git a/collector/src/test/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFCpuLoadMapperTest.java b/collector/src/test/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFCpuLoadMapperTest.java new file mode 100644 index 000000000000..317dc7c8930c --- /dev/null +++ b/collector/src/test/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFCpuLoadMapperTest.java @@ -0,0 +1,40 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.navercorp.pinpoint.collector.mapper.thrift.stat; + +import com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo; +import com.navercorp.pinpoint.thrift.dto.flink.TFCpuLoad; +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * @author minwoo.jung + */ +public class TFCpuLoadMapperTest { + @Test + public void mapTest() throws Exception { + TFCpuLoadMapper tFCpuLoadMapper = new TFCpuLoadMapper(); + CpuLoadBo cpuLoadBo = new CpuLoadBo(); + cpuLoadBo.setJvmCpuLoad(30); + cpuLoadBo.setSystemCpuLoad(50); + TFCpuLoad tFCpuLoad = tFCpuLoadMapper.map(cpuLoadBo); + assertEquals(tFCpuLoad.getJvmCpuLoad(), 30, 0); + assertEquals(tFCpuLoad.getSystemCpuLoad(), 50, 0); + } + +} \ No newline at end of file diff --git a/collector/src/test/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFJvmGcMapperTest.java b/collector/src/test/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFJvmGcMapperTest.java new file mode 100644 index 000000000000..568492f18c9e --- /dev/null +++ b/collector/src/test/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFJvmGcMapperTest.java @@ -0,0 +1,42 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.navercorp.pinpoint.collector.mapper.thrift.stat; + +import com.navercorp.pinpoint.common.server.bo.stat.JvmGcBo; +import com.navercorp.pinpoint.thrift.dto.flink.TFJvmGc; +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * @author minwoo.jung + */ +public class TFJvmGcMapperTest { + + @Test + public void mapTest() throws Exception { + TFJvmGcMapper tFJvmGcMapper = new TFJvmGcMapper(); + JvmGcBo jvmGcBo = new JvmGcBo(); + jvmGcBo.setHeapUsed(3000); + jvmGcBo.setNonHeapUsed(500); + TFJvmGc tFJvmGc = tFJvmGcMapper.map(jvmGcBo); + + assertEquals(tFJvmGc.getJvmMemoryHeapUsed(), 3000); + assertEquals(tFJvmGc.getJvmMemoryNonHeapUsed(), 500); + } + +} \ No newline at end of file diff --git a/collector/src/test/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFResponseTimeMapperTest.java b/collector/src/test/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFResponseTimeMapperTest.java new file mode 100644 index 000000000000..140bbddf4839 --- /dev/null +++ b/collector/src/test/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFResponseTimeMapperTest.java @@ -0,0 +1,38 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.navercorp.pinpoint.collector.mapper.thrift.stat; + +import com.navercorp.pinpoint.common.server.bo.stat.ResponseTimeBo; +import com.navercorp.pinpoint.thrift.dto.flink.TFResponseTime; +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * @author minwoo.jung + */ +public class TFResponseTimeMapperTest { + + @Test + public void mapTest() { + TFResponseTimeMapper mapper = new TFResponseTimeMapper(); + ResponseTimeBo responseTimeBo = new ResponseTimeBo(); + responseTimeBo.setAvg(50); + TFResponseTime tFResponseTime = mapper.map(responseTimeBo); + assertEquals(tFResponseTime.getAvg(), 50); + } +} \ No newline at end of file diff --git a/collector/src/test/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFTransactionMapperTest.java b/collector/src/test/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFTransactionMapperTest.java new file mode 100644 index 000000000000..b635fbe250dc --- /dev/null +++ b/collector/src/test/java/com/navercorp/pinpoint/collector/mapper/thrift/stat/TFTransactionMapperTest.java @@ -0,0 +1,46 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.navercorp.pinpoint.collector.mapper.thrift.stat; + +import com.navercorp.pinpoint.common.server.bo.stat.TransactionBo; +import com.navercorp.pinpoint.thrift.dto.flink.TFTransaction; +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * @author minwoo.jung + */ +public class TFTransactionMapperTest { + + @Test + public void mapTest() throws Exception { + TFTransactionMapper tFTransactionMapper = new TFTransactionMapper(); + TransactionBo transactionBo = new TransactionBo(); + transactionBo.setSampledContinuationCount(5); + transactionBo.setUnsampledContinuationCount(6); + transactionBo.setSampledNewCount(11); + transactionBo.setUnsampledNewCount(10); + TFTransaction tFtransaction = tFTransactionMapper.map(transactionBo); + + assertEquals(tFtransaction.getSampledContinuationCount(), 5); + assertEquals(tFtransaction.getUnsampledContinuationCount(), 6); + assertEquals(tFtransaction.getSampledNewCount(), 11); + assertEquals(tFtransaction.getUnsampledNewCount(), 10); + } + +} \ No newline at end of file diff --git a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/codec/stat/join/ResponseTimeCodec.java b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/codec/stat/join/ResponseTimeCodec.java new file mode 100644 index 000000000000..992cef812ce2 --- /dev/null +++ b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/codec/stat/join/ResponseTimeCodec.java @@ -0,0 +1,146 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.navercorp.pinpoint.common.server.bo.codec.stat.join; + +import com.navercorp.pinpoint.common.buffer.Buffer; +import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDataPointCodec; +import com.navercorp.pinpoint.common.server.bo.codec.stat.ApplicationStatCodec; +import com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderDecoder; +import com.navercorp.pinpoint.common.server.bo.codec.stat.header.AgentStatHeaderEncoder; +import com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderDecoder; +import com.navercorp.pinpoint.common.server.bo.codec.stat.header.BitCountingHeaderEncoder; +import com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.StrategyAnalyzer; +import com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.StringEncodingStrategy; +import com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.UnsignedLongEncodingStrategy; +import com.navercorp.pinpoint.common.server.bo.codec.strategy.EncodingStrategy; +import com.navercorp.pinpoint.common.server.bo.serializer.stat.ApplicationStatDecodingContext; +import com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo; +import com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo; +import com.navercorp.pinpoint.common.util.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.Assert; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author minwoo.jung + */ +@Component("joinResponseTimeCodec") +public class ResponseTimeCodec implements ApplicationStatCodec { + private static final byte VERSION = 1; + + private final AgentStatDataPointCodec codec; + + @Autowired + public ResponseTimeCodec(AgentStatDataPointCodec codec) { + Assert.notNull(codec, "agentStatDataPointCodec must not be null"); + this.codec = codec; + } + + + @Override + public byte getVersion() { + return VERSION; + } + + @Override + public void encodeValues(Buffer valueBuffer, List joinResponseTimeBoList) { + if (CollectionUtils.isEmpty(joinResponseTimeBoList)) { + throw new IllegalArgumentException("joinResponseTimeBoList must not be empty"); + } + + final int numValues = joinResponseTimeBoList.size(); + valueBuffer.putVInt(numValues); + List timestamps = new ArrayList(numValues); + UnsignedLongEncodingStrategy.Analyzer.Builder avgAnalyzerBuilder = new UnsignedLongEncodingStrategy.Analyzer.Builder(); + UnsignedLongEncodingStrategy.Analyzer.Builder minAvgAnalyzerBuilder = new UnsignedLongEncodingStrategy.Analyzer.Builder(); + StringEncodingStrategy.Analyzer.Builder minAvgAgentIdAnalyzerBuilder = new StringEncodingStrategy.Analyzer.Builder(); + UnsignedLongEncodingStrategy.Analyzer.Builder maxAvgAnalyzerBuilder = new UnsignedLongEncodingStrategy.Analyzer.Builder(); + StringEncodingStrategy.Analyzer.Builder maxAvgAgentIdAnalyzerBuilder = new StringEncodingStrategy.Analyzer.Builder(); + + for (JoinStatBo joinStatBo : joinResponseTimeBoList) { + JoinResponseTimeBo joinResponseTimeBo = (JoinResponseTimeBo) joinStatBo; + timestamps.add(joinResponseTimeBo.getTimestamp()); + avgAnalyzerBuilder.addValue(joinResponseTimeBo.getAvg()); + minAvgAnalyzerBuilder.addValue(joinResponseTimeBo.getMinAvg()); + minAvgAgentIdAnalyzerBuilder.addValue(joinResponseTimeBo.getMinAvgAgentId()); + maxAvgAnalyzerBuilder.addValue(joinResponseTimeBo.getMaxAvg()); + maxAvgAgentIdAnalyzerBuilder.addValue(joinResponseTimeBo.getMaxAvgAgentId()); + } + + codec.encodeTimestamps(valueBuffer, timestamps); + encodeDataPoints(valueBuffer, avgAnalyzerBuilder.build(), minAvgAnalyzerBuilder.build(), minAvgAgentIdAnalyzerBuilder.build(), maxAvgAnalyzerBuilder.build(), maxAvgAgentIdAnalyzerBuilder.build()); + } + + private void encodeDataPoints(Buffer valueBuffer, StrategyAnalyzer avgAnalyzer, StrategyAnalyzer minAvgAnalyzer, StrategyAnalyzer minAvgAgentIdAnalyzer, StrategyAnalyzer maxAvgAnalyzer, StrategyAnalyzer maxAvgAgentIdAnalyzer) { + AgentStatHeaderEncoder headerEncoder = new BitCountingHeaderEncoder(); + headerEncoder.addCode(avgAnalyzer.getBestStrategy().getCode()); + headerEncoder.addCode(minAvgAnalyzer.getBestStrategy().getCode()); + headerEncoder.addCode(minAvgAgentIdAnalyzer.getBestStrategy().getCode()); + headerEncoder.addCode(maxAvgAnalyzer.getBestStrategy().getCode()); + headerEncoder.addCode(maxAvgAgentIdAnalyzer.getBestStrategy().getCode()); + final byte[] header = headerEncoder.getHeader(); + valueBuffer.putPrefixedBytes(header); + + this.codec.encodeValues(valueBuffer, avgAnalyzer.getBestStrategy(), avgAnalyzer.getValues()); + this.codec.encodeValues(valueBuffer, minAvgAnalyzer.getBestStrategy(), minAvgAnalyzer.getValues()); + this.codec.encodeValues(valueBuffer, minAvgAgentIdAnalyzer.getBestStrategy(), minAvgAgentIdAnalyzer.getValues()); + this.codec.encodeValues(valueBuffer, maxAvgAnalyzer.getBestStrategy(), maxAvgAnalyzer.getValues()); + this.codec.encodeValues(valueBuffer, maxAvgAgentIdAnalyzer.getBestStrategy(), maxAvgAgentIdAnalyzer.getValues()); + } + + @Override + public List decodeValues(Buffer valueBuffer, ApplicationStatDecodingContext decodingContext) { + final String id = decodingContext.getApplicationId(); + final long baseTimestamp = decodingContext.getBaseTimestamp(); + final long timestampDelta = decodingContext.getTimestampDelta(); + final long initialTimestamp = baseTimestamp + timestampDelta; + + int numValues = valueBuffer.readVInt(); + List timestampList = this.codec.decodeTimestamps(initialTimestamp, valueBuffer, numValues); + + final byte[] header = valueBuffer.readPrefixedBytes(); + AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header); + EncodingStrategy avgEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode()); + EncodingStrategy minAvgEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode()); + EncodingStrategy minAvgAgentIdEncodingStrategy = StringEncodingStrategy.getFromCode(headerDecoder.getCode()); + EncodingStrategy maxAvgEncodingStrategy = UnsignedLongEncodingStrategy.getFromCode(headerDecoder.getCode()); + EncodingStrategy maxAvgAgentIdEncodingStrategy = StringEncodingStrategy.getFromCode(headerDecoder.getCode()); + + List avgList = this.codec.decodeValues(valueBuffer, avgEncodingStrategy, numValues); + List minAvgList = this.codec.decodeValues(valueBuffer, minAvgEncodingStrategy, numValues); + List minAvgAgentIdList = this.codec.decodeValues(valueBuffer, minAvgAgentIdEncodingStrategy, numValues); + List maxAvgList = this.codec.decodeValues(valueBuffer, maxAvgEncodingStrategy, numValues); + List maxAvgAgentIdList = this.codec.decodeValues(valueBuffer, maxAvgAgentIdEncodingStrategy, numValues); + + List joinResponseTimeBoList = new ArrayList(); + for (int i = 0 ; i < numValues ; ++i) { + JoinResponseTimeBo joinResponseTimeBo = new JoinResponseTimeBo(); + joinResponseTimeBo.setId(id); + joinResponseTimeBo.setTimestamp(timestampList.get(i)); + joinResponseTimeBo.setAvg(avgList.get(i)); + joinResponseTimeBo.setMinAvg(minAvgList.get(i)); + joinResponseTimeBo.setMinAvgAgentId(minAvgAgentIdList.get(i)); + joinResponseTimeBo.setMaxAvg(maxAvgList.get(i)); + joinResponseTimeBo.setMaxAvgAgentId(maxAvgAgentIdList.get(i)); + joinResponseTimeBoList.add(joinResponseTimeBo); + } + + return joinResponseTimeBoList; + } +} diff --git a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/codec/stat/join/ResponseTimeDecoder.java b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/codec/stat/join/ResponseTimeDecoder.java new file mode 100644 index 000000000000..84e184f9e9ac --- /dev/null +++ b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/codec/stat/join/ResponseTimeDecoder.java @@ -0,0 +1,32 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.navercorp.pinpoint.common.server.bo.codec.stat.join; + +import com.navercorp.pinpoint.common.server.bo.codec.stat.ApplicationStatDecoder; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author minwoo.jung + */ +@Component("joinResponseTimeDecoder") +public class ResponseTimeDecoder extends ApplicationStatDecoder { + + public ResponseTimeDecoder(List responseTimeCodecs) { + super(responseTimeCodecs); + } +} diff --git a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/codec/stat/join/ResponseTimeEncoder.java b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/codec/stat/join/ResponseTimeEncoder.java new file mode 100644 index 000000000000..c672712a8ecb --- /dev/null +++ b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/codec/stat/join/ResponseTimeEncoder.java @@ -0,0 +1,32 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.navercorp.pinpoint.common.server.bo.codec.stat.join; + +import com.navercorp.pinpoint.common.server.bo.codec.stat.ApplicationStatCodec; +import com.navercorp.pinpoint.common.server.bo.codec.stat.ApplicationStatEncoder; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; + +/** + * @author minwoo.jung + */ +public class ResponseTimeEncoder extends ApplicationStatEncoder { + + @Autowired + private ResponseTimeEncoder(@Qualifier("joinResponseTimeCodec") ApplicationStatCodec responseTimeCodec) { + super(responseTimeCodec); + } +} diff --git a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/serializer/stat/join/ResponseTimeSerializer.java b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/serializer/stat/join/ResponseTimeSerializer.java new file mode 100644 index 000000000000..88cfa458d2b0 --- /dev/null +++ b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/serializer/stat/join/ResponseTimeSerializer.java @@ -0,0 +1,30 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.navercorp.pinpoint.common.server.bo.serializer.stat.join; + +import com.navercorp.pinpoint.common.server.bo.codec.stat.join.ResponseTimeEncoder; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @author minwoo.jung + */ +public class ResponseTimeSerializer extends ApplicationStatSerializer { + + @Autowired + public ResponseTimeSerializer(ResponseTimeEncoder responseTimeEncoder) { + super(responseTimeEncoder); + } +} diff --git a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinActiveTraceBo.java b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinActiveTraceBo.java index 610025598a4e..95d8627e94c9 100644 --- a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinActiveTraceBo.java +++ b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinActiveTraceBo.java @@ -22,7 +22,8 @@ * @author minwoo.jung */ public class JoinActiveTraceBo implements JoinStatBo { - public static final JoinActiveTraceBo EMPTY_ACTIVE_TRACE_BO = new JoinActiveTraceBo(); + + public static final JoinActiveTraceBo EMPTY_JOIN_ACTIVE_TRACE_BO = new JoinActiveTraceBo(); public static final int UNCOLLECTED_VALUE = -1; private static final int DEFAULT_HISTOGRAM_SCHEMA_TYPE = -1; private static final short DEFAULT_VERSION = -1; @@ -130,7 +131,7 @@ public static JoinActiveTraceBo joinActiveTraceBoList(List jo final int boCount = joinActiveTraceBoList.size(); if (boCount == 0) { - return JoinActiveTraceBo.EMPTY_ACTIVE_TRACE_BO; + return JoinActiveTraceBo.EMPTY_JOIN_ACTIVE_TRACE_BO; } final JoinActiveTraceBo initJoinActiveTraceBo = joinActiveTraceBoList.get(0); diff --git a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinAgentStatBo.java b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinAgentStatBo.java index 0b2b53b274d6..14bc3ebd0d3d 100644 --- a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinAgentStatBo.java +++ b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinAgentStatBo.java @@ -27,6 +27,7 @@ public class JoinAgentStatBo implements JoinStatBo { private static final List EMPTY_JOIN_MEMORY_BO_LIST = new ArrayList(); private static final List EMPTY_JOIN_TRANSACTION_BO_LIST = new ArrayList(); private static final List EMPTY_JOIN_ACTIVE_TRACE_BO_LIST = new ArrayList(); + private static final List EMPTY_JOIN_RESPONSE_TIME_BO_LIST = new ArrayList(); private String agentId = UNKNOWN_AGENT; private long agentStartTimestamp = Long.MIN_VALUE; @@ -35,6 +36,15 @@ public class JoinAgentStatBo implements JoinStatBo { private List joinMemoryBoList = EMPTY_JOIN_MEMORY_BO_LIST; private List joinTransactionBoList = EMPTY_JOIN_TRANSACTION_BO_LIST; private List joinActiveTraceBoList = EMPTY_JOIN_ACTIVE_TRACE_BO_LIST; + private List joinResponseTimeBoList = EMPTY_JOIN_RESPONSE_TIME_BO_LIST; + + public List getJoinResponseTimeBoList() { + return joinResponseTimeBoList; + } + + public void setJoinResponseTimeBoList(List joinResponseTimeBoList) { + this.joinResponseTimeBoList = joinResponseTimeBoList; + } public void setId(String id) { this.agentId = id; diff --git a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinApplicationStatBo.java b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinApplicationStatBo.java index 6d703a5c81fa..2da72da82d51 100644 --- a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinApplicationStatBo.java +++ b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinApplicationStatBo.java @@ -26,6 +26,7 @@ public class JoinApplicationStatBo implements JoinStatBo { private static final List EMPTY_JOIN_MEMORY_BO_LIST = new ArrayList(); private static final List EMPTY_JOIN_TRANSACTION_BO_LIST = new ArrayList(); private static final List EMPTY_JOIN_ACTIVE_TRACE_BO_LIST = new ArrayList(); + private static final List EMPTY_JOIN_RESPONSE_TIME_BO_LIST = new ArrayList(); private static final long SHIFT_RANGE = 1000 * 5; @@ -34,10 +35,11 @@ public class JoinApplicationStatBo implements JoinStatBo { private List joinMemoryBoList = EMPTY_JOIN_MEMORY_BO_LIST; private List joinTransactionBoList = EMPTY_JOIN_TRANSACTION_BO_LIST; private List joinActiveTraceBoList = EMPTY_JOIN_ACTIVE_TRACE_BO_LIST; + private List joinResponseTimeBoList = EMPTY_JOIN_RESPONSE_TIME_BO_LIST; private long timestamp = Long.MIN_VALUE; - private StatType statType = StatType.APP_STST; + public static JoinApplicationStatBo joinApplicationStatBoByTimeSlice(final List joinApplicationStatBoList) { if (joinApplicationStatBoList.size() == 0) { return EMPTY_JOIN_APPLICATION_STAT_BO; @@ -49,6 +51,7 @@ public static JoinApplicationStatBo joinApplicationStatBoByTimeSlice(final List< newJoinApplicationStatBo.setJoinMemoryBoList(joinMemoryBoByTimeSlice(joinApplicationStatBoList)); newJoinApplicationStatBo.setJoinTransactionBoList(joinTransactionBoByTimeSlice(joinApplicationStatBoList)); newJoinApplicationStatBo.setJoinActiveTraceBoList(joinActiveTraceBoByTimeSlice(joinApplicationStatBoList)); + newJoinApplicationStatBo.setJoinResponseTimeBoList(joinResponseTimeBoByTimeSlice(joinApplicationStatBoList)); newJoinApplicationStatBo.setTimestamp(extractMinTimestamp(newJoinApplicationStatBo)); return newJoinApplicationStatBo; } @@ -80,9 +83,43 @@ private static long extractMinTimestamp(JoinApplicationStatBo joinApplicationSta } } + for (JoinResponseTimeBo joinResponseTimeBo : joinApplicationStatBo.getJoinResponseTimeBoList()) { + if (joinResponseTimeBo.getTimestamp() < minTimestamp) { + minTimestamp = joinResponseTimeBo.getTimestamp(); + } + } + return minTimestamp; } + private static List joinResponseTimeBoByTimeSlice(List joinApplicationStatBoList) { + Map> joinResponseTimeBoMap = new HashMap>(); + + for (JoinApplicationStatBo joinApplicationStatBo : joinApplicationStatBoList) { + for (JoinResponseTimeBo joinResponseTimeBo : joinApplicationStatBo.getJoinResponseTimeBoList()) { + long shiftTimestamp = shiftTimestamp(joinResponseTimeBo.getTimestamp()); + List joinResponseTimeBoList = joinResponseTimeBoMap.get(shiftTimestamp); + + if (joinResponseTimeBoList == null) { + joinResponseTimeBoList = new ArrayList(); + joinResponseTimeBoMap.put(shiftTimestamp, joinResponseTimeBoList); + } + + joinResponseTimeBoList.add(joinResponseTimeBo); + } + } + + List newJoinResponseTimeBoList = new ArrayList(); + + for (Map.Entry> entry : joinResponseTimeBoMap.entrySet()) { + List joinResponseTimeBoList = entry.getValue(); + JoinResponseTimeBo joinResponseTimeBo = JoinResponseTimeBo.joinResponseTimeBoList(joinResponseTimeBoList, entry.getKey()); + newJoinResponseTimeBoList.add(joinResponseTimeBo); + } + + return newJoinResponseTimeBoList; + } + private static List joinActiveTraceBoByTimeSlice(List joinApplicationStatBoList) { Map> joinActiveTraceBoMap = new HashMap>(); @@ -280,6 +317,14 @@ public List getJoinActiveTraceBoList() { return joinActiveTraceBoList; } + public List getJoinResponseTimeBoList() { + return joinResponseTimeBoList; + } + + public void setJoinResponseTimeBoList(List joinResponseTimeBoList) { + this.joinResponseTimeBoList = joinResponseTimeBoList; + } + public static List createJoinApplicationStatBo(String applicationId, JoinAgentStatBo joinAgentStatBo, long rangeTime) { List joinApplicationStatBoList = new ArrayList(); List joinAgentStatBoList = splitJoinAgentStatBo(applicationId, joinAgentStatBo, rangeTime); @@ -292,6 +337,7 @@ public static List createJoinApplicationStatBo(String app joinApplicationStatBo.setJoinMemoryBoList(sliceJoinAgentStatBo.getJoinMemoryBoList()); joinApplicationStatBo.setJoinTransactionBoList(sliceJoinAgentStatBo.getJoinTransactionBoList()); joinApplicationStatBo.setJoinActiveTraceBoList(sliceJoinAgentStatBo.getJoinActiveTraceBoList()); + joinApplicationStatBo.setJoinResponseTimeBoList(sliceJoinAgentStatBo.getJoinResponseTimeBoList()); joinApplicationStatBoList.add(joinApplicationStatBo); } @@ -304,11 +350,35 @@ private static List splitJoinAgentStatBo(String applicationId, sliceJoinMemoryBo(applicationId, joinAgentStatBo, rangeTime, joinAgentStatBoMap); sliceJoinTransactionBo(applicationId, joinAgentStatBo, rangeTime, joinAgentStatBoMap); sliceJoinActiveTraceBo(applicationId, joinAgentStatBo, rangeTime, joinAgentStatBoMap); + sliceJoinResponseTimeBo(applicationId, joinAgentStatBo, rangeTime, joinAgentStatBoMap); return new ArrayList(joinAgentStatBoMap.values()); } + private static void sliceJoinResponseTimeBo(String applicationId, JoinAgentStatBo joinAgentStatBo, long rangeTime, Map joinAgentStatBoMap) { + Map> joinResponseTimeBoMap = new HashMap>(); + + for (JoinResponseTimeBo joinResponseTimeBo : joinAgentStatBo.getJoinResponseTimeBoList()) { + long timestamp = joinResponseTimeBo.getTimestamp(); + long time = timestamp - (timestamp % rangeTime); + List joinResponseTimeBoList = joinResponseTimeBoMap.get(time); + + if (joinResponseTimeBoList == null) { + joinResponseTimeBoList = new ArrayList(); + joinResponseTimeBoMap.put(time, joinResponseTimeBoList); + } + + joinResponseTimeBoList.add(joinResponseTimeBo); + } + for (Map.Entry> entry : joinResponseTimeBoMap.entrySet()) { + long time = entry.getKey(); + JoinAgentStatBo sliceJoinAgentStatBo = getORCreateJoinAgentStatBo(applicationId, joinAgentStatBoMap, time); + sliceJoinAgentStatBo.setJoinResponseTimeBoList(entry.getValue()); + } + } + private static void sliceJoinActiveTraceBo(String applicationId, JoinAgentStatBo joinAgentStatBo, long rangeTime, Map joinAgentStatBoMap) { Map> joinActiveTraceBoMap = new HashMap>(); + for (JoinActiveTraceBo joinActiveTraceBo : joinAgentStatBo.getJoinActiveTraceBoList()) { long timestamp = joinActiveTraceBo.getTimestamp(); long time = timestamp - (timestamp % rangeTime); @@ -321,7 +391,7 @@ private static void sliceJoinActiveTraceBo(String applicationId, JoinAgentStatBo joinActiveTraceBoList.add(joinActiveTraceBo); } - for(Map.Entry> entry : joinActiveTraceBoMap.entrySet()) { + for (Map.Entry> entry : joinActiveTraceBoMap.entrySet()) { long time = entry.getKey(); JoinAgentStatBo sliceJoinAgentStatBo = getORCreateJoinAgentStatBo(applicationId, joinAgentStatBoMap, time); sliceJoinAgentStatBo.setJoinActiveTraceBoList(entry.getValue()); @@ -343,7 +413,7 @@ private static void sliceJoinTransactionBo(String applicationId, JoinAgentStatBo joinTransactionBoList.add(joinTransactionBo); } - for(Map.Entry> entry : joinTransactionBoMap.entrySet()) { + for (Map.Entry> entry : joinTransactionBoMap.entrySet()) { long time = entry.getKey(); JoinAgentStatBo sliceJoinAgentStatBo = getORCreateJoinAgentStatBo(applicationId, joinAgentStatBoMap, time); sliceJoinAgentStatBo.setJoinTransactionBoList(entry.getValue()); diff --git a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinResponseTimeBo.java b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinResponseTimeBo.java new file mode 100644 index 000000000000..5a5e20211b36 --- /dev/null +++ b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinResponseTimeBo.java @@ -0,0 +1,176 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.navercorp.pinpoint.common.server.bo.stat.join; + +import java.util.Date; +import java.util.List; + +/** + * @author minwoo.jung + */ +public class JoinResponseTimeBo implements JoinStatBo { + + public static final JoinResponseTimeBo EMPTY_JOIN_RESPONSE_TIME_BO = new JoinResponseTimeBo(); + public static final long UNCOLLECTED_VALUE = -1; + + + private String id = UNKNOWN_ID; + private long timestamp = Long.MIN_VALUE; + private long avg = UNCOLLECTED_VALUE; + private String maxAvgAgentId = UNKNOWN_AGENT; + private long maxAvg = UNCOLLECTED_VALUE; + private String minAvgAgentId = UNKNOWN_AGENT; + private long minAvg = UNCOLLECTED_VALUE; + + public JoinResponseTimeBo() { + } + + public JoinResponseTimeBo(String id, long timestamp, long avg, long minAvg, String minAvgAgentId, long maxAvg, String maxAvgAgentId) { + this.id = id; + this.timestamp = timestamp; + this.avg = avg; + this.maxAvgAgentId = maxAvgAgentId; + this.maxAvg = maxAvg; + this.minAvgAgentId = minAvgAgentId; + this.minAvg = minAvg; + } + + public void setId(String id) { + this.id = id; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + } + + public void setAvg(long avg) { + this.avg = avg; + } + + public void setMaxAvgAgentId(String maxAvgAgentId) { + this.maxAvgAgentId = maxAvgAgentId; + } + + public void setMaxAvg(long maxAvg) { + this.maxAvg = maxAvg; + } + + public void setMinAvgAgentId(String minAvgAgentId) { + this.minAvgAgentId = minAvgAgentId; + } + + public void setMinAvg(long minAvg) { + this.minAvg = minAvg; + } + + @Override + public String getId() { + return id; + } + + @Override + public long getTimestamp() { + return timestamp; + } + + public long getAvg() { + return avg; + } + + public String getMaxAvgAgentId() { + return maxAvgAgentId; + } + + public long getMaxAvg() { + return maxAvg; + } + + public String getMinAvgAgentId() { + return minAvgAgentId; + } + + public long getMinAvg() { + return minAvg; + } + + public static JoinResponseTimeBo joinResponseTimeBoList(List joinResponseTimeBoList, Long timestamp) { + final int boCount = joinResponseTimeBoList.size(); + + if (boCount == 0) { + return JoinResponseTimeBo.EMPTY_JOIN_RESPONSE_TIME_BO; + } + + final JoinResponseTimeBo initJoinResponseTimeBo = joinResponseTimeBoList.get(0); + long sumAvg = 0; + long maxAvg = initJoinResponseTimeBo.getMaxAvg(); + String maxAvgAgentId = initJoinResponseTimeBo.getMaxAvgAgentId(); + long minAvg = initJoinResponseTimeBo.getMinAvg(); + String minAvgAgentId = initJoinResponseTimeBo.getMinAvgAgentId(); + + for (JoinResponseTimeBo joinResponseTimeBo : joinResponseTimeBoList) { + sumAvg += joinResponseTimeBo.getAvg(); + + if(joinResponseTimeBo.getMaxAvg() > maxAvg) { + maxAvg = joinResponseTimeBo.getMaxAvg(); + maxAvgAgentId = joinResponseTimeBo.getMaxAvgAgentId(); + } + if (joinResponseTimeBo.getMinAvg() < minAvg) { + minAvg = joinResponseTimeBo.getMinAvg(); + minAvgAgentId = joinResponseTimeBo.getMinAvgAgentId(); + } + } + + final JoinResponseTimeBo newJoinResponseTimeBo = new JoinResponseTimeBo(); + newJoinResponseTimeBo.setId(initJoinResponseTimeBo.getId()); + newJoinResponseTimeBo.setTimestamp(timestamp); + newJoinResponseTimeBo.setAvg(sumAvg / (long)boCount); + newJoinResponseTimeBo.setMinAvg(minAvg); + newJoinResponseTimeBo.setMinAvgAgentId(minAvgAgentId); + newJoinResponseTimeBo.setMaxAvg(maxAvg); + newJoinResponseTimeBo.setMaxAvgAgentId(maxAvgAgentId); + + return newJoinResponseTimeBo; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + JoinResponseTimeBo that = (JoinResponseTimeBo) o; + + if (timestamp != that.timestamp) return false; + if (avg != that.avg) return false; + if (maxAvg != that.maxAvg) return false; + if (minAvg != that.minAvg) return false; + if (id != null ? !id.equals(that.id) : that.id != null) return false; + if (maxAvgAgentId != null ? !maxAvgAgentId.equals(that.maxAvgAgentId) : that.maxAvgAgentId != null) return false; + return minAvgAgentId != null ? minAvgAgentId.equals(that.minAvgAgentId) : that.minAvgAgentId == null; + } + + @Override + public String toString() { + return "JoinResponseTimeBo{" + + "id='" + id + '\'' + + ", timestamp=" + new Date(timestamp) + + ", avg=" + avg + + ", maxAvgAgentId='" + maxAvgAgentId + '\'' + + ", maxAvg=" + maxAvg + + ", minAvgAgentId='" + minAvgAgentId + '\'' + + ", minAvg=" + minAvg + + '}'; + } +} diff --git a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinTransactionBo.java b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinTransactionBo.java index c3577501b491..e77273c7944d 100644 --- a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinTransactionBo.java +++ b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinTransactionBo.java @@ -21,7 +21,7 @@ * @author minwoo.jung */ public class JoinTransactionBo implements JoinStatBo { - public static final JoinTransactionBo EMPTY_TRANSACTION_BO = new JoinTransactionBo(); + public static final JoinTransactionBo EMPTY_JOIN_TRANSACTION_BO = new JoinTransactionBo(); public static final long UNCOLLECTED_VALUE = -1; private String id = UNKNOWN_ID; @@ -117,7 +117,7 @@ public static JoinTransactionBo joinTransactionBoLIst(List jo final int boCount = joinTransactionBoList.size(); if (boCount == 0) { - return JoinTransactionBo.EMPTY_TRANSACTION_BO; + return JoinTransactionBo.EMPTY_JOIN_TRANSACTION_BO; } final JoinTransactionBo initJoinTransactionBo = joinTransactionBoList.get(0); diff --git a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/StatType.java b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/StatType.java index 237a4f515fd8..365b9f2ee5d8 100644 --- a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/StatType.java +++ b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/stat/join/StatType.java @@ -28,18 +28,21 @@ public enum StatType { APP_MEMORY_USED(3, "Application Memory Usage"), APP_TRANSACTION_COUNT(4, "Application Transaction Count"), APP_ACTIVE_TRACE_COUNT(5, "Application Active trace Count"), + APP_RESPONSE_TIME(6, "Application Response Time"), APP_STST_AGGRE(51, "Application stst aggregation"), APP_CPU_LOAD_AGGRE(52, "Application Cpu Usage aggregation"), APP_MEMORY_USED_AGGRE(53, "Application Memory Usage aggregation"), APP_TRANSACTION_COUNT_AGGRE(54, "Application Transaction count aggregation"), APP_ACTIVE_TRACE_COUNT_AGGRE(55, "Application Active trace count aggregation"), + APP_RESPONSE_TIME_AGGRE(56, "Application Response Time aggregation"), AGENT_STST_AGGRE(101, "Agent stst aggregation"), AGENT_CPU_LOAD_AGGRE(102, "Agent Cpu Usage aggregation"), AGENT_MEMORY_USED_AGGRE(103, "Agent Memory Usage aggregation"), AGENT_TRANSACTION_COUNT_AGGRE(104, "Agent Transaction count aggregation"), - AGENT_ACTIVE_TRACE_COUNT(105, "Agent Active trace count aggregation"); + AGENT_ACTIVE_TRACE_COUNT_AGGRE(105, "Agent Active trace count aggregation"), + AGENT_RESPONSE_TIME_AGGRE(106, "Agent response time aggregation"); public static final int TYPE_CODE_BYTE_LENGTH = 1; diff --git a/commons-server/src/test/java/com/navercorp/pinpoint/common/server/bo/codec/stat/join/ResponseTimeCodecTest.java b/commons-server/src/test/java/com/navercorp/pinpoint/common/server/bo/codec/stat/join/ResponseTimeCodecTest.java new file mode 100644 index 000000000000..bc2876065cfb --- /dev/null +++ b/commons-server/src/test/java/com/navercorp/pinpoint/common/server/bo/codec/stat/join/ResponseTimeCodecTest.java @@ -0,0 +1,83 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.navercorp.pinpoint.common.server.bo.codec.stat.join; + +import com.navercorp.pinpoint.common.buffer.AutomaticBuffer; +import com.navercorp.pinpoint.common.buffer.Buffer; +import com.navercorp.pinpoint.common.buffer.FixedBuffer; +import com.navercorp.pinpoint.common.server.bo.codec.stat.AgentStatDataPointCodec; +import com.navercorp.pinpoint.common.server.bo.serializer.stat.AgentStatUtils; +import com.navercorp.pinpoint.common.server.bo.serializer.stat.ApplicationStatDecodingContext; +import com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo; +import com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import static org.junit.Assert.*; + +/** + * @author minwoo.jung + */ +public class ResponseTimeCodecTest { + + @Test + public void encodeAndDecodeTest() { + final String id = "test_app"; + final long currentTime = new Date().getTime(); + final AgentStatDataPointCodec agentStatDataPointCodec = new AgentStatDataPointCodec(); + final ResponseTimeCodec responseTimeCodec = new ResponseTimeCodec(agentStatDataPointCodec); + final Buffer encodedValueBuffer = new AutomaticBuffer(); + final List joinResponseTimeBoList = createJoinResponseTimeBoList(currentTime); + encodedValueBuffer.putByte(responseTimeCodec.getVersion()); + responseTimeCodec.encodeValues(encodedValueBuffer, joinResponseTimeBoList); + + final Buffer valueBuffer = new FixedBuffer(encodedValueBuffer.getBuffer());; + final long baseTimestamp = AgentStatUtils.getBaseTimestamp(currentTime); + final long timestampDelta = currentTime - baseTimestamp; + final ApplicationStatDecodingContext decodingContext = new ApplicationStatDecodingContext(); + decodingContext.setApplicationId(id); + decodingContext.setBaseTimestamp(baseTimestamp); + decodingContext.setTimestampDelta(timestampDelta); + + assertEquals(valueBuffer.readByte(), responseTimeCodec.getVersion()); + List decodedJoinResponseTimeBoList = responseTimeCodec.decodeValues(valueBuffer, decodingContext); + for (int i = 0 ; i < decodedJoinResponseTimeBoList.size(); i++) { + assertTrue(decodedJoinResponseTimeBoList.get(i).equals(joinResponseTimeBoList.get(i))); + } + } + + private List createJoinResponseTimeBoList(long currentTime) { + final String id = "test_app"; + List joinResponseTimeBoList = new ArrayList(); + JoinResponseTimeBo joinResponseTimeBo1 = new JoinResponseTimeBo(id, currentTime, 3000, 2, "app_1_1", 6000, "app_1_2"); + JoinResponseTimeBo joinResponseTimeBo2 = new JoinResponseTimeBo(id, currentTime, 4000, 200, "app_2_1", 9000, "app_2_2"); + JoinResponseTimeBo joinResponseTimeBo3 = new JoinResponseTimeBo(id, currentTime, 2000, 20, "app_3_1", 7000, "app_3_2"); + JoinResponseTimeBo joinResponseTimeBo4 = new JoinResponseTimeBo(id, currentTime, 5000, 20, "app_4_1", 8000, "app_4_2"); + JoinResponseTimeBo joinResponseTimeBo5 = new JoinResponseTimeBo(id, currentTime, 1000, 10, "app_5_1", 6600, "app_5_2"); + joinResponseTimeBoList.add(joinResponseTimeBo1); + joinResponseTimeBoList.add(joinResponseTimeBo2); + joinResponseTimeBoList.add(joinResponseTimeBo3); + joinResponseTimeBoList.add(joinResponseTimeBo4); + joinResponseTimeBoList.add(joinResponseTimeBo5); + + return joinResponseTimeBoList; + } + +} \ No newline at end of file diff --git a/commons-server/src/test/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinActiveTraceBoTest.java b/commons-server/src/test/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinActiveTraceBoTest.java index 882157a8282e..cb86acb27601 100644 --- a/commons-server/src/test/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinActiveTraceBoTest.java +++ b/commons-server/src/test/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinActiveTraceBoTest.java @@ -58,6 +58,6 @@ public void joinActiveTraceBoTest() { public void joinActiveTraceBo2Test() { List joinActiveTraceBoList = new ArrayList(); JoinActiveTraceBo joinActiveTraceBo = JoinActiveTraceBo.joinActiveTraceBoList(joinActiveTraceBoList, 1496988667231L); - assertEquals(joinActiveTraceBo, JoinActiveTraceBo.EMPTY_ACTIVE_TRACE_BO); + assertEquals(joinActiveTraceBo, JoinActiveTraceBo.EMPTY_JOIN_ACTIVE_TRACE_BO); } } \ No newline at end of file diff --git a/commons-server/src/test/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinApplicationStatBoTest.java b/commons-server/src/test/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinApplicationStatBoTest.java index 84aba8f3d913..510fddf38491 100644 --- a/commons-server/src/test/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinApplicationStatBoTest.java +++ b/commons-server/src/test/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinApplicationStatBoTest.java @@ -709,6 +709,161 @@ private void assertJoinActiveTraceBoList(List joinActiveTrace assertEquals(joinActiveTraceBo5.getMaxTotalCountAgentId(), "id4_2"); } + @Test + public void joinApplicationStatBoByTimeSlice9Test() { + final long currentTime = 1487149800000L; // 18:10:00 15 2 2017 + List joinApplicationStatBoList = new ArrayList(); + joinApplicationStatBoList.add(createJoinApplicationStatBo5("id1", currentTime, 10)); + joinApplicationStatBoList.add(createJoinApplicationStatBo5("id2", currentTime + 1000, -40)); + joinApplicationStatBoList.add(createJoinApplicationStatBo5("id3", currentTime + 2000, -30)); + joinApplicationStatBoList.add(createJoinApplicationStatBo5("id4", currentTime + 3000, 40)); + joinApplicationStatBoList.add(createJoinApplicationStatBo5("id5", currentTime + 4000, -50)); + JoinApplicationStatBo resultJoinApplicationStatBo = JoinApplicationStatBo.joinApplicationStatBoByTimeSlice(joinApplicationStatBoList); + List joinResponseTimeBoList = resultJoinApplicationStatBo.getJoinResponseTimeBoList(); + Collections.sort(joinResponseTimeBoList, new ComparatorImpl5()); + + assertJoinResponseTimeBoList(joinResponseTimeBoList); + } + + @Test + public void joinApplicationStatBoByTimeSlice10Test() { + List joinApplicationStatBoList = new ArrayList(); + + List joinResponseTimeBoList1 = new ArrayList(); + JoinResponseTimeBo joinResponseTimeBo1_1 = new JoinResponseTimeBo("agent1", 1498462545000L, 100, 60, "agent1", 200, "agent1"); + JoinResponseTimeBo joinResponseTimeBo1_2 = new JoinResponseTimeBo("agent1", 1498462550000L, 100, 60, "agent1", 200, "agent1"); + JoinResponseTimeBo joinResponseTimeBo1_3 = new JoinResponseTimeBo("agent1", 1498462555000L, 100, 60, "agent1", 200, "agent1"); + joinResponseTimeBoList1.add(joinResponseTimeBo1_1); + joinResponseTimeBoList1.add(joinResponseTimeBo1_2); + joinResponseTimeBoList1.add(joinResponseTimeBo1_3); + JoinApplicationStatBo joinApplicationStatBo1 = new JoinApplicationStatBo(); + joinApplicationStatBo1.setId("test_app"); + joinApplicationStatBo1.setJoinResponseTimeBoList(joinResponseTimeBoList1); + joinApplicationStatBo1.setTimestamp(1498462545000L); + joinApplicationStatBoList.add(joinApplicationStatBo1); + + List joinResponseTimeBoList2 = new ArrayList(); + JoinResponseTimeBo joinResponseTimeBo2_1 = new JoinResponseTimeBo("agent1", 1498462545000L, 50, 20, "agent1", 230, "agent1"); + JoinResponseTimeBo joinResponseTimeBo2_2 = new JoinResponseTimeBo("agent2", 1498462550000L, 200, 60, "agent2", 400, "agent2"); + JoinResponseTimeBo joinResponseTimeBo2_3 = new JoinResponseTimeBo("agent3", 1498462555000L, 500, 10, "agent3", 100, "agent3"); + JoinResponseTimeBo joinResponseTimeBo2_4 = new JoinResponseTimeBo("agent3", 1498462560000L, 400, 60, "agent3", 500, "agent3"); + joinResponseTimeBoList2.add(joinResponseTimeBo2_1); + joinResponseTimeBoList2.add(joinResponseTimeBo2_2); + joinResponseTimeBoList2.add(joinResponseTimeBo2_3); + joinResponseTimeBoList2.add(joinResponseTimeBo2_4); + JoinApplicationStatBo joinApplicationStatBo2 = new JoinApplicationStatBo(); + joinApplicationStatBo2.setId("test_app"); + joinApplicationStatBo2.setJoinResponseTimeBoList(joinResponseTimeBoList2); + joinApplicationStatBo2.setTimestamp(1498462545000L); + joinApplicationStatBoList.add(joinApplicationStatBo2); + + List joinResponseTimeBoList3 = new ArrayList(); + JoinResponseTimeBo joinResponseTimeBo3_1 = new JoinResponseTimeBo("agent1", 1498462545000L, 150, 20, "agent1", 230, "agent1"); + JoinResponseTimeBo joinResponseTimeBo3_2 = new JoinResponseTimeBo("agent2", 1498462550000L, 300, 10, "agent2", 400, "agent2"); + JoinResponseTimeBo joinResponseTimeBo3_3 = new JoinResponseTimeBo("agent3", 1498462565000L, 30, 5, "agent3", 100, "agent3"); + joinResponseTimeBoList3.add(joinResponseTimeBo3_1); + joinResponseTimeBoList3.add(joinResponseTimeBo3_2); + joinResponseTimeBoList3.add(joinResponseTimeBo3_3); + JoinApplicationStatBo joinApplicationStatBo3 = new JoinApplicationStatBo(); + joinApplicationStatBo3.setId("test_app"); + joinApplicationStatBo3.setJoinResponseTimeBoList(joinResponseTimeBoList3); + joinApplicationStatBo3.setTimestamp(1498462545000L); + joinApplicationStatBoList.add(joinApplicationStatBo3); + + JoinApplicationStatBo joinApplicationStatBo = JoinApplicationStatBo.joinApplicationStatBoByTimeSlice(joinApplicationStatBoList); + assertEquals(joinApplicationStatBo.getId(), "test_app"); + assertEquals(joinApplicationStatBo.getTimestamp(), 1498462545000L); + List joinResponseTimeBoList = joinApplicationStatBo.getJoinResponseTimeBoList(); + Collections.sort(joinResponseTimeBoList, new ComparatorImpl5()); + assertEquals(joinResponseTimeBoList.size(), 5); + assertEquals(joinResponseTimeBoList.get(0).getAvg(), 100); + assertEquals(joinResponseTimeBoList.get(1).getAvg(), 200); + assertEquals(joinResponseTimeBoList.get(2).getAvg(), 300); + assertEquals(joinResponseTimeBoList.get(3).getAvg(), 400); + assertEquals(joinResponseTimeBoList.get(4).getAvg(), 30); + } + + private void assertJoinResponseTimeBoList(List joinResponseTimeBoList) { + assertEquals(joinResponseTimeBoList.size(), 5); + + JoinResponseTimeBo joinResponseTimeBo1 = joinResponseTimeBoList.get(0); + assertEquals(joinResponseTimeBo1.getId(), "id1"); + assertEquals(joinResponseTimeBo1.getTimestamp(), 1487149800000L); + assertEquals(joinResponseTimeBo1.getAvg(), 286); + assertEquals(joinResponseTimeBo1.getMinAvg(), 150); + assertEquals(joinResponseTimeBo1.getMinAvgAgentId(), "id5_1"); + assertEquals(joinResponseTimeBo1.getMaxAvg(), 6040); + assertEquals(joinResponseTimeBo1.getMaxAvgAgentId(), "id4_2"); + + JoinResponseTimeBo joinResponseTimeBo2 = joinResponseTimeBoList.get(1); + assertEquals(joinResponseTimeBo2.getId(), "id1"); + assertEquals(joinResponseTimeBo2.getTimestamp(), 1487149805000L); + assertEquals(joinResponseTimeBo2.getAvg(), 186); + assertEquals(joinResponseTimeBo2.getMinAvg(), 0); + assertEquals(joinResponseTimeBo2.getMinAvgAgentId(), "id5_1"); + assertEquals(joinResponseTimeBo2.getMaxAvg(), 7040); + assertEquals(joinResponseTimeBo2.getMaxAvgAgentId(), "id4_2"); + + JoinResponseTimeBo joinResponseTimeBo3 = joinResponseTimeBoList.get(2); + assertEquals(joinResponseTimeBo3.getId(), "id1"); + assertEquals(joinResponseTimeBo3.getTimestamp(), 1487149810000L); + assertEquals(joinResponseTimeBo3.getAvg(), 386); + assertEquals(joinResponseTimeBo3.getMinAvg(), 250); + assertEquals(joinResponseTimeBo3.getMinAvgAgentId(), "id5_1"); + assertEquals(joinResponseTimeBo3.getMaxAvg(), 8040); + assertEquals(joinResponseTimeBo3.getMaxAvgAgentId(), "id4_2"); + + JoinResponseTimeBo joinResponseTimeBo4 = joinResponseTimeBoList.get(3); + assertEquals(joinResponseTimeBo4.getId(), "id1"); + assertEquals(joinResponseTimeBo4.getTimestamp(), 1487149815000L); + assertEquals(joinResponseTimeBo4.getAvg(), 486); + assertEquals(joinResponseTimeBo4.getMinAvg(), 350); + assertEquals(joinResponseTimeBo4.getMinAvgAgentId(), "id5_1"); + assertEquals(joinResponseTimeBo4.getMaxAvg(), 2040); + assertEquals(joinResponseTimeBo4.getMaxAvgAgentId(), "id4_2"); + + JoinResponseTimeBo joinResponseTimeBo5 = joinResponseTimeBoList.get(4); + assertEquals(joinResponseTimeBo5.getId(), "id1"); + assertEquals(joinResponseTimeBo5.getTimestamp(), 1487149820000L); + assertEquals(joinResponseTimeBo5.getAvg(), 86); + assertEquals(joinResponseTimeBo5.getMinAvg(), 50); + assertEquals(joinResponseTimeBo5.getMinAvgAgentId(), "id5_1"); + assertEquals(joinResponseTimeBo5.getMaxAvg(), 9040); + assertEquals(joinResponseTimeBo5.getMaxAvgAgentId(), "id4_2"); + } + + private class ComparatorImpl5 implements Comparator { + @Override + public int compare(JoinResponseTimeBo bo1, JoinResponseTimeBo bo2) { + return bo1.getTimestamp() < bo2.getTimestamp() ? -1 : 1; + } + } + + private JoinApplicationStatBo createJoinApplicationStatBo5(final String id, final long timestamp, final int plus) { + final JoinApplicationStatBo joinApplicationStatBo = new JoinApplicationStatBo(); + joinApplicationStatBo.setId(id); + joinApplicationStatBo.setJoinResponseTimeBoList(createJoinResponseTimeList(id, timestamp, plus)); + joinApplicationStatBo.setTimestamp(timestamp); + joinApplicationStatBo.setStatType(StatType.APP_STST); + return joinApplicationStatBo; + } + + private List createJoinResponseTimeList(String id, long currentTime, int plus) { + final List joinResponseTimeBoList = new ArrayList(); + JoinResponseTimeBo joinResponseTimeBo1 = new JoinResponseTimeBo(id, currentTime, 300+ plus, 200 + plus, id + "_1", 6000 + plus, id + "_2"); + JoinResponseTimeBo joinResponseTimeBo2 = new JoinResponseTimeBo(id, currentTime + 5000, 200 + plus, 50 + plus, id + "_1", 7000 + plus, id + "_2"); + JoinResponseTimeBo joinResponseTimeBo3 = new JoinResponseTimeBo(id, currentTime + 10000, 400 + plus, 300 + plus, id + "_1", 8000 + plus, id + "_2"); + JoinResponseTimeBo joinResponseTimeBo4 = new JoinResponseTimeBo(id, currentTime + 15000, 500 + plus, 400 + plus, id + "_1", 2000 + plus, id + "_2"); + JoinResponseTimeBo joinResponseTimeBo5 = new JoinResponseTimeBo(id, currentTime + 20000, 100 + plus, 100 + plus, id + "_1", 9000 + plus, id + "_2"); + joinResponseTimeBoList.add(joinResponseTimeBo1); + joinResponseTimeBoList.add(joinResponseTimeBo2); + joinResponseTimeBoList.add(joinResponseTimeBo3); + joinResponseTimeBoList.add(joinResponseTimeBo4); + joinResponseTimeBoList.add(joinResponseTimeBo5); + + return joinResponseTimeBoList; + } + @Test public void createJoinApplicationStatBoTest() { JoinAgentStatBo joinAgentStatBo = new JoinAgentStatBo(); @@ -766,6 +921,19 @@ public void createJoinApplicationStatBoTest() { JoinActiveTraceBoList.add(joinActiveTraceBo5); joinAgentStatBo.setJoinActiveTraceBoList(JoinActiveTraceBoList); + List joinResponseTimeBoList = new ArrayList(); + JoinResponseTimeBo joinResponseTimeBo1 = new JoinResponseTimeBo("agent1", 1498462565000L, 3000, 2, "app_1_1", 6000, "app_1_2"); + JoinResponseTimeBo joinResponseTimeBo2 = new JoinResponseTimeBo("agent1", 1498462570000L, 4000, 200, "app_2_1", 9000, "app_2_2"); + JoinResponseTimeBo joinResponseTimeBo3 = new JoinResponseTimeBo("agent1", 1498462575000L, 2000, 20, "app_3_1", 7000, "app_3_2"); + JoinResponseTimeBo joinResponseTimeBo4 = new JoinResponseTimeBo("agent1", 1498462580000L, 5000, 20, "app_4_1", 8000, "app_4_2"); + JoinResponseTimeBo joinResponseTimeBo5 = new JoinResponseTimeBo("agent1", 1498462585000L, 1000, 10, "app_5_1", 6600, "app_5_2"); + joinResponseTimeBoList.add(joinResponseTimeBo1); + joinResponseTimeBoList.add(joinResponseTimeBo2); + joinResponseTimeBoList.add(joinResponseTimeBo3); + joinResponseTimeBoList.add(joinResponseTimeBo4); + joinResponseTimeBoList.add(joinResponseTimeBo5); + joinAgentStatBo.setJoinResponseTimeBoList(joinResponseTimeBoList); + List joinApplicationStatBoList = JoinApplicationStatBo.createJoinApplicationStatBo("test_app", joinAgentStatBo, 60000); assertEquals(joinApplicationStatBoList.size(), 1); JoinApplicationStatBo joinApplicationStatBo = joinApplicationStatBoList.get(0); @@ -774,6 +942,7 @@ public void createJoinApplicationStatBoTest() { assertEquals(joinApplicationStatBo.getJoinMemoryBoList().size(), 5); assertEquals(joinApplicationStatBo.getJoinTransactionBoList().size(), 5); assertEquals(joinApplicationStatBo.getJoinActiveTraceBoList().size(), 5); + assertEquals(joinApplicationStatBo.getJoinResponseTimeBoList().size(), 5); } @Test @@ -833,6 +1002,19 @@ public void createJoinApplicationStatBo2Test() { JoinActiveTraceBoList.add(joinActiveTraceBo5); joinAgentStatBo.setJoinActiveTraceBoList(JoinActiveTraceBoList); + List joinResponseTimeBoList = new ArrayList(); + JoinResponseTimeBo joinResponseTimeBo1 = new JoinResponseTimeBo("agent1", 1498462545000L, 3000, 2, "app_1_1", 6000, "app_1_2"); + JoinResponseTimeBo joinResponseTimeBo2 = new JoinResponseTimeBo("agent1", 1498462550000L, 4000, 200, "app_2_1", 9000, "app_2_2"); + JoinResponseTimeBo joinResponseTimeBo3 = new JoinResponseTimeBo("agent1", 1498462555000L, 2000, 20, "app_3_1", 7000, "app_3_2"); + JoinResponseTimeBo joinResponseTimeBo4 = new JoinResponseTimeBo("agent1", 1498462560000L, 5000, 20, "app_4_1", 8000, "app_4_2"); + JoinResponseTimeBo joinResponseTimeBo5 = new JoinResponseTimeBo("agent1", 1498462565000L, 1000, 10, "app_5_1", 6600, "app_5_2"); + joinResponseTimeBoList.add(joinResponseTimeBo1); + joinResponseTimeBoList.add(joinResponseTimeBo2); + joinResponseTimeBoList.add(joinResponseTimeBo3); + joinResponseTimeBoList.add(joinResponseTimeBo4); + joinResponseTimeBoList.add(joinResponseTimeBo5); + joinAgentStatBo.setJoinResponseTimeBoList(joinResponseTimeBoList); + List joinApplicationStatBoList = JoinApplicationStatBo.createJoinApplicationStatBo("test_app", joinAgentStatBo, 60000); assertEquals(joinApplicationStatBoList.size(), 2); for (JoinApplicationStatBo joinApplicationStatBo : joinApplicationStatBoList) { @@ -842,11 +1024,13 @@ public void createJoinApplicationStatBo2Test() { assertEquals(joinApplicationStatBo.getJoinMemoryBoList().size(), 2); assertEquals(joinApplicationStatBo.getJoinTransactionBoList().size(), 2); assertEquals(joinApplicationStatBo.getJoinActiveTraceBoList().size(), 2); + assertEquals(joinApplicationStatBo.getJoinResponseTimeBoList().size(), 2); } else if (joinApplicationStatBo.getTimestamp() == 1498462500000L) { assertEquals(joinApplicationStatBo.getJoinCpuLoadBoList().size(), 3); assertEquals(joinApplicationStatBo.getJoinMemoryBoList().size(), 3); assertEquals(joinApplicationStatBo.getJoinTransactionBoList().size(), 3); assertEquals(joinApplicationStatBo.getJoinActiveTraceBoList().size(), 3); + assertEquals(joinApplicationStatBo.getJoinResponseTimeBoList().size(), 3); } else { fail(); } @@ -910,6 +1094,19 @@ public void createJoinApplicationStatBo3Test() { JoinActiveTraceBoList.add(joinActiveTraceBo5); joinAgentStatBo.setJoinActiveTraceBoList(JoinActiveTraceBoList); + List joinResponseTimeBoList = new ArrayList(); + JoinResponseTimeBo joinResponseTimeBo1 = new JoinResponseTimeBo("agent1", 1498462545000L, 3000, 2, "app_1_1", 6000, "app_1_2"); + JoinResponseTimeBo joinResponseTimeBo2 = new JoinResponseTimeBo("agent1", 1498462550000L, 4000, 200, "app_2_1", 9000, "app_2_2"); + JoinResponseTimeBo joinResponseTimeBo3 = new JoinResponseTimeBo("agent1", 1498462555000L, 2000, 20, "app_3_1", 7000, "app_3_2"); + JoinResponseTimeBo joinResponseTimeBo4 = new JoinResponseTimeBo("agent1", 1498462560000L, 5000, 20, "app_4_1", 8000, "app_4_2"); + JoinResponseTimeBo joinResponseTimeBo5 = new JoinResponseTimeBo("agent1", 1498462565000L, 1000, 10, "app_5_1", 6600, "app_5_2"); + joinResponseTimeBoList.add(joinResponseTimeBo1); + joinResponseTimeBoList.add(joinResponseTimeBo2); + joinResponseTimeBoList.add(joinResponseTimeBo3); + joinResponseTimeBoList.add(joinResponseTimeBo4); + joinResponseTimeBoList.add(joinResponseTimeBo5); + joinAgentStatBo.setJoinResponseTimeBoList(joinResponseTimeBoList); + List joinApplicationStatBoList = JoinApplicationStatBo.createJoinApplicationStatBo("test_app", joinAgentStatBo, 10000); assertEquals(joinApplicationStatBoList.size(), 3); for (JoinApplicationStatBo joinApplicationStatBo : joinApplicationStatBoList) { @@ -919,16 +1116,19 @@ public void createJoinApplicationStatBo3Test() { assertEquals(joinApplicationStatBo.getJoinMemoryBoList().size(), 2); assertEquals(joinApplicationStatBo.getJoinTransactionBoList().size(), 2); assertEquals(joinApplicationStatBo.getJoinActiveTraceBoList().size(), 2); + assertEquals(joinApplicationStatBo.getJoinResponseTimeBoList().size(), 2); } else if (joinApplicationStatBo.getTimestamp() == 1498462540000L) { assertEquals(joinApplicationStatBo.getJoinCpuLoadBoList().size(), 1); assertEquals(joinApplicationStatBo.getJoinMemoryBoList().size(), 1); assertEquals(joinApplicationStatBo.getJoinTransactionBoList().size(), 1); assertEquals(joinApplicationStatBo.getJoinActiveTraceBoList().size(), 1); + assertEquals(joinApplicationStatBo.getJoinResponseTimeBoList().size(), 1); } else if (joinApplicationStatBo.getTimestamp() == 1498462550000L) { assertEquals(joinApplicationStatBo.getJoinCpuLoadBoList().size(), 2); assertEquals(joinApplicationStatBo.getJoinMemoryBoList().size(), 2); assertEquals(joinApplicationStatBo.getJoinTransactionBoList().size(), 2); assertEquals(joinApplicationStatBo.getJoinActiveTraceBoList().size(), 2); + assertEquals(joinApplicationStatBo.getJoinResponseTimeBoList().size(), 2); } else { fail(); } diff --git a/commons-server/src/test/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinResponseTimeBoTest.java b/commons-server/src/test/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinResponseTimeBoTest.java new file mode 100644 index 000000000000..101d414885ac --- /dev/null +++ b/commons-server/src/test/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinResponseTimeBoTest.java @@ -0,0 +1,63 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.navercorp.pinpoint.common.server.bo.stat.join; + +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.*; + +/** + * @author minwoo.jung + */ +public class JoinResponseTimeBoTest { + + @Test + public void joinResponseTimeBoListTest() { + long time = 1496988667231L; + List joinResponseTimeBoList = new ArrayList(); + JoinResponseTimeBo joinResponseTimeBo1 = new JoinResponseTimeBo("agent1", time, 3000, 2, "agent1", 6000, "agent1"); + JoinResponseTimeBo joinResponseTimeBo2 = new JoinResponseTimeBo("agent2", time, 4000, 200, "agent2", 9000, "agent2"); + JoinResponseTimeBo joinResponseTimeBo3 = new JoinResponseTimeBo("agent3", time, 2000, 20, "agent3", 7000, "agent3"); + JoinResponseTimeBo joinResponseTimeBo4 = new JoinResponseTimeBo("agent4", time, 5000, 20, "agent4", 8000, "agent4"); + JoinResponseTimeBo joinResponseTimeBo5 = new JoinResponseTimeBo("agent5", time, 1000, 10, "agent5", 6600, "agent5"); + joinResponseTimeBoList.add(joinResponseTimeBo1); + joinResponseTimeBoList.add(joinResponseTimeBo2); + joinResponseTimeBoList.add(joinResponseTimeBo3); + joinResponseTimeBoList.add(joinResponseTimeBo4); + joinResponseTimeBoList.add(joinResponseTimeBo5); + + JoinResponseTimeBo joinResponseTimeBo = JoinResponseTimeBo.joinResponseTimeBoList(joinResponseTimeBoList, time); + assertEquals("agent1", joinResponseTimeBo.getId()); + assertEquals(time, joinResponseTimeBo.getTimestamp()); + assertEquals(3000, joinResponseTimeBo.getAvg()); + assertEquals(2, joinResponseTimeBo.getMinAvg()); + assertEquals("agent1", joinResponseTimeBo.getMinAvgAgentId()); + assertEquals(9000, joinResponseTimeBo.getMaxAvg()); + assertEquals("agent2", joinResponseTimeBo.getMaxAvgAgentId()); + } + + @Test + public void joinResponseTimeBoList2Test() { + List joinResponseTimeBoList = new ArrayList(); + JoinResponseTimeBo joinResponseTimeBo = JoinResponseTimeBo.joinResponseTimeBoList(joinResponseTimeBoList, 1496988667231L); + assertEquals(joinResponseTimeBo, JoinResponseTimeBo.EMPTY_JOIN_RESPONSE_TIME_BO); + } + +} \ No newline at end of file diff --git a/commons-server/src/test/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinTransactionBoTest.java b/commons-server/src/test/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinTransactionBoTest.java index eab089212845..ed001b50eb9f 100644 --- a/commons-server/src/test/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinTransactionBoTest.java +++ b/commons-server/src/test/java/com/navercorp/pinpoint/common/server/bo/stat/join/JoinTransactionBoTest.java @@ -57,6 +57,6 @@ public void joinTransactionBoLIstTest() { public void joinTransactionBoLIst2Test() { List joinTransactionBoList = new ArrayList(); JoinTransactionBo joinTransactionBo = JoinTransactionBo.joinTransactionBoLIst(joinTransactionBoList, 1496988667231L); - assertEquals(joinTransactionBo, JoinTransactionBo.EMPTY_TRANSACTION_BO); + assertEquals(joinTransactionBo, JoinTransactionBo.EMPTY_JOIN_TRANSACTION_BO); } } \ No newline at end of file diff --git a/flink/src/main/java/com/navercorp/pinpoint/flink/dao/hbase/ResponseTimeDao.java b/flink/src/main/java/com/navercorp/pinpoint/flink/dao/hbase/ResponseTimeDao.java new file mode 100644 index 000000000000..f48efb8815c6 --- /dev/null +++ b/flink/src/main/java/com/navercorp/pinpoint/flink/dao/hbase/ResponseTimeDao.java @@ -0,0 +1,61 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.navercorp.pinpoint.flink.dao.hbase; + +import com.navercorp.pinpoint.common.hbase.HBaseTables; +import com.navercorp.pinpoint.common.hbase.HbaseTemplate2; +import com.navercorp.pinpoint.common.server.bo.serializer.stat.ApplicationStatHbaseOperationFactory; +import com.navercorp.pinpoint.common.server.bo.serializer.stat.join.MemorySerializer; +import com.navercorp.pinpoint.common.server.bo.serializer.stat.join.ResponseTimeSerializer; +import com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo; +import com.navercorp.pinpoint.common.server.bo.stat.join.StatType; +import org.apache.commons.collections.CollectionUtils; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.client.Put; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Date; +import java.util.List; + +/** + * @author minwoo.jung + */ +public class ResponseTimeDao { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + private static HbaseTemplate2 hbaseTemplate2 = null; + private static ApplicationStatHbaseOperationFactory applicationStatHbaseOperationFactory = null; + private static ResponseTimeSerializer responseTimeSerializer = null; + private static TableName APPLICATION_STAT_AGGRE = HBaseTables.APPLICATION_STAT_AGGRE; + + public ResponseTimeDao(HbaseTemplate2 hbaseTemplate2, ApplicationStatHbaseOperationFactory applicationStatHbaseOperationFactory, ResponseTimeSerializer responseTimeSerializer) { + this.hbaseTemplate2 = hbaseTemplate2; + this.applicationStatHbaseOperationFactory = applicationStatHbaseOperationFactory; + this.responseTimeSerializer = responseTimeSerializer; + } + + public void insert(String id, long timestamp, List joinResponseTimeBoList, StatType statType) { + logger.info("[insert] " + new Date(timestamp) + " : ("+ joinResponseTimeBoList + " )"); + List responseTimePuts = applicationStatHbaseOperationFactory.createPuts(id, joinResponseTimeBoList, statType, responseTimeSerializer); + if (!responseTimePuts.isEmpty()) { + List rejectedPuts = hbaseTemplate2.asyncPut(APPLICATION_STAT_AGGRE, responseTimePuts); + if (CollectionUtils.isNotEmpty(rejectedPuts)) { + hbaseTemplate2.put(APPLICATION_STAT_AGGRE, rejectedPuts); + } + } + } +} diff --git a/flink/src/main/java/com/navercorp/pinpoint/flink/dao/hbase/StatisticsDao.java b/flink/src/main/java/com/navercorp/pinpoint/flink/dao/hbase/StatisticsDao.java index e082e13b8845..cdb83b0280ff 100644 --- a/flink/src/main/java/com/navercorp/pinpoint/flink/dao/hbase/StatisticsDao.java +++ b/flink/src/main/java/com/navercorp/pinpoint/flink/dao/hbase/StatisticsDao.java @@ -17,6 +17,7 @@ import com.navercorp.pinpoint.common.hbase.HBaseTables; import com.navercorp.pinpoint.common.server.bo.stat.join.*; +import com.navercorp.pinpoint.web.vo.ResponseTime; import org.apache.flink.api.common.io.OutputFormat; import org.apache.flink.api.java.tuple.Tuple3; import org.apache.flink.configuration.Configuration; @@ -42,14 +43,16 @@ public class StatisticsDao implements OutputFormat joinMemoryBoList = castJoinStatBoList(joinApplicationStatBo.getJoinMemoryBoList()); List joinTransactionBoList = castJoinStatBoList(joinApplicationStatBo.getJoinTransactionBoList()); List joinActiveTraceBoList = castJoinStatBoList(joinApplicationStatBo.getJoinActiveTraceBoList()); + List joinResponseTimeBoList = castJoinStatBoList(joinApplicationStatBo.getJoinResponseTimeBoList()); + if (joinApplicationStatBo.getStatType() == StatType.APP_STST_AGGRE) { // logger.info("insert application aggre : " + new Date(joinApplicationStatBo.getTimestamp()) + " ("+ joinApplicationStatBo.getApplicationId() + " )"); } else { @@ -86,6 +91,7 @@ private void insertJoinApplicationStatBo(JoinApplicationStatBo joinApplicationSt memoryDao.insert(joinApplicationStatBo.getId(), joinApplicationStatBo.getTimestamp(), joinMemoryBoList, StatType.APP_MEMORY_USED); transactionDao.insert(joinApplicationStatBo.getId(), joinApplicationStatBo.getTimestamp(), joinTransactionBoList, StatType.APP_TRANSACTION_COUNT); activeTraceDao.insert(joinApplicationStatBo.getId(), joinApplicationStatBo.getTimestamp(), joinActiveTraceBoList, StatType.APP_ACTIVE_TRACE_COUNT); + responseTimeDao.insert(joinApplicationStatBo.getId(), joinApplicationStatBo.getTimestamp(), joinResponseTimeBoList, StatType.APP_RESPONSE_TIME); } } diff --git a/flink/src/main/java/com/navercorp/pinpoint/flink/function/ApplicationStatBoWindow.java b/flink/src/main/java/com/navercorp/pinpoint/flink/function/ApplicationStatBoWindow.java index d0da23879f32..03f3bdb8349a 100644 --- a/flink/src/main/java/com/navercorp/pinpoint/flink/function/ApplicationStatBoWindow.java +++ b/flink/src/main/java/com/navercorp/pinpoint/flink/function/ApplicationStatBoWindow.java @@ -64,6 +64,7 @@ public void apply(Tuple tuple, TimeWindow window, Iterable> values) { List joinApplicaitonStatBoList = new ArrayList(); + for (Tuple3 value : values) { joinApplicaitonStatBoList.add((JoinApplicationStatBo) value.f1); } diff --git a/flink/src/main/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinActiveTraceBoMapper.java b/flink/src/main/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinActiveTraceBoMapper.java index 198b31d1ec42..23cc424af0c4 100644 --- a/flink/src/main/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinActiveTraceBoMapper.java +++ b/flink/src/main/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinActiveTraceBoMapper.java @@ -20,7 +20,6 @@ import com.navercorp.pinpoint.thrift.dto.flink.TFActiveTrace; import com.navercorp.pinpoint.thrift.dto.flink.TFActiveTraceHistogram; import com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat; -import sun.nio.cs.HistoricallyNamedCharset; import java.util.List; @@ -31,14 +30,14 @@ public class JoinActiveTraceBoMapper { public JoinActiveTraceBo map(TFAgentStat tFAgentStat) { if (!tFAgentStat.isSetActiveTrace()) { - return JoinActiveTraceBo.EMPTY_ACTIVE_TRACE_BO; + return JoinActiveTraceBo.EMPTY_JOIN_ACTIVE_TRACE_BO; } final TFActiveTrace tFactiveTrace = tFAgentStat.getActiveTrace(); final String agentId = tFAgentStat.getAgentId(); if (tFactiveTrace.isSetHistogram() == false) { - return JoinActiveTraceBo.EMPTY_ACTIVE_TRACE_BO; + return JoinActiveTraceBo.EMPTY_JOIN_ACTIVE_TRACE_BO; } final TFActiveTraceHistogram histogram = tFactiveTrace.getHistogram(); diff --git a/flink/src/main/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinAgentStatBoMapper.java b/flink/src/main/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinAgentStatBoMapper.java index 55c6ea23235d..0f90c2a942d8 100644 --- a/flink/src/main/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinAgentStatBoMapper.java +++ b/flink/src/main/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinAgentStatBoMapper.java @@ -34,6 +34,7 @@ public class JoinAgentStatBoMapper implements ThriftBoMapper joinMemoryBoList = new ArrayList<>(agentStatSize); List joinTransactionBoList = new ArrayList<>(agentStatSize); List joinActiveTraceBoList = new ArrayList<>(agentStatSize); + List joinResponseTimeBoList = new ArrayList<>(agentStatSize); + for (TFAgentStat tFAgentStat : tFAgentStatBatch.getAgentStats()) { createAndAddJoinCpuLoadBo(tFAgentStat, joinCpuLoadBoList); createAndAddJoinMemoryBo(tFAgentStat, joinMemoryBoList); createAndAddJoinTransactionBo(tFAgentStat, joinTransactionBoList); createAndAddJoinActiveTraceBo(tFAgentStat, joinActiveTraceBoList); + createAndAddJoinResponseTimeBo(tFAgentStat, joinResponseTimeBoList); } joinAgentStatBo.setJoinCpuLoadBoList(joinCpuLoadBoList); joinAgentStatBo.setJoinMemoryBoList(joinMemoryBoList); joinAgentStatBo.setJoinTransactionBoList(joinTransactionBoList); joinAgentStatBo.setJoinActiveTraceBoList(joinActiveTraceBoList); + joinAgentStatBo.setJoinResponseTimeBoList(joinResponseTimeBoList); joinAgentStatBo.setId(tFAgentStatBatch.getAgentId()); joinAgentStatBo.setAgentStartTimestamp(tFAgentStatBatch.getStartTimestamp()); joinAgentStatBo.setTimestamp(getTimeStamp(joinAgentStatBo)); return joinAgentStatBo; } + private void createAndAddJoinResponseTimeBo(TFAgentStat tFAgentStat, List joinResponseTimeBoList) { + JoinResponseTimeBo joinResponseTimeBo = joinResponseTimeBoMapper.map(tFAgentStat); + + if (joinResponseTimeBo == joinResponseTimeBo.EMPTY_JOIN_RESPONSE_TIME_BO) { + return; + } + + joinResponseTimeBoList.add(joinResponseTimeBo); + } + private void createAndAddJoinActiveTraceBo(TFAgentStat tFAgentStat, List joinActiveTraceBoList) { JoinActiveTraceBo joinActiveTraceBo = joinActiveTraceBoMapper.map(tFAgentStat); - if (joinActiveTraceBo == joinActiveTraceBo.EMPTY_ACTIVE_TRACE_BO) { + if (joinActiveTraceBo == joinActiveTraceBo.EMPTY_JOIN_ACTIVE_TRACE_BO) { return; } @@ -81,7 +96,7 @@ private void createAndAddJoinActiveTraceBo(TFAgentStat tFAgentStat, List joinTransactionBoList) { JoinTransactionBo joinTransactionBo = joinTransactionBoMapper.map(tFAgentStat); - if (joinTransactionBo == JoinTransactionBo.EMPTY_TRANSACTION_BO) { + if (joinTransactionBo == JoinTransactionBo.EMPTY_JOIN_TRANSACTION_BO) { return; } @@ -113,6 +128,12 @@ private long getTimeStamp(JoinAgentStatBo joinAgentStatBo) { return joinActiveTraceBoList.get(0).getTimestamp(); } + List joinResponseTimeBoList = joinAgentStatBo.getJoinResponseTimeBoList(); + + if (joinResponseTimeBoList.size() != 0) { + return joinResponseTimeBoList.get(0).getTimestamp(); + } + return Long.MIN_VALUE; } diff --git a/flink/src/main/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinResponseTimeBoMapper.java b/flink/src/main/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinResponseTimeBoMapper.java new file mode 100644 index 000000000000..5405e39d7731 --- /dev/null +++ b/flink/src/main/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinResponseTimeBoMapper.java @@ -0,0 +1,48 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.navercorp.pinpoint.flink.mapper.thrift.stat; + +import com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo; +import com.navercorp.pinpoint.flink.mapper.thrift.ThriftBoMapper; +import com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat; +import com.navercorp.pinpoint.thrift.dto.flink.TFResponseTime; + +/** + * @author minwoo.jung + */ +public class JoinResponseTimeBoMapper implements ThriftBoMapper { + + public JoinResponseTimeBo map(TFAgentStat tFAgentStat) { + if (!tFAgentStat.isSetResponseTime()) { + return JoinResponseTimeBo.EMPTY_JOIN_RESPONSE_TIME_BO; + } + + final String agentId = tFAgentStat.getAgentId(); + final TFResponseTime tFResponseTime = tFAgentStat.getResponseTime(); + final long avg = tFResponseTime.getAvg(); + + JoinResponseTimeBo joinResponseTimeBo = new JoinResponseTimeBo(); + joinResponseTimeBo.setId(agentId); + joinResponseTimeBo.setTimestamp(tFAgentStat.getTimestamp()); + joinResponseTimeBo.setAvg(avg); + joinResponseTimeBo.setMinAvg(avg); + joinResponseTimeBo.setMinAvgAgentId(agentId); + joinResponseTimeBo.setMaxAvg(avg); + joinResponseTimeBo.setMaxAvgAgentId(agentId); + + return joinResponseTimeBo; + } +} diff --git a/flink/src/main/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinTransactionBoMapper.java b/flink/src/main/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinTransactionBoMapper.java index 8287693751ed..708cb1102b33 100644 --- a/flink/src/main/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinTransactionBoMapper.java +++ b/flink/src/main/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinTransactionBoMapper.java @@ -28,7 +28,7 @@ public class JoinTransactionBoMapper implements ThriftBoMapper> out final ApplicationCache.ApplicationKey applicationKey = new ApplicationCache.ApplicationKey(joinAgentStatBo.getId(), joinAgentStatBo.getAgentStartTimestamp()); final String applicationId = applicationCache.findApplicationId(applicationKey); - if (applicationId.equals(ApplicationCache.NOT_FOOUND_APP_ID)) { + if (applicationId.equals(ApplicationCache.NOT_FOUND_APP_ID)) { logger.warn("can't found application id"); return; } diff --git a/flink/src/main/resources/applicationContext-flink.xml b/flink/src/main/resources/applicationContext-flink.xml index 9f7362956efd..bf60253ed57a 100644 --- a/flink/src/main/resources/applicationContext-flink.xml +++ b/flink/src/main/resources/applicationContext-flink.xml @@ -72,6 +72,10 @@ + + + + @@ -79,6 +83,7 @@ + @@ -105,6 +110,12 @@ + + + + + + diff --git a/flink/src/test/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinActiveTraceBoMapperTest.java b/flink/src/test/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinActiveTraceBoMapperTest.java index c70bf164a20e..3b9f3c5ebf9a 100644 --- a/flink/src/test/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinActiveTraceBoMapperTest.java +++ b/flink/src/test/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinActiveTraceBoMapperTest.java @@ -78,7 +78,7 @@ public void map2Test() { final JoinActiveTraceBoMapper joinActiveTraceBoMapper = new JoinActiveTraceBoMapper(); final JoinActiveTraceBo joinActiveTraceBo = joinActiveTraceBoMapper.map(tFAgentStat); - assertEquals(joinActiveTraceBo, JoinActiveTraceBo.EMPTY_ACTIVE_TRACE_BO); + assertEquals(joinActiveTraceBo, JoinActiveTraceBo.EMPTY_JOIN_ACTIVE_TRACE_BO); } } \ No newline at end of file diff --git a/flink/src/test/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinAgentStatBoMapperTest.java b/flink/src/test/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinAgentStatBoMapperTest.java index 881275c37ecb..761abf942f87 100644 --- a/flink/src/test/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinAgentStatBoMapperTest.java +++ b/flink/src/test/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinAgentStatBoMapperTest.java @@ -296,4 +296,59 @@ public void map4Test() { assertEquals(joinActiveTraceBo2.getMinTotalCountAgentId(), agentId); } + @Test + public void map5Test() { + final String agentId = "testAgent"; + final JoinAgentStatBoMapper joinAgentStatBoMapper = new JoinAgentStatBoMapper(); + + final TFAgentStatBatch tFAgentStatBatch = new TFAgentStatBatch(); + tFAgentStatBatch.setStartTimestamp(1491274138454L); + tFAgentStatBatch.setAgentId(agentId); + + final TFResponseTime tFResponseTime = new TFResponseTime(); + tFResponseTime.setAvg(100); + final TFAgentStat tFAgentStat = new TFAgentStat(); + tFAgentStat.setAgentId(agentId); + tFAgentStat.setTimestamp(1491274148454L); + tFAgentStat.setResponseTime(tFResponseTime); + + final TFResponseTime tFResponseTime2 = new TFResponseTime(); + tFResponseTime2.setAvg(120); + final TFAgentStat tFAgentStat2 = new TFAgentStat(); + tFAgentStat2.setAgentId(agentId); + tFAgentStat2.setTimestamp(1491275148454L); + tFAgentStat2.setResponseTime(tFResponseTime2); + + final List tFAgentStatList = new ArrayList<>(2); + tFAgentStatList.add(tFAgentStat); + tFAgentStatList.add(tFAgentStat2); + tFAgentStatBatch.setAgentStats(tFAgentStatList); + + JoinAgentStatBo joinAgentStatBo = joinAgentStatBoMapper.map(tFAgentStatBatch); + assertEquals(joinAgentStatBo.getId(), agentId); + assertEquals(joinAgentStatBo.getAgentStartTimestamp(), 1491274138454L); + assertEquals(joinAgentStatBo.getTimestamp(), 1491274148454L); + + List joinResponseTimeBoList = joinAgentStatBo.getJoinResponseTimeBoList(); + assertEquals(joinResponseTimeBoList.size(), 2); + + JoinResponseTimeBo joinResponseTimeBo = joinResponseTimeBoList.get(0); + assertEquals(joinResponseTimeBo.getId(), agentId); + assertEquals(joinResponseTimeBo.getTimestamp(), 1491274148454L); + assertEquals(joinResponseTimeBo.getAvg(), 100); + assertEquals(joinResponseTimeBo.getMinAvg(), 100); + assertEquals(joinResponseTimeBo.getMinAvgAgentId(), agentId); + assertEquals(joinResponseTimeBo.getMaxAvg(), 100); + assertEquals(joinResponseTimeBo.getMaxAvgAgentId(), agentId); + + JoinResponseTimeBo joinResponseTimeBo2 = joinResponseTimeBoList.get(1); + assertEquals(joinResponseTimeBo2.getId(), agentId); + assertEquals(joinResponseTimeBo2.getTimestamp(), 1491275148454L); + assertEquals(joinResponseTimeBo2.getAvg(), 120); + assertEquals(joinResponseTimeBo2.getMinAvg(), 120); + assertEquals(joinResponseTimeBo2.getMinAvgAgentId(), agentId); + assertEquals(joinResponseTimeBo2.getMaxAvg(), 120); + assertEquals(joinResponseTimeBo2.getMaxAvgAgentId(), agentId); + } + } \ No newline at end of file diff --git a/flink/src/test/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinResponseTimeBoMapperTest.java b/flink/src/test/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinResponseTimeBoMapperTest.java new file mode 100644 index 000000000000..a0520e262cc0 --- /dev/null +++ b/flink/src/test/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinResponseTimeBoMapperTest.java @@ -0,0 +1,69 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.navercorp.pinpoint.flink.mapper.thrift.stat; + +import com.navercorp.pinpoint.common.server.bo.stat.join.JoinActiveTraceBo; +import com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo; +import com.navercorp.pinpoint.thrift.dto.flink.TFAgentStat; +import com.navercorp.pinpoint.thrift.dto.flink.TFResponseTime; +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * @author minwoo.jung + */ +public class JoinResponseTimeBoMapperTest { + + @Test + public void mapTest() { + final String agentId = "agentId"; + final TFResponseTime tFResponseTime = new TFResponseTime(); + tFResponseTime.setAvg(100); + final TFAgentStat tFAgentStat = new TFAgentStat(); + tFAgentStat.setAgentId(agentId); + tFAgentStat.setTimestamp(1491274148454L); + tFAgentStat.setResponseTime(tFResponseTime); + + JoinResponseTimeBoMapper mapper = new JoinResponseTimeBoMapper(); + JoinResponseTimeBo joinResponseTimeBo = mapper.map(tFAgentStat); + + assertEquals(joinResponseTimeBo.getId(), agentId); + assertEquals(joinResponseTimeBo.getTimestamp(), 1491274148454L); + assertEquals(joinResponseTimeBo.getAvg(), 100); + assertEquals(joinResponseTimeBo.getMinAvg(), 100); + assertEquals(joinResponseTimeBo.getMinAvgAgentId(), agentId); + assertEquals(joinResponseTimeBo.getMaxAvg(), 100); + assertEquals(joinResponseTimeBo.getMaxAvgAgentId(), agentId); + } + + @Test + public void map2Test() { + final String agentId = "agentId"; + final TFResponseTime tFResponseTime = new TFResponseTime(); + tFResponseTime.setAvg(100); + final TFAgentStat tFAgentStat = new TFAgentStat(); + tFAgentStat.setAgentId(agentId); + tFAgentStat.setTimestamp(1491274148454L); + + JoinResponseTimeBoMapper mapper = new JoinResponseTimeBoMapper(); + JoinResponseTimeBo joinResponseTimeBo = mapper.map(tFAgentStat); + + assertEquals(joinResponseTimeBo, JoinResponseTimeBo.EMPTY_JOIN_RESPONSE_TIME_BO); + } + +} \ No newline at end of file diff --git a/flink/src/test/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinTransactionBoMapperTest.java b/flink/src/test/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinTransactionBoMapperTest.java index 79e88ffd8001..7d4604d6d164 100644 --- a/flink/src/test/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinTransactionBoMapperTest.java +++ b/flink/src/test/java/com/navercorp/pinpoint/flink/mapper/thrift/stat/JoinTransactionBoMapperTest.java @@ -68,6 +68,6 @@ public void map2Test() { final JoinTransactionBoMapper joinTransactionBoMapper = new JoinTransactionBoMapper(); final JoinTransactionBo joinTransactionBo = joinTransactionBoMapper.map(tFAgentStat); - assertEquals(joinTransactionBo, JoinTransactionBo.EMPTY_TRANSACTION_BO); + assertEquals(joinTransactionBo, JoinTransactionBo.EMPTY_JOIN_TRANSACTION_BO); } } \ No newline at end of file diff --git a/thrift/pom.xml b/thrift/pom.xml index 5cdc4df78b6a..5f14d10acb2e 100644 --- a/thrift/pom.xml +++ b/thrift/pom.xml @@ -93,6 +93,13 @@ + + + + + + + diff --git a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFActiveTrace.java b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFActiveTrace.java index 939116e62b04..edf2c4344a5e 100644 --- a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFActiveTrace.java +++ b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFActiveTrace.java @@ -1,41 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.9.2) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.navercorp.pinpoint.thrift.dto.flink; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.TException; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-3-31") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-09-06") public class TFActiveTrace implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFActiveTrace"); private static final org.apache.thrift.protocol.TField HISTOGRAM_FIELD_DESC = new org.apache.thrift.protocol.TField("histogram", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFActiveTraceStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFActiveTraceTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFActiveTraceStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFActiveTraceTupleSchemeFactory(); private TFActiveTraceHistogram histogram; // optional @@ -43,10 +22,10 @@ public class TFActiveTrace implements org.apache.thrift.TBase byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -69,21 +48,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -92,19 +71,19 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.HISTOGRAM}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.HISTOGRAM, new org.apache.thrift.meta_data.FieldMetaData("histogram", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TFActiveTraceHistogram.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFActiveTrace.class, metaDataMap); } @@ -152,7 +131,7 @@ public void setHistogramIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case HISTOGRAM: if (value == null) { @@ -165,30 +144,30 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case HISTOGRAM: return getHistogram(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case HISTOGRAM: return isSetHistogram(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TFActiveTrace) @@ -199,6 +178,8 @@ public boolean equals(Object that) { public boolean equals(TFActiveTrace that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_histogram = true && this.isSetHistogram(); boolean that_present_histogram = true && that.isSetHistogram(); @@ -214,14 +195,13 @@ public boolean equals(TFActiveTrace that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_histogram = true && (isSetHistogram()); - list.add(present_histogram); - if (present_histogram) - list.add(histogram); + hashCode = hashCode * 8191 + ((isSetHistogram()) ? 131071 : 524287); + if (isSetHistogram()) + hashCode = hashCode * 8191 + histogram.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -232,7 +212,7 @@ public int compareTo(TFActiveTrace other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetHistogram()).compareTo(other.isSetHistogram()); + lastComparison = java.lang.Boolean.valueOf(isSetHistogram()).compareTo(other.isSetHistogram()); if (lastComparison != 0) { return lastComparison; } @@ -249,17 +229,17 @@ public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } - public void read(org.apache.thrift.protocol.TProtocol iprot) throws TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); } - public void write(org.apache.thrift.protocol.TProtocol oprot) throws TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFActiveTrace("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFActiveTrace("); boolean first = true; if (isSetHistogram()) { @@ -275,7 +255,7 @@ public String toString() { return sb.toString(); } - public void validate() throws TException { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (histogram != null) { @@ -286,34 +266,34 @@ public void validate() throws TException { private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private static class TFActiveTraceStandardSchemeFactory implements SchemeFactory { + private static class TFActiveTraceStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFActiveTraceStandardScheme getScheme() { return new TFActiveTraceStandardScheme(); } } - private static class TFActiveTraceStandardScheme extends StandardScheme { + private static class TFActiveTraceStandardScheme extends org.apache.thrift.scheme.StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, TFActiveTrace struct) throws TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, TFActiveTrace struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -322,7 +302,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFActiveTrace struc struct.histogram = new TFActiveTraceHistogram(); struct.histogram.read(iprot); struct.setHistogramIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -335,7 +315,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFActiveTrace struc struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, TFActiveTrace struct) throws TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, TFActiveTrace struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -352,18 +332,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFActiveTrace stru } - private static class TFActiveTraceTupleSchemeFactory implements SchemeFactory { + private static class TFActiveTraceTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFActiveTraceTupleScheme getScheme() { return new TFActiveTraceTupleScheme(); } } - private static class TFActiveTraceTupleScheme extends TupleScheme { + private static class TFActiveTraceTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFActiveTrace struct) throws TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + public void write(org.apache.thrift.protocol.TProtocol prot, TFActiveTrace struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetHistogram()) { optionals.set(0); } @@ -374,9 +354,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFActiveTrace struc } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFActiveTrace struct) throws TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + public void read(org.apache.thrift.protocol.TProtocol prot, TFActiveTrace struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.histogram = new TFActiveTraceHistogram(); struct.histogram.read(iprot); @@ -385,5 +365,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFActiveTrace struct } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFActiveTraceHistogram.java b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFActiveTraceHistogram.java index 302e4cc2fc2b..268deb644ef6 100644 --- a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFActiveTraceHistogram.java +++ b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFActiveTraceHistogram.java @@ -1,32 +1,13 @@ /** - * Autogenerated by Thrift Compiler (0.9.2) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.navercorp.pinpoint.thrift.dto.flink; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-3-31") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-09-06") public class TFActiveTraceHistogram implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFActiveTraceHistogram"); @@ -34,15 +15,12 @@ public class TFActiveTraceHistogram implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFActiveTraceHistogramStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFActiveTraceHistogramTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFActiveTraceHistogramStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFActiveTraceHistogramTupleSchemeFactory(); private short version; // required private int histogramSchemaType; // optional - private List activeTraceCount; // optional + private java.util.List activeTraceCount; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -50,10 +28,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { HISTOGRAM_SCHEMA_TYPE((short)2, "histogramSchemaType"), ACTIVE_TRACE_COUNT((short)3, "activeTraceCount"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -80,21 +58,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -103,7 +81,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -112,10 +90,10 @@ public String getFieldName() { private static final int __VERSION_ISSET_ID = 0; private static final int __HISTOGRAMSCHEMATYPE_ISSET_ID = 1; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.HISTOGRAM_SCHEMA_TYPE, _Fields.ACTIVE_TRACE_COUNT}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + private static final _Fields optionals[] = {_Fields.HISTOGRAM_SCHEMA_TYPE,_Fields.ACTIVE_TRACE_COUNT}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); tmpMap.put(_Fields.HISTOGRAM_SCHEMA_TYPE, new org.apache.thrift.meta_data.FieldMetaData("histogramSchemaType", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -123,7 +101,7 @@ public String getFieldName() { tmpMap.put(_Fields.ACTIVE_TRACE_COUNT, new org.apache.thrift.meta_data.FieldMetaData("activeTraceCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFActiveTraceHistogram.class, metaDataMap); } @@ -148,7 +126,7 @@ public TFActiveTraceHistogram(TFActiveTraceHistogram other) { this.version = other.version; this.histogramSchemaType = other.histogramSchemaType; if (other.isSetActiveTraceCount()) { - List __this__activeTraceCount = new ArrayList(other.activeTraceCount); + java.util.List __this__activeTraceCount = new java.util.ArrayList(other.activeTraceCount); this.activeTraceCount = __this__activeTraceCount; } } @@ -176,16 +154,16 @@ public void setVersion(short version) { } public void unsetVersion() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VERSION_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VERSION_ISSET_ID); } /** Returns true if field version is set (has been assigned a value) and false otherwise */ public boolean isSetVersion() { - return EncodingUtils.testBit(__isset_bitfield, __VERSION_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VERSION_ISSET_ID); } public void setVersionIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VERSION_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VERSION_ISSET_ID, value); } public int getHistogramSchemaType() { @@ -198,38 +176,38 @@ public void setHistogramSchemaType(int histogramSchemaType) { } public void unsetHistogramSchemaType() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HISTOGRAMSCHEMATYPE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HISTOGRAMSCHEMATYPE_ISSET_ID); } /** Returns true if field histogramSchemaType is set (has been assigned a value) and false otherwise */ public boolean isSetHistogramSchemaType() { - return EncodingUtils.testBit(__isset_bitfield, __HISTOGRAMSCHEMATYPE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HISTOGRAMSCHEMATYPE_ISSET_ID); } public void setHistogramSchemaTypeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HISTOGRAMSCHEMATYPE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HISTOGRAMSCHEMATYPE_ISSET_ID, value); } public int getActiveTraceCountSize() { return (this.activeTraceCount == null) ? 0 : this.activeTraceCount.size(); } - public java.util.Iterator getActiveTraceCountIterator() { + public java.util.Iterator getActiveTraceCountIterator() { return (this.activeTraceCount == null) ? null : this.activeTraceCount.iterator(); } public void addToActiveTraceCount(int elem) { if (this.activeTraceCount == null) { - this.activeTraceCount = new ArrayList(); + this.activeTraceCount = new java.util.ArrayList(); } this.activeTraceCount.add(elem); } - public List getActiveTraceCount() { + public java.util.List getActiveTraceCount() { return this.activeTraceCount; } - public void setActiveTraceCount(List activeTraceCount) { + public void setActiveTraceCount(java.util.List activeTraceCount) { this.activeTraceCount = activeTraceCount; } @@ -248,13 +226,13 @@ public void setActiveTraceCountIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case VERSION: if (value == null) { unsetVersion(); } else { - setVersion((Short)value); + setVersion((java.lang.Short)value); } break; @@ -262,7 +240,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetHistogramSchemaType(); } else { - setHistogramSchemaType((Integer)value); + setHistogramSchemaType((java.lang.Integer)value); } break; @@ -270,32 +248,32 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetActiveTraceCount(); } else { - setActiveTraceCount((List)value); + setActiveTraceCount((java.util.List)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VERSION: - return Short.valueOf(getVersion()); + return getVersion(); case HISTOGRAM_SCHEMA_TYPE: - return Integer.valueOf(getHistogramSchemaType()); + return getHistogramSchemaType(); case ACTIVE_TRACE_COUNT: return getActiveTraceCount(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -306,11 +284,11 @@ public boolean isSet(_Fields field) { case ACTIVE_TRACE_COUNT: return isSetActiveTraceCount(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TFActiveTraceHistogram) @@ -321,6 +299,8 @@ public boolean equals(Object that) { public boolean equals(TFActiveTraceHistogram that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_version = true; boolean that_present_version = true; @@ -354,24 +334,19 @@ public boolean equals(TFActiveTraceHistogram that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_version = true; - list.add(present_version); - if (present_version) - list.add(version); + hashCode = hashCode * 8191 + version; - boolean present_histogramSchemaType = true && (isSetHistogramSchemaType()); - list.add(present_histogramSchemaType); - if (present_histogramSchemaType) - list.add(histogramSchemaType); + hashCode = hashCode * 8191 + ((isSetHistogramSchemaType()) ? 131071 : 524287); + if (isSetHistogramSchemaType()) + hashCode = hashCode * 8191 + histogramSchemaType; - boolean present_activeTraceCount = true && (isSetActiveTraceCount()); - list.add(present_activeTraceCount); - if (present_activeTraceCount) - list.add(activeTraceCount); + hashCode = hashCode * 8191 + ((isSetActiveTraceCount()) ? 131071 : 524287); + if (isSetActiveTraceCount()) + hashCode = hashCode * 8191 + activeTraceCount.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -382,7 +357,7 @@ public int compareTo(TFActiveTraceHistogram other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); + lastComparison = java.lang.Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); if (lastComparison != 0) { return lastComparison; } @@ -392,7 +367,7 @@ public int compareTo(TFActiveTraceHistogram other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetHistogramSchemaType()).compareTo(other.isSetHistogramSchemaType()); + lastComparison = java.lang.Boolean.valueOf(isSetHistogramSchemaType()).compareTo(other.isSetHistogramSchemaType()); if (lastComparison != 0) { return lastComparison; } @@ -402,7 +377,7 @@ public int compareTo(TFActiveTraceHistogram other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetActiveTraceCount()).compareTo(other.isSetActiveTraceCount()); + lastComparison = java.lang.Boolean.valueOf(isSetActiveTraceCount()).compareTo(other.isSetActiveTraceCount()); if (lastComparison != 0) { return lastComparison; } @@ -419,17 +394,17 @@ public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } - public void read(org.apache.thrift.protocol.TProtocol iprot) throws TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); } - public void write(org.apache.thrift.protocol.TProtocol oprot) throws TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFActiveTraceHistogram("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFActiveTraceHistogram("); boolean first = true; sb.append("version:"); @@ -455,7 +430,7 @@ public String toString() { return sb.toString(); } - public void validate() throws TException { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -463,36 +438,36 @@ public void validate() throws TException { private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private static class TFActiveTraceHistogramStandardSchemeFactory implements SchemeFactory { + private static class TFActiveTraceHistogramStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFActiveTraceHistogramStandardScheme getScheme() { return new TFActiveTraceHistogramStandardScheme(); } } - private static class TFActiveTraceHistogramStandardScheme extends StandardScheme { + private static class TFActiveTraceHistogramStandardScheme extends org.apache.thrift.scheme.StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, TFActiveTraceHistogram struct) throws TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, TFActiveTraceHistogram struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -500,7 +475,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFActiveTraceHistog if (schemeField.type == org.apache.thrift.protocol.TType.I16) { struct.version = iprot.readI16(); struct.setVersionIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -508,7 +483,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFActiveTraceHistog if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.histogramSchemaType = iprot.readI32(); struct.setHistogramSchemaTypeIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -516,7 +491,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFActiveTraceHistog if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list24 = iprot.readListBegin(); - struct.activeTraceCount = new ArrayList(_list24.size); + struct.activeTraceCount = new java.util.ArrayList(_list24.size); int _elem25; for (int _i26 = 0; _i26 < _list24.size; ++_i26) { @@ -526,7 +501,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFActiveTraceHistog iprot.readListEnd(); } struct.setActiveTraceCountIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -539,7 +514,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFActiveTraceHistog struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, TFActiveTraceHistogram struct) throws TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, TFActiveTraceHistogram struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -571,18 +546,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFActiveTraceHisto } - private static class TFActiveTraceHistogramTupleSchemeFactory implements SchemeFactory { + private static class TFActiveTraceHistogramTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFActiveTraceHistogramTupleScheme getScheme() { return new TFActiveTraceHistogramTupleScheme(); } } - private static class TFActiveTraceHistogramTupleScheme extends TupleScheme { + private static class TFActiveTraceHistogramTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFActiveTraceHistogram struct) throws TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + public void write(org.apache.thrift.protocol.TProtocol prot, TFActiveTraceHistogram struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetVersion()) { optionals.set(0); } @@ -611,9 +586,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFActiveTraceHistog } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFActiveTraceHistogram struct) throws TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); + public void read(org.apache.thrift.protocol.TProtocol prot, TFActiveTraceHistogram struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.version = iprot.readI16(); struct.setVersionIsSet(true); @@ -625,7 +600,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFActiveTraceHistogr if (incoming.get(2)) { { org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.activeTraceCount = new ArrayList(_list29.size); + struct.activeTraceCount = new java.util.ArrayList(_list29.size); int _elem30; for (int _i31 = 0; _i31 < _list29.size; ++_i31) { @@ -638,5 +613,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFActiveTraceHistogr } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFAgentInfo.java b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFAgentInfo.java index a76150bb9f83..bab01d0ebb5f 100644 --- a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFAgentInfo.java +++ b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFAgentInfo.java @@ -1,32 +1,13 @@ /** - * Autogenerated by Thrift Compiler (0.9.2) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.navercorp.pinpoint.thrift.dto.flink; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-3-31") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-09-06") public class TFAgentInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFAgentInfo"); @@ -45,21 +26,18 @@ public class TFAgentInfo implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFAgentInfoStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFAgentInfoTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFAgentInfoStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFAgentInfoTupleSchemeFactory(); - private String hostname; // required - private String ip; // required - private String ports; // required - private String agentId; // required - private String applicationName; // required + private java.lang.String hostname; // required + private java.lang.String ip; // required + private java.lang.String ports; // required + private java.lang.String agentId; // required + private java.lang.String applicationName; // required private short serviceType; // required private int pid; // required - private String agentVersion; // required - private String vmVersion; // required + private java.lang.String agentVersion; // required + private java.lang.String vmVersion; // required private long startTimestamp; // required private long endTimestamp; // optional private int endStatus; // optional @@ -83,10 +61,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SERVER_META_DATA((short)20, "serverMetaData"), JVM_INFO((short)30, "jvmInfo"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -135,21 +113,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -158,7 +136,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -170,10 +148,10 @@ public String getFieldName() { private static final int __ENDTIMESTAMP_ISSET_ID = 3; private static final int __ENDSTATUS_ISSET_ID = 4; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.END_TIMESTAMP, _Fields.END_STATUS, _Fields.SERVER_META_DATA, _Fields.JVM_INFO}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + private static final _Fields optionals[] = {_Fields.END_TIMESTAMP,_Fields.END_STATUS,_Fields.SERVER_META_DATA,_Fields.JVM_INFO}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.HOSTNAME, new org.apache.thrift.meta_data.FieldMetaData("hostname", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.IP, new org.apache.thrift.meta_data.FieldMetaData("ip", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -202,7 +180,7 @@ public String getFieldName() { new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TFServerMetaData.class))); tmpMap.put(_Fields.JVM_INFO, new org.apache.thrift.meta_data.FieldMetaData("jvmInfo", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TFJvmInfo.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFAgentInfo.class, metaDataMap); } @@ -210,15 +188,15 @@ public TFAgentInfo() { } public TFAgentInfo( - String hostname, - String ip, - String ports, - String agentId, - String applicationName, + java.lang.String hostname, + java.lang.String ip, + java.lang.String ports, + java.lang.String agentId, + java.lang.String applicationName, short serviceType, int pid, - String agentVersion, - String vmVersion, + java.lang.String agentVersion, + java.lang.String vmVersion, long startTimestamp) { this(); @@ -303,11 +281,11 @@ public void clear() { this.jvmInfo = null; } - public String getHostname() { + public java.lang.String getHostname() { return this.hostname; } - public void setHostname(String hostname) { + public void setHostname(java.lang.String hostname) { this.hostname = hostname; } @@ -326,11 +304,11 @@ public void setHostnameIsSet(boolean value) { } } - public String getIp() { + public java.lang.String getIp() { return this.ip; } - public void setIp(String ip) { + public void setIp(java.lang.String ip) { this.ip = ip; } @@ -349,11 +327,11 @@ public void setIpIsSet(boolean value) { } } - public String getPorts() { + public java.lang.String getPorts() { return this.ports; } - public void setPorts(String ports) { + public void setPorts(java.lang.String ports) { this.ports = ports; } @@ -372,11 +350,11 @@ public void setPortsIsSet(boolean value) { } } - public String getAgentId() { + public java.lang.String getAgentId() { return this.agentId; } - public void setAgentId(String agentId) { + public void setAgentId(java.lang.String agentId) { this.agentId = agentId; } @@ -395,11 +373,11 @@ public void setAgentIdIsSet(boolean value) { } } - public String getApplicationName() { + public java.lang.String getApplicationName() { return this.applicationName; } - public void setApplicationName(String applicationName) { + public void setApplicationName(java.lang.String applicationName) { this.applicationName = applicationName; } @@ -428,16 +406,16 @@ public void setServiceType(short serviceType) { } public void unsetServiceType() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SERVICETYPE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SERVICETYPE_ISSET_ID); } /** Returns true if field serviceType is set (has been assigned a value) and false otherwise */ public boolean isSetServiceType() { - return EncodingUtils.testBit(__isset_bitfield, __SERVICETYPE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SERVICETYPE_ISSET_ID); } public void setServiceTypeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SERVICETYPE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SERVICETYPE_ISSET_ID, value); } public int getPid() { @@ -450,23 +428,23 @@ public void setPid(int pid) { } public void unsetPid() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PID_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PID_ISSET_ID); } /** Returns true if field pid is set (has been assigned a value) and false otherwise */ public boolean isSetPid() { - return EncodingUtils.testBit(__isset_bitfield, __PID_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PID_ISSET_ID); } public void setPidIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PID_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PID_ISSET_ID, value); } - public String getAgentVersion() { + public java.lang.String getAgentVersion() { return this.agentVersion; } - public void setAgentVersion(String agentVersion) { + public void setAgentVersion(java.lang.String agentVersion) { this.agentVersion = agentVersion; } @@ -485,11 +463,11 @@ public void setAgentVersionIsSet(boolean value) { } } - public String getVmVersion() { + public java.lang.String getVmVersion() { return this.vmVersion; } - public void setVmVersion(String vmVersion) { + public void setVmVersion(java.lang.String vmVersion) { this.vmVersion = vmVersion; } @@ -518,16 +496,16 @@ public void setStartTimestamp(long startTimestamp) { } public void unsetStartTimestamp() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTTIMESTAMP_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTTIMESTAMP_ISSET_ID); } /** Returns true if field startTimestamp is set (has been assigned a value) and false otherwise */ public boolean isSetStartTimestamp() { - return EncodingUtils.testBit(__isset_bitfield, __STARTTIMESTAMP_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STARTTIMESTAMP_ISSET_ID); } public void setStartTimestampIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTTIMESTAMP_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTTIMESTAMP_ISSET_ID, value); } public long getEndTimestamp() { @@ -540,16 +518,16 @@ public void setEndTimestamp(long endTimestamp) { } public void unsetEndTimestamp() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ENDTIMESTAMP_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ENDTIMESTAMP_ISSET_ID); } /** Returns true if field endTimestamp is set (has been assigned a value) and false otherwise */ public boolean isSetEndTimestamp() { - return EncodingUtils.testBit(__isset_bitfield, __ENDTIMESTAMP_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ENDTIMESTAMP_ISSET_ID); } public void setEndTimestampIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ENDTIMESTAMP_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ENDTIMESTAMP_ISSET_ID, value); } public int getEndStatus() { @@ -562,16 +540,16 @@ public void setEndStatus(int endStatus) { } public void unsetEndStatus() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ENDSTATUS_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ENDSTATUS_ISSET_ID); } /** Returns true if field endStatus is set (has been assigned a value) and false otherwise */ public boolean isSetEndStatus() { - return EncodingUtils.testBit(__isset_bitfield, __ENDSTATUS_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ENDSTATUS_ISSET_ID); } public void setEndStatusIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ENDSTATUS_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ENDSTATUS_ISSET_ID, value); } public TFServerMetaData getServerMetaData() { @@ -620,13 +598,13 @@ public void setJvmInfoIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case HOSTNAME: if (value == null) { unsetHostname(); } else { - setHostname((String)value); + setHostname((java.lang.String)value); } break; @@ -634,7 +612,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetIp(); } else { - setIp((String)value); + setIp((java.lang.String)value); } break; @@ -642,7 +620,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetPorts(); } else { - setPorts((String)value); + setPorts((java.lang.String)value); } break; @@ -650,7 +628,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetAgentId(); } else { - setAgentId((String)value); + setAgentId((java.lang.String)value); } break; @@ -658,7 +636,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetApplicationName(); } else { - setApplicationName((String)value); + setApplicationName((java.lang.String)value); } break; @@ -666,7 +644,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetServiceType(); } else { - setServiceType((Short)value); + setServiceType((java.lang.Short)value); } break; @@ -674,7 +652,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetPid(); } else { - setPid((Integer)value); + setPid((java.lang.Integer)value); } break; @@ -682,7 +660,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetAgentVersion(); } else { - setAgentVersion((String)value); + setAgentVersion((java.lang.String)value); } break; @@ -690,7 +668,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetVmVersion(); } else { - setVmVersion((String)value); + setVmVersion((java.lang.String)value); } break; @@ -698,7 +676,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetStartTimestamp(); } else { - setStartTimestamp((Long)value); + setStartTimestamp((java.lang.Long)value); } break; @@ -706,7 +684,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetEndTimestamp(); } else { - setEndTimestamp((Long)value); + setEndTimestamp((java.lang.Long)value); } break; @@ -714,7 +692,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetEndStatus(); } else { - setEndStatus((Integer)value); + setEndStatus((java.lang.Integer)value); } break; @@ -737,7 +715,7 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case HOSTNAME: return getHostname(); @@ -755,10 +733,10 @@ public Object getFieldValue(_Fields field) { return getApplicationName(); case SERVICE_TYPE: - return Short.valueOf(getServiceType()); + return getServiceType(); case PID: - return Integer.valueOf(getPid()); + return getPid(); case AGENT_VERSION: return getAgentVersion(); @@ -767,13 +745,13 @@ public Object getFieldValue(_Fields field) { return getVmVersion(); case START_TIMESTAMP: - return Long.valueOf(getStartTimestamp()); + return getStartTimestamp(); case END_TIMESTAMP: - return Long.valueOf(getEndTimestamp()); + return getEndTimestamp(); case END_STATUS: - return Integer.valueOf(getEndStatus()); + return getEndStatus(); case SERVER_META_DATA: return getServerMetaData(); @@ -782,13 +760,13 @@ public Object getFieldValue(_Fields field) { return getJvmInfo(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -821,11 +799,11 @@ public boolean isSet(_Fields field) { case JVM_INFO: return isSetJvmInfo(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TFAgentInfo) @@ -836,6 +814,8 @@ public boolean equals(Object that) { public boolean equals(TFAgentInfo that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_hostname = true && this.isSetHostname(); boolean that_present_hostname = true && that.isSetHostname(); @@ -968,79 +948,59 @@ public boolean equals(TFAgentInfo that) { @Override public int hashCode() { - List list = new ArrayList(); - - boolean present_hostname = true && (isSetHostname()); - list.add(present_hostname); - if (present_hostname) - list.add(hostname); - - boolean present_ip = true && (isSetIp()); - list.add(present_ip); - if (present_ip) - list.add(ip); - - boolean present_ports = true && (isSetPorts()); - list.add(present_ports); - if (present_ports) - list.add(ports); - - boolean present_agentId = true && (isSetAgentId()); - list.add(present_agentId); - if (present_agentId) - list.add(agentId); - - boolean present_applicationName = true && (isSetApplicationName()); - list.add(present_applicationName); - if (present_applicationName) - list.add(applicationName); - - boolean present_serviceType = true; - list.add(present_serviceType); - if (present_serviceType) - list.add(serviceType); - - boolean present_pid = true; - list.add(present_pid); - if (present_pid) - list.add(pid); - - boolean present_agentVersion = true && (isSetAgentVersion()); - list.add(present_agentVersion); - if (present_agentVersion) - list.add(agentVersion); - - boolean present_vmVersion = true && (isSetVmVersion()); - list.add(present_vmVersion); - if (present_vmVersion) - list.add(vmVersion); - - boolean present_startTimestamp = true; - list.add(present_startTimestamp); - if (present_startTimestamp) - list.add(startTimestamp); - - boolean present_endTimestamp = true && (isSetEndTimestamp()); - list.add(present_endTimestamp); - if (present_endTimestamp) - list.add(endTimestamp); - - boolean present_endStatus = true && (isSetEndStatus()); - list.add(present_endStatus); - if (present_endStatus) - list.add(endStatus); - - boolean present_serverMetaData = true && (isSetServerMetaData()); - list.add(present_serverMetaData); - if (present_serverMetaData) - list.add(serverMetaData); - - boolean present_jvmInfo = true && (isSetJvmInfo()); - list.add(present_jvmInfo); - if (present_jvmInfo) - list.add(jvmInfo); - - return list.hashCode(); + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetHostname()) ? 131071 : 524287); + if (isSetHostname()) + hashCode = hashCode * 8191 + hostname.hashCode(); + + hashCode = hashCode * 8191 + ((isSetIp()) ? 131071 : 524287); + if (isSetIp()) + hashCode = hashCode * 8191 + ip.hashCode(); + + hashCode = hashCode * 8191 + ((isSetPorts()) ? 131071 : 524287); + if (isSetPorts()) + hashCode = hashCode * 8191 + ports.hashCode(); + + hashCode = hashCode * 8191 + ((isSetAgentId()) ? 131071 : 524287); + if (isSetAgentId()) + hashCode = hashCode * 8191 + agentId.hashCode(); + + hashCode = hashCode * 8191 + ((isSetApplicationName()) ? 131071 : 524287); + if (isSetApplicationName()) + hashCode = hashCode * 8191 + applicationName.hashCode(); + + hashCode = hashCode * 8191 + serviceType; + + hashCode = hashCode * 8191 + pid; + + hashCode = hashCode * 8191 + ((isSetAgentVersion()) ? 131071 : 524287); + if (isSetAgentVersion()) + hashCode = hashCode * 8191 + agentVersion.hashCode(); + + hashCode = hashCode * 8191 + ((isSetVmVersion()) ? 131071 : 524287); + if (isSetVmVersion()) + hashCode = hashCode * 8191 + vmVersion.hashCode(); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startTimestamp); + + hashCode = hashCode * 8191 + ((isSetEndTimestamp()) ? 131071 : 524287); + if (isSetEndTimestamp()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(endTimestamp); + + hashCode = hashCode * 8191 + ((isSetEndStatus()) ? 131071 : 524287); + if (isSetEndStatus()) + hashCode = hashCode * 8191 + endStatus; + + hashCode = hashCode * 8191 + ((isSetServerMetaData()) ? 131071 : 524287); + if (isSetServerMetaData()) + hashCode = hashCode * 8191 + serverMetaData.hashCode(); + + hashCode = hashCode * 8191 + ((isSetJvmInfo()) ? 131071 : 524287); + if (isSetJvmInfo()) + hashCode = hashCode * 8191 + jvmInfo.hashCode(); + + return hashCode; } @Override @@ -1051,7 +1011,7 @@ public int compareTo(TFAgentInfo other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetHostname()).compareTo(other.isSetHostname()); + lastComparison = java.lang.Boolean.valueOf(isSetHostname()).compareTo(other.isSetHostname()); if (lastComparison != 0) { return lastComparison; } @@ -1061,7 +1021,7 @@ public int compareTo(TFAgentInfo other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetIp()).compareTo(other.isSetIp()); + lastComparison = java.lang.Boolean.valueOf(isSetIp()).compareTo(other.isSetIp()); if (lastComparison != 0) { return lastComparison; } @@ -1071,7 +1031,7 @@ public int compareTo(TFAgentInfo other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetPorts()).compareTo(other.isSetPorts()); + lastComparison = java.lang.Boolean.valueOf(isSetPorts()).compareTo(other.isSetPorts()); if (lastComparison != 0) { return lastComparison; } @@ -1081,7 +1041,7 @@ public int compareTo(TFAgentInfo other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId()); + lastComparison = java.lang.Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId()); if (lastComparison != 0) { return lastComparison; } @@ -1091,7 +1051,7 @@ public int compareTo(TFAgentInfo other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetApplicationName()).compareTo(other.isSetApplicationName()); + lastComparison = java.lang.Boolean.valueOf(isSetApplicationName()).compareTo(other.isSetApplicationName()); if (lastComparison != 0) { return lastComparison; } @@ -1101,7 +1061,7 @@ public int compareTo(TFAgentInfo other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetServiceType()).compareTo(other.isSetServiceType()); + lastComparison = java.lang.Boolean.valueOf(isSetServiceType()).compareTo(other.isSetServiceType()); if (lastComparison != 0) { return lastComparison; } @@ -1111,7 +1071,7 @@ public int compareTo(TFAgentInfo other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetPid()).compareTo(other.isSetPid()); + lastComparison = java.lang.Boolean.valueOf(isSetPid()).compareTo(other.isSetPid()); if (lastComparison != 0) { return lastComparison; } @@ -1121,7 +1081,7 @@ public int compareTo(TFAgentInfo other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetAgentVersion()).compareTo(other.isSetAgentVersion()); + lastComparison = java.lang.Boolean.valueOf(isSetAgentVersion()).compareTo(other.isSetAgentVersion()); if (lastComparison != 0) { return lastComparison; } @@ -1131,7 +1091,7 @@ public int compareTo(TFAgentInfo other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetVmVersion()).compareTo(other.isSetVmVersion()); + lastComparison = java.lang.Boolean.valueOf(isSetVmVersion()).compareTo(other.isSetVmVersion()); if (lastComparison != 0) { return lastComparison; } @@ -1141,7 +1101,7 @@ public int compareTo(TFAgentInfo other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetStartTimestamp()).compareTo(other.isSetStartTimestamp()); + lastComparison = java.lang.Boolean.valueOf(isSetStartTimestamp()).compareTo(other.isSetStartTimestamp()); if (lastComparison != 0) { return lastComparison; } @@ -1151,7 +1111,7 @@ public int compareTo(TFAgentInfo other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetEndTimestamp()).compareTo(other.isSetEndTimestamp()); + lastComparison = java.lang.Boolean.valueOf(isSetEndTimestamp()).compareTo(other.isSetEndTimestamp()); if (lastComparison != 0) { return lastComparison; } @@ -1161,7 +1121,7 @@ public int compareTo(TFAgentInfo other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetEndStatus()).compareTo(other.isSetEndStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetEndStatus()).compareTo(other.isSetEndStatus()); if (lastComparison != 0) { return lastComparison; } @@ -1171,7 +1131,7 @@ public int compareTo(TFAgentInfo other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetServerMetaData()).compareTo(other.isSetServerMetaData()); + lastComparison = java.lang.Boolean.valueOf(isSetServerMetaData()).compareTo(other.isSetServerMetaData()); if (lastComparison != 0) { return lastComparison; } @@ -1181,7 +1141,7 @@ public int compareTo(TFAgentInfo other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetJvmInfo()).compareTo(other.isSetJvmInfo()); + lastComparison = java.lang.Boolean.valueOf(isSetJvmInfo()).compareTo(other.isSetJvmInfo()); if (lastComparison != 0) { return lastComparison; } @@ -1198,17 +1158,17 @@ public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } - public void read(org.apache.thrift.protocol.TProtocol iprot) throws TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); } - public void write(org.apache.thrift.protocol.TProtocol oprot) throws TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFAgentInfo("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFAgentInfo("); boolean first = true; sb.append("hostname:"); @@ -1314,7 +1274,7 @@ public String toString() { return sb.toString(); } - public void validate() throws TException { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (serverMetaData != null) { @@ -1328,36 +1288,36 @@ public void validate() throws TException { private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private static class TFAgentInfoStandardSchemeFactory implements SchemeFactory { + private static class TFAgentInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFAgentInfoStandardScheme getScheme() { return new TFAgentInfoStandardScheme(); } } - private static class TFAgentInfoStandardScheme extends StandardScheme { + private static class TFAgentInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentInfo struct) throws TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -1365,7 +1325,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentInfo struct) if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.hostname = iprot.readString(); struct.setHostnameIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1373,7 +1333,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentInfo struct) if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.ip = iprot.readString(); struct.setIpIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1381,7 +1341,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentInfo struct) if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.ports = iprot.readString(); struct.setPortsIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1389,7 +1349,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentInfo struct) if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.agentId = iprot.readString(); struct.setAgentIdIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1397,7 +1357,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentInfo struct) if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.applicationName = iprot.readString(); struct.setApplicationNameIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1405,7 +1365,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentInfo struct) if (schemeField.type == org.apache.thrift.protocol.TType.I16) { struct.serviceType = iprot.readI16(); struct.setServiceTypeIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1413,7 +1373,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentInfo struct) if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.pid = iprot.readI32(); struct.setPidIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1421,7 +1381,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentInfo struct) if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.agentVersion = iprot.readString(); struct.setAgentVersionIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1429,7 +1389,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentInfo struct) if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.vmVersion = iprot.readString(); struct.setVmVersionIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1437,7 +1397,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentInfo struct) if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.startTimestamp = iprot.readI64(); struct.setStartTimestampIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1445,7 +1405,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentInfo struct) if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.endTimestamp = iprot.readI64(); struct.setEndTimestampIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1453,7 +1413,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentInfo struct) if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.endStatus = iprot.readI32(); struct.setEndStatusIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1462,7 +1422,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentInfo struct) struct.serverMetaData = new TFServerMetaData(); struct.serverMetaData.read(iprot); struct.setServerMetaDataIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1471,7 +1431,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentInfo struct) struct.jvmInfo = new TFJvmInfo(); struct.jvmInfo.read(iprot); struct.setJvmInfoIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1484,7 +1444,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentInfo struct) struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, TFAgentInfo struct) throws TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, TFAgentInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -1562,18 +1522,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFAgentInfo struct } - private static class TFAgentInfoTupleSchemeFactory implements SchemeFactory { + private static class TFAgentInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFAgentInfoTupleScheme getScheme() { return new TFAgentInfoTupleScheme(); } } - private static class TFAgentInfoTupleScheme extends TupleScheme { + private static class TFAgentInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFAgentInfo struct) throws TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + public void write(org.apache.thrift.protocol.TProtocol prot, TFAgentInfo struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetHostname()) { optionals.set(0); } @@ -1662,9 +1622,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFAgentInfo struct) } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFAgentInfo struct) throws TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(14); + public void read(org.apache.thrift.protocol.TProtocol prot, TFAgentInfo struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(14); if (incoming.get(0)) { struct.hostname = iprot.readString(); struct.setHostnameIsSet(true); @@ -1726,5 +1686,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFAgentInfo struct) } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFAgentStat.java b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFAgentStat.java index 3e687449d21c..0761e2514a36 100644 --- a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFAgentStat.java +++ b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFAgentStat.java @@ -1,40 +1,13 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - /** - * Autogenerated by Thrift Compiler (0.9.2) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.navercorp.pinpoint.thrift.dto.flink; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; -import org.apache.thrift.scheme.TupleScheme; - -import javax.annotation.Generated; -import java.util.*; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-3-31") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-09-06") public class TFAgentStat implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFAgentStat"); @@ -47,15 +20,13 @@ public class TFAgentStat implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFAgentStatStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFAgentStatTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFAgentStatStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFAgentStatTupleSchemeFactory(); - private String agentId; // optional + private java.lang.String agentId; // optional private long startTimestamp; // optional private long timestamp; // optional private long collectInterval; // optional @@ -64,7 +35,8 @@ public class TFAgentStat implements org.apache.thrift.TBase byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -110,6 +83,8 @@ public static _Fields findByThriftId(int fieldId) { return ACTIVE_TRACE; case 50: // DATA_SOURCE_LIST return DATA_SOURCE_LIST; + case 60: // RESPONSE_TIME + return RESPONSE_TIME; case 200: // METADATA return METADATA; default: @@ -123,21 +98,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -146,7 +121,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -156,10 +131,10 @@ public String getFieldName() { private static final int __TIMESTAMP_ISSET_ID = 1; private static final int __COLLECTINTERVAL_ISSET_ID = 2; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.AGENT_ID, _Fields.START_TIMESTAMP, _Fields.TIMESTAMP, _Fields.COLLECT_INTERVAL, _Fields.GC, _Fields.CPU_LOAD, _Fields.TRANSACTION, _Fields.ACTIVE_TRACE, _Fields.DATA_SOURCE_LIST, _Fields.METADATA}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + private static final _Fields optionals[] = {_Fields.AGENT_ID,_Fields.START_TIMESTAMP,_Fields.TIMESTAMP,_Fields.COLLECT_INTERVAL,_Fields.GC,_Fields.CPU_LOAD,_Fields.TRANSACTION,_Fields.ACTIVE_TRACE,_Fields.DATA_SOURCE_LIST,_Fields.RESPONSE_TIME,_Fields.METADATA}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.AGENT_ID, new org.apache.thrift.meta_data.FieldMetaData("agentId", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.START_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("startTimestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -178,9 +153,11 @@ public String getFieldName() { new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TFActiveTrace.class))); tmpMap.put(_Fields.DATA_SOURCE_LIST, new org.apache.thrift.meta_data.FieldMetaData("dataSourceList", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT , "TFDataSourceList"))); + tmpMap.put(_Fields.RESPONSE_TIME, new org.apache.thrift.meta_data.FieldMetaData("responseTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TFResponseTime.class))); tmpMap.put(_Fields.METADATA, new org.apache.thrift.meta_data.FieldMetaData("metadata", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFAgentStat.class, metaDataMap); } @@ -211,7 +188,10 @@ public TFAgentStat(TFAgentStat other) { this.activeTrace = new TFActiveTrace(other.activeTrace); } if (other.isSetDataSourceList()) { - this.dataSourceList = other.dataSourceList; + this.dataSourceList = new TFDataSourceList(other.dataSourceList); + } + if (other.isSetResponseTime()) { + this.responseTime = new TFResponseTime(other.responseTime); } if (other.isSetMetadata()) { this.metadata = other.metadata; @@ -236,14 +216,15 @@ public void clear() { this.transaction = null; this.activeTrace = null; this.dataSourceList = null; + this.responseTime = null; this.metadata = null; } - public String getAgentId() { + public java.lang.String getAgentId() { return this.agentId; } - public void setAgentId(String agentId) { + public void setAgentId(java.lang.String agentId) { this.agentId = agentId; } @@ -272,16 +253,16 @@ public void setStartTimestamp(long startTimestamp) { } public void unsetStartTimestamp() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTTIMESTAMP_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTTIMESTAMP_ISSET_ID); } /** Returns true if field startTimestamp is set (has been assigned a value) and false otherwise */ public boolean isSetStartTimestamp() { - return EncodingUtils.testBit(__isset_bitfield, __STARTTIMESTAMP_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STARTTIMESTAMP_ISSET_ID); } public void setStartTimestampIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTTIMESTAMP_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTTIMESTAMP_ISSET_ID, value); } public long getTimestamp() { @@ -294,16 +275,16 @@ public void setTimestamp(long timestamp) { } public void unsetTimestamp() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); } /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ public boolean isSetTimestamp() { - return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); } public void setTimestampIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); } public long getCollectInterval() { @@ -316,16 +297,16 @@ public void setCollectInterval(long collectInterval) { } public void unsetCollectInterval() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COLLECTINTERVAL_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COLLECTINTERVAL_ISSET_ID); } /** Returns true if field collectInterval is set (has been assigned a value) and false otherwise */ public boolean isSetCollectInterval() { - return EncodingUtils.testBit(__isset_bitfield, __COLLECTINTERVAL_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLLECTINTERVAL_ISSET_ID); } public void setCollectIntervalIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COLLECTINTERVAL_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COLLECTINTERVAL_ISSET_ID, value); } public TFJvmGc getGc() { @@ -443,11 +424,34 @@ public void setDataSourceListIsSet(boolean value) { } } - public String getMetadata() { + public TFResponseTime getResponseTime() { + return this.responseTime; + } + + public void setResponseTime(TFResponseTime responseTime) { + this.responseTime = responseTime; + } + + public void unsetResponseTime() { + this.responseTime = null; + } + + /** Returns true if field responseTime is set (has been assigned a value) and false otherwise */ + public boolean isSetResponseTime() { + return this.responseTime != null; + } + + public void setResponseTimeIsSet(boolean value) { + if (!value) { + this.responseTime = null; + } + } + + public java.lang.String getMetadata() { return this.metadata; } - public void setMetadata(String metadata) { + public void setMetadata(java.lang.String metadata) { this.metadata = metadata; } @@ -466,13 +470,13 @@ public void setMetadataIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case AGENT_ID: if (value == null) { unsetAgentId(); } else { - setAgentId((String)value); + setAgentId((java.lang.String)value); } break; @@ -480,7 +484,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetStartTimestamp(); } else { - setStartTimestamp((Long)value); + setStartTimestamp((java.lang.Long)value); } break; @@ -488,7 +492,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetTimestamp(); } else { - setTimestamp((Long)value); + setTimestamp((java.lang.Long)value); } break; @@ -496,7 +500,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetCollectInterval(); } else { - setCollectInterval((Long)value); + setCollectInterval((java.lang.Long)value); } break; @@ -540,30 +544,38 @@ public void setFieldValue(_Fields field, Object value) { } break; + case RESPONSE_TIME: + if (value == null) { + unsetResponseTime(); + } else { + setResponseTime((TFResponseTime)value); + } + break; + case METADATA: if (value == null) { unsetMetadata(); } else { - setMetadata((String)value); + setMetadata((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case AGENT_ID: return getAgentId(); case START_TIMESTAMP: - return Long.valueOf(getStartTimestamp()); + return getStartTimestamp(); case TIMESTAMP: - return Long.valueOf(getTimestamp()); + return getTimestamp(); case COLLECT_INTERVAL: - return Long.valueOf(getCollectInterval()); + return getCollectInterval(); case GC: return getGc(); @@ -580,17 +592,20 @@ public Object getFieldValue(_Fields field) { case DATA_SOURCE_LIST: return getDataSourceList(); + case RESPONSE_TIME: + return getResponseTime(); + case METADATA: return getMetadata(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -612,14 +627,16 @@ public boolean isSet(_Fields field) { return isSetActiveTrace(); case DATA_SOURCE_LIST: return isSetDataSourceList(); + case RESPONSE_TIME: + return isSetResponseTime(); case METADATA: return isSetMetadata(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TFAgentStat) @@ -630,6 +647,8 @@ public boolean equals(Object that) { public boolean equals(TFAgentStat that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_agentId = true && this.isSetAgentId(); boolean that_present_agentId = true && that.isSetAgentId(); @@ -712,6 +731,15 @@ public boolean equals(TFAgentStat that) { return false; } + boolean this_present_responseTime = true && this.isSetResponseTime(); + boolean that_present_responseTime = true && that.isSetResponseTime(); + if (this_present_responseTime || that_present_responseTime) { + if (!(this_present_responseTime && that_present_responseTime)) + return false; + if (!this.responseTime.equals(that.responseTime)) + return false; + } + boolean this_present_metadata = true && this.isSetMetadata(); boolean that_present_metadata = true && that.isSetMetadata(); if (this_present_metadata || that_present_metadata) { @@ -726,59 +754,53 @@ public boolean equals(TFAgentStat that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_agentId = true && (isSetAgentId()); - list.add(present_agentId); - if (present_agentId) - list.add(agentId); + hashCode = hashCode * 8191 + ((isSetAgentId()) ? 131071 : 524287); + if (isSetAgentId()) + hashCode = hashCode * 8191 + agentId.hashCode(); - boolean present_startTimestamp = true && (isSetStartTimestamp()); - list.add(present_startTimestamp); - if (present_startTimestamp) - list.add(startTimestamp); + hashCode = hashCode * 8191 + ((isSetStartTimestamp()) ? 131071 : 524287); + if (isSetStartTimestamp()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startTimestamp); - boolean present_timestamp = true && (isSetTimestamp()); - list.add(present_timestamp); - if (present_timestamp) - list.add(timestamp); + hashCode = hashCode * 8191 + ((isSetTimestamp()) ? 131071 : 524287); + if (isSetTimestamp()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(timestamp); - boolean present_collectInterval = true && (isSetCollectInterval()); - list.add(present_collectInterval); - if (present_collectInterval) - list.add(collectInterval); + hashCode = hashCode * 8191 + ((isSetCollectInterval()) ? 131071 : 524287); + if (isSetCollectInterval()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(collectInterval); - boolean present_gc = true && (isSetGc()); - list.add(present_gc); - if (present_gc) - list.add(gc); + hashCode = hashCode * 8191 + ((isSetGc()) ? 131071 : 524287); + if (isSetGc()) + hashCode = hashCode * 8191 + gc.hashCode(); - boolean present_cpuLoad = true && (isSetCpuLoad()); - list.add(present_cpuLoad); - if (present_cpuLoad) - list.add(cpuLoad); + hashCode = hashCode * 8191 + ((isSetCpuLoad()) ? 131071 : 524287); + if (isSetCpuLoad()) + hashCode = hashCode * 8191 + cpuLoad.hashCode(); - boolean present_transaction = true && (isSetTransaction()); - list.add(present_transaction); - if (present_transaction) - list.add(transaction); + hashCode = hashCode * 8191 + ((isSetTransaction()) ? 131071 : 524287); + if (isSetTransaction()) + hashCode = hashCode * 8191 + transaction.hashCode(); - boolean present_activeTrace = true && (isSetActiveTrace()); - list.add(present_activeTrace); - if (present_activeTrace) - list.add(activeTrace); + hashCode = hashCode * 8191 + ((isSetActiveTrace()) ? 131071 : 524287); + if (isSetActiveTrace()) + hashCode = hashCode * 8191 + activeTrace.hashCode(); - boolean present_dataSourceList = true && (isSetDataSourceList()); - list.add(present_dataSourceList); - if (present_dataSourceList) - list.add(dataSourceList); + hashCode = hashCode * 8191 + ((isSetDataSourceList()) ? 131071 : 524287); + if (isSetDataSourceList()) + hashCode = hashCode * 8191 + dataSourceList.hashCode(); - boolean present_metadata = true && (isSetMetadata()); - list.add(present_metadata); - if (present_metadata) - list.add(metadata); + hashCode = hashCode * 8191 + ((isSetResponseTime()) ? 131071 : 524287); + if (isSetResponseTime()) + hashCode = hashCode * 8191 + responseTime.hashCode(); - return list.hashCode(); + hashCode = hashCode * 8191 + ((isSetMetadata()) ? 131071 : 524287); + if (isSetMetadata()) + hashCode = hashCode * 8191 + metadata.hashCode(); + + return hashCode; } @Override @@ -789,7 +811,7 @@ public int compareTo(TFAgentStat other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId()); + lastComparison = java.lang.Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId()); if (lastComparison != 0) { return lastComparison; } @@ -799,7 +821,7 @@ public int compareTo(TFAgentStat other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetStartTimestamp()).compareTo(other.isSetStartTimestamp()); + lastComparison = java.lang.Boolean.valueOf(isSetStartTimestamp()).compareTo(other.isSetStartTimestamp()); if (lastComparison != 0) { return lastComparison; } @@ -809,7 +831,7 @@ public int compareTo(TFAgentStat other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); + lastComparison = java.lang.Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); if (lastComparison != 0) { return lastComparison; } @@ -819,7 +841,7 @@ public int compareTo(TFAgentStat other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetCollectInterval()).compareTo(other.isSetCollectInterval()); + lastComparison = java.lang.Boolean.valueOf(isSetCollectInterval()).compareTo(other.isSetCollectInterval()); if (lastComparison != 0) { return lastComparison; } @@ -829,7 +851,7 @@ public int compareTo(TFAgentStat other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetGc()).compareTo(other.isSetGc()); + lastComparison = java.lang.Boolean.valueOf(isSetGc()).compareTo(other.isSetGc()); if (lastComparison != 0) { return lastComparison; } @@ -839,7 +861,7 @@ public int compareTo(TFAgentStat other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetCpuLoad()).compareTo(other.isSetCpuLoad()); + lastComparison = java.lang.Boolean.valueOf(isSetCpuLoad()).compareTo(other.isSetCpuLoad()); if (lastComparison != 0) { return lastComparison; } @@ -849,7 +871,7 @@ public int compareTo(TFAgentStat other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetTransaction()).compareTo(other.isSetTransaction()); + lastComparison = java.lang.Boolean.valueOf(isSetTransaction()).compareTo(other.isSetTransaction()); if (lastComparison != 0) { return lastComparison; } @@ -859,7 +881,7 @@ public int compareTo(TFAgentStat other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetActiveTrace()).compareTo(other.isSetActiveTrace()); + lastComparison = java.lang.Boolean.valueOf(isSetActiveTrace()).compareTo(other.isSetActiveTrace()); if (lastComparison != 0) { return lastComparison; } @@ -869,7 +891,7 @@ public int compareTo(TFAgentStat other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetDataSourceList()).compareTo(other.isSetDataSourceList()); + lastComparison = java.lang.Boolean.valueOf(isSetDataSourceList()).compareTo(other.isSetDataSourceList()); if (lastComparison != 0) { return lastComparison; } @@ -879,7 +901,17 @@ public int compareTo(TFAgentStat other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetMetadata()).compareTo(other.isSetMetadata()); + lastComparison = java.lang.Boolean.valueOf(isSetResponseTime()).compareTo(other.isSetResponseTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetResponseTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.responseTime, other.responseTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetMetadata()).compareTo(other.isSetMetadata()); if (lastComparison != 0) { return lastComparison; } @@ -896,17 +928,17 @@ public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } - public void read(org.apache.thrift.protocol.TProtocol iprot) throws TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); } - public void write(org.apache.thrift.protocol.TProtocol oprot) throws TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFAgentStat("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFAgentStat("); boolean first = true; if (isSetAgentId()) { @@ -986,6 +1018,16 @@ public String toString() { } first = false; } + if (isSetResponseTime()) { + if (!first) sb.append(", "); + sb.append("responseTime:"); + if (this.responseTime == null) { + sb.append("null"); + } else { + sb.append(this.responseTime); + } + first = false; + } if (isSetMetadata()) { if (!first) sb.append(", "); sb.append("metadata:"); @@ -1000,7 +1042,7 @@ public String toString() { return sb.toString(); } - public void validate() throws TException { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (gc != null) { @@ -1015,41 +1057,44 @@ public void validate() throws TException { if (activeTrace != null) { activeTrace.validate(); } + if (responseTime != null) { + responseTime.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private static class TFAgentStatStandardSchemeFactory implements SchemeFactory { + private static class TFAgentStatStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFAgentStatStandardScheme getScheme() { return new TFAgentStatStandardScheme(); } } - private static class TFAgentStatStandardScheme extends StandardScheme { + private static class TFAgentStatStandardScheme extends org.apache.thrift.scheme.StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStat struct) throws TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStat struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -1057,7 +1102,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStat struct) if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.agentId = iprot.readString(); struct.setAgentIdIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1065,7 +1110,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStat struct) if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.startTimestamp = iprot.readI64(); struct.setStartTimestampIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1073,7 +1118,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStat struct) if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.timestamp = iprot.readI64(); struct.setTimestampIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1081,7 +1126,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStat struct) if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.collectInterval = iprot.readI64(); struct.setCollectIntervalIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1090,7 +1135,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStat struct) struct.gc = new TFJvmGc(); struct.gc.read(iprot); struct.setGcIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1099,7 +1144,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStat struct) struct.cpuLoad = new TFCpuLoad(); struct.cpuLoad.read(iprot); struct.setCpuLoadIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1108,7 +1153,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStat struct) struct.transaction = new TFTransaction(); struct.transaction.read(iprot); struct.setTransactionIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1117,7 +1162,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStat struct) struct.activeTrace = new TFActiveTrace(); struct.activeTrace.read(iprot); struct.setActiveTraceIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1126,7 +1171,16 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStat struct) struct.dataSourceList = new TFDataSourceList(); struct.dataSourceList.read(iprot); struct.setDataSourceListIsSet(true); - } else { + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 60: // RESPONSE_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.responseTime = new TFResponseTime(); + struct.responseTime.read(iprot); + struct.setResponseTimeIsSet(true); + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1134,7 +1188,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStat struct) if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.metadata = iprot.readString(); struct.setMetadataIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -1147,7 +1201,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStat struct) struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, TFAgentStat struct) throws TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, TFAgentStat struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -1208,6 +1262,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFAgentStat struct oprot.writeFieldEnd(); } } + if (struct.responseTime != null) { + if (struct.isSetResponseTime()) { + oprot.writeFieldBegin(RESPONSE_TIME_FIELD_DESC); + struct.responseTime.write(oprot); + oprot.writeFieldEnd(); + } + } if (struct.metadata != null) { if (struct.isSetMetadata()) { oprot.writeFieldBegin(METADATA_FIELD_DESC); @@ -1221,18 +1282,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFAgentStat struct } - private static class TFAgentStatTupleSchemeFactory implements SchemeFactory { + private static class TFAgentStatTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFAgentStatTupleScheme getScheme() { return new TFAgentStatTupleScheme(); } } - private static class TFAgentStatTupleScheme extends TupleScheme { + private static class TFAgentStatTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFAgentStat struct) throws TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + public void write(org.apache.thrift.protocol.TProtocol prot, TFAgentStat struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetAgentId()) { optionals.set(0); } @@ -1260,10 +1321,13 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFAgentStat struct) if (struct.isSetDataSourceList()) { optionals.set(8); } - if (struct.isSetMetadata()) { + if (struct.isSetResponseTime()) { optionals.set(9); } - oprot.writeBitSet(optionals, 10); + if (struct.isSetMetadata()) { + optionals.set(10); + } + oprot.writeBitSet(optionals, 11); if (struct.isSetAgentId()) { oprot.writeString(struct.agentId); } @@ -1291,15 +1355,18 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFAgentStat struct) if (struct.isSetDataSourceList()) { struct.dataSourceList.write(oprot); } + if (struct.isSetResponseTime()) { + struct.responseTime.write(oprot); + } if (struct.isSetMetadata()) { oprot.writeString(struct.metadata); } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFAgentStat struct) throws TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(10); + public void read(org.apache.thrift.protocol.TProtocol prot, TFAgentStat struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(11); if (incoming.get(0)) { struct.agentId = iprot.readString(); struct.setAgentIdIsSet(true); @@ -1342,11 +1409,19 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFAgentStat struct) struct.setDataSourceListIsSet(true); } if (incoming.get(9)) { + struct.responseTime = new TFResponseTime(); + struct.responseTime.read(iprot); + struct.setResponseTimeIsSet(true); + } + if (incoming.get(10)) { struct.metadata = iprot.readString(); struct.setMetadataIsSet(true); } } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFAgentStatBatch.java b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFAgentStatBatch.java index c166ca48597e..5cc45c7d6665 100644 --- a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFAgentStatBatch.java +++ b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFAgentStatBatch.java @@ -1,40 +1,13 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - /** - * Autogenerated by Thrift Compiler (0.9.2) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.navercorp.pinpoint.thrift.dto.flink; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; -import org.apache.thrift.scheme.TupleScheme; - -import javax.annotation.Generated; -import java.util.*; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-3-31") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-09-06") public class TFAgentStatBatch implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFAgentStatBatch"); @@ -42,15 +15,12 @@ public class TFAgentStatBatch implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFAgentStatBatchStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFAgentStatBatchTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFAgentStatBatchStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFAgentStatBatchTupleSchemeFactory(); - private String agentId; // required + private java.lang.String agentId; // required private long startTimestamp; // required - private List agentStats; // required + private java.util.List agentStats; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -58,10 +28,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { START_TIMESTAMP((short)2, "startTimestamp"), AGENT_STATS((short)10, "agentStats"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -88,21 +58,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -111,7 +81,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -119,9 +89,9 @@ public String getFieldName() { // isset id assignments private static final int __STARTTIMESTAMP_ISSET_ID = 0; private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.AGENT_ID, new org.apache.thrift.meta_data.FieldMetaData("agentId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.START_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("startTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -129,7 +99,7 @@ public String getFieldName() { tmpMap.put(_Fields.AGENT_STATS, new org.apache.thrift.meta_data.FieldMetaData("agentStats", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TFAgentStat.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFAgentStatBatch.class, metaDataMap); } @@ -137,9 +107,9 @@ public TFAgentStatBatch() { } public TFAgentStatBatch( - String agentId, + java.lang.String agentId, long startTimestamp, - List agentStats) + java.util.List agentStats) { this(); this.agentId = agentId; @@ -158,7 +128,7 @@ public TFAgentStatBatch(TFAgentStatBatch other) { } this.startTimestamp = other.startTimestamp; if (other.isSetAgentStats()) { - List __this__agentStats = new ArrayList(other.agentStats.size()); + java.util.List __this__agentStats = new java.util.ArrayList(other.agentStats.size()); for (TFAgentStat other_element : other.agentStats) { __this__agentStats.add(new TFAgentStat(other_element)); } @@ -178,11 +148,11 @@ public void clear() { this.agentStats = null; } - public String getAgentId() { + public java.lang.String getAgentId() { return this.agentId; } - public void setAgentId(String agentId) { + public void setAgentId(java.lang.String agentId) { this.agentId = agentId; } @@ -211,16 +181,16 @@ public void setStartTimestamp(long startTimestamp) { } public void unsetStartTimestamp() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTTIMESTAMP_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTTIMESTAMP_ISSET_ID); } /** Returns true if field startTimestamp is set (has been assigned a value) and false otherwise */ public boolean isSetStartTimestamp() { - return EncodingUtils.testBit(__isset_bitfield, __STARTTIMESTAMP_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STARTTIMESTAMP_ISSET_ID); } public void setStartTimestampIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTTIMESTAMP_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTTIMESTAMP_ISSET_ID, value); } public int getAgentStatsSize() { @@ -233,16 +203,16 @@ public java.util.Iterator getAgentStatsIterator() { public void addToAgentStats(TFAgentStat elem) { if (this.agentStats == null) { - this.agentStats = new ArrayList(); + this.agentStats = new java.util.ArrayList(); } this.agentStats.add(elem); } - public List getAgentStats() { + public java.util.List getAgentStats() { return this.agentStats; } - public void setAgentStats(List agentStats) { + public void setAgentStats(java.util.List agentStats) { this.agentStats = agentStats; } @@ -261,13 +231,13 @@ public void setAgentStatsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case AGENT_ID: if (value == null) { unsetAgentId(); } else { - setAgentId((String)value); + setAgentId((java.lang.String)value); } break; @@ -275,7 +245,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetStartTimestamp(); } else { - setStartTimestamp((Long)value); + setStartTimestamp((java.lang.Long)value); } break; @@ -283,32 +253,32 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetAgentStats(); } else { - setAgentStats((List)value); + setAgentStats((java.util.List)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case AGENT_ID: return getAgentId(); case START_TIMESTAMP: - return Long.valueOf(getStartTimestamp()); + return getStartTimestamp(); case AGENT_STATS: return getAgentStats(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -319,11 +289,11 @@ public boolean isSet(_Fields field) { case AGENT_STATS: return isSetAgentStats(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TFAgentStatBatch) @@ -334,6 +304,8 @@ public boolean equals(Object that) { public boolean equals(TFAgentStatBatch that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_agentId = true && this.isSetAgentId(); boolean that_present_agentId = true && that.isSetAgentId(); @@ -367,24 +339,19 @@ public boolean equals(TFAgentStatBatch that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_agentId = true && (isSetAgentId()); - list.add(present_agentId); - if (present_agentId) - list.add(agentId); + hashCode = hashCode * 8191 + ((isSetAgentId()) ? 131071 : 524287); + if (isSetAgentId()) + hashCode = hashCode * 8191 + agentId.hashCode(); - boolean present_startTimestamp = true; - list.add(present_startTimestamp); - if (present_startTimestamp) - list.add(startTimestamp); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startTimestamp); - boolean present_agentStats = true && (isSetAgentStats()); - list.add(present_agentStats); - if (present_agentStats) - list.add(agentStats); + hashCode = hashCode * 8191 + ((isSetAgentStats()) ? 131071 : 524287); + if (isSetAgentStats()) + hashCode = hashCode * 8191 + agentStats.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -395,7 +362,7 @@ public int compareTo(TFAgentStatBatch other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId()); + lastComparison = java.lang.Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId()); if (lastComparison != 0) { return lastComparison; } @@ -405,7 +372,7 @@ public int compareTo(TFAgentStatBatch other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetStartTimestamp()).compareTo(other.isSetStartTimestamp()); + lastComparison = java.lang.Boolean.valueOf(isSetStartTimestamp()).compareTo(other.isSetStartTimestamp()); if (lastComparison != 0) { return lastComparison; } @@ -415,7 +382,7 @@ public int compareTo(TFAgentStatBatch other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetAgentStats()).compareTo(other.isSetAgentStats()); + lastComparison = java.lang.Boolean.valueOf(isSetAgentStats()).compareTo(other.isSetAgentStats()); if (lastComparison != 0) { return lastComparison; } @@ -432,17 +399,17 @@ public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } - public void read(org.apache.thrift.protocol.TProtocol iprot) throws TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); } - public void write(org.apache.thrift.protocol.TProtocol oprot) throws TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFAgentStatBatch("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFAgentStatBatch("); boolean first = true; sb.append("agentId:"); @@ -468,7 +435,7 @@ public String toString() { return sb.toString(); } - public void validate() throws TException { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -476,36 +443,36 @@ public void validate() throws TException { private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private static class TFAgentStatBatchStandardSchemeFactory implements SchemeFactory { + private static class TFAgentStatBatchStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFAgentStatBatchStandardScheme getScheme() { return new TFAgentStatBatchStandardScheme(); } } - private static class TFAgentStatBatchStandardScheme extends StandardScheme { + private static class TFAgentStatBatchStandardScheme extends org.apache.thrift.scheme.StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStatBatch struct) throws TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStatBatch struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -513,7 +480,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStatBatch st if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.agentId = iprot.readString(); struct.setAgentIdIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -521,7 +488,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStatBatch st if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.startTimestamp = iprot.readI64(); struct.setStartTimestampIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -529,7 +496,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStatBatch st if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list32 = iprot.readListBegin(); - struct.agentStats = new ArrayList(_list32.size); + struct.agentStats = new java.util.ArrayList(_list32.size); TFAgentStat _elem33; for (int _i34 = 0; _i34 < _list32.size; ++_i34) { @@ -540,7 +507,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStatBatch st iprot.readListEnd(); } struct.setAgentStatsIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -553,7 +520,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFAgentStatBatch st struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, TFAgentStatBatch struct) throws TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, TFAgentStatBatch struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -583,18 +550,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFAgentStatBatch s } - private static class TFAgentStatBatchTupleSchemeFactory implements SchemeFactory { + private static class TFAgentStatBatchTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFAgentStatBatchTupleScheme getScheme() { return new TFAgentStatBatchTupleScheme(); } } - private static class TFAgentStatBatchTupleScheme extends TupleScheme { + private static class TFAgentStatBatchTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFAgentStatBatch struct) throws TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + public void write(org.apache.thrift.protocol.TProtocol prot, TFAgentStatBatch struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetAgentId()) { optionals.set(0); } @@ -623,9 +590,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFAgentStatBatch st } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFAgentStatBatch struct) throws TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); + public void read(org.apache.thrift.protocol.TProtocol prot, TFAgentStatBatch struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.agentId = iprot.readString(); struct.setAgentIdIsSet(true); @@ -637,7 +604,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFAgentStatBatch str if (incoming.get(2)) { { org.apache.thrift.protocol.TList _list37 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.agentStats = new ArrayList(_list37.size); + struct.agentStats = new java.util.ArrayList(_list37.size); TFAgentStat _elem38; for (int _i39 = 0; _i39 < _list37.size; ++_i39) { @@ -651,5 +618,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFAgentStatBatch str } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFCpuLoad.java b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFCpuLoad.java index 32322778c2cd..00b0463013e2 100644 --- a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFCpuLoad.java +++ b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFCpuLoad.java @@ -1,43 +1,21 @@ /** - * Autogenerated by Thrift Compiler (0.9.2) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.navercorp.pinpoint.thrift.dto.flink; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-3-31") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-09-06") public class TFCpuLoad implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFCpuLoad"); private static final org.apache.thrift.protocol.TField JVM_CPU_LOAD_FIELD_DESC = new org.apache.thrift.protocol.TField("jvmCpuLoad", org.apache.thrift.protocol.TType.DOUBLE, (short)1); private static final org.apache.thrift.protocol.TField SYSTEM_CPU_LOAD_FIELD_DESC = new org.apache.thrift.protocol.TField("systemCpuLoad", org.apache.thrift.protocol.TType.DOUBLE, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFCpuLoadStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFCpuLoadTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFCpuLoadStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFCpuLoadTupleSchemeFactory(); private double jvmCpuLoad; // optional private double systemCpuLoad; // optional @@ -47,10 +25,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { JVM_CPU_LOAD((short)1, "jvmCpuLoad"), SYSTEM_CPU_LOAD((short)2, "systemCpuLoad"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -75,21 +53,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -98,7 +76,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -107,15 +85,15 @@ public String getFieldName() { private static final int __JVMCPULOAD_ISSET_ID = 0; private static final int __SYSTEMCPULOAD_ISSET_ID = 1; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.JVM_CPU_LOAD, _Fields.SYSTEM_CPU_LOAD}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + private static final _Fields optionals[] = {_Fields.JVM_CPU_LOAD,_Fields.SYSTEM_CPU_LOAD}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.JVM_CPU_LOAD, new org.apache.thrift.meta_data.FieldMetaData("jvmCpuLoad", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); tmpMap.put(_Fields.SYSTEM_CPU_LOAD, new org.apache.thrift.meta_data.FieldMetaData("systemCpuLoad", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFCpuLoad.class, metaDataMap); } @@ -153,16 +131,16 @@ public void setJvmCpuLoad(double jvmCpuLoad) { } public void unsetJvmCpuLoad() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMCPULOAD_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __JVMCPULOAD_ISSET_ID); } /** Returns true if field jvmCpuLoad is set (has been assigned a value) and false otherwise */ public boolean isSetJvmCpuLoad() { - return EncodingUtils.testBit(__isset_bitfield, __JVMCPULOAD_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __JVMCPULOAD_ISSET_ID); } public void setJvmCpuLoadIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMCPULOAD_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __JVMCPULOAD_ISSET_ID, value); } public double getSystemCpuLoad() { @@ -175,25 +153,25 @@ public void setSystemCpuLoad(double systemCpuLoad) { } public void unsetSystemCpuLoad() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SYSTEMCPULOAD_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SYSTEMCPULOAD_ISSET_ID); } /** Returns true if field systemCpuLoad is set (has been assigned a value) and false otherwise */ public boolean isSetSystemCpuLoad() { - return EncodingUtils.testBit(__isset_bitfield, __SYSTEMCPULOAD_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SYSTEMCPULOAD_ISSET_ID); } public void setSystemCpuLoadIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SYSTEMCPULOAD_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SYSTEMCPULOAD_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case JVM_CPU_LOAD: if (value == null) { unsetJvmCpuLoad(); } else { - setJvmCpuLoad((Double)value); + setJvmCpuLoad((java.lang.Double)value); } break; @@ -201,29 +179,29 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetSystemCpuLoad(); } else { - setSystemCpuLoad((Double)value); + setSystemCpuLoad((java.lang.Double)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case JVM_CPU_LOAD: - return Double.valueOf(getJvmCpuLoad()); + return getJvmCpuLoad(); case SYSTEM_CPU_LOAD: - return Double.valueOf(getSystemCpuLoad()); + return getSystemCpuLoad(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -232,11 +210,11 @@ public boolean isSet(_Fields field) { case SYSTEM_CPU_LOAD: return isSetSystemCpuLoad(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TFCpuLoad) @@ -247,6 +225,8 @@ public boolean equals(Object that) { public boolean equals(TFCpuLoad that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_jvmCpuLoad = true && this.isSetJvmCpuLoad(); boolean that_present_jvmCpuLoad = true && that.isSetJvmCpuLoad(); @@ -271,19 +251,17 @@ public boolean equals(TFCpuLoad that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_jvmCpuLoad = true && (isSetJvmCpuLoad()); - list.add(present_jvmCpuLoad); - if (present_jvmCpuLoad) - list.add(jvmCpuLoad); + hashCode = hashCode * 8191 + ((isSetJvmCpuLoad()) ? 131071 : 524287); + if (isSetJvmCpuLoad()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(jvmCpuLoad); - boolean present_systemCpuLoad = true && (isSetSystemCpuLoad()); - list.add(present_systemCpuLoad); - if (present_systemCpuLoad) - list.add(systemCpuLoad); + hashCode = hashCode * 8191 + ((isSetSystemCpuLoad()) ? 131071 : 524287); + if (isSetSystemCpuLoad()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(systemCpuLoad); - return list.hashCode(); + return hashCode; } @Override @@ -294,7 +272,7 @@ public int compareTo(TFCpuLoad other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetJvmCpuLoad()).compareTo(other.isSetJvmCpuLoad()); + lastComparison = java.lang.Boolean.valueOf(isSetJvmCpuLoad()).compareTo(other.isSetJvmCpuLoad()); if (lastComparison != 0) { return lastComparison; } @@ -304,7 +282,7 @@ public int compareTo(TFCpuLoad other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetSystemCpuLoad()).compareTo(other.isSetSystemCpuLoad()); + lastComparison = java.lang.Boolean.valueOf(isSetSystemCpuLoad()).compareTo(other.isSetSystemCpuLoad()); if (lastComparison != 0) { return lastComparison; } @@ -321,17 +299,17 @@ public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } - public void read(org.apache.thrift.protocol.TProtocol iprot) throws TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); } - public void write(org.apache.thrift.protocol.TProtocol oprot) throws TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFCpuLoad("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFCpuLoad("); boolean first = true; if (isSetJvmCpuLoad()) { @@ -349,7 +327,7 @@ public String toString() { return sb.toString(); } - public void validate() throws TException { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -357,36 +335,36 @@ public void validate() throws TException { private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private static class TFCpuLoadStandardSchemeFactory implements SchemeFactory { + private static class TFCpuLoadStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFCpuLoadStandardScheme getScheme() { return new TFCpuLoadStandardScheme(); } } - private static class TFCpuLoadStandardScheme extends StandardScheme { + private static class TFCpuLoadStandardScheme extends org.apache.thrift.scheme.StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, TFCpuLoad struct) throws TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, TFCpuLoad struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -394,7 +372,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFCpuLoad struct) t if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { struct.jvmCpuLoad = iprot.readDouble(); struct.setJvmCpuLoadIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -402,7 +380,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFCpuLoad struct) t if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { struct.systemCpuLoad = iprot.readDouble(); struct.setSystemCpuLoadIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -415,7 +393,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFCpuLoad struct) t struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, TFCpuLoad struct) throws TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, TFCpuLoad struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -435,18 +413,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFCpuLoad struct) } - private static class TFCpuLoadTupleSchemeFactory implements SchemeFactory { + private static class TFCpuLoadTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFCpuLoadTupleScheme getScheme() { return new TFCpuLoadTupleScheme(); } } - private static class TFCpuLoadTupleScheme extends TupleScheme { + private static class TFCpuLoadTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFCpuLoad struct) throws TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + public void write(org.apache.thrift.protocol.TProtocol prot, TFCpuLoad struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetJvmCpuLoad()) { optionals.set(0); } @@ -463,9 +441,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFCpuLoad struct) t } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFCpuLoad struct) throws TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); + public void read(org.apache.thrift.protocol.TProtocol prot, TFCpuLoad struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.jvmCpuLoad = iprot.readDouble(); struct.setJvmCpuLoadIsSet(true); @@ -477,5 +455,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFCpuLoad struct) th } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFDataSource.java b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFDataSource.java index 39f4b9985067..a049768375d2 100644 --- a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFDataSource.java +++ b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFDataSource.java @@ -1,40 +1,13 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - /** - * Autogenerated by Thrift Compiler (0.9.2) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.navercorp.pinpoint.thrift.dto.flink; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; -import org.apache.thrift.scheme.TupleScheme; - -import javax.annotation.Generated; -import java.util.*; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-3-31") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-09-06") public class TFDataSource implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFDataSource"); @@ -45,16 +18,13 @@ public class TFDataSource implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFDataSourceStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFDataSourceTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFDataSourceStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFDataSourceTupleSchemeFactory(); private int id; // required private short serviceTypeCode; // optional - private String databaseName; // optional - private String url; // optional + private java.lang.String databaseName; // optional + private java.lang.String url; // optional private int activeConnectionSize; // optional private int maxConnectionSize; // optional @@ -67,10 +37,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ACTIVE_CONNECTION_SIZE((short)5, "activeConnectionSize"), MAX_CONNECTION_SIZE((short)6, "maxConnectionSize"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -103,21 +73,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -126,7 +96,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -137,10 +107,10 @@ public String getFieldName() { private static final int __ACTIVECONNECTIONSIZE_ISSET_ID = 2; private static final int __MAXCONNECTIONSIZE_ISSET_ID = 3; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.SERVICE_TYPE_CODE, _Fields.DATABASE_NAME, _Fields.URL, _Fields.ACTIVE_CONNECTION_SIZE, _Fields.MAX_CONNECTION_SIZE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + private static final _Fields optionals[] = {_Fields.SERVICE_TYPE_CODE,_Fields.DATABASE_NAME,_Fields.URL,_Fields.ACTIVE_CONNECTION_SIZE,_Fields.MAX_CONNECTION_SIZE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.SERVICE_TYPE_CODE, new org.apache.thrift.meta_data.FieldMetaData("serviceTypeCode", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -153,7 +123,7 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.MAX_CONNECTION_SIZE, new org.apache.thrift.meta_data.FieldMetaData("maxConnectionSize", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFDataSource.class, metaDataMap); } @@ -215,16 +185,16 @@ public void setId(int id) { } public void unsetId() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID); } /** Returns true if field id is set (has been assigned a value) and false otherwise */ public boolean isSetId() { - return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID); } public void setIdIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value); } public short getServiceTypeCode() { @@ -237,23 +207,23 @@ public void setServiceTypeCode(short serviceTypeCode) { } public void unsetServiceTypeCode() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SERVICETYPECODE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SERVICETYPECODE_ISSET_ID); } /** Returns true if field serviceTypeCode is set (has been assigned a value) and false otherwise */ public boolean isSetServiceTypeCode() { - return EncodingUtils.testBit(__isset_bitfield, __SERVICETYPECODE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SERVICETYPECODE_ISSET_ID); } public void setServiceTypeCodeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SERVICETYPECODE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SERVICETYPECODE_ISSET_ID, value); } - public String getDatabaseName() { + public java.lang.String getDatabaseName() { return this.databaseName; } - public void setDatabaseName(String databaseName) { + public void setDatabaseName(java.lang.String databaseName) { this.databaseName = databaseName; } @@ -272,11 +242,11 @@ public void setDatabaseNameIsSet(boolean value) { } } - public String getUrl() { + public java.lang.String getUrl() { return this.url; } - public void setUrl(String url) { + public void setUrl(java.lang.String url) { this.url = url; } @@ -305,16 +275,16 @@ public void setActiveConnectionSize(int activeConnectionSize) { } public void unsetActiveConnectionSize() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ACTIVECONNECTIONSIZE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ACTIVECONNECTIONSIZE_ISSET_ID); } /** Returns true if field activeConnectionSize is set (has been assigned a value) and false otherwise */ public boolean isSetActiveConnectionSize() { - return EncodingUtils.testBit(__isset_bitfield, __ACTIVECONNECTIONSIZE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ACTIVECONNECTIONSIZE_ISSET_ID); } public void setActiveConnectionSizeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ACTIVECONNECTIONSIZE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ACTIVECONNECTIONSIZE_ISSET_ID, value); } public int getMaxConnectionSize() { @@ -327,25 +297,25 @@ public void setMaxConnectionSize(int maxConnectionSize) { } public void unsetMaxConnectionSize() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXCONNECTIONSIZE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAXCONNECTIONSIZE_ISSET_ID); } /** Returns true if field maxConnectionSize is set (has been assigned a value) and false otherwise */ public boolean isSetMaxConnectionSize() { - return EncodingUtils.testBit(__isset_bitfield, __MAXCONNECTIONSIZE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAXCONNECTIONSIZE_ISSET_ID); } public void setMaxConnectionSizeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXCONNECTIONSIZE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAXCONNECTIONSIZE_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case ID: if (value == null) { unsetId(); } else { - setId((Integer)value); + setId((java.lang.Integer)value); } break; @@ -353,7 +323,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetServiceTypeCode(); } else { - setServiceTypeCode((Short)value); + setServiceTypeCode((java.lang.Short)value); } break; @@ -361,7 +331,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetDatabaseName(); } else { - setDatabaseName((String)value); + setDatabaseName((java.lang.String)value); } break; @@ -369,7 +339,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetUrl(); } else { - setUrl((String)value); + setUrl((java.lang.String)value); } break; @@ -377,7 +347,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetActiveConnectionSize(); } else { - setActiveConnectionSize((Integer)value); + setActiveConnectionSize((java.lang.Integer)value); } break; @@ -385,20 +355,20 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetMaxConnectionSize(); } else { - setMaxConnectionSize((Integer)value); + setMaxConnectionSize((java.lang.Integer)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case ID: - return Integer.valueOf(getId()); + return getId(); case SERVICE_TYPE_CODE: - return Short.valueOf(getServiceTypeCode()); + return getServiceTypeCode(); case DATABASE_NAME: return getDatabaseName(); @@ -407,19 +377,19 @@ public Object getFieldValue(_Fields field) { return getUrl(); case ACTIVE_CONNECTION_SIZE: - return Integer.valueOf(getActiveConnectionSize()); + return getActiveConnectionSize(); case MAX_CONNECTION_SIZE: - return Integer.valueOf(getMaxConnectionSize()); + return getMaxConnectionSize(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -436,11 +406,11 @@ public boolean isSet(_Fields field) { case MAX_CONNECTION_SIZE: return isSetMaxConnectionSize(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TFDataSource) @@ -451,6 +421,8 @@ public boolean equals(Object that) { public boolean equals(TFDataSource that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_id = true; boolean that_present_id = true; @@ -511,39 +483,31 @@ public boolean equals(TFDataSource that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_id = true; - list.add(present_id); - if (present_id) - list.add(id); + hashCode = hashCode * 8191 + id; - boolean present_serviceTypeCode = true && (isSetServiceTypeCode()); - list.add(present_serviceTypeCode); - if (present_serviceTypeCode) - list.add(serviceTypeCode); + hashCode = hashCode * 8191 + ((isSetServiceTypeCode()) ? 131071 : 524287); + if (isSetServiceTypeCode()) + hashCode = hashCode * 8191 + serviceTypeCode; - boolean present_databaseName = true && (isSetDatabaseName()); - list.add(present_databaseName); - if (present_databaseName) - list.add(databaseName); + hashCode = hashCode * 8191 + ((isSetDatabaseName()) ? 131071 : 524287); + if (isSetDatabaseName()) + hashCode = hashCode * 8191 + databaseName.hashCode(); - boolean present_url = true && (isSetUrl()); - list.add(present_url); - if (present_url) - list.add(url); + hashCode = hashCode * 8191 + ((isSetUrl()) ? 131071 : 524287); + if (isSetUrl()) + hashCode = hashCode * 8191 + url.hashCode(); - boolean present_activeConnectionSize = true && (isSetActiveConnectionSize()); - list.add(present_activeConnectionSize); - if (present_activeConnectionSize) - list.add(activeConnectionSize); + hashCode = hashCode * 8191 + ((isSetActiveConnectionSize()) ? 131071 : 524287); + if (isSetActiveConnectionSize()) + hashCode = hashCode * 8191 + activeConnectionSize; - boolean present_maxConnectionSize = true && (isSetMaxConnectionSize()); - list.add(present_maxConnectionSize); - if (present_maxConnectionSize) - list.add(maxConnectionSize); + hashCode = hashCode * 8191 + ((isSetMaxConnectionSize()) ? 131071 : 524287); + if (isSetMaxConnectionSize()) + hashCode = hashCode * 8191 + maxConnectionSize; - return list.hashCode(); + return hashCode; } @Override @@ -554,7 +518,7 @@ public int compareTo(TFDataSource other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); + lastComparison = java.lang.Boolean.valueOf(isSetId()).compareTo(other.isSetId()); if (lastComparison != 0) { return lastComparison; } @@ -564,7 +528,7 @@ public int compareTo(TFDataSource other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetServiceTypeCode()).compareTo(other.isSetServiceTypeCode()); + lastComparison = java.lang.Boolean.valueOf(isSetServiceTypeCode()).compareTo(other.isSetServiceTypeCode()); if (lastComparison != 0) { return lastComparison; } @@ -574,7 +538,7 @@ public int compareTo(TFDataSource other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetDatabaseName()).compareTo(other.isSetDatabaseName()); + lastComparison = java.lang.Boolean.valueOf(isSetDatabaseName()).compareTo(other.isSetDatabaseName()); if (lastComparison != 0) { return lastComparison; } @@ -584,7 +548,7 @@ public int compareTo(TFDataSource other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetUrl()).compareTo(other.isSetUrl()); + lastComparison = java.lang.Boolean.valueOf(isSetUrl()).compareTo(other.isSetUrl()); if (lastComparison != 0) { return lastComparison; } @@ -594,7 +558,7 @@ public int compareTo(TFDataSource other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetActiveConnectionSize()).compareTo(other.isSetActiveConnectionSize()); + lastComparison = java.lang.Boolean.valueOf(isSetActiveConnectionSize()).compareTo(other.isSetActiveConnectionSize()); if (lastComparison != 0) { return lastComparison; } @@ -604,7 +568,7 @@ public int compareTo(TFDataSource other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetMaxConnectionSize()).compareTo(other.isSetMaxConnectionSize()); + lastComparison = java.lang.Boolean.valueOf(isSetMaxConnectionSize()).compareTo(other.isSetMaxConnectionSize()); if (lastComparison != 0) { return lastComparison; } @@ -621,17 +585,17 @@ public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } - public void read(org.apache.thrift.protocol.TProtocol iprot) throws TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); } - public void write(org.apache.thrift.protocol.TProtocol oprot) throws TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFDataSource("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFDataSource("); boolean first = true; sb.append("id:"); @@ -679,7 +643,7 @@ public String toString() { return sb.toString(); } - public void validate() throws TException { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -687,36 +651,36 @@ public void validate() throws TException { private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private static class TFDataSourceStandardSchemeFactory implements SchemeFactory { + private static class TFDataSourceStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFDataSourceStandardScheme getScheme() { return new TFDataSourceStandardScheme(); } } - private static class TFDataSourceStandardScheme extends StandardScheme { + private static class TFDataSourceStandardScheme extends org.apache.thrift.scheme.StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, TFDataSource struct) throws TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, TFDataSource struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -724,7 +688,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFDataSource struct if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.id = iprot.readI32(); struct.setIdIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -732,7 +696,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFDataSource struct if (schemeField.type == org.apache.thrift.protocol.TType.I16) { struct.serviceTypeCode = iprot.readI16(); struct.setServiceTypeCodeIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -740,7 +704,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFDataSource struct if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.databaseName = iprot.readString(); struct.setDatabaseNameIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -748,7 +712,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFDataSource struct if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.url = iprot.readString(); struct.setUrlIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -756,7 +720,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFDataSource struct if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.activeConnectionSize = iprot.readI32(); struct.setActiveConnectionSizeIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -764,7 +728,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFDataSource struct if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.maxConnectionSize = iprot.readI32(); struct.setMaxConnectionSizeIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -777,7 +741,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFDataSource struct struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, TFDataSource struct) throws TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, TFDataSource struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -819,18 +783,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFDataSource struc } - private static class TFDataSourceTupleSchemeFactory implements SchemeFactory { + private static class TFDataSourceTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFDataSourceTupleScheme getScheme() { return new TFDataSourceTupleScheme(); } } - private static class TFDataSourceTupleScheme extends TupleScheme { + private static class TFDataSourceTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFDataSource struct) throws TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + public void write(org.apache.thrift.protocol.TProtocol prot, TFDataSource struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetId()) { optionals.set(0); } @@ -871,9 +835,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFDataSource struct } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFDataSource struct) throws TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(6); + public void read(org.apache.thrift.protocol.TProtocol prot, TFDataSource struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.id = iprot.readI32(); struct.setIdIsSet(true); @@ -901,5 +865,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFDataSource struct) } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFDataSourceList.java b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFDataSourceList.java index 5a8d2bff8063..f785345f2baa 100644 --- a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFDataSourceList.java +++ b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFDataSourceList.java @@ -1,60 +1,31 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - /** - * Autogenerated by Thrift Compiler (0.9.2) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.navercorp.pinpoint.thrift.dto.flink; -import org.apache.thrift.TException; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; -import org.apache.thrift.scheme.TupleScheme; - -import javax.annotation.Generated; -import java.util.*; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-3-31") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-09-06") public class TFDataSourceList implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFDataSourceList"); private static final org.apache.thrift.protocol.TField DATA_SOURCE_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("dataSourceList", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFDataSourceListStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFDataSourceListTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFDataSourceListStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFDataSourceListTupleSchemeFactory(); - private List dataSourceList; // required + private java.util.List dataSourceList; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { DATA_SOURCE_LIST((short)1, "dataSourceList"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -77,21 +48,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -100,19 +71,19 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.DATA_SOURCE_LIST, new org.apache.thrift.meta_data.FieldMetaData("dataSourceList", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TFDataSource.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFDataSourceList.class, metaDataMap); } @@ -120,7 +91,7 @@ public TFDataSourceList() { } public TFDataSourceList( - List dataSourceList) + java.util.List dataSourceList) { this(); this.dataSourceList = dataSourceList; @@ -131,7 +102,7 @@ public TFDataSourceList( */ public TFDataSourceList(TFDataSourceList other) { if (other.isSetDataSourceList()) { - List __this__dataSourceList = new ArrayList(other.dataSourceList.size()); + java.util.List __this__dataSourceList = new java.util.ArrayList(other.dataSourceList.size()); for (TFDataSource other_element : other.dataSourceList) { __this__dataSourceList.add(new TFDataSource(other_element)); } @@ -158,16 +129,16 @@ public java.util.Iterator getDataSourceListIterator() { public void addToDataSourceList(TFDataSource elem) { if (this.dataSourceList == null) { - this.dataSourceList = new ArrayList(); + this.dataSourceList = new java.util.ArrayList(); } this.dataSourceList.add(elem); } - public List getDataSourceList() { + public java.util.List getDataSourceList() { return this.dataSourceList; } - public void setDataSourceList(List dataSourceList) { + public void setDataSourceList(java.util.List dataSourceList) { this.dataSourceList = dataSourceList; } @@ -186,43 +157,43 @@ public void setDataSourceListIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case DATA_SOURCE_LIST: if (value == null) { unsetDataSourceList(); } else { - setDataSourceList((List)value); + setDataSourceList((java.util.List)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case DATA_SOURCE_LIST: return getDataSourceList(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case DATA_SOURCE_LIST: return isSetDataSourceList(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TFDataSourceList) @@ -233,6 +204,8 @@ public boolean equals(Object that) { public boolean equals(TFDataSourceList that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_dataSourceList = true && this.isSetDataSourceList(); boolean that_present_dataSourceList = true && that.isSetDataSourceList(); @@ -248,14 +221,13 @@ public boolean equals(TFDataSourceList that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_dataSourceList = true && (isSetDataSourceList()); - list.add(present_dataSourceList); - if (present_dataSourceList) - list.add(dataSourceList); + hashCode = hashCode * 8191 + ((isSetDataSourceList()) ? 131071 : 524287); + if (isSetDataSourceList()) + hashCode = hashCode * 8191 + dataSourceList.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -266,7 +238,7 @@ public int compareTo(TFDataSourceList other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetDataSourceList()).compareTo(other.isSetDataSourceList()); + lastComparison = java.lang.Boolean.valueOf(isSetDataSourceList()).compareTo(other.isSetDataSourceList()); if (lastComparison != 0) { return lastComparison; } @@ -283,17 +255,17 @@ public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } - public void read(org.apache.thrift.protocol.TProtocol iprot) throws TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); } - public void write(org.apache.thrift.protocol.TProtocol oprot) throws TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFDataSourceList("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFDataSourceList("); boolean first = true; sb.append("dataSourceList:"); @@ -307,7 +279,7 @@ public String toString() { return sb.toString(); } - public void validate() throws TException { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -315,34 +287,34 @@ public void validate() throws TException { private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private static class TFDataSourceListStandardSchemeFactory implements SchemeFactory { + private static class TFDataSourceListStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFDataSourceListStandardScheme getScheme() { return new TFDataSourceListStandardScheme(); } } - private static class TFDataSourceListStandardScheme extends StandardScheme { + private static class TFDataSourceListStandardScheme extends org.apache.thrift.scheme.StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, TFDataSourceList struct) throws TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, TFDataSourceList struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -350,7 +322,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFDataSourceList st if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list40 = iprot.readListBegin(); - struct.dataSourceList = new ArrayList(_list40.size); + struct.dataSourceList = new java.util.ArrayList(_list40.size); TFDataSource _elem41; for (int _i42 = 0; _i42 < _list40.size; ++_i42) { @@ -361,7 +333,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFDataSourceList st iprot.readListEnd(); } struct.setDataSourceListIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -374,7 +346,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFDataSourceList st struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, TFDataSourceList struct) throws TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, TFDataSourceList struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -396,18 +368,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFDataSourceList s } - private static class TFDataSourceListTupleSchemeFactory implements SchemeFactory { + private static class TFDataSourceListTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFDataSourceListTupleScheme getScheme() { return new TFDataSourceListTupleScheme(); } } - private static class TFDataSourceListTupleScheme extends TupleScheme { + private static class TFDataSourceListTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFDataSourceList struct) throws TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + public void write(org.apache.thrift.protocol.TProtocol prot, TFDataSourceList struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetDataSourceList()) { optionals.set(0); } @@ -424,13 +396,13 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFDataSourceList st } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFDataSourceList struct) throws TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + public void read(org.apache.thrift.protocol.TProtocol prot, TFDataSourceList struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list45 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.dataSourceList = new ArrayList(_list45.size); + struct.dataSourceList = new java.util.ArrayList(_list45.size); TFDataSource _elem46; for (int _i47 = 0; _i47 < _list45.size; ++_i47) { @@ -444,5 +416,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFDataSourceList str } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFJvmGc.java b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFJvmGc.java index c48b7d28ad8b..ddc580dc8499 100644 --- a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFJvmGc.java +++ b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFJvmGc.java @@ -1,32 +1,13 @@ /** - * Autogenerated by Thrift Compiler (0.9.2) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.navercorp.pinpoint.thrift.dto.flink; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-3-31") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-09-06") public class TFJvmGc implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFJvmGc"); @@ -39,11 +20,8 @@ public class TFJvmGc implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFJvmGcStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFJvmGcTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFJvmGcStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFJvmGcTupleSchemeFactory(); private TFJvmGcType type; // required private long jvmMemoryHeapUsed; // required @@ -69,10 +47,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { JVM_GC_OLD_TIME((short)7, "jvmGcOldTime"), JVM_GC_DETAILED((short)8, "jvmGcDetailed"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -109,21 +87,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -132,7 +110,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -146,9 +124,9 @@ public String getFieldName() { private static final int __JVMGCOLDTIME_ISSET_ID = 5; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.JVM_GC_DETAILED}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TFJvmGcType.class))); tmpMap.put(_Fields.JVM_MEMORY_HEAP_USED, new org.apache.thrift.meta_data.FieldMetaData("jvmMemoryHeapUsed", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -165,7 +143,7 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.JVM_GC_DETAILED, new org.apache.thrift.meta_data.FieldMetaData("jvmGcDetailed", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT , "TFJvmGcDetailed"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFJvmGc.class, metaDataMap); } @@ -214,7 +192,7 @@ public TFJvmGc(TFJvmGc other) { this.jvmGcOldCount = other.jvmGcOldCount; this.jvmGcOldTime = other.jvmGcOldTime; if (other.isSetJvmGcDetailed()) { - this.jvmGcDetailed = other.jvmGcDetailed; + this.jvmGcDetailed = new TFJvmGcDetailed(other.jvmGcDetailed); } } @@ -282,16 +260,16 @@ public void setJvmMemoryHeapUsed(long jvmMemoryHeapUsed) { } public void unsetJvmMemoryHeapUsed() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYHEAPUSED_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYHEAPUSED_ISSET_ID); } /** Returns true if field jvmMemoryHeapUsed is set (has been assigned a value) and false otherwise */ public boolean isSetJvmMemoryHeapUsed() { - return EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYHEAPUSED_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYHEAPUSED_ISSET_ID); } public void setJvmMemoryHeapUsedIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYHEAPUSED_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYHEAPUSED_ISSET_ID, value); } public long getJvmMemoryHeapMax() { @@ -304,16 +282,16 @@ public void setJvmMemoryHeapMax(long jvmMemoryHeapMax) { } public void unsetJvmMemoryHeapMax() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYHEAPMAX_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYHEAPMAX_ISSET_ID); } /** Returns true if field jvmMemoryHeapMax is set (has been assigned a value) and false otherwise */ public boolean isSetJvmMemoryHeapMax() { - return EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYHEAPMAX_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYHEAPMAX_ISSET_ID); } public void setJvmMemoryHeapMaxIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYHEAPMAX_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYHEAPMAX_ISSET_ID, value); } public long getJvmMemoryNonHeapUsed() { @@ -326,16 +304,16 @@ public void setJvmMemoryNonHeapUsed(long jvmMemoryNonHeapUsed) { } public void unsetJvmMemoryNonHeapUsed() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYNONHEAPUSED_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYNONHEAPUSED_ISSET_ID); } /** Returns true if field jvmMemoryNonHeapUsed is set (has been assigned a value) and false otherwise */ public boolean isSetJvmMemoryNonHeapUsed() { - return EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYNONHEAPUSED_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYNONHEAPUSED_ISSET_ID); } public void setJvmMemoryNonHeapUsedIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYNONHEAPUSED_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYNONHEAPUSED_ISSET_ID, value); } public long getJvmMemoryNonHeapMax() { @@ -348,16 +326,16 @@ public void setJvmMemoryNonHeapMax(long jvmMemoryNonHeapMax) { } public void unsetJvmMemoryNonHeapMax() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYNONHEAPMAX_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __JVMMEMORYNONHEAPMAX_ISSET_ID); } /** Returns true if field jvmMemoryNonHeapMax is set (has been assigned a value) and false otherwise */ public boolean isSetJvmMemoryNonHeapMax() { - return EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYNONHEAPMAX_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __JVMMEMORYNONHEAPMAX_ISSET_ID); } public void setJvmMemoryNonHeapMaxIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYNONHEAPMAX_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __JVMMEMORYNONHEAPMAX_ISSET_ID, value); } public long getJvmGcOldCount() { @@ -370,16 +348,16 @@ public void setJvmGcOldCount(long jvmGcOldCount) { } public void unsetJvmGcOldCount() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMGCOLDCOUNT_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __JVMGCOLDCOUNT_ISSET_ID); } /** Returns true if field jvmGcOldCount is set (has been assigned a value) and false otherwise */ public boolean isSetJvmGcOldCount() { - return EncodingUtils.testBit(__isset_bitfield, __JVMGCOLDCOUNT_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __JVMGCOLDCOUNT_ISSET_ID); } public void setJvmGcOldCountIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMGCOLDCOUNT_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __JVMGCOLDCOUNT_ISSET_ID, value); } public long getJvmGcOldTime() { @@ -392,16 +370,16 @@ public void setJvmGcOldTime(long jvmGcOldTime) { } public void unsetJvmGcOldTime() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMGCOLDTIME_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __JVMGCOLDTIME_ISSET_ID); } /** Returns true if field jvmGcOldTime is set (has been assigned a value) and false otherwise */ public boolean isSetJvmGcOldTime() { - return EncodingUtils.testBit(__isset_bitfield, __JVMGCOLDTIME_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __JVMGCOLDTIME_ISSET_ID); } public void setJvmGcOldTimeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMGCOLDTIME_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __JVMGCOLDTIME_ISSET_ID, value); } public TFJvmGcDetailed getJvmGcDetailed() { @@ -427,7 +405,7 @@ public void setJvmGcDetailedIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case TYPE: if (value == null) { @@ -441,7 +419,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetJvmMemoryHeapUsed(); } else { - setJvmMemoryHeapUsed((Long)value); + setJvmMemoryHeapUsed((java.lang.Long)value); } break; @@ -449,7 +427,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetJvmMemoryHeapMax(); } else { - setJvmMemoryHeapMax((Long)value); + setJvmMemoryHeapMax((java.lang.Long)value); } break; @@ -457,7 +435,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetJvmMemoryNonHeapUsed(); } else { - setJvmMemoryNonHeapUsed((Long)value); + setJvmMemoryNonHeapUsed((java.lang.Long)value); } break; @@ -465,7 +443,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetJvmMemoryNonHeapMax(); } else { - setJvmMemoryNonHeapMax((Long)value); + setJvmMemoryNonHeapMax((java.lang.Long)value); } break; @@ -473,7 +451,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetJvmGcOldCount(); } else { - setJvmGcOldCount((Long)value); + setJvmGcOldCount((java.lang.Long)value); } break; @@ -481,7 +459,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetJvmGcOldTime(); } else { - setJvmGcOldTime((Long)value); + setJvmGcOldTime((java.lang.Long)value); } break; @@ -496,40 +474,40 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TYPE: return getType(); case JVM_MEMORY_HEAP_USED: - return Long.valueOf(getJvmMemoryHeapUsed()); + return getJvmMemoryHeapUsed(); case JVM_MEMORY_HEAP_MAX: - return Long.valueOf(getJvmMemoryHeapMax()); + return getJvmMemoryHeapMax(); case JVM_MEMORY_NON_HEAP_USED: - return Long.valueOf(getJvmMemoryNonHeapUsed()); + return getJvmMemoryNonHeapUsed(); case JVM_MEMORY_NON_HEAP_MAX: - return Long.valueOf(getJvmMemoryNonHeapMax()); + return getJvmMemoryNonHeapMax(); case JVM_GC_OLD_COUNT: - return Long.valueOf(getJvmGcOldCount()); + return getJvmGcOldCount(); case JVM_GC_OLD_TIME: - return Long.valueOf(getJvmGcOldTime()); + return getJvmGcOldTime(); case JVM_GC_DETAILED: return getJvmGcDetailed(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -550,11 +528,11 @@ public boolean isSet(_Fields field) { case JVM_GC_DETAILED: return isSetJvmGcDetailed(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TFJvmGc) @@ -565,6 +543,8 @@ public boolean equals(Object that) { public boolean equals(TFJvmGc that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_type = true && this.isSetType(); boolean that_present_type = true && that.isSetType(); @@ -643,49 +623,29 @@ public boolean equals(TFJvmGc that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_type = true && (isSetType()); - list.add(present_type); - if (present_type) - list.add(type.getValue()); + hashCode = hashCode * 8191 + ((isSetType()) ? 131071 : 524287); + if (isSetType()) + hashCode = hashCode * 8191 + type.getValue(); - boolean present_jvmMemoryHeapUsed = true; - list.add(present_jvmMemoryHeapUsed); - if (present_jvmMemoryHeapUsed) - list.add(jvmMemoryHeapUsed); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(jvmMemoryHeapUsed); - boolean present_jvmMemoryHeapMax = true; - list.add(present_jvmMemoryHeapMax); - if (present_jvmMemoryHeapMax) - list.add(jvmMemoryHeapMax); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(jvmMemoryHeapMax); - boolean present_jvmMemoryNonHeapUsed = true; - list.add(present_jvmMemoryNonHeapUsed); - if (present_jvmMemoryNonHeapUsed) - list.add(jvmMemoryNonHeapUsed); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(jvmMemoryNonHeapUsed); - boolean present_jvmMemoryNonHeapMax = true; - list.add(present_jvmMemoryNonHeapMax); - if (present_jvmMemoryNonHeapMax) - list.add(jvmMemoryNonHeapMax); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(jvmMemoryNonHeapMax); - boolean present_jvmGcOldCount = true; - list.add(present_jvmGcOldCount); - if (present_jvmGcOldCount) - list.add(jvmGcOldCount); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(jvmGcOldCount); - boolean present_jvmGcOldTime = true; - list.add(present_jvmGcOldTime); - if (present_jvmGcOldTime) - list.add(jvmGcOldTime); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(jvmGcOldTime); - boolean present_jvmGcDetailed = true && (isSetJvmGcDetailed()); - list.add(present_jvmGcDetailed); - if (present_jvmGcDetailed) - list.add(jvmGcDetailed); + hashCode = hashCode * 8191 + ((isSetJvmGcDetailed()) ? 131071 : 524287); + if (isSetJvmGcDetailed()) + hashCode = hashCode * 8191 + jvmGcDetailed.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -696,7 +656,7 @@ public int compareTo(TFJvmGc other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType()); + lastComparison = java.lang.Boolean.valueOf(isSetType()).compareTo(other.isSetType()); if (lastComparison != 0) { return lastComparison; } @@ -706,7 +666,7 @@ public int compareTo(TFJvmGc other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetJvmMemoryHeapUsed()).compareTo(other.isSetJvmMemoryHeapUsed()); + lastComparison = java.lang.Boolean.valueOf(isSetJvmMemoryHeapUsed()).compareTo(other.isSetJvmMemoryHeapUsed()); if (lastComparison != 0) { return lastComparison; } @@ -716,7 +676,7 @@ public int compareTo(TFJvmGc other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetJvmMemoryHeapMax()).compareTo(other.isSetJvmMemoryHeapMax()); + lastComparison = java.lang.Boolean.valueOf(isSetJvmMemoryHeapMax()).compareTo(other.isSetJvmMemoryHeapMax()); if (lastComparison != 0) { return lastComparison; } @@ -726,7 +686,7 @@ public int compareTo(TFJvmGc other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetJvmMemoryNonHeapUsed()).compareTo(other.isSetJvmMemoryNonHeapUsed()); + lastComparison = java.lang.Boolean.valueOf(isSetJvmMemoryNonHeapUsed()).compareTo(other.isSetJvmMemoryNonHeapUsed()); if (lastComparison != 0) { return lastComparison; } @@ -736,7 +696,7 @@ public int compareTo(TFJvmGc other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetJvmMemoryNonHeapMax()).compareTo(other.isSetJvmMemoryNonHeapMax()); + lastComparison = java.lang.Boolean.valueOf(isSetJvmMemoryNonHeapMax()).compareTo(other.isSetJvmMemoryNonHeapMax()); if (lastComparison != 0) { return lastComparison; } @@ -746,7 +706,7 @@ public int compareTo(TFJvmGc other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetJvmGcOldCount()).compareTo(other.isSetJvmGcOldCount()); + lastComparison = java.lang.Boolean.valueOf(isSetJvmGcOldCount()).compareTo(other.isSetJvmGcOldCount()); if (lastComparison != 0) { return lastComparison; } @@ -756,7 +716,7 @@ public int compareTo(TFJvmGc other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetJvmGcOldTime()).compareTo(other.isSetJvmGcOldTime()); + lastComparison = java.lang.Boolean.valueOf(isSetJvmGcOldTime()).compareTo(other.isSetJvmGcOldTime()); if (lastComparison != 0) { return lastComparison; } @@ -766,7 +726,7 @@ public int compareTo(TFJvmGc other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetJvmGcDetailed()).compareTo(other.isSetJvmGcDetailed()); + lastComparison = java.lang.Boolean.valueOf(isSetJvmGcDetailed()).compareTo(other.isSetJvmGcDetailed()); if (lastComparison != 0) { return lastComparison; } @@ -783,17 +743,17 @@ public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } - public void read(org.apache.thrift.protocol.TProtocol iprot) throws TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); } - public void write(org.apache.thrift.protocol.TProtocol oprot) throws TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFJvmGc("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFJvmGc("); boolean first = true; sb.append("type:"); @@ -841,7 +801,7 @@ public String toString() { return sb.toString(); } - public void validate() throws TException { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -849,36 +809,36 @@ public void validate() throws TException { private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private static class TFJvmGcStandardSchemeFactory implements SchemeFactory { + private static class TFJvmGcStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFJvmGcStandardScheme getScheme() { return new TFJvmGcStandardScheme(); } } - private static class TFJvmGcStandardScheme extends StandardScheme { + private static class TFJvmGcStandardScheme extends org.apache.thrift.scheme.StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGc struct) throws TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGc struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -886,7 +846,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGc struct) thr if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.type = com.navercorp.pinpoint.thrift.dto.flink.TFJvmGcType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -894,7 +854,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGc struct) thr if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.jvmMemoryHeapUsed = iprot.readI64(); struct.setJvmMemoryHeapUsedIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -902,7 +862,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGc struct) thr if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.jvmMemoryHeapMax = iprot.readI64(); struct.setJvmMemoryHeapMaxIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -910,7 +870,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGc struct) thr if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.jvmMemoryNonHeapUsed = iprot.readI64(); struct.setJvmMemoryNonHeapUsedIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -918,7 +878,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGc struct) thr if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.jvmMemoryNonHeapMax = iprot.readI64(); struct.setJvmMemoryNonHeapMaxIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -926,7 +886,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGc struct) thr if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.jvmGcOldCount = iprot.readI64(); struct.setJvmGcOldCountIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -934,7 +894,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGc struct) thr if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.jvmGcOldTime = iprot.readI64(); struct.setJvmGcOldTimeIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -943,7 +903,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGc struct) thr struct.jvmGcDetailed = new TFJvmGcDetailed(); struct.jvmGcDetailed.read(iprot); struct.setJvmGcDetailedIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -956,7 +916,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGc struct) thr struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, TFJvmGc struct) throws TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, TFJvmGc struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -996,18 +956,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFJvmGc struct) th } - private static class TFJvmGcTupleSchemeFactory implements SchemeFactory { + private static class TFJvmGcTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFJvmGcTupleScheme getScheme() { return new TFJvmGcTupleScheme(); } } - private static class TFJvmGcTupleScheme extends TupleScheme { + private static class TFJvmGcTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFJvmGc struct) throws TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + public void write(org.apache.thrift.protocol.TProtocol prot, TFJvmGc struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetType()) { optionals.set(0); } @@ -1060,9 +1020,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFJvmGc struct) thr } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFJvmGc struct) throws TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(8); + public void read(org.apache.thrift.protocol.TProtocol prot, TFJvmGc struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(8); if (incoming.get(0)) { struct.type = com.navercorp.pinpoint.thrift.dto.flink.TFJvmGcType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); @@ -1099,5 +1059,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFJvmGc struct) thro } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFJvmGcDetailed.java b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFJvmGcDetailed.java index 774d73dc97fd..02a329e97ee5 100644 --- a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFJvmGcDetailed.java +++ b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFJvmGcDetailed.java @@ -1,40 +1,13 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - /** - * Autogenerated by Thrift Compiler (0.9.2) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.navercorp.pinpoint.thrift.dto.flink; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; -import org.apache.thrift.scheme.TupleScheme; - -import javax.annotation.Generated; -import java.util.*; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-3-31") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-09-06") public class TFJvmGcDetailed implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFJvmGcDetailed"); @@ -47,11 +20,8 @@ public class TFJvmGcDetailed implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFJvmGcDetailedStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFJvmGcDetailedTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFJvmGcDetailedStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFJvmGcDetailedTupleSchemeFactory(); private long jvmGcNewCount; // optional private long jvmGcNewTime; // optional @@ -73,10 +43,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { JVM_POOL_PERM_GEN_USED((short)7, "jvmPoolPermGenUsed"), JVM_POOL_METASPACE_USED((short)8, "jvmPoolMetaspaceUsed"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -113,21 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -136,7 +106,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -151,10 +121,10 @@ public String getFieldName() { private static final int __JVMPOOLPERMGENUSED_ISSET_ID = 6; private static final int __JVMPOOLMETASPACEUSED_ISSET_ID = 7; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.JVM_GC_NEW_COUNT, _Fields.JVM_GC_NEW_TIME, _Fields.JVM_POOL_CODE_CACHE_USED, _Fields.JVM_POOL_NEW_GEN_USED, _Fields.JVM_POOL_OLD_GEN_USED, _Fields.JVM_POOL_SURVIVOR_SPACE_USED, _Fields.JVM_POOL_PERM_GEN_USED, _Fields.JVM_POOL_METASPACE_USED}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + private static final _Fields optionals[] = {_Fields.JVM_GC_NEW_COUNT,_Fields.JVM_GC_NEW_TIME,_Fields.JVM_POOL_CODE_CACHE_USED,_Fields.JVM_POOL_NEW_GEN_USED,_Fields.JVM_POOL_OLD_GEN_USED,_Fields.JVM_POOL_SURVIVOR_SPACE_USED,_Fields.JVM_POOL_PERM_GEN_USED,_Fields.JVM_POOL_METASPACE_USED}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.JVM_GC_NEW_COUNT, new org.apache.thrift.meta_data.FieldMetaData("jvmGcNewCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.JVM_GC_NEW_TIME, new org.apache.thrift.meta_data.FieldMetaData("jvmGcNewTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -171,7 +141,7 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); tmpMap.put(_Fields.JVM_POOL_METASPACE_USED, new org.apache.thrift.meta_data.FieldMetaData("jvmPoolMetaspaceUsed", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFJvmGcDetailed.class, metaDataMap); } @@ -227,16 +197,16 @@ public void setJvmGcNewCount(long jvmGcNewCount) { } public void unsetJvmGcNewCount() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMGCNEWCOUNT_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __JVMGCNEWCOUNT_ISSET_ID); } /** Returns true if field jvmGcNewCount is set (has been assigned a value) and false otherwise */ public boolean isSetJvmGcNewCount() { - return EncodingUtils.testBit(__isset_bitfield, __JVMGCNEWCOUNT_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __JVMGCNEWCOUNT_ISSET_ID); } public void setJvmGcNewCountIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMGCNEWCOUNT_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __JVMGCNEWCOUNT_ISSET_ID, value); } public long getJvmGcNewTime() { @@ -249,16 +219,16 @@ public void setJvmGcNewTime(long jvmGcNewTime) { } public void unsetJvmGcNewTime() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMGCNEWTIME_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __JVMGCNEWTIME_ISSET_ID); } /** Returns true if field jvmGcNewTime is set (has been assigned a value) and false otherwise */ public boolean isSetJvmGcNewTime() { - return EncodingUtils.testBit(__isset_bitfield, __JVMGCNEWTIME_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __JVMGCNEWTIME_ISSET_ID); } public void setJvmGcNewTimeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMGCNEWTIME_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __JVMGCNEWTIME_ISSET_ID, value); } public double getJvmPoolCodeCacheUsed() { @@ -271,16 +241,16 @@ public void setJvmPoolCodeCacheUsed(double jvmPoolCodeCacheUsed) { } public void unsetJvmPoolCodeCacheUsed() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMPOOLCODECACHEUSED_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __JVMPOOLCODECACHEUSED_ISSET_ID); } /** Returns true if field jvmPoolCodeCacheUsed is set (has been assigned a value) and false otherwise */ public boolean isSetJvmPoolCodeCacheUsed() { - return EncodingUtils.testBit(__isset_bitfield, __JVMPOOLCODECACHEUSED_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __JVMPOOLCODECACHEUSED_ISSET_ID); } public void setJvmPoolCodeCacheUsedIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMPOOLCODECACHEUSED_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __JVMPOOLCODECACHEUSED_ISSET_ID, value); } public double getJvmPoolNewGenUsed() { @@ -293,16 +263,16 @@ public void setJvmPoolNewGenUsed(double jvmPoolNewGenUsed) { } public void unsetJvmPoolNewGenUsed() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMPOOLNEWGENUSED_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __JVMPOOLNEWGENUSED_ISSET_ID); } /** Returns true if field jvmPoolNewGenUsed is set (has been assigned a value) and false otherwise */ public boolean isSetJvmPoolNewGenUsed() { - return EncodingUtils.testBit(__isset_bitfield, __JVMPOOLNEWGENUSED_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __JVMPOOLNEWGENUSED_ISSET_ID); } public void setJvmPoolNewGenUsedIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMPOOLNEWGENUSED_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __JVMPOOLNEWGENUSED_ISSET_ID, value); } public double getJvmPoolOldGenUsed() { @@ -315,16 +285,16 @@ public void setJvmPoolOldGenUsed(double jvmPoolOldGenUsed) { } public void unsetJvmPoolOldGenUsed() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMPOOLOLDGENUSED_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __JVMPOOLOLDGENUSED_ISSET_ID); } /** Returns true if field jvmPoolOldGenUsed is set (has been assigned a value) and false otherwise */ public boolean isSetJvmPoolOldGenUsed() { - return EncodingUtils.testBit(__isset_bitfield, __JVMPOOLOLDGENUSED_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __JVMPOOLOLDGENUSED_ISSET_ID); } public void setJvmPoolOldGenUsedIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMPOOLOLDGENUSED_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __JVMPOOLOLDGENUSED_ISSET_ID, value); } public double getJvmPoolSurvivorSpaceUsed() { @@ -337,16 +307,16 @@ public void setJvmPoolSurvivorSpaceUsed(double jvmPoolSurvivorSpaceUsed) { } public void unsetJvmPoolSurvivorSpaceUsed() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMPOOLSURVIVORSPACEUSED_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __JVMPOOLSURVIVORSPACEUSED_ISSET_ID); } /** Returns true if field jvmPoolSurvivorSpaceUsed is set (has been assigned a value) and false otherwise */ public boolean isSetJvmPoolSurvivorSpaceUsed() { - return EncodingUtils.testBit(__isset_bitfield, __JVMPOOLSURVIVORSPACEUSED_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __JVMPOOLSURVIVORSPACEUSED_ISSET_ID); } public void setJvmPoolSurvivorSpaceUsedIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMPOOLSURVIVORSPACEUSED_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __JVMPOOLSURVIVORSPACEUSED_ISSET_ID, value); } public double getJvmPoolPermGenUsed() { @@ -359,16 +329,16 @@ public void setJvmPoolPermGenUsed(double jvmPoolPermGenUsed) { } public void unsetJvmPoolPermGenUsed() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMPOOLPERMGENUSED_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __JVMPOOLPERMGENUSED_ISSET_ID); } /** Returns true if field jvmPoolPermGenUsed is set (has been assigned a value) and false otherwise */ public boolean isSetJvmPoolPermGenUsed() { - return EncodingUtils.testBit(__isset_bitfield, __JVMPOOLPERMGENUSED_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __JVMPOOLPERMGENUSED_ISSET_ID); } public void setJvmPoolPermGenUsedIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMPOOLPERMGENUSED_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __JVMPOOLPERMGENUSED_ISSET_ID, value); } public double getJvmPoolMetaspaceUsed() { @@ -381,25 +351,25 @@ public void setJvmPoolMetaspaceUsed(double jvmPoolMetaspaceUsed) { } public void unsetJvmPoolMetaspaceUsed() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JVMPOOLMETASPACEUSED_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __JVMPOOLMETASPACEUSED_ISSET_ID); } /** Returns true if field jvmPoolMetaspaceUsed is set (has been assigned a value) and false otherwise */ public boolean isSetJvmPoolMetaspaceUsed() { - return EncodingUtils.testBit(__isset_bitfield, __JVMPOOLMETASPACEUSED_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __JVMPOOLMETASPACEUSED_ISSET_ID); } public void setJvmPoolMetaspaceUsedIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JVMPOOLMETASPACEUSED_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __JVMPOOLMETASPACEUSED_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case JVM_GC_NEW_COUNT: if (value == null) { unsetJvmGcNewCount(); } else { - setJvmGcNewCount((Long)value); + setJvmGcNewCount((java.lang.Long)value); } break; @@ -407,7 +377,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetJvmGcNewTime(); } else { - setJvmGcNewTime((Long)value); + setJvmGcNewTime((java.lang.Long)value); } break; @@ -415,7 +385,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetJvmPoolCodeCacheUsed(); } else { - setJvmPoolCodeCacheUsed((Double)value); + setJvmPoolCodeCacheUsed((java.lang.Double)value); } break; @@ -423,7 +393,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetJvmPoolNewGenUsed(); } else { - setJvmPoolNewGenUsed((Double)value); + setJvmPoolNewGenUsed((java.lang.Double)value); } break; @@ -431,7 +401,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetJvmPoolOldGenUsed(); } else { - setJvmPoolOldGenUsed((Double)value); + setJvmPoolOldGenUsed((java.lang.Double)value); } break; @@ -439,7 +409,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetJvmPoolSurvivorSpaceUsed(); } else { - setJvmPoolSurvivorSpaceUsed((Double)value); + setJvmPoolSurvivorSpaceUsed((java.lang.Double)value); } break; @@ -447,7 +417,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetJvmPoolPermGenUsed(); } else { - setJvmPoolPermGenUsed((Double)value); + setJvmPoolPermGenUsed((java.lang.Double)value); } break; @@ -455,47 +425,47 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetJvmPoolMetaspaceUsed(); } else { - setJvmPoolMetaspaceUsed((Double)value); + setJvmPoolMetaspaceUsed((java.lang.Double)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case JVM_GC_NEW_COUNT: - return Long.valueOf(getJvmGcNewCount()); + return getJvmGcNewCount(); case JVM_GC_NEW_TIME: - return Long.valueOf(getJvmGcNewTime()); + return getJvmGcNewTime(); case JVM_POOL_CODE_CACHE_USED: - return Double.valueOf(getJvmPoolCodeCacheUsed()); + return getJvmPoolCodeCacheUsed(); case JVM_POOL_NEW_GEN_USED: - return Double.valueOf(getJvmPoolNewGenUsed()); + return getJvmPoolNewGenUsed(); case JVM_POOL_OLD_GEN_USED: - return Double.valueOf(getJvmPoolOldGenUsed()); + return getJvmPoolOldGenUsed(); case JVM_POOL_SURVIVOR_SPACE_USED: - return Double.valueOf(getJvmPoolSurvivorSpaceUsed()); + return getJvmPoolSurvivorSpaceUsed(); case JVM_POOL_PERM_GEN_USED: - return Double.valueOf(getJvmPoolPermGenUsed()); + return getJvmPoolPermGenUsed(); case JVM_POOL_METASPACE_USED: - return Double.valueOf(getJvmPoolMetaspaceUsed()); + return getJvmPoolMetaspaceUsed(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -516,11 +486,11 @@ public boolean isSet(_Fields field) { case JVM_POOL_METASPACE_USED: return isSetJvmPoolMetaspaceUsed(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TFJvmGcDetailed) @@ -531,6 +501,8 @@ public boolean equals(Object that) { public boolean equals(TFJvmGcDetailed that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_jvmGcNewCount = true && this.isSetJvmGcNewCount(); boolean that_present_jvmGcNewCount = true && that.isSetJvmGcNewCount(); @@ -609,49 +581,41 @@ public boolean equals(TFJvmGcDetailed that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_jvmGcNewCount = true && (isSetJvmGcNewCount()); - list.add(present_jvmGcNewCount); - if (present_jvmGcNewCount) - list.add(jvmGcNewCount); + hashCode = hashCode * 8191 + ((isSetJvmGcNewCount()) ? 131071 : 524287); + if (isSetJvmGcNewCount()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(jvmGcNewCount); - boolean present_jvmGcNewTime = true && (isSetJvmGcNewTime()); - list.add(present_jvmGcNewTime); - if (present_jvmGcNewTime) - list.add(jvmGcNewTime); + hashCode = hashCode * 8191 + ((isSetJvmGcNewTime()) ? 131071 : 524287); + if (isSetJvmGcNewTime()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(jvmGcNewTime); - boolean present_jvmPoolCodeCacheUsed = true && (isSetJvmPoolCodeCacheUsed()); - list.add(present_jvmPoolCodeCacheUsed); - if (present_jvmPoolCodeCacheUsed) - list.add(jvmPoolCodeCacheUsed); + hashCode = hashCode * 8191 + ((isSetJvmPoolCodeCacheUsed()) ? 131071 : 524287); + if (isSetJvmPoolCodeCacheUsed()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(jvmPoolCodeCacheUsed); - boolean present_jvmPoolNewGenUsed = true && (isSetJvmPoolNewGenUsed()); - list.add(present_jvmPoolNewGenUsed); - if (present_jvmPoolNewGenUsed) - list.add(jvmPoolNewGenUsed); + hashCode = hashCode * 8191 + ((isSetJvmPoolNewGenUsed()) ? 131071 : 524287); + if (isSetJvmPoolNewGenUsed()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(jvmPoolNewGenUsed); - boolean present_jvmPoolOldGenUsed = true && (isSetJvmPoolOldGenUsed()); - list.add(present_jvmPoolOldGenUsed); - if (present_jvmPoolOldGenUsed) - list.add(jvmPoolOldGenUsed); + hashCode = hashCode * 8191 + ((isSetJvmPoolOldGenUsed()) ? 131071 : 524287); + if (isSetJvmPoolOldGenUsed()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(jvmPoolOldGenUsed); - boolean present_jvmPoolSurvivorSpaceUsed = true && (isSetJvmPoolSurvivorSpaceUsed()); - list.add(present_jvmPoolSurvivorSpaceUsed); - if (present_jvmPoolSurvivorSpaceUsed) - list.add(jvmPoolSurvivorSpaceUsed); + hashCode = hashCode * 8191 + ((isSetJvmPoolSurvivorSpaceUsed()) ? 131071 : 524287); + if (isSetJvmPoolSurvivorSpaceUsed()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(jvmPoolSurvivorSpaceUsed); - boolean present_jvmPoolPermGenUsed = true && (isSetJvmPoolPermGenUsed()); - list.add(present_jvmPoolPermGenUsed); - if (present_jvmPoolPermGenUsed) - list.add(jvmPoolPermGenUsed); + hashCode = hashCode * 8191 + ((isSetJvmPoolPermGenUsed()) ? 131071 : 524287); + if (isSetJvmPoolPermGenUsed()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(jvmPoolPermGenUsed); - boolean present_jvmPoolMetaspaceUsed = true && (isSetJvmPoolMetaspaceUsed()); - list.add(present_jvmPoolMetaspaceUsed); - if (present_jvmPoolMetaspaceUsed) - list.add(jvmPoolMetaspaceUsed); + hashCode = hashCode * 8191 + ((isSetJvmPoolMetaspaceUsed()) ? 131071 : 524287); + if (isSetJvmPoolMetaspaceUsed()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(jvmPoolMetaspaceUsed); - return list.hashCode(); + return hashCode; } @Override @@ -662,7 +626,7 @@ public int compareTo(TFJvmGcDetailed other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetJvmGcNewCount()).compareTo(other.isSetJvmGcNewCount()); + lastComparison = java.lang.Boolean.valueOf(isSetJvmGcNewCount()).compareTo(other.isSetJvmGcNewCount()); if (lastComparison != 0) { return lastComparison; } @@ -672,7 +636,7 @@ public int compareTo(TFJvmGcDetailed other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetJvmGcNewTime()).compareTo(other.isSetJvmGcNewTime()); + lastComparison = java.lang.Boolean.valueOf(isSetJvmGcNewTime()).compareTo(other.isSetJvmGcNewTime()); if (lastComparison != 0) { return lastComparison; } @@ -682,7 +646,7 @@ public int compareTo(TFJvmGcDetailed other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetJvmPoolCodeCacheUsed()).compareTo(other.isSetJvmPoolCodeCacheUsed()); + lastComparison = java.lang.Boolean.valueOf(isSetJvmPoolCodeCacheUsed()).compareTo(other.isSetJvmPoolCodeCacheUsed()); if (lastComparison != 0) { return lastComparison; } @@ -692,7 +656,7 @@ public int compareTo(TFJvmGcDetailed other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetJvmPoolNewGenUsed()).compareTo(other.isSetJvmPoolNewGenUsed()); + lastComparison = java.lang.Boolean.valueOf(isSetJvmPoolNewGenUsed()).compareTo(other.isSetJvmPoolNewGenUsed()); if (lastComparison != 0) { return lastComparison; } @@ -702,7 +666,7 @@ public int compareTo(TFJvmGcDetailed other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetJvmPoolOldGenUsed()).compareTo(other.isSetJvmPoolOldGenUsed()); + lastComparison = java.lang.Boolean.valueOf(isSetJvmPoolOldGenUsed()).compareTo(other.isSetJvmPoolOldGenUsed()); if (lastComparison != 0) { return lastComparison; } @@ -712,7 +676,7 @@ public int compareTo(TFJvmGcDetailed other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetJvmPoolSurvivorSpaceUsed()).compareTo(other.isSetJvmPoolSurvivorSpaceUsed()); + lastComparison = java.lang.Boolean.valueOf(isSetJvmPoolSurvivorSpaceUsed()).compareTo(other.isSetJvmPoolSurvivorSpaceUsed()); if (lastComparison != 0) { return lastComparison; } @@ -722,7 +686,7 @@ public int compareTo(TFJvmGcDetailed other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetJvmPoolPermGenUsed()).compareTo(other.isSetJvmPoolPermGenUsed()); + lastComparison = java.lang.Boolean.valueOf(isSetJvmPoolPermGenUsed()).compareTo(other.isSetJvmPoolPermGenUsed()); if (lastComparison != 0) { return lastComparison; } @@ -732,7 +696,7 @@ public int compareTo(TFJvmGcDetailed other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetJvmPoolMetaspaceUsed()).compareTo(other.isSetJvmPoolMetaspaceUsed()); + lastComparison = java.lang.Boolean.valueOf(isSetJvmPoolMetaspaceUsed()).compareTo(other.isSetJvmPoolMetaspaceUsed()); if (lastComparison != 0) { return lastComparison; } @@ -749,17 +713,17 @@ public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } - public void read(org.apache.thrift.protocol.TProtocol iprot) throws TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); } - public void write(org.apache.thrift.protocol.TProtocol oprot) throws TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFJvmGcDetailed("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFJvmGcDetailed("); boolean first = true; if (isSetJvmGcNewCount()) { @@ -813,7 +777,7 @@ public String toString() { return sb.toString(); } - public void validate() throws TException { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -821,36 +785,36 @@ public void validate() throws TException { private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private static class TFJvmGcDetailedStandardSchemeFactory implements SchemeFactory { + private static class TFJvmGcDetailedStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFJvmGcDetailedStandardScheme getScheme() { return new TFJvmGcDetailedStandardScheme(); } } - private static class TFJvmGcDetailedStandardScheme extends StandardScheme { + private static class TFJvmGcDetailedStandardScheme extends org.apache.thrift.scheme.StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGcDetailed struct) throws TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGcDetailed struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -858,7 +822,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGcDetailed str if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.jvmGcNewCount = iprot.readI64(); struct.setJvmGcNewCountIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -866,7 +830,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGcDetailed str if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.jvmGcNewTime = iprot.readI64(); struct.setJvmGcNewTimeIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -874,7 +838,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGcDetailed str if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { struct.jvmPoolCodeCacheUsed = iprot.readDouble(); struct.setJvmPoolCodeCacheUsedIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -882,7 +846,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGcDetailed str if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { struct.jvmPoolNewGenUsed = iprot.readDouble(); struct.setJvmPoolNewGenUsedIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -890,7 +854,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGcDetailed str if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { struct.jvmPoolOldGenUsed = iprot.readDouble(); struct.setJvmPoolOldGenUsedIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -898,7 +862,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGcDetailed str if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { struct.jvmPoolSurvivorSpaceUsed = iprot.readDouble(); struct.setJvmPoolSurvivorSpaceUsedIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -906,7 +870,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGcDetailed str if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { struct.jvmPoolPermGenUsed = iprot.readDouble(); struct.setJvmPoolPermGenUsedIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -914,7 +878,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGcDetailed str if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { struct.jvmPoolMetaspaceUsed = iprot.readDouble(); struct.setJvmPoolMetaspaceUsedIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -927,7 +891,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmGcDetailed str struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, TFJvmGcDetailed struct) throws TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, TFJvmGcDetailed struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -977,18 +941,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFJvmGcDetailed st } - private static class TFJvmGcDetailedTupleSchemeFactory implements SchemeFactory { + private static class TFJvmGcDetailedTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFJvmGcDetailedTupleScheme getScheme() { return new TFJvmGcDetailedTupleScheme(); } } - private static class TFJvmGcDetailedTupleScheme extends TupleScheme { + private static class TFJvmGcDetailedTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFJvmGcDetailed struct) throws TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + public void write(org.apache.thrift.protocol.TProtocol prot, TFJvmGcDetailed struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetJvmGcNewCount()) { optionals.set(0); } @@ -1041,9 +1005,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFJvmGcDetailed str } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFJvmGcDetailed struct) throws TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(8); + public void read(org.apache.thrift.protocol.TProtocol prot, TFJvmGcDetailed struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(8); if (incoming.get(0)) { struct.jvmGcNewCount = iprot.readI64(); struct.setJvmGcNewCountIsSet(true); @@ -1079,5 +1043,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFJvmGcDetailed stru } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFJvmGcType.java b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFJvmGcType.java index f2af927685a8..78d89f982fab 100644 --- a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFJvmGcType.java +++ b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFJvmGcType.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.9.2) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -7,9 +7,11 @@ package com.navercorp.pinpoint.thrift.dto.flink; +import java.util.Map; +import java.util.HashMap; import org.apache.thrift.TEnum; -public enum TFJvmGcType implements TEnum { +public enum TFJvmGcType implements org.apache.thrift.TEnum { UNKNOWN(0), SERIAL(1), PARALLEL(2), diff --git a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFJvmInfo.java b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFJvmInfo.java index 197bc1bbd662..93d8c0a8b794 100644 --- a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFJvmInfo.java +++ b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFJvmInfo.java @@ -1,32 +1,13 @@ /** - * Autogenerated by Thrift Compiler (0.9.2) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.navercorp.pinpoint.thrift.dto.flink; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-3-31") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-09-06") public class TFJvmInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFJvmInfo"); @@ -34,14 +15,11 @@ public class TFJvmInfo implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFJvmInfoStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFJvmInfoTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFJvmInfoStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFJvmInfoTupleSchemeFactory(); private short version; // required - private String vmVersion; // optional + private java.lang.String vmVersion; // optional private TFJvmGcType gcType; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -54,10 +32,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { */ GC_TYPE((short)3, "gcType"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -84,21 +62,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -107,7 +85,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -115,17 +93,17 @@ public String getFieldName() { // isset id assignments private static final int __VERSION_ISSET_ID = 0; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.VM_VERSION, _Fields.GC_TYPE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + private static final _Fields optionals[] = {_Fields.VM_VERSION,_Fields.GC_TYPE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); tmpMap.put(_Fields.VM_VERSION, new org.apache.thrift.meta_data.FieldMetaData("vmVersion", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.GC_TYPE, new org.apache.thrift.meta_data.FieldMetaData("gcType", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TFJvmGcType.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFJvmInfo.class, metaDataMap); } @@ -181,23 +159,23 @@ public void setVersion(short version) { } public void unsetVersion() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VERSION_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VERSION_ISSET_ID); } /** Returns true if field version is set (has been assigned a value) and false otherwise */ public boolean isSetVersion() { - return EncodingUtils.testBit(__isset_bitfield, __VERSION_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VERSION_ISSET_ID); } public void setVersionIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VERSION_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VERSION_ISSET_ID, value); } - public String getVmVersion() { + public java.lang.String getVmVersion() { return this.vmVersion; } - public void setVmVersion(String vmVersion) { + public void setVmVersion(java.lang.String vmVersion) { this.vmVersion = vmVersion; } @@ -247,13 +225,13 @@ public void setGcTypeIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case VERSION: if (value == null) { unsetVersion(); } else { - setVersion((Short)value); + setVersion((java.lang.Short)value); } break; @@ -261,7 +239,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetVmVersion(); } else { - setVmVersion((String)value); + setVmVersion((java.lang.String)value); } break; @@ -276,10 +254,10 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VERSION: - return Short.valueOf(getVersion()); + return getVersion(); case VM_VERSION: return getVmVersion(); @@ -288,13 +266,13 @@ public Object getFieldValue(_Fields field) { return getGcType(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -305,11 +283,11 @@ public boolean isSet(_Fields field) { case GC_TYPE: return isSetGcType(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TFJvmInfo) @@ -320,6 +298,8 @@ public boolean equals(Object that) { public boolean equals(TFJvmInfo that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_version = true; boolean that_present_version = true; @@ -353,24 +333,19 @@ public boolean equals(TFJvmInfo that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_version = true; - list.add(present_version); - if (present_version) - list.add(version); + hashCode = hashCode * 8191 + version; - boolean present_vmVersion = true && (isSetVmVersion()); - list.add(present_vmVersion); - if (present_vmVersion) - list.add(vmVersion); + hashCode = hashCode * 8191 + ((isSetVmVersion()) ? 131071 : 524287); + if (isSetVmVersion()) + hashCode = hashCode * 8191 + vmVersion.hashCode(); - boolean present_gcType = true && (isSetGcType()); - list.add(present_gcType); - if (present_gcType) - list.add(gcType.getValue()); + hashCode = hashCode * 8191 + ((isSetGcType()) ? 131071 : 524287); + if (isSetGcType()) + hashCode = hashCode * 8191 + gcType.getValue(); - return list.hashCode(); + return hashCode; } @Override @@ -381,7 +356,7 @@ public int compareTo(TFJvmInfo other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); + lastComparison = java.lang.Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); if (lastComparison != 0) { return lastComparison; } @@ -391,7 +366,7 @@ public int compareTo(TFJvmInfo other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetVmVersion()).compareTo(other.isSetVmVersion()); + lastComparison = java.lang.Boolean.valueOf(isSetVmVersion()).compareTo(other.isSetVmVersion()); if (lastComparison != 0) { return lastComparison; } @@ -401,7 +376,7 @@ public int compareTo(TFJvmInfo other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetGcType()).compareTo(other.isSetGcType()); + lastComparison = java.lang.Boolean.valueOf(isSetGcType()).compareTo(other.isSetGcType()); if (lastComparison != 0) { return lastComparison; } @@ -418,17 +393,17 @@ public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } - public void read(org.apache.thrift.protocol.TProtocol iprot) throws TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); } - public void write(org.apache.thrift.protocol.TProtocol oprot) throws TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFJvmInfo("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFJvmInfo("); boolean first = true; sb.append("version:"); @@ -458,7 +433,7 @@ public String toString() { return sb.toString(); } - public void validate() throws TException { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -466,36 +441,36 @@ public void validate() throws TException { private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private static class TFJvmInfoStandardSchemeFactory implements SchemeFactory { + private static class TFJvmInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFJvmInfoStandardScheme getScheme() { return new TFJvmInfoStandardScheme(); } } - private static class TFJvmInfoStandardScheme extends StandardScheme { + private static class TFJvmInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmInfo struct) throws TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -503,7 +478,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmInfo struct) t if (schemeField.type == org.apache.thrift.protocol.TType.I16) { struct.version = iprot.readI16(); struct.setVersionIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -511,7 +486,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmInfo struct) t if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.vmVersion = iprot.readString(); struct.setVmVersionIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -519,7 +494,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmInfo struct) t if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.gcType = com.navercorp.pinpoint.thrift.dto.flink.TFJvmGcType.findByValue(iprot.readI32()); struct.setGcTypeIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -532,7 +507,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFJvmInfo struct) t struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, TFJvmInfo struct) throws TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, TFJvmInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -559,18 +534,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFJvmInfo struct) } - private static class TFJvmInfoTupleSchemeFactory implements SchemeFactory { + private static class TFJvmInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFJvmInfoTupleScheme getScheme() { return new TFJvmInfoTupleScheme(); } } - private static class TFJvmInfoTupleScheme extends TupleScheme { + private static class TFJvmInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFJvmInfo struct) throws TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + public void write(org.apache.thrift.protocol.TProtocol prot, TFJvmInfo struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetVersion()) { optionals.set(0); } @@ -593,9 +568,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFJvmInfo struct) t } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFJvmInfo struct) throws TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); + public void read(org.apache.thrift.protocol.TProtocol prot, TFJvmInfo struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.version = iprot.readI16(); struct.setVersionIsSet(true); @@ -611,5 +586,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFJvmInfo struct) th } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFResponseTime.java b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFResponseTime.java new file mode 100644 index 000000000000..7e2366bfe489 --- /dev/null +++ b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFResponseTime.java @@ -0,0 +1,366 @@ +/** + * Autogenerated by Thrift Compiler (0.10.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.navercorp.pinpoint.thrift.dto.flink; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-09-06") +public class TFResponseTime implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFResponseTime"); + + private static final org.apache.thrift.protocol.TField AVG_FIELD_DESC = new org.apache.thrift.protocol.TField("avg", org.apache.thrift.protocol.TType.I64, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFResponseTimeStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFResponseTimeTupleSchemeFactory(); + + private long avg; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + AVG((short)1, "avg"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // AVG + return AVG; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __AVG_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.AVG}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.AVG, new org.apache.thrift.meta_data.FieldMetaData("avg", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFResponseTime.class, metaDataMap); + } + + public TFResponseTime() { + this.avg = 0L; + + } + + /** + * Performs a deep copy on other. + */ + public TFResponseTime(TFResponseTime other) { + __isset_bitfield = other.__isset_bitfield; + this.avg = other.avg; + } + + public TFResponseTime deepCopy() { + return new TFResponseTime(this); + } + + @Override + public void clear() { + this.avg = 0L; + + } + + public long getAvg() { + return this.avg; + } + + public void setAvg(long avg) { + this.avg = avg; + setAvgIsSet(true); + } + + public void unsetAvg() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __AVG_ISSET_ID); + } + + /** Returns true if field avg is set (has been assigned a value) and false otherwise */ + public boolean isSetAvg() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __AVG_ISSET_ID); + } + + public void setAvgIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __AVG_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, java.lang.Object value) { + switch (field) { + case AVG: + if (value == null) { + unsetAvg(); + } else { + setAvg((java.lang.Long)value); + } + break; + + } + } + + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case AVG: + return getAvg(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case AVG: + return isSetAvg(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TFResponseTime) + return this.equals((TFResponseTime)that); + return false; + } + + public boolean equals(TFResponseTime that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_avg = true && this.isSetAvg(); + boolean that_present_avg = true && that.isSetAvg(); + if (this_present_avg || that_present_avg) { + if (!(this_present_avg && that_present_avg)) + return false; + if (this.avg != that.avg) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetAvg()) ? 131071 : 524287); + if (isSetAvg()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(avg); + + return hashCode; + } + + @Override + public int compareTo(TFResponseTime other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetAvg()).compareTo(other.isSetAvg()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAvg()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.avg, other.avg); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFResponseTime("); + boolean first = true; + + if (isSetAvg()) { + sb.append("avg:"); + sb.append(this.avg); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class TFResponseTimeStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TFResponseTimeStandardScheme getScheme() { + return new TFResponseTimeStandardScheme(); + } + } + + private static class TFResponseTimeStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TFResponseTime struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // AVG + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.avg = iprot.readI64(); + struct.setAvgIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, TFResponseTime struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetAvg()) { + oprot.writeFieldBegin(AVG_FIELD_DESC); + oprot.writeI64(struct.avg); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TFResponseTimeTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TFResponseTimeTupleScheme getScheme() { + return new TFResponseTimeTupleScheme(); + } + } + + private static class TFResponseTimeTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TFResponseTime struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetAvg()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetAvg()) { + oprot.writeI64(struct.avg); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TFResponseTime struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.avg = iprot.readI64(); + struct.setAvgIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFServerMetaData.java b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFServerMetaData.java index e541d485c97d..bd0312844c1e 100644 --- a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFServerMetaData.java +++ b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFServerMetaData.java @@ -1,39 +1,13 @@ -/* - * Copyright 2017 NAVER Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - /** - * Autogenerated by Thrift Compiler (0.9.2) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.navercorp.pinpoint.thrift.dto.flink; -import org.apache.thrift.TException; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; -import org.apache.thrift.scheme.TupleScheme; - -import javax.annotation.Generated; -import java.util.*; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-3-31") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-09-06") public class TFServerMetaData implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFServerMetaData"); @@ -41,15 +15,12 @@ public class TFServerMetaData implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFServerMetaDataStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFServerMetaDataTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFServerMetaDataStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFServerMetaDataTupleSchemeFactory(); - private String serverInfo; // optional - private List vmArgs; // optional - private List serviceInfos; // optional + private java.lang.String serverInfo; // optional + private java.util.List vmArgs; // optional + private java.util.List serviceInfos; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -57,10 +28,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { VM_ARGS((short)2, "vmArgs"), SERVICE_INFOS((short)10, "serviceInfos"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -87,21 +58,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -110,16 +81,16 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - private static final _Fields optionals[] = {_Fields.SERVER_INFO, _Fields.VM_ARGS, _Fields.SERVICE_INFOS}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + private static final _Fields optionals[] = {_Fields.SERVER_INFO,_Fields.VM_ARGS,_Fields.SERVICE_INFOS}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SERVER_INFO, new org.apache.thrift.meta_data.FieldMetaData("serverInfo", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.VM_ARGS, new org.apache.thrift.meta_data.FieldMetaData("vmArgs", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -128,7 +99,7 @@ public String getFieldName() { tmpMap.put(_Fields.SERVICE_INFOS, new org.apache.thrift.meta_data.FieldMetaData("serviceInfos", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TFServiceInfo.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFServerMetaData.class, metaDataMap); } @@ -143,11 +114,11 @@ public TFServerMetaData(TFServerMetaData other) { this.serverInfo = other.serverInfo; } if (other.isSetVmArgs()) { - List __this__vmArgs = new ArrayList(other.vmArgs); + java.util.List __this__vmArgs = new java.util.ArrayList(other.vmArgs); this.vmArgs = __this__vmArgs; } if (other.isSetServiceInfos()) { - List __this__serviceInfos = new ArrayList(other.serviceInfos.size()); + java.util.List __this__serviceInfos = new java.util.ArrayList(other.serviceInfos.size()); for (TFServiceInfo other_element : other.serviceInfos) { __this__serviceInfos.add(new TFServiceInfo(other_element)); } @@ -166,11 +137,11 @@ public void clear() { this.serviceInfos = null; } - public String getServerInfo() { + public java.lang.String getServerInfo() { return this.serverInfo; } - public void setServerInfo(String serverInfo) { + public void setServerInfo(java.lang.String serverInfo) { this.serverInfo = serverInfo; } @@ -193,22 +164,22 @@ public int getVmArgsSize() { return (this.vmArgs == null) ? 0 : this.vmArgs.size(); } - public java.util.Iterator getVmArgsIterator() { + public java.util.Iterator getVmArgsIterator() { return (this.vmArgs == null) ? null : this.vmArgs.iterator(); } - public void addToVmArgs(String elem) { + public void addToVmArgs(java.lang.String elem) { if (this.vmArgs == null) { - this.vmArgs = new ArrayList(); + this.vmArgs = new java.util.ArrayList(); } this.vmArgs.add(elem); } - public List getVmArgs() { + public java.util.List getVmArgs() { return this.vmArgs; } - public void setVmArgs(List vmArgs) { + public void setVmArgs(java.util.List vmArgs) { this.vmArgs = vmArgs; } @@ -237,16 +208,16 @@ public java.util.Iterator getServiceInfosIterator() { public void addToServiceInfos(TFServiceInfo elem) { if (this.serviceInfos == null) { - this.serviceInfos = new ArrayList(); + this.serviceInfos = new java.util.ArrayList(); } this.serviceInfos.add(elem); } - public List getServiceInfos() { + public java.util.List getServiceInfos() { return this.serviceInfos; } - public void setServiceInfos(List serviceInfos) { + public void setServiceInfos(java.util.List serviceInfos) { this.serviceInfos = serviceInfos; } @@ -265,13 +236,13 @@ public void setServiceInfosIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case SERVER_INFO: if (value == null) { unsetServerInfo(); } else { - setServerInfo((String)value); + setServerInfo((java.lang.String)value); } break; @@ -279,7 +250,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetVmArgs(); } else { - setVmArgs((List)value); + setVmArgs((java.util.List)value); } break; @@ -287,14 +258,14 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetServiceInfos(); } else { - setServiceInfos((List)value); + setServiceInfos((java.util.List)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SERVER_INFO: return getServerInfo(); @@ -306,13 +277,13 @@ public Object getFieldValue(_Fields field) { return getServiceInfos(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -323,11 +294,11 @@ public boolean isSet(_Fields field) { case SERVICE_INFOS: return isSetServiceInfos(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TFServerMetaData) @@ -338,6 +309,8 @@ public boolean equals(Object that) { public boolean equals(TFServerMetaData that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_serverInfo = true && this.isSetServerInfo(); boolean that_present_serverInfo = true && that.isSetServerInfo(); @@ -371,24 +344,21 @@ public boolean equals(TFServerMetaData that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_serverInfo = true && (isSetServerInfo()); - list.add(present_serverInfo); - if (present_serverInfo) - list.add(serverInfo); + hashCode = hashCode * 8191 + ((isSetServerInfo()) ? 131071 : 524287); + if (isSetServerInfo()) + hashCode = hashCode * 8191 + serverInfo.hashCode(); - boolean present_vmArgs = true && (isSetVmArgs()); - list.add(present_vmArgs); - if (present_vmArgs) - list.add(vmArgs); + hashCode = hashCode * 8191 + ((isSetVmArgs()) ? 131071 : 524287); + if (isSetVmArgs()) + hashCode = hashCode * 8191 + vmArgs.hashCode(); - boolean present_serviceInfos = true && (isSetServiceInfos()); - list.add(present_serviceInfos); - if (present_serviceInfos) - list.add(serviceInfos); + hashCode = hashCode * 8191 + ((isSetServiceInfos()) ? 131071 : 524287); + if (isSetServiceInfos()) + hashCode = hashCode * 8191 + serviceInfos.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -399,7 +369,7 @@ public int compareTo(TFServerMetaData other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetServerInfo()).compareTo(other.isSetServerInfo()); + lastComparison = java.lang.Boolean.valueOf(isSetServerInfo()).compareTo(other.isSetServerInfo()); if (lastComparison != 0) { return lastComparison; } @@ -409,7 +379,7 @@ public int compareTo(TFServerMetaData other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetVmArgs()).compareTo(other.isSetVmArgs()); + lastComparison = java.lang.Boolean.valueOf(isSetVmArgs()).compareTo(other.isSetVmArgs()); if (lastComparison != 0) { return lastComparison; } @@ -419,7 +389,7 @@ public int compareTo(TFServerMetaData other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetServiceInfos()).compareTo(other.isSetServiceInfos()); + lastComparison = java.lang.Boolean.valueOf(isSetServiceInfos()).compareTo(other.isSetServiceInfos()); if (lastComparison != 0) { return lastComparison; } @@ -436,17 +406,17 @@ public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } - public void read(org.apache.thrift.protocol.TProtocol iprot) throws TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); } - public void write(org.apache.thrift.protocol.TProtocol oprot) throws TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFServerMetaData("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFServerMetaData("); boolean first = true; if (isSetServerInfo()) { @@ -482,7 +452,7 @@ public String toString() { return sb.toString(); } - public void validate() throws TException { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -490,34 +460,34 @@ public void validate() throws TException { private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private static class TFServerMetaDataStandardSchemeFactory implements SchemeFactory { + private static class TFServerMetaDataStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFServerMetaDataStandardScheme getScheme() { return new TFServerMetaDataStandardScheme(); } } - private static class TFServerMetaDataStandardScheme extends StandardScheme { + private static class TFServerMetaDataStandardScheme extends org.apache.thrift.scheme.StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, TFServerMetaData struct) throws TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, TFServerMetaData struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -525,7 +495,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFServerMetaData st if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.serverInfo = iprot.readString(); struct.setServerInfoIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -533,8 +503,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFServerMetaData st if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); - struct.vmArgs = new ArrayList(_list8.size); - String _elem9; + struct.vmArgs = new java.util.ArrayList(_list8.size); + java.lang.String _elem9; for (int _i10 = 0; _i10 < _list8.size; ++_i10) { _elem9 = iprot.readString(); @@ -543,7 +513,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFServerMetaData st iprot.readListEnd(); } struct.setVmArgsIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -551,7 +521,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFServerMetaData st if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list11 = iprot.readListBegin(); - struct.serviceInfos = new ArrayList(_list11.size); + struct.serviceInfos = new java.util.ArrayList(_list11.size); TFServiceInfo _elem12; for (int _i13 = 0; _i13 < _list11.size; ++_i13) { @@ -562,7 +532,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFServerMetaData st iprot.readListEnd(); } struct.setServiceInfosIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -575,7 +545,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFServerMetaData st struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, TFServerMetaData struct) throws TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, TFServerMetaData struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -591,7 +561,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFServerMetaData s oprot.writeFieldBegin(VM_ARGS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.vmArgs.size())); - for (String _iter14 : struct.vmArgs) + for (java.lang.String _iter14 : struct.vmArgs) { oprot.writeString(_iter14); } @@ -620,18 +590,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFServerMetaData s } - private static class TFServerMetaDataTupleSchemeFactory implements SchemeFactory { + private static class TFServerMetaDataTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFServerMetaDataTupleScheme getScheme() { return new TFServerMetaDataTupleScheme(); } } - private static class TFServerMetaDataTupleScheme extends TupleScheme { + private static class TFServerMetaDataTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFServerMetaData struct) throws TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + public void write(org.apache.thrift.protocol.TProtocol prot, TFServerMetaData struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetServerInfo()) { optionals.set(0); } @@ -648,7 +618,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFServerMetaData st if (struct.isSetVmArgs()) { { oprot.writeI32(struct.vmArgs.size()); - for (String _iter16 : struct.vmArgs) + for (java.lang.String _iter16 : struct.vmArgs) { oprot.writeString(_iter16); } @@ -666,9 +636,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFServerMetaData st } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFServerMetaData struct) throws TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); + public void read(org.apache.thrift.protocol.TProtocol prot, TFServerMetaData struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.serverInfo = iprot.readString(); struct.setServerInfoIsSet(true); @@ -676,8 +646,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFServerMetaData str if (incoming.get(1)) { { org.apache.thrift.protocol.TList _list18 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.vmArgs = new ArrayList(_list18.size); - String _elem19; + struct.vmArgs = new java.util.ArrayList(_list18.size); + java.lang.String _elem19; for (int _i20 = 0; _i20 < _list18.size; ++_i20) { _elem19 = iprot.readString(); @@ -689,7 +659,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFServerMetaData str if (incoming.get(2)) { { org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.serviceInfos = new ArrayList(_list21.size); + struct.serviceInfos = new java.util.ArrayList(_list21.size); TFServiceInfo _elem22; for (int _i23 = 0; _i23 < _list21.size; ++_i23) { @@ -703,5 +673,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFServerMetaData str } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFServiceInfo.java b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFServiceInfo.java index 882d02d68622..983e92c3c3c6 100644 --- a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFServiceInfo.java +++ b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFServiceInfo.java @@ -1,55 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.2) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.navercorp.pinpoint.thrift.dto.flink; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.TException; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-3-31") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-09-06") public class TFServiceInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFServiceInfo"); private static final org.apache.thrift.protocol.TField SERVICE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceName", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField SERVICE_LIBS_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceLibs", org.apache.thrift.protocol.TType.LIST, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFServiceInfoStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFServiceInfoTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFServiceInfoStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFServiceInfoTupleSchemeFactory(); - private String serviceName; // optional - private List serviceLibs; // optional + private java.lang.String serviceName; // optional + private java.util.List serviceLibs; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SERVICE_NAME((short)1, "serviceName"), SERVICE_LIBS((short)2, "serviceLibs"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -74,21 +53,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -97,22 +76,22 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - private static final _Fields optionals[] = {_Fields.SERVICE_NAME, _Fields.SERVICE_LIBS}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + private static final _Fields optionals[] = {_Fields.SERVICE_NAME,_Fields.SERVICE_LIBS}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SERVICE_NAME, new org.apache.thrift.meta_data.FieldMetaData("serviceName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.SERVICE_LIBS, new org.apache.thrift.meta_data.FieldMetaData("serviceLibs", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFServiceInfo.class, metaDataMap); } @@ -127,7 +106,7 @@ public TFServiceInfo(TFServiceInfo other) { this.serviceName = other.serviceName; } if (other.isSetServiceLibs()) { - List __this__serviceLibs = new ArrayList(other.serviceLibs); + java.util.List __this__serviceLibs = new java.util.ArrayList(other.serviceLibs); this.serviceLibs = __this__serviceLibs; } } @@ -142,11 +121,11 @@ public void clear() { this.serviceLibs = null; } - public String getServiceName() { + public java.lang.String getServiceName() { return this.serviceName; } - public void setServiceName(String serviceName) { + public void setServiceName(java.lang.String serviceName) { this.serviceName = serviceName; } @@ -169,22 +148,22 @@ public int getServiceLibsSize() { return (this.serviceLibs == null) ? 0 : this.serviceLibs.size(); } - public java.util.Iterator getServiceLibsIterator() { + public java.util.Iterator getServiceLibsIterator() { return (this.serviceLibs == null) ? null : this.serviceLibs.iterator(); } - public void addToServiceLibs(String elem) { + public void addToServiceLibs(java.lang.String elem) { if (this.serviceLibs == null) { - this.serviceLibs = new ArrayList(); + this.serviceLibs = new java.util.ArrayList(); } this.serviceLibs.add(elem); } - public List getServiceLibs() { + public java.util.List getServiceLibs() { return this.serviceLibs; } - public void setServiceLibs(List serviceLibs) { + public void setServiceLibs(java.util.List serviceLibs) { this.serviceLibs = serviceLibs; } @@ -203,13 +182,13 @@ public void setServiceLibsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case SERVICE_NAME: if (value == null) { unsetServiceName(); } else { - setServiceName((String)value); + setServiceName((java.lang.String)value); } break; @@ -217,14 +196,14 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetServiceLibs(); } else { - setServiceLibs((List)value); + setServiceLibs((java.util.List)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SERVICE_NAME: return getServiceName(); @@ -233,13 +212,13 @@ public Object getFieldValue(_Fields field) { return getServiceLibs(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -248,11 +227,11 @@ public boolean isSet(_Fields field) { case SERVICE_LIBS: return isSetServiceLibs(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TFServiceInfo) @@ -263,6 +242,8 @@ public boolean equals(Object that) { public boolean equals(TFServiceInfo that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_serviceName = true && this.isSetServiceName(); boolean that_present_serviceName = true && that.isSetServiceName(); @@ -287,19 +268,17 @@ public boolean equals(TFServiceInfo that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_serviceName = true && (isSetServiceName()); - list.add(present_serviceName); - if (present_serviceName) - list.add(serviceName); + hashCode = hashCode * 8191 + ((isSetServiceName()) ? 131071 : 524287); + if (isSetServiceName()) + hashCode = hashCode * 8191 + serviceName.hashCode(); - boolean present_serviceLibs = true && (isSetServiceLibs()); - list.add(present_serviceLibs); - if (present_serviceLibs) - list.add(serviceLibs); + hashCode = hashCode * 8191 + ((isSetServiceLibs()) ? 131071 : 524287); + if (isSetServiceLibs()) + hashCode = hashCode * 8191 + serviceLibs.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -310,7 +289,7 @@ public int compareTo(TFServiceInfo other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetServiceName()).compareTo(other.isSetServiceName()); + lastComparison = java.lang.Boolean.valueOf(isSetServiceName()).compareTo(other.isSetServiceName()); if (lastComparison != 0) { return lastComparison; } @@ -320,7 +299,7 @@ public int compareTo(TFServiceInfo other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetServiceLibs()).compareTo(other.isSetServiceLibs()); + lastComparison = java.lang.Boolean.valueOf(isSetServiceLibs()).compareTo(other.isSetServiceLibs()); if (lastComparison != 0) { return lastComparison; } @@ -337,17 +316,17 @@ public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } - public void read(org.apache.thrift.protocol.TProtocol iprot) throws TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); } - public void write(org.apache.thrift.protocol.TProtocol oprot) throws TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFServiceInfo("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFServiceInfo("); boolean first = true; if (isSetServiceName()) { @@ -373,7 +352,7 @@ public String toString() { return sb.toString(); } - public void validate() throws TException { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -381,34 +360,34 @@ public void validate() throws TException { private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private static class TFServiceInfoStandardSchemeFactory implements SchemeFactory { + private static class TFServiceInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFServiceInfoStandardScheme getScheme() { return new TFServiceInfoStandardScheme(); } } - private static class TFServiceInfoStandardScheme extends StandardScheme { + private static class TFServiceInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, TFServiceInfo struct) throws TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, TFServiceInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -416,7 +395,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFServiceInfo struc if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.serviceName = iprot.readString(); struct.setServiceNameIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -424,8 +403,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFServiceInfo struc if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); - struct.serviceLibs = new ArrayList(_list0.size); - String _elem1; + struct.serviceLibs = new java.util.ArrayList(_list0.size); + java.lang.String _elem1; for (int _i2 = 0; _i2 < _list0.size; ++_i2) { _elem1 = iprot.readString(); @@ -434,7 +413,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFServiceInfo struc iprot.readListEnd(); } struct.setServiceLibsIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -447,7 +426,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFServiceInfo struc struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, TFServiceInfo struct) throws TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, TFServiceInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -463,7 +442,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFServiceInfo stru oprot.writeFieldBegin(SERVICE_LIBS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.serviceLibs.size())); - for (String _iter3 : struct.serviceLibs) + for (java.lang.String _iter3 : struct.serviceLibs) { oprot.writeString(_iter3); } @@ -478,18 +457,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFServiceInfo stru } - private static class TFServiceInfoTupleSchemeFactory implements SchemeFactory { + private static class TFServiceInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFServiceInfoTupleScheme getScheme() { return new TFServiceInfoTupleScheme(); } } - private static class TFServiceInfoTupleScheme extends TupleScheme { + private static class TFServiceInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFServiceInfo struct) throws TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + public void write(org.apache.thrift.protocol.TProtocol prot, TFServiceInfo struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetServiceName()) { optionals.set(0); } @@ -503,7 +482,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFServiceInfo struc if (struct.isSetServiceLibs()) { { oprot.writeI32(struct.serviceLibs.size()); - for (String _iter4 : struct.serviceLibs) + for (java.lang.String _iter4 : struct.serviceLibs) { oprot.writeString(_iter4); } @@ -512,9 +491,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFServiceInfo struc } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFServiceInfo struct) throws TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); + public void read(org.apache.thrift.protocol.TProtocol prot, TFServiceInfo struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.serviceName = iprot.readString(); struct.setServiceNameIsSet(true); @@ -522,8 +501,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFServiceInfo struct if (incoming.get(1)) { { org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.serviceLibs = new ArrayList(_list5.size); - String _elem6; + struct.serviceLibs = new java.util.ArrayList(_list5.size); + java.lang.String _elem6; for (int _i7 = 0; _i7 < _list5.size; ++_i7) { _elem6 = iprot.readString(); @@ -535,5 +514,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFServiceInfo struct } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFTransaction.java b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFTransaction.java index f5cf728e332c..4a73ec2466bd 100644 --- a/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFTransaction.java +++ b/thrift/src/main/java/com/navercorp/pinpoint/thrift/dto/flink/TFTransaction.java @@ -1,32 +1,13 @@ /** - * Autogenerated by Thrift Compiler (0.9.2) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.navercorp.pinpoint.thrift.dto.flink; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2017-3-31") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-09-06") public class TFTransaction implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFTransaction"); @@ -35,11 +16,8 @@ public class TFTransaction implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFTransactionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFTransactionTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFTransactionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFTransactionTupleSchemeFactory(); private long sampledNewCount; // optional private long sampledContinuationCount; // optional @@ -53,10 +31,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { UNSAMPLED_NEW_COUNT((short)4, "unsampledNewCount"), UNSAMPLED_CONTINUATION_COUNT((short)5, "unsampledContinuationCount"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -85,21 +63,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -108,7 +86,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -119,10 +97,10 @@ public String getFieldName() { private static final int __UNSAMPLEDNEWCOUNT_ISSET_ID = 2; private static final int __UNSAMPLEDCONTINUATIONCOUNT_ISSET_ID = 3; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.SAMPLED_NEW_COUNT, _Fields.SAMPLED_CONTINUATION_COUNT, _Fields.UNSAMPLED_NEW_COUNT, _Fields.UNSAMPLED_CONTINUATION_COUNT}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + private static final _Fields optionals[] = {_Fields.SAMPLED_NEW_COUNT,_Fields.SAMPLED_CONTINUATION_COUNT,_Fields.UNSAMPLED_NEW_COUNT,_Fields.UNSAMPLED_CONTINUATION_COUNT}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SAMPLED_NEW_COUNT, new org.apache.thrift.meta_data.FieldMetaData("sampledNewCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.SAMPLED_CONTINUATION_COUNT, new org.apache.thrift.meta_data.FieldMetaData("sampledContinuationCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -131,7 +109,7 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.UNSAMPLED_CONTINUATION_COUNT, new org.apache.thrift.meta_data.FieldMetaData("unsampledContinuationCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFTransaction.class, metaDataMap); } @@ -175,16 +153,16 @@ public void setSampledNewCount(long sampledNewCount) { } public void unsetSampledNewCount() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SAMPLEDNEWCOUNT_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SAMPLEDNEWCOUNT_ISSET_ID); } /** Returns true if field sampledNewCount is set (has been assigned a value) and false otherwise */ public boolean isSetSampledNewCount() { - return EncodingUtils.testBit(__isset_bitfield, __SAMPLEDNEWCOUNT_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SAMPLEDNEWCOUNT_ISSET_ID); } public void setSampledNewCountIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SAMPLEDNEWCOUNT_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SAMPLEDNEWCOUNT_ISSET_ID, value); } public long getSampledContinuationCount() { @@ -197,16 +175,16 @@ public void setSampledContinuationCount(long sampledContinuationCount) { } public void unsetSampledContinuationCount() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SAMPLEDCONTINUATIONCOUNT_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SAMPLEDCONTINUATIONCOUNT_ISSET_ID); } /** Returns true if field sampledContinuationCount is set (has been assigned a value) and false otherwise */ public boolean isSetSampledContinuationCount() { - return EncodingUtils.testBit(__isset_bitfield, __SAMPLEDCONTINUATIONCOUNT_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SAMPLEDCONTINUATIONCOUNT_ISSET_ID); } public void setSampledContinuationCountIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SAMPLEDCONTINUATIONCOUNT_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SAMPLEDCONTINUATIONCOUNT_ISSET_ID, value); } public long getUnsampledNewCount() { @@ -219,16 +197,16 @@ public void setUnsampledNewCount(long unsampledNewCount) { } public void unsetUnsampledNewCount() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UNSAMPLEDNEWCOUNT_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __UNSAMPLEDNEWCOUNT_ISSET_ID); } /** Returns true if field unsampledNewCount is set (has been assigned a value) and false otherwise */ public boolean isSetUnsampledNewCount() { - return EncodingUtils.testBit(__isset_bitfield, __UNSAMPLEDNEWCOUNT_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __UNSAMPLEDNEWCOUNT_ISSET_ID); } public void setUnsampledNewCountIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UNSAMPLEDNEWCOUNT_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __UNSAMPLEDNEWCOUNT_ISSET_ID, value); } public long getUnsampledContinuationCount() { @@ -241,25 +219,25 @@ public void setUnsampledContinuationCount(long unsampledContinuationCount) { } public void unsetUnsampledContinuationCount() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UNSAMPLEDCONTINUATIONCOUNT_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __UNSAMPLEDCONTINUATIONCOUNT_ISSET_ID); } /** Returns true if field unsampledContinuationCount is set (has been assigned a value) and false otherwise */ public boolean isSetUnsampledContinuationCount() { - return EncodingUtils.testBit(__isset_bitfield, __UNSAMPLEDCONTINUATIONCOUNT_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __UNSAMPLEDCONTINUATIONCOUNT_ISSET_ID); } public void setUnsampledContinuationCountIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UNSAMPLEDCONTINUATIONCOUNT_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __UNSAMPLEDCONTINUATIONCOUNT_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case SAMPLED_NEW_COUNT: if (value == null) { unsetSampledNewCount(); } else { - setSampledNewCount((Long)value); + setSampledNewCount((java.lang.Long)value); } break; @@ -267,7 +245,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetSampledContinuationCount(); } else { - setSampledContinuationCount((Long)value); + setSampledContinuationCount((java.lang.Long)value); } break; @@ -275,7 +253,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetUnsampledNewCount(); } else { - setUnsampledNewCount((Long)value); + setUnsampledNewCount((java.lang.Long)value); } break; @@ -283,35 +261,35 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetUnsampledContinuationCount(); } else { - setUnsampledContinuationCount((Long)value); + setUnsampledContinuationCount((java.lang.Long)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SAMPLED_NEW_COUNT: - return Long.valueOf(getSampledNewCount()); + return getSampledNewCount(); case SAMPLED_CONTINUATION_COUNT: - return Long.valueOf(getSampledContinuationCount()); + return getSampledContinuationCount(); case UNSAMPLED_NEW_COUNT: - return Long.valueOf(getUnsampledNewCount()); + return getUnsampledNewCount(); case UNSAMPLED_CONTINUATION_COUNT: - return Long.valueOf(getUnsampledContinuationCount()); + return getUnsampledContinuationCount(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -324,11 +302,11 @@ public boolean isSet(_Fields field) { case UNSAMPLED_CONTINUATION_COUNT: return isSetUnsampledContinuationCount(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TFTransaction) @@ -339,6 +317,8 @@ public boolean equals(Object that) { public boolean equals(TFTransaction that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_sampledNewCount = true && this.isSetSampledNewCount(); boolean that_present_sampledNewCount = true && that.isSetSampledNewCount(); @@ -381,29 +361,25 @@ public boolean equals(TFTransaction that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_sampledNewCount = true && (isSetSampledNewCount()); - list.add(present_sampledNewCount); - if (present_sampledNewCount) - list.add(sampledNewCount); + hashCode = hashCode * 8191 + ((isSetSampledNewCount()) ? 131071 : 524287); + if (isSetSampledNewCount()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(sampledNewCount); - boolean present_sampledContinuationCount = true && (isSetSampledContinuationCount()); - list.add(present_sampledContinuationCount); - if (present_sampledContinuationCount) - list.add(sampledContinuationCount); + hashCode = hashCode * 8191 + ((isSetSampledContinuationCount()) ? 131071 : 524287); + if (isSetSampledContinuationCount()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(sampledContinuationCount); - boolean present_unsampledNewCount = true && (isSetUnsampledNewCount()); - list.add(present_unsampledNewCount); - if (present_unsampledNewCount) - list.add(unsampledNewCount); + hashCode = hashCode * 8191 + ((isSetUnsampledNewCount()) ? 131071 : 524287); + if (isSetUnsampledNewCount()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(unsampledNewCount); - boolean present_unsampledContinuationCount = true && (isSetUnsampledContinuationCount()); - list.add(present_unsampledContinuationCount); - if (present_unsampledContinuationCount) - list.add(unsampledContinuationCount); + hashCode = hashCode * 8191 + ((isSetUnsampledContinuationCount()) ? 131071 : 524287); + if (isSetUnsampledContinuationCount()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(unsampledContinuationCount); - return list.hashCode(); + return hashCode; } @Override @@ -414,7 +390,7 @@ public int compareTo(TFTransaction other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSampledNewCount()).compareTo(other.isSetSampledNewCount()); + lastComparison = java.lang.Boolean.valueOf(isSetSampledNewCount()).compareTo(other.isSetSampledNewCount()); if (lastComparison != 0) { return lastComparison; } @@ -424,7 +400,7 @@ public int compareTo(TFTransaction other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetSampledContinuationCount()).compareTo(other.isSetSampledContinuationCount()); + lastComparison = java.lang.Boolean.valueOf(isSetSampledContinuationCount()).compareTo(other.isSetSampledContinuationCount()); if (lastComparison != 0) { return lastComparison; } @@ -434,7 +410,7 @@ public int compareTo(TFTransaction other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetUnsampledNewCount()).compareTo(other.isSetUnsampledNewCount()); + lastComparison = java.lang.Boolean.valueOf(isSetUnsampledNewCount()).compareTo(other.isSetUnsampledNewCount()); if (lastComparison != 0) { return lastComparison; } @@ -444,7 +420,7 @@ public int compareTo(TFTransaction other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetUnsampledContinuationCount()).compareTo(other.isSetUnsampledContinuationCount()); + lastComparison = java.lang.Boolean.valueOf(isSetUnsampledContinuationCount()).compareTo(other.isSetUnsampledContinuationCount()); if (lastComparison != 0) { return lastComparison; } @@ -461,17 +437,17 @@ public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } - public void read(org.apache.thrift.protocol.TProtocol iprot) throws TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); } - public void write(org.apache.thrift.protocol.TProtocol oprot) throws TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFTransaction("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFTransaction("); boolean first = true; if (isSetSampledNewCount()) { @@ -501,7 +477,7 @@ public String toString() { return sb.toString(); } - public void validate() throws TException { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -509,36 +485,36 @@ public void validate() throws TException { private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (TException te) { + } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private static class TFTransactionStandardSchemeFactory implements SchemeFactory { + private static class TFTransactionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFTransactionStandardScheme getScheme() { return new TFTransactionStandardScheme(); } } - private static class TFTransactionStandardScheme extends StandardScheme { + private static class TFTransactionStandardScheme extends org.apache.thrift.scheme.StandardScheme { - public void read(org.apache.thrift.protocol.TProtocol iprot, TFTransaction struct) throws TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, TFTransaction struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -546,7 +522,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFTransaction struc if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.sampledNewCount = iprot.readI64(); struct.setSampledNewCountIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -554,7 +530,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFTransaction struc if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.sampledContinuationCount = iprot.readI64(); struct.setSampledContinuationCountIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -562,7 +538,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFTransaction struc if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.unsampledNewCount = iprot.readI64(); struct.setUnsampledNewCountIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -570,7 +546,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFTransaction struc if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.unsampledContinuationCount = iprot.readI64(); struct.setUnsampledContinuationCountIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -583,7 +559,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFTransaction struc struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, TFTransaction struct) throws TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, TFTransaction struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); @@ -613,18 +589,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFTransaction stru } - private static class TFTransactionTupleSchemeFactory implements SchemeFactory { + private static class TFTransactionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFTransactionTupleScheme getScheme() { return new TFTransactionTupleScheme(); } } - private static class TFTransactionTupleScheme extends TupleScheme { + private static class TFTransactionTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFTransaction struct) throws TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + public void write(org.apache.thrift.protocol.TProtocol prot, TFTransaction struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSampledNewCount()) { optionals.set(0); } @@ -653,9 +629,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFTransaction struc } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFTransaction struct) throws TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(4); + public void read(org.apache.thrift.protocol.TProtocol prot, TFTransaction struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.sampledNewCount = iprot.readI64(); struct.setSampledNewCountIsSet(true); @@ -675,5 +651,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFTransaction struct } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/thrift/src/main/thrift/flink.thrift b/thrift/src/main/thrift/flink.thrift index 289225739b36..24c45131bcf2 100644 --- a/thrift/src/main/thrift/flink.thrift +++ b/thrift/src/main/thrift/flink.thrift @@ -55,7 +55,6 @@ struct TFJvmGc { 6: i64 jvmGcOldCount 7: i64 jvmGcOldTime 8: optional TFJvmGcDetailed jvmGcDetailed - } struct TFJvmGcDetailed { @@ -91,6 +90,10 @@ struct TFActiveTrace { 1: optional TFActiveTraceHistogram histogram } +struct TFResponseTime { + 1: optional i64 avg = 0 +} + struct TFAgentStat { 1: optional string agentId 2: optional i64 startTimestamp @@ -101,6 +104,7 @@ struct TFAgentStat { 30: optional TFTransaction transaction 40: optional TFActiveTrace activeTrace 50: optional TFDataSourceList dataSourceList + 60: optional TFResponseTime responseTime 200: optional string metadata } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/controller/ApplicationStatController.java b/web/src/main/java/com/navercorp/pinpoint/web/controller/ApplicationStatController.java index 340edff7af52..a0d8494b5450 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/controller/ApplicationStatController.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/controller/ApplicationStatController.java @@ -19,6 +19,7 @@ import com.navercorp.pinpoint.web.service.ApplicationStatChartService; import com.navercorp.pinpoint.web.service.stat.ApplicationActiveTraceService; import com.navercorp.pinpoint.web.service.stat.ApplicationMemoryService; +import com.navercorp.pinpoint.web.service.stat.ApplicationResponseTimeService; import com.navercorp.pinpoint.web.service.stat.ApplicationTransactionService; import com.navercorp.pinpoint.web.util.TimeWindow; import com.navercorp.pinpoint.web.util.TimeWindowSlotCentricSampler; @@ -93,5 +94,14 @@ public ApplicationActiveTraceController(ApplicationActiveTraceService applicatio super(applicationActiveTraceService); } } + + @Controller + @RequestMapping("/getApplicationStat/responseTime/chart") + public static class ApplicationResponseTimeController extends ApplicationStatController { + @Autowired + public ApplicationResponseTimeController(ApplicationResponseTimeService applicationResponseTimeService) { + super(applicationResponseTimeService); + } + } } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/ApplicationResponseTimeDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/ApplicationResponseTimeDao.java new file mode 100644 index 000000000000..85f9e9757e9c --- /dev/null +++ b/web/src/main/java/com/navercorp/pinpoint/web/dao/ApplicationResponseTimeDao.java @@ -0,0 +1,28 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.navercorp.pinpoint.web.dao; + +import com.navercorp.pinpoint.web.util.TimeWindow; +import com.navercorp.pinpoint.web.vo.stat.AggreJoinResponseTimeBo; + +import java.util.List; + +/** + * @author minwoo.jung + */ +public interface ApplicationResponseTimeDao { + List getApplicationStatList(String applicationId, TimeWindow timeWindow); +} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/HbaseApplicationMemoryDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/HbaseApplicationMemoryDao.java index 51f4603e35ca..8307b5f0c917 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/HbaseApplicationMemoryDao.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/HbaseApplicationMemoryDao.java @@ -59,12 +59,12 @@ public List getApplicationStatList(String applicationId, Time } private List cast(List aggregationStatDataList) { - List aggreJoinCpuLoadBoList = new ArrayList<>(aggregationStatDataList.size()); + List aggreJoinMemoryBoList = new ArrayList<>(aggregationStatDataList.size()); for (AggregationStatData aggregationStatData : aggregationStatDataList) { - aggreJoinCpuLoadBoList.add((AggreJoinMemoryBo) aggregationStatData); + aggreJoinMemoryBoList.add((AggreJoinMemoryBo) aggregationStatData); } - return aggreJoinCpuLoadBoList; + return aggreJoinMemoryBoList; } } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/HbaseApplicationResponseTimeDao.java b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/HbaseApplicationResponseTimeDao.java new file mode 100644 index 000000000000..35c42201d721 --- /dev/null +++ b/web/src/main/java/com/navercorp/pinpoint/web/dao/hbase/HbaseApplicationResponseTimeDao.java @@ -0,0 +1,70 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.navercorp.pinpoint.web.dao.hbase; + +import com.navercorp.pinpoint.common.server.bo.codec.stat.join.ResponseTimeDecoder; +import com.navercorp.pinpoint.common.server.bo.stat.join.StatType; +import com.navercorp.pinpoint.web.dao.ApplicationResponseTimeDao; +import com.navercorp.pinpoint.web.dao.hbase.HbaseApplicationStatDaoOperations; +import com.navercorp.pinpoint.web.mapper.stat.ApplicationStatMapper; +import com.navercorp.pinpoint.web.mapper.stat.SampledApplicationStatResultExtractor; +import com.navercorp.pinpoint.web.mapper.stat.sampling.sampler.JoinResponseTimeSampler; +import com.navercorp.pinpoint.web.util.TimeWindow; +import com.navercorp.pinpoint.web.vo.Range; +import com.navercorp.pinpoint.web.vo.stat.AggreJoinResponseTimeBo; +import com.navercorp.pinpoint.web.vo.stat.AggregationStatData; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Repository; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author minwoo.jung + */ +@Repository +public class HbaseApplicationResponseTimeDao implements ApplicationResponseTimeDao { + + @Autowired + private ResponseTimeDecoder responseTimeDecoder; + + @Autowired + private JoinResponseTimeSampler joinResponseTimeSampler; + + @Autowired + private HbaseApplicationStatDaoOperations operations; + + @Override + public List getApplicationStatList(String applicationId, TimeWindow timeWindow) { + long scanFrom = timeWindow.getWindowRange().getFrom(); + long scanTo = timeWindow.getWindowRange().getTo() + timeWindow.getWindowSlotSize(); + Range range = new Range(scanFrom, scanTo); + ApplicationStatMapper mapper = operations.createRowMapper(responseTimeDecoder, range); + SampledApplicationStatResultExtractor resultExtractor = new SampledApplicationStatResultExtractor(timeWindow, mapper, joinResponseTimeSampler); + List aggregationStatDataList = operations.getSampledStatList(StatType.APP_RESPONSE_TIME, resultExtractor, applicationId, range); + return cast(aggregationStatDataList); + } + + private List cast(List aggregationStatDataList) { + List aggreJoinResponseTimeBoList = new ArrayList<>(aggregationStatDataList.size()); + + for (AggregationStatData aggregationStatData : aggregationStatDataList) { + aggreJoinResponseTimeBoList.add((AggreJoinResponseTimeBo) aggregationStatData); + } + + return aggreJoinResponseTimeBoList; + } +} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/mapper/stat/sampling/sampler/JoinResponseTimeSampler.java b/web/src/main/java/com/navercorp/pinpoint/web/mapper/stat/sampling/sampler/JoinResponseTimeSampler.java new file mode 100644 index 000000000000..4ba66a0e2ca3 --- /dev/null +++ b/web/src/main/java/com/navercorp/pinpoint/web/mapper/stat/sampling/sampler/JoinResponseTimeSampler.java @@ -0,0 +1,48 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.navercorp.pinpoint.web.mapper.stat.sampling.sampler; + +import com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo; +import com.navercorp.pinpoint.web.vo.stat.AggreJoinResponseTimeBo; +import com.navercorp.pinpoint.web.vo.stat.AggregationStatData; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author minwoo.jung + */ +@Component +public class JoinResponseTimeSampler implements ApplicationStatSampler { + + @Override + public AggreJoinResponseTimeBo sampleDataPoints(int index, long timestamp, List joinResponseTimeBoList, JoinResponseTimeBo previousDataPoint) { + if (joinResponseTimeBoList.size() == 0) { + return AggreJoinResponseTimeBo.createUncollectedObject(timestamp); + } + + JoinResponseTimeBo joinResponseTimeBo = JoinResponseTimeBo.joinResponseTimeBoList(joinResponseTimeBoList, timestamp); + String id = joinResponseTimeBo.getId(); + long avg = joinResponseTimeBo.getAvg(); + long minAvg = joinResponseTimeBo.getMinAvg(); + String minAvgAgentId = joinResponseTimeBo.getMinAvgAgentId(); + long maxAvg = joinResponseTimeBo.getMaxAvg(); + String maxAvgAgentId = joinResponseTimeBo.getMaxAvgAgentId(); + + AggreJoinResponseTimeBo aggreJoinResponseTimeBo = new AggreJoinResponseTimeBo(id, timestamp, avg, minAvg, minAvgAgentId, maxAvg, maxAvgAgentId); + return aggreJoinResponseTimeBo; + } +} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ApplicationMemoryService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ApplicationMemoryService.java index 772fea94a67d..a83ea259cfcb 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ApplicationMemoryService.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ApplicationMemoryService.java @@ -43,7 +43,7 @@ public ApplicationStatChartGroup selectApplicationChart(String applicationId, Ti if (timeWindow == null) { throw new NullPointerException("timeWindow must not be null"); } - List aggreJoinCpuLoadBoList = this.applicationMemoryDao.getApplicationStatList(applicationId, timeWindow); - return new ApplicationMemoryChartGroup(timeWindow, aggreJoinCpuLoadBoList); + List aggreJoinMemoryBoList = this.applicationMemoryDao.getApplicationStatList(applicationId, timeWindow); + return new ApplicationMemoryChartGroup(timeWindow, aggreJoinMemoryBoList); } } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ApplicationResponseTimeService.java b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ApplicationResponseTimeService.java new file mode 100644 index 000000000000..6b680d9df615 --- /dev/null +++ b/web/src/main/java/com/navercorp/pinpoint/web/service/stat/ApplicationResponseTimeService.java @@ -0,0 +1,50 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.navercorp.pinpoint.web.service.stat; + +import com.navercorp.pinpoint.web.dao.ApplicationResponseTimeDao; +import com.navercorp.pinpoint.web.service.ApplicationStatChartService; +import com.navercorp.pinpoint.web.util.TimeWindow; +import com.navercorp.pinpoint.web.vo.stat.AggreJoinResponseTimeBo; +import com.navercorp.pinpoint.web.vo.stat.chart.ApplicationResponseTimeChartGroup; +import com.navercorp.pinpoint.web.vo.stat.chart.ApplicationStatChartGroup; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author minwoo.jung + */ +@Service +public class ApplicationResponseTimeService implements ApplicationStatChartService { + + @Autowired + private ApplicationResponseTimeDao applicationResponseTimeDao; + + @Override + public ApplicationStatChartGroup selectApplicationChart(String applicationId, TimeWindow timeWindow) { + if (applicationId == null) { + throw new NullPointerException("applicationId must not be null"); + } + if (timeWindow == null) { + throw new NullPointerException("timeWindow must not be null"); + } + + List aggreJoinResponseTimeBoList = this.applicationResponseTimeDao.getApplicationStatList(applicationId, timeWindow); + return new ApplicationResponseTimeChartGroup(timeWindow, aggreJoinResponseTimeBoList); + } +} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/vo/stat/AggreJoinResponseTimeBo.java b/web/src/main/java/com/navercorp/pinpoint/web/vo/stat/AggreJoinResponseTimeBo.java new file mode 100644 index 000000000000..a4d6b2579add --- /dev/null +++ b/web/src/main/java/com/navercorp/pinpoint/web/vo/stat/AggreJoinResponseTimeBo.java @@ -0,0 +1,37 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.navercorp.pinpoint.web.vo.stat; + +import com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo; + +/** + * @author minwoo.jung + */ +public class AggreJoinResponseTimeBo extends JoinResponseTimeBo implements AggregationStatData { + + public AggreJoinResponseTimeBo() { + } + + public AggreJoinResponseTimeBo(String id, long timestamp, long avg, long minAvg, String minAvgAgentId, long maxAvg, String maxAvgAgentId) { + super(id, timestamp, avg, minAvg, minAvgAgentId, maxAvg, maxAvgAgentId); + } + + public static AggreJoinResponseTimeBo createUncollectedObject(long timestamp) { + AggreJoinResponseTimeBo aggreJoinResponseTimeBo = new AggreJoinResponseTimeBo(); + aggreJoinResponseTimeBo.setTimestamp(timestamp); + return aggreJoinResponseTimeBo; + } +} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/vo/stat/chart/ApplicationActiveTraceChartGroup.java b/web/src/main/java/com/navercorp/pinpoint/web/vo/stat/chart/ApplicationActiveTraceChartGroup.java index e2ffb3ab1fd5..0a23b1f1d0a2 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/vo/stat/chart/ApplicationActiveTraceChartGroup.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/vo/stat/chart/ApplicationActiveTraceChartGroup.java @@ -40,7 +40,7 @@ public ApplicationActiveTraceChartGroup(TimeWindow timeWindow, List(); List activeTraceList = new ArrayList<>(AggreJoinActiveTraceBoList.size()); - for(AggreJoinActiveTraceBo aggreJoinActiveTraceBo : AggreJoinActiveTraceBoList) { + for (AggreJoinActiveTraceBo aggreJoinActiveTraceBo : AggreJoinActiveTraceBoList) { activeTraceList.add(new ActiveTracePoint(aggreJoinActiveTraceBo.getTimestamp(), aggreJoinActiveTraceBo.getMinTotalCount(), aggreJoinActiveTraceBo.getMinTotalCountAgentId(), aggreJoinActiveTraceBo.getMaxTotalCount(), aggreJoinActiveTraceBo.getMaxTotalCountAgentId(), aggreJoinActiveTraceBo.getTotalCount())); } @@ -49,6 +49,6 @@ public ApplicationActiveTraceChartGroup(TimeWindow timeWindow, List getCharts() { - return this.activeTraceChartMap; + return activeTraceChartMap; } } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/vo/stat/chart/ApplicationResponseTimeChartGroup.java b/web/src/main/java/com/navercorp/pinpoint/web/vo/stat/chart/ApplicationResponseTimeChartGroup.java new file mode 100644 index 000000000000..c84d2b196472 --- /dev/null +++ b/web/src/main/java/com/navercorp/pinpoint/web/vo/stat/chart/ApplicationResponseTimeChartGroup.java @@ -0,0 +1,55 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.navercorp.pinpoint.web.vo.stat.chart; + +import com.navercorp.pinpoint.web.util.TimeWindow; +import com.navercorp.pinpoint.web.vo.stat.AggreJoinResponseTimeBo; +import com.navercorp.pinpoint.web.vo.stat.chart.ResponseTimePoint.UncollectedResponseTimePointCreater; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author minwoo.jung + */ +public class ApplicationResponseTimeChartGroup implements ApplicationStatChartGroup { + + public static final UncollectedResponseTimePointCreater UNCOLLECTED_RESPONSETIMEPOINT = new UncollectedResponseTimePointCreater(); + + private final Map responseTimeChartMap; + + public enum ResponseTimeChartType implements ChartType { + RESPONSE_TIME + } + + public ApplicationResponseTimeChartGroup(TimeWindow timeWindow, List aggreJoinResponseTimeBoList) { + responseTimeChartMap = new HashMap<>(); + List responseTimeList = new ArrayList<>(aggreJoinResponseTimeBoList.size()); + + for (AggreJoinResponseTimeBo aggreJoinResponseTimeBo : aggreJoinResponseTimeBoList) { + responseTimeList.add(new ResponseTimePoint(aggreJoinResponseTimeBo.getTimestamp(), aggreJoinResponseTimeBo.getMinAvg(), aggreJoinResponseTimeBo.getMinAvgAgentId(), aggreJoinResponseTimeBo.getMaxAvg(), aggreJoinResponseTimeBo.getMaxAvgAgentId(), aggreJoinResponseTimeBo.getAvg())); + } + + responseTimeChartMap.put(ResponseTimeChartType.RESPONSE_TIME, new TimeSeriesChartBuilder(timeWindow, UNCOLLECTED_RESPONSETIMEPOINT).build(responseTimeList)); + } + + @Override + public Map getCharts() { + return responseTimeChartMap; + } +} diff --git a/web/src/main/java/com/navercorp/pinpoint/web/vo/stat/chart/ResponseTimePoint.java b/web/src/main/java/com/navercorp/pinpoint/web/vo/stat/chart/ResponseTimePoint.java new file mode 100644 index 000000000000..78fe4f57e827 --- /dev/null +++ b/web/src/main/java/com/navercorp/pinpoint/web/vo/stat/chart/ResponseTimePoint.java @@ -0,0 +1,71 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.navercorp.pinpoint.web.vo.stat.chart; + +import com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo; + +/** + * @author minwoo.jung + */ +public class ResponseTimePoint implements Point { + + private final long xVal; + private final double yValForMin; + private final String agentIdForMin; + private final double yValForMax; + private final String agentIdForMax; + private final double yValForAvg; + + public ResponseTimePoint(long xVal, double yValForMin, String agentIdForMin, double yValForMax, String agentIdForMax, double yValForAvg) { + this.xVal = xVal; + this.yValForMin = yValForMin; + this.agentIdForMin = agentIdForMin; + this.yValForMax = yValForMax; + this.agentIdForMax = agentIdForMax; + this.yValForAvg = yValForAvg; + } + + @Override + public long getxVal() { + return xVal; + } + + public double getyValForMin() { + return yValForMin; + } + + public String getAgentIdForMin() { + return agentIdForMin; + } + + public double getyValForMax() { + return yValForMax; + } + + public String getAgentIdForMax() { + return agentIdForMax; + } + + public double getyValForAvg() { + return yValForAvg; + } + + public static class UncollectedResponseTimePointCreater implements UncollectedPointCreater { + public Point createUnCollectedPoint(long xVal) { + return new ResponseTimePoint(xVal, JoinResponseTimeBo.UNCOLLECTED_VALUE, JoinResponseTimeBo.UNKNOWN_AGENT, JoinResponseTimeBo.UNCOLLECTED_VALUE, JoinResponseTimeBo.UNKNOWN_AGENT, JoinResponseTimeBo.UNCOLLECTED_VALUE); + } + } +} diff --git a/web/src/test/java/com/navercorp/pinpoint/web/mapper/stat/sampling/sampler/JoinActiveTraceSamplerTest.java b/web/src/test/java/com/navercorp/pinpoint/web/mapper/stat/sampling/sampler/JoinActiveTraceSamplerTest.java index c0f970f331ab..29126f0ae56f 100644 --- a/web/src/test/java/com/navercorp/pinpoint/web/mapper/stat/sampling/sampler/JoinActiveTraceSamplerTest.java +++ b/web/src/test/java/com/navercorp/pinpoint/web/mapper/stat/sampling/sampler/JoinActiveTraceSamplerTest.java @@ -35,7 +35,7 @@ public void sampleDataPointsTest() { long currentTime = 1487149800000L; JoinActiveTraceSampler sampler = new JoinActiveTraceSampler(); List joinActiveTraceBoList = createJoinActiveTraceBoList(currentTime); - AggreJoinActiveTraceBo aggreJoinActiveTraceBo = sampler.sampleDataPoints(1, currentTime, joinActiveTraceBoList, JoinActiveTraceBo.EMPTY_ACTIVE_TRACE_BO); + AggreJoinActiveTraceBo aggreJoinActiveTraceBo = sampler.sampleDataPoints(1, currentTime, joinActiveTraceBoList, JoinActiveTraceBo.EMPTY_JOIN_ACTIVE_TRACE_BO); assertEquals(aggreJoinActiveTraceBo.getId(), "test_app"); assertEquals(aggreJoinActiveTraceBo.getHistogramSchemaType(), 1); diff --git a/web/src/test/java/com/navercorp/pinpoint/web/mapper/stat/sampling/sampler/JoinResponseTimeSamplerTest.java b/web/src/test/java/com/navercorp/pinpoint/web/mapper/stat/sampling/sampler/JoinResponseTimeSamplerTest.java new file mode 100644 index 000000000000..2852590e3749 --- /dev/null +++ b/web/src/test/java/com/navercorp/pinpoint/web/mapper/stat/sampling/sampler/JoinResponseTimeSamplerTest.java @@ -0,0 +1,78 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.navercorp.pinpoint.web.mapper.stat.sampling.sampler; + +import com.navercorp.pinpoint.common.server.bo.stat.join.JoinResponseTimeBo; +import com.navercorp.pinpoint.web.vo.stat.AggreJoinResponseTimeBo; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.*; + +/** + * @author minwoo.jung + */ +public class JoinResponseTimeSamplerTest { + + @Test + public void sampleDataPointsTest() { + long currentTime = 1487149800000L; + JoinResponseTimeSampler joinResponseTimeSampler = new JoinResponseTimeSampler(); + List joinResponseTimeBoList = createJoinResponseTimeList(currentTime); + AggreJoinResponseTimeBo aggreJoinResponseTimeBo = joinResponseTimeSampler.sampleDataPoints(1, currentTime, joinResponseTimeBoList, JoinResponseTimeBo.EMPTY_JOIN_RESPONSE_TIME_BO); + assertEquals(aggreJoinResponseTimeBo.getId(), "test_app"); + assertEquals(aggreJoinResponseTimeBo.getTimestamp(), 1487149800000L); + assertEquals(aggreJoinResponseTimeBo.getAvg(), 3000); + assertEquals(2, aggreJoinResponseTimeBo.getMinAvg()); + assertEquals("app_1_1", aggreJoinResponseTimeBo.getMinAvgAgentId()); + assertEquals(9000, aggreJoinResponseTimeBo.getMaxAvg()); + assertEquals("app_2_1", aggreJoinResponseTimeBo.getMaxAvgAgentId()); + } + + private List createJoinResponseTimeList(long currentTime) { + final String id = "test_app"; + List joinResponseTimeBoList = new ArrayList(); + JoinResponseTimeBo joinResponseTimeBo1 = new JoinResponseTimeBo(id, currentTime, 3000, 2, "app_1_1", 6000, "app_1_1"); + JoinResponseTimeBo joinResponseTimeBo2 = new JoinResponseTimeBo(id, currentTime + 5000, 4000, 200, "app_2_1", 9000, "app_2_1"); + JoinResponseTimeBo joinResponseTimeBo3 = new JoinResponseTimeBo(id, currentTime + 10000, 2000, 20, "app_3_1", 7000, "app_3_1"); + JoinResponseTimeBo joinResponseTimeBo4 = new JoinResponseTimeBo(id, currentTime + 15000, 5000, 20, "app_4_1", 8000, "app_4_1"); + JoinResponseTimeBo joinResponseTimeBo5 = new JoinResponseTimeBo(id, currentTime + 20000, 1000, 10, "app_5_1", 6600, "app_5_1"); + joinResponseTimeBoList.add(joinResponseTimeBo1); + joinResponseTimeBoList.add(joinResponseTimeBo2); + joinResponseTimeBoList.add(joinResponseTimeBo3); + joinResponseTimeBoList.add(joinResponseTimeBo4); + joinResponseTimeBoList.add(joinResponseTimeBo5); + return joinResponseTimeBoList; + } + + @Test + public void sampleDataPoints2Test() { + long currentTime = 1487149800000L; + JoinResponseTimeSampler joinResponseTimeSampler = new JoinResponseTimeSampler(); + List joinResponseTimeBoList = new ArrayList(); + AggreJoinResponseTimeBo aggreJoinResponseTimeBo = joinResponseTimeSampler.sampleDataPoints(1, currentTime, joinResponseTimeBoList, JoinResponseTimeBo.EMPTY_JOIN_RESPONSE_TIME_BO); + assertEquals(aggreJoinResponseTimeBo.getId(), JoinResponseTimeBo.UNKNOWN_ID); + assertEquals(aggreJoinResponseTimeBo.getTimestamp(), 1487149800000L); + assertEquals(aggreJoinResponseTimeBo.getAvg(), JoinResponseTimeBo.UNCOLLECTED_VALUE); + assertEquals(JoinResponseTimeBo.UNCOLLECTED_VALUE, aggreJoinResponseTimeBo.getMinAvg()); + assertEquals(JoinResponseTimeBo.UNKNOWN_AGENT, aggreJoinResponseTimeBo.getMinAvgAgentId()); + assertEquals(JoinResponseTimeBo.UNCOLLECTED_VALUE, aggreJoinResponseTimeBo.getMaxAvg()); + assertEquals(JoinResponseTimeBo.UNKNOWN_AGENT, aggreJoinResponseTimeBo.getMaxAvgAgentId()); + } +} \ No newline at end of file diff --git a/web/src/test/java/com/navercorp/pinpoint/web/mapper/stat/sampling/sampler/JoinTransactionSamplerTest.java b/web/src/test/java/com/navercorp/pinpoint/web/mapper/stat/sampling/sampler/JoinTransactionSamplerTest.java index 40edf3404734..177ab5c59d29 100644 --- a/web/src/test/java/com/navercorp/pinpoint/web/mapper/stat/sampling/sampler/JoinTransactionSamplerTest.java +++ b/web/src/test/java/com/navercorp/pinpoint/web/mapper/stat/sampling/sampler/JoinTransactionSamplerTest.java @@ -16,7 +16,6 @@ package com.navercorp.pinpoint.web.mapper.stat.sampling.sampler; -import com.navercorp.pinpoint.common.server.bo.stat.join.JoinStatBo; import com.navercorp.pinpoint.common.server.bo.stat.join.JoinTransactionBo; import com.navercorp.pinpoint.web.vo.stat.AggreJoinTransactionBo; import org.junit.Test; @@ -36,7 +35,7 @@ public void sampleDataPointsTest() { long currentTime = 1487149800000L; JoinTransactionSampler joinTransactionSampler = new JoinTransactionSampler(); List joinTransactionBoList = createJoinTransactionBoList(currentTime); - AggreJoinTransactionBo aggreJoinTransactionBo = joinTransactionSampler.sampleDataPoints(1, currentTime, joinTransactionBoList, JoinTransactionBo.EMPTY_TRANSACTION_BO); + AggreJoinTransactionBo aggreJoinTransactionBo = joinTransactionSampler.sampleDataPoints(1, currentTime, joinTransactionBoList, JoinTransactionBo.EMPTY_JOIN_TRANSACTION_BO); assertEquals(aggreJoinTransactionBo.getId(), "test_app"); assertEquals(aggreJoinTransactionBo.getCollectInterval(),5000); diff --git a/web/src/test/java/com/navercorp/pinpoint/web/vo/stat/chart/ApplicationResponseTimeChartGroupTest.java b/web/src/test/java/com/navercorp/pinpoint/web/vo/stat/chart/ApplicationResponseTimeChartGroupTest.java new file mode 100644 index 000000000000..ac653477fa2e --- /dev/null +++ b/web/src/test/java/com/navercorp/pinpoint/web/vo/stat/chart/ApplicationResponseTimeChartGroupTest.java @@ -0,0 +1,75 @@ +/* + * Copyright 2017 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.navercorp.pinpoint.web.vo.stat.chart; + +import com.navercorp.pinpoint.web.util.TimeWindow; +import com.navercorp.pinpoint.web.vo.Range; +import com.navercorp.pinpoint.web.vo.stat.AggreJoinResponseTimeBo; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import static org.junit.Assert.*; + +/** + * @author minwoo.jung + */ +public class ApplicationResponseTimeChartGroupTest { + + @Test + public void createApplicationResponseTimeChartGroupTest() { + long time = 1495418083250L; + Range range = new Range(time - 240000, time); + TimeWindow timeWindow = new TimeWindow(range); + + final String id = "test_app"; + List aggreJoinResponseTimeBoList = new ArrayList(); + AggreJoinResponseTimeBo aggreJoinResponseTimeBo1 = new AggreJoinResponseTimeBo(id, time, 3000, 2, "app_1_1", 6000, "app_1_1"); + AggreJoinResponseTimeBo aggreJoinResponseTimeBo2 = new AggreJoinResponseTimeBo(id, time - 60000, 4000, 200, "app_2_1", 9000, "app_2_1"); + AggreJoinResponseTimeBo aggreJoinResponseTimeBo3 = new AggreJoinResponseTimeBo(id, time - 120000, 2000, 20, "app_3_1", 7000, "app_3_1"); + AggreJoinResponseTimeBo aggreJoinResponseTimeBo4 = new AggreJoinResponseTimeBo(id, time - 180000, 5000, 20, "app_4_1", 8000, "app_4_1"); + AggreJoinResponseTimeBo aggreJoinResponseTimeBo5 = new AggreJoinResponseTimeBo(id, time - 240000, 1000, 10, "app_5_1", 6600, "app_5_1"); + aggreJoinResponseTimeBoList.add(aggreJoinResponseTimeBo1); + aggreJoinResponseTimeBoList.add(aggreJoinResponseTimeBo2); + aggreJoinResponseTimeBoList.add(aggreJoinResponseTimeBo3); + aggreJoinResponseTimeBoList.add(aggreJoinResponseTimeBo4); + aggreJoinResponseTimeBoList.add(aggreJoinResponseTimeBo5); + ApplicationResponseTimeChartGroup applicationResponseTimeChartGroup = new ApplicationResponseTimeChartGroup(timeWindow, aggreJoinResponseTimeBoList); + Map charts = applicationResponseTimeChartGroup.getCharts(); + + Chart responseTimeChart = charts.get(ApplicationResponseTimeChartGroup.ResponseTimeChartType.RESPONSE_TIME); + List responseTimePointList = responseTimeChart.getPoints(); + assertEquals(5, responseTimePointList.size()); + int index = responseTimePointList.size(); + + for (Point point : responseTimePointList) { + testResponseTimeCount((ResponseTimePoint) point, aggreJoinResponseTimeBoList.get(--index)); + } + } + + private void testResponseTimeCount(ResponseTimePoint responseTimePoint, AggreJoinResponseTimeBo aggreJoinResponseTimeBo) { + assertEquals(responseTimePoint.getyValForAvg(), aggreJoinResponseTimeBo.getAvg(), 0); + assertEquals(responseTimePoint.getyValForMin(), aggreJoinResponseTimeBo.getMinAvg(), 0); + assertEquals(responseTimePoint.getyValForMax(), aggreJoinResponseTimeBo.getMaxAvg(), 0); + assertEquals(responseTimePoint.getAgentIdForMax(), aggreJoinResponseTimeBo.getMaxAvgAgentId()); + assertEquals(responseTimePoint.getAgentIdForMin(), aggreJoinResponseTimeBo.getMinAvgAgentId()); + } + + +} \ No newline at end of file