diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/pom.xml b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/pom.xml deleted file mode 100644 index ca0eb81e014e4fa435b97f8236f317956300472b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - agent-grpc - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - agent-grpc-define - jar - \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine deleted file mode 100644 index 502c70faae94f0f7a06fc9567ebd69adda7b15e6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.agent.grpc.define.AgentGRPCModule diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/pom.xml b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/pom.xml deleted file mode 100644 index b41ad3cd549e448eafe685a6a649bcca3f5ea72a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/pom.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - agent-grpc - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - agent-grpc-provider - - 1.14.0 - 20.0 - - - - - com.google.guava - guava - - - - - - org.apache.skywalking - agent-grpc-define - ${project.version} - - - org.apache.skywalking - collector-cluster-define - ${project.version} - - - org.apache.skywalking - collector-naming-define - ${project.version} - - - org.apache.skywalking - collector-grpc-manager-define - ${project.version} - - - org.apache.skywalking - segment-parser-define - ${project.version} - - - org.apache.skywalking - jvm-define - ${project.version} - - - org.apache.skywalking - metric-define - ${project.version} - - - org.apache.skywalking - register-define - ${project.version} - - - io.grpc - grpc-testing - ${grpc.version} - test - - - mockito-core - org.mockito - - - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCConfig.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCConfig.java deleted file mode 100644 index 47049d2a6884447ae9c7bd5df6dadd624da334a3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider; - -import org.apache.skywalking.apm.collector.server.grpc.GRPCServerConfig; - -/** - * @author peng-yongsheng - */ -class AgentModuleGRPCConfig extends GRPCServerConfig { -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCProvider.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCProvider.java deleted file mode 100644 index f4487171dd114cb42a56e0ae1ee5591be0d9c759..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCProvider.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider; - -import java.io.File; -import org.apache.skywalking.apm.collector.agent.grpc.define.AgentGRPCModule; -import org.apache.skywalking.apm.collector.agent.grpc.provider.handler.ApplicationRegisterServiceHandler; -import org.apache.skywalking.apm.collector.agent.grpc.provider.handler.InstanceDiscoveryServiceHandler; -import org.apache.skywalking.apm.collector.agent.grpc.provider.handler.JVMMetricsServiceHandler; -import org.apache.skywalking.apm.collector.agent.grpc.provider.handler.NetworkAddressRegisterServiceHandler; -import org.apache.skywalking.apm.collector.agent.grpc.provider.handler.ServiceNameDiscoveryServiceHandler; -import org.apache.skywalking.apm.collector.agent.grpc.provider.handler.TraceSegmentServiceHandler; -import org.apache.skywalking.apm.collector.agent.grpc.provider.handler.naming.AgentGRPCNamingHandler; -import org.apache.skywalking.apm.collector.agent.grpc.provider.handler.naming.AgentGRPCNamingListener; -import org.apache.skywalking.apm.collector.analysis.metric.define.AnalysisMetricModule; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.AnalysisSegmentParserModule; -import org.apache.skywalking.apm.collector.cluster.ClusterModule; -import org.apache.skywalking.apm.collector.cluster.service.ModuleListenerService; -import org.apache.skywalking.apm.collector.cluster.service.ModuleRegisterService; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; -import org.apache.skywalking.apm.collector.core.module.ModuleProvider; -import org.apache.skywalking.apm.collector.core.module.ServiceNotProvidedException; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.StringUtils; -import org.apache.skywalking.apm.collector.grpc.manager.GRPCManagerModule; -import org.apache.skywalking.apm.collector.grpc.manager.service.GRPCManagerService; -import org.apache.skywalking.apm.collector.naming.NamingModule; -import org.apache.skywalking.apm.collector.naming.service.NamingHandlerRegisterService; -import org.apache.skywalking.apm.collector.server.grpc.GRPCServer; -import org.eclipse.jetty.util.StringUtil; - -/** - * @author peng-yongsheng - */ -public class AgentModuleGRPCProvider extends ModuleProvider { - - public static final String NAME = "gRPC"; - private final AgentModuleGRPCConfig config; - - public AgentModuleGRPCProvider() { - super(); - this.config = new AgentModuleGRPCConfig(); - } - - @Override - public String name() { - return NAME; - } - - @Override - public Class module() { - return AgentGRPCModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override - public void prepare() { - } - - @Override - public void start() throws ServiceNotProvidedException { - String host = config.getHost(); - Integer port = config.getPort(); - String sslCertChainFilePath = config.getSslCertChainFilePath(); - String sslPrivateKeyFilePath = config.getSslPrivateKeyFilePath(); - String authentication = StringUtils.isNotEmpty(config.getAuthentication()) ? config.getAuthentication() : Const.EMPTY_STRING; - - AuthenticationSimpleChecker.INSTANCE.setExpectedToken(authentication); - File sslCertChainFile = null; - File sslPrivateKeyFile = null; - if (StringUtil.isNotBlank(sslCertChainFilePath)) { - sslCertChainFile = new File(sslCertChainFilePath); - if (!(sslCertChainFile.exists() && sslCertChainFile.isFile())) { - sslCertChainFile = null; - } - } - if (StringUtil.isNotBlank(sslPrivateKeyFilePath)) { - sslPrivateKeyFile = new File(sslPrivateKeyFilePath); - if (!(sslPrivateKeyFile.exists() && sslPrivateKeyFile.isFile())) { - sslPrivateKeyFile = null; - } - } - - ModuleRegisterService moduleRegisterService = getManager().find(ClusterModule.NAME).getService(ModuleRegisterService.class); - moduleRegisterService.register(AgentGRPCModule.NAME, this.name(), new AgentModuleGRPCRegistration(host, port)); - - AgentGRPCNamingListener namingListener = new AgentGRPCNamingListener(); - ModuleListenerService moduleListenerService = getManager().find(ClusterModule.NAME).getService(ModuleListenerService.class); - moduleListenerService.addListener(namingListener); - - NamingHandlerRegisterService namingHandlerRegisterService = getManager().find(NamingModule.NAME).getService(NamingHandlerRegisterService.class); - namingHandlerRegisterService.register(new AgentGRPCNamingHandler(namingListener)); - - GRPCManagerService managerService = getManager().find(GRPCManagerModule.NAME).getService(GRPCManagerService.class); - GRPCServer gRPCServer; - if (sslCertChainFile != null && sslPrivateKeyFile != null) { - gRPCServer = managerService.createIfAbsent(host, port, sslCertChainFile, sslPrivateKeyFile); - } else { - gRPCServer = managerService.createIfAbsent(host, port); - } - - addHandlers(gRPCServer); - } - - @Override - public void notifyAfterCompleted() { - } - - @Override - public String[] requiredModules() { - return new String[] {ClusterModule.NAME, NamingModule.NAME, GRPCManagerModule.NAME, AnalysisSegmentParserModule.NAME, AnalysisMetricModule.NAME}; - } - - private void addHandlers(GRPCServer gRPCServer) { - AuthenticationSimpleChecker.INSTANCE.build(gRPCServer, new ApplicationRegisterServiceHandler(getManager())); - AuthenticationSimpleChecker.INSTANCE.build(gRPCServer, new InstanceDiscoveryServiceHandler(getManager())); - AuthenticationSimpleChecker.INSTANCE.build(gRPCServer, new ServiceNameDiscoveryServiceHandler(getManager())); - AuthenticationSimpleChecker.INSTANCE.build(gRPCServer, new JVMMetricsServiceHandler(getManager())); - AuthenticationSimpleChecker.INSTANCE.build(gRPCServer, new TraceSegmentServiceHandler(getManager())); - AuthenticationSimpleChecker.INSTANCE.build(gRPCServer, new NetworkAddressRegisterServiceHandler(getManager())); - } -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AuthenticationSimpleChecker.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AuthenticationSimpleChecker.java deleted file mode 100644 index 10e69da87b65a4e51ca46835b9f6babdf702003e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AuthenticationSimpleChecker.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider; - -import io.grpc.BindableService; -import io.grpc.Metadata; -import io.grpc.ServerCall; -import io.grpc.ServerCallHandler; -import io.grpc.ServerInterceptor; -import io.grpc.ServerInterceptors; -import io.grpc.Status; -import org.apache.skywalking.apm.collector.core.util.StringUtils; -import org.apache.skywalking.apm.collector.server.grpc.GRPCServer; - -/** - * Active the authentication token checker if expected token exists in application.yml - * - * @author wusheng - */ -public enum AuthenticationSimpleChecker { - INSTANCE; - - private static final Metadata.Key AUTH_HEAD_HEADER_NAME = - Metadata.Key.of("Authentication", Metadata.ASCII_STRING_MARSHALLER); - - private String expectedToken = ""; - - public void build(GRPCServer gRPCServer, BindableService targetService) { - if (StringUtils.isNotEmpty(expectedToken)) { - gRPCServer.addHandler(ServerInterceptors.intercept(targetService, new ServerInterceptor() { - @Override - public ServerCall.Listener interceptCall(ServerCall serverCall, - Metadata metadata, - ServerCallHandler next) { - String token = metadata.get(AUTH_HEAD_HEADER_NAME); - if (expectedToken.equals(token)) { - return next.startCall(serverCall, metadata); - } else { - serverCall.close(Status.PERMISSION_DENIED, new Metadata()); - return new ServerCall.Listener() { - }; - } - - } - })); - } else { - gRPCServer.addHandler(targetService); - } - } - - public void setExpectedToken(String expectedToken) { - this.expectedToken = expectedToken; - } -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ApplicationRegisterServiceHandler.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ApplicationRegisterServiceHandler.java deleted file mode 100644 index 8c23d849ffc0efd99f717587ba181c3d21824ee0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ApplicationRegisterServiceHandler.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler; - -import io.grpc.stub.StreamObserver; -import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IApplicationIDService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.server.grpc.GRPCHandler; -import org.apache.skywalking.apm.network.language.agent.Application; -import org.apache.skywalking.apm.network.language.agent.ApplicationMapping; -import org.apache.skywalking.apm.network.language.agent.ApplicationRegisterServiceGrpc; -import org.apache.skywalking.apm.network.language.agent.KeyWithIntegerValue; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class ApplicationRegisterServiceHandler extends ApplicationRegisterServiceGrpc.ApplicationRegisterServiceImplBase implements GRPCHandler { - - private static final Logger logger = LoggerFactory.getLogger(ApplicationRegisterServiceHandler.class); - - private final IApplicationIDService applicationIDService; - - public ApplicationRegisterServiceHandler(ModuleManager moduleManager) { - applicationIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IApplicationIDService.class); - } - - @Override - public void applicationCodeRegister(Application request, StreamObserver responseObserver) { - if (logger.isDebugEnabled()) { - logger.debug("register application"); - } - - ApplicationMapping.Builder builder = ApplicationMapping.newBuilder(); - String applicationCode = request.getApplicationCode(); - int applicationId = applicationIDService.getOrCreateForApplicationCode(applicationCode); - - if (applicationId != 0) { - KeyWithIntegerValue value = KeyWithIntegerValue.newBuilder().setKey(applicationCode).setValue(applicationId).build(); - builder.setApplication(value); - } - responseObserver.onNext(builder.build()); - responseObserver.onCompleted(); - } -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/InstanceDiscoveryServiceHandler.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/InstanceDiscoveryServiceHandler.java deleted file mode 100644 index b044211c48c4ad2fa8990e1089a6ed1335d3912c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/InstanceDiscoveryServiceHandler.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler; - -import io.grpc.stub.StreamObserver; -import org.apache.skywalking.apm.collector.analysis.metric.define.AnalysisMetricModule; -import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService; -import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule; -import org.apache.skywalking.apm.collector.analysis.register.define.service.AgentOsInfo; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IInstanceIDService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.server.grpc.GRPCHandler; -import org.apache.skywalking.apm.network.language.agent.ApplicationInstance; -import org.apache.skywalking.apm.network.language.agent.ApplicationInstanceHeartbeat; -import org.apache.skywalking.apm.network.language.agent.ApplicationInstanceMapping; -import org.apache.skywalking.apm.network.language.agent.Downstream; -import org.apache.skywalking.apm.network.language.agent.InstanceDiscoveryServiceGrpc; -import org.apache.skywalking.apm.network.language.agent.OSInfo; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class InstanceDiscoveryServiceHandler extends InstanceDiscoveryServiceGrpc.InstanceDiscoveryServiceImplBase implements GRPCHandler { - - private static final Logger logger = LoggerFactory.getLogger(InstanceDiscoveryServiceHandler.class); - - private final IInstanceIDService instanceIDService; - private final IInstanceHeartBeatService instanceHeartBeatService; - - public InstanceDiscoveryServiceHandler(ModuleManager moduleManager) { - this.instanceIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IInstanceIDService.class); - this.instanceHeartBeatService = moduleManager.find(AnalysisMetricModule.NAME).getService(IInstanceHeartBeatService.class); - } - - @Override - public void registerInstance(ApplicationInstance request, - StreamObserver responseObserver) { - OSInfo osinfo = request.getOsinfo(); - AgentOsInfo agentOsInfo = new AgentOsInfo(); - agentOsInfo.setHostname(osinfo.getHostname()); - agentOsInfo.setOsName(osinfo.getOsName()); - agentOsInfo.setProcessNo(osinfo.getProcessNo()); - agentOsInfo.setIpv4s(osinfo.getIpv4SList()); - - int instanceId = instanceIDService.getOrCreateByAgentUUID(request.getApplicationId(), request.getAgentUUID(), request.getRegisterTime(), agentOsInfo); - ApplicationInstanceMapping.Builder builder = ApplicationInstanceMapping.newBuilder(); - builder.setApplicationId(request.getApplicationId()); - builder.setApplicationInstanceId(instanceId); - responseObserver.onNext(builder.build()); - responseObserver.onCompleted(); - } - - @Override public void heartbeat(ApplicationInstanceHeartbeat request, StreamObserver responseObserver) { - int instanceId = request.getApplicationInstanceId(); - long heartBeatTime = request.getHeartbeatTime(); - this.instanceHeartBeatService.heartBeat(instanceId, heartBeatTime); - responseObserver.onNext(Downstream.getDefaultInstance()); - responseObserver.onCompleted(); - } -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/JVMMetricsServiceHandler.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/JVMMetricsServiceHandler.java deleted file mode 100644 index 2608e42f193f489d553b729bb67f41d2acdf83d3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/JVMMetricsServiceHandler.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler; - -import io.grpc.stub.StreamObserver; -import java.util.List; -import org.apache.skywalking.apm.collector.analysis.jvm.define.AnalysisJVMModule; -import org.apache.skywalking.apm.collector.analysis.jvm.define.service.*; -import org.apache.skywalking.apm.collector.analysis.metric.define.AnalysisMetricModule; -import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.server.grpc.GRPCHandler; -import org.apache.skywalking.apm.network.language.agent.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class JVMMetricsServiceHandler extends JVMMetricsServiceGrpc.JVMMetricsServiceImplBase implements GRPCHandler { - - private static final Logger logger = LoggerFactory.getLogger(JVMMetricsServiceHandler.class); - - private final ICpuMetricService cpuMetricService; - private final IGCMetricService gcMetricService; - private final IMemoryMetricService memoryMetricService; - private final IMemoryPoolMetricService memoryPoolMetricService; - private final IInstanceHeartBeatService instanceHeartBeatService; - - public JVMMetricsServiceHandler(ModuleManager moduleManager) { - this.cpuMetricService = moduleManager.find(AnalysisJVMModule.NAME).getService(ICpuMetricService.class); - this.gcMetricService = moduleManager.find(AnalysisJVMModule.NAME).getService(IGCMetricService.class); - this.memoryMetricService = moduleManager.find(AnalysisJVMModule.NAME).getService(IMemoryMetricService.class); - this.memoryPoolMetricService = moduleManager.find(AnalysisJVMModule.NAME).getService(IMemoryPoolMetricService.class); - this.instanceHeartBeatService = moduleManager.find(AnalysisMetricModule.NAME).getService(IInstanceHeartBeatService.class); - } - - @Override public void collect(JVMMetrics request, StreamObserver responseObserver) { - int instanceId = request.getApplicationInstanceId(); - - if (logger.isDebugEnabled()) { - logger.debug("receive the jvm metric from application instance, id: {}", instanceId); - } - - request.getMetricsList().forEach(metric -> { - long minuteTimeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(metric.getTime()); - sendToCpuMetricService(instanceId, minuteTimeBucket, metric.getCpu()); - sendToMemoryMetricService(instanceId, minuteTimeBucket, metric.getMemoryList()); - sendToMemoryPoolMetricService(instanceId, minuteTimeBucket, metric.getMemoryPoolList()); - sendToGCMetricService(instanceId, minuteTimeBucket, metric.getGcList()); - sendToInstanceHeartBeatService(instanceId, metric.getTime()); - }); - - responseObserver.onNext(Downstream.newBuilder().build()); - responseObserver.onCompleted(); - } - - private void sendToMemoryMetricService(int instanceId, long timeBucket, List memories) { - memories.forEach(memory -> memoryMetricService.send(instanceId, timeBucket, memory.getIsHeap(), memory.getInit(), memory.getMax(), memory.getUsed(), memory.getCommitted())); - } - - private void sendToMemoryPoolMetricService(int instanceId, long timeBucket, - List memoryPools) { - - memoryPools.forEach(memoryPool -> memoryPoolMetricService.send(instanceId, timeBucket, memoryPool.getType().getNumber(), memoryPool.getInit(), memoryPool.getMax(), memoryPool.getUsed(), memoryPool.getCommited())); - } - - private void sendToCpuMetricService(int instanceId, long timeBucket, CPU cpu) { - cpuMetricService.send(instanceId, timeBucket, cpu.getUsagePercent()); - } - - private void sendToGCMetricService(int instanceId, long timeBucket, List gcs) { - gcs.forEach(gc -> gcMetricService.send(instanceId, timeBucket, gc.getPhraseValue(), gc.getCount(), gc.getTime())); - } - - private void sendToInstanceHeartBeatService(int instanceId, long heartBeatTime) { - instanceHeartBeatService.heartBeat(instanceId, heartBeatTime); - } -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/NetworkAddressRegisterServiceHandler.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/NetworkAddressRegisterServiceHandler.java deleted file mode 100644 index 0ebaf87cc6113061c35d61a3e2e7f3b4d7f8d9c6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/NetworkAddressRegisterServiceHandler.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler; - -import com.google.protobuf.ProtocolStringList; -import io.grpc.stub.StreamObserver; -import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule; -import org.apache.skywalking.apm.collector.analysis.register.define.service.INetworkAddressIDService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.server.grpc.GRPCHandler; -import org.apache.skywalking.apm.network.language.agent.KeyWithIntegerValue; -import org.apache.skywalking.apm.network.language.agent.NetworkAddressMappings; -import org.apache.skywalking.apm.network.language.agent.NetworkAddressRegisterServiceGrpc; -import org.apache.skywalking.apm.network.language.agent.NetworkAddresses; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class NetworkAddressRegisterServiceHandler extends NetworkAddressRegisterServiceGrpc.NetworkAddressRegisterServiceImplBase implements GRPCHandler { - - private static final Logger logger = LoggerFactory.getLogger(NetworkAddressRegisterServiceHandler.class); - - private final INetworkAddressIDService networkAddressIDService; - - public NetworkAddressRegisterServiceHandler(ModuleManager moduleManager) { - this.networkAddressIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(INetworkAddressIDService.class); - } - - @Override - public void batchRegister(NetworkAddresses request, StreamObserver responseObserver) { - if (logger.isDebugEnabled()) { - logger.debug("register application"); - } - - ProtocolStringList addressesList = request.getAddressesList(); - - NetworkAddressMappings.Builder builder = NetworkAddressMappings.newBuilder(); - for (String networkAddress : addressesList) { - int addressId = networkAddressIDService.get(networkAddress); - - if (addressId != 0) { - KeyWithIntegerValue value = KeyWithIntegerValue.newBuilder().setKey(networkAddress).setValue(addressId).build(); - builder.addAddressIds(value); - } - } - responseObserver.onNext(builder.build()); - responseObserver.onCompleted(); - } -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ServiceNameDiscoveryServiceHandler.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ServiceNameDiscoveryServiceHandler.java deleted file mode 100644 index 50bd2bf4834dab6a6aa3846bd4d807329ed0a095..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ServiceNameDiscoveryServiceHandler.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler; - -import io.grpc.stub.StreamObserver; -import java.util.List; -import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IServiceNameService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.server.grpc.GRPCHandler; -import org.apache.skywalking.apm.network.language.agent.ServiceNameCollection; -import org.apache.skywalking.apm.network.language.agent.ServiceNameDiscoveryServiceGrpc; -import org.apache.skywalking.apm.network.language.agent.ServiceNameElement; -import org.apache.skywalking.apm.network.language.agent.ServiceNameMappingCollection; -import org.apache.skywalking.apm.network.language.agent.ServiceNameMappingElement; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class ServiceNameDiscoveryServiceHandler extends ServiceNameDiscoveryServiceGrpc.ServiceNameDiscoveryServiceImplBase implements GRPCHandler { - - private static final Logger logger = LoggerFactory.getLogger(ServiceNameDiscoveryServiceHandler.class); - - private final IServiceNameService serviceNameService; - - public ServiceNameDiscoveryServiceHandler(ModuleManager moduleManager) { - this.serviceNameService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IServiceNameService.class); - } - - @Override public void discovery(ServiceNameCollection request, - StreamObserver responseObserver) { - List serviceNameElementList = request.getElementsList(); - - ServiceNameMappingCollection.Builder builder = ServiceNameMappingCollection.newBuilder(); - for (ServiceNameElement serviceNameElement : serviceNameElementList) { - int applicationId = serviceNameElement.getApplicationId(); - String serviceName = serviceNameElement.getServiceName(); - int srcSpanType = serviceNameElement.getSrcSpanTypeValue(); - int serviceId = serviceNameService.get(applicationId, srcSpanType, serviceName); - - if (serviceId != 0) { - ServiceNameMappingElement.Builder mappingElement = ServiceNameMappingElement.newBuilder(); - mappingElement.setServiceId(serviceId); - mappingElement.setElement(serviceNameElement); - builder.addElements(mappingElement); - } - } - - responseObserver.onNext(builder.build()); - responseObserver.onCompleted(); - } -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingHandler.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingHandler.java deleted file mode 100644 index cf505d01f1c4a234a164be7376dc750014fcc804..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingHandler.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.naming; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import java.util.Set; -import javax.servlet.http.HttpServletRequest; -import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException; -import org.apache.skywalking.apm.collector.server.jetty.JettyJsonHandler; - -/** - * @author peng-yongsheng - */ -public class AgentGRPCNamingHandler extends JettyJsonHandler { - - private final AgentGRPCNamingListener namingListener; - - public AgentGRPCNamingHandler(AgentGRPCNamingListener namingListener) { - this.namingListener = namingListener; - } - - @Override public String pathSpec() { - return "/agent/gRPC"; - } - - @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException { - Set servers = namingListener.getAddresses(); - JsonArray serverArray = new JsonArray(); - servers.forEach(serverArray::add); - return serverArray; - } - - @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException { - throw new UnsupportedOperationException(); - } -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingListener.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingListener.java deleted file mode 100644 index c6e2310320014ff80e00d9985ffdb0dd16851e1f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingListener.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.naming; - -import org.apache.skywalking.apm.collector.agent.grpc.define.AgentGRPCModule; -import org.apache.skywalking.apm.collector.agent.grpc.provider.AgentModuleGRPCProvider; -import org.apache.skywalking.apm.collector.cluster.ClusterModuleListener; - -/** - * @author peng-yongsheng - */ -public class AgentGRPCNamingListener extends ClusterModuleListener { - - public static final String PATH = "/" + AgentGRPCModule.NAME + "/" + AgentModuleGRPCProvider.NAME; - - @Override public String path() { - return PATH; - } - - @Override public void serverJoinNotify(String serverAddress) { - - } - - @Override public void serverQuitNotify(String serverAddress) { - - } -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index c32b4c9379692354d011d407b868c0e892008951..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.agent.grpc.provider.AgentModuleGRPCProvider diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCProviderTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCProviderTest.java deleted file mode 100644 index 8196f4445e65ae4a660d9e19b6e06aac4dec6a95..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCProviderTest.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider; - -import org.apache.skywalking.apm.collector.agent.grpc.define.AgentGRPCModule; -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.module.ServiceNotProvidedException; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.anyString; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class AgentModuleGRPCProviderTest { - - private AgentModuleGRPCProvider agentModuleGRPCProvider; - - @Mock - private AgentModuleGRPCConfig config; - - @Mock - private ModuleManager moduleManager; - - - @Before - public void setUp() throws Exception { - agentModuleGRPCProvider = new AgentModuleGRPCProvider(); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - Whitebox.setInternalState(agentModuleGRPCProvider, "config", config); - Whitebox.setInternalState(agentModuleGRPCProvider, "manager", moduleManager); - } - - @Test - public void name() { - Assert.assertEquals(agentModuleGRPCProvider.name(), "gRPC"); - } - - @Test - public void module() { - Assert.assertEquals(agentModuleGRPCProvider.module(), AgentGRPCModule.class); - } - - @Test - public void createConfigBeanIfAbsent() { - assertEquals(agentModuleGRPCProvider.createConfigBeanIfAbsent(), config); - } - - @Test - public void prepare() { - agentModuleGRPCProvider.prepare(); - } - - @Test - public void start() throws ServiceNotProvidedException { - String host = "127.0.0.1"; - Integer port = 12801; - Mockito.when(config.getHost()).thenReturn(host); - Mockito.when(config.getPort()).thenReturn(port); - Mockito.when(config.getAuthentication()).thenReturn("test_token"); - agentModuleGRPCProvider.start(); - - } - - @Test - public void notifyAfterCompleted() { - agentModuleGRPCProvider.notifyAfterCompleted(); - } - - @Test - public void requiredModules() { - String[] strings = agentModuleGRPCProvider.requiredModules(); - assertTrue(strings.length > 0); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCRegistrationTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCRegistrationTest.java deleted file mode 100644 index 5239ca19f5e97ffd7430b7e36d55898d4fb439a3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCRegistrationTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider; - -import org.apache.skywalking.apm.collector.cluster.ModuleRegistration; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.junit.Assert.*; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class AgentModuleGRPCRegistrationTest { - - private AgentModuleGRPCRegistration agentModuleGRPCRegistration; - - @Before - public void setUp() throws Exception { - agentModuleGRPCRegistration = new AgentModuleGRPCRegistration("127.0.0.1", 10900); - } - - @Test - public void buildValue() { - ModuleRegistration.Value value = agentModuleGRPCRegistration.buildValue(); - Assert.assertEquals(value.getHostPort(),"127.0.0.1:10900"); - Assert.assertEquals(value.getContextPath(),""); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AuthenticationSimpleCheckerTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AuthenticationSimpleCheckerTest.java deleted file mode 100644 index fc3df53d9670e15bec4650d28b304ef5454efdb1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AuthenticationSimpleCheckerTest.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider; - -import io.grpc.ServerServiceDefinition; -import io.grpc.StatusRuntimeException; -import io.grpc.testing.GrpcServerRule; -import org.apache.skywalking.apm.collector.agent.grpc.provider.handler.ApplicationRegisterServiceHandler; -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.server.ServerException; -import org.apache.skywalking.apm.collector.server.grpc.GRPCServer; -import org.apache.skywalking.apm.network.language.agent.Application; -import org.apache.skywalking.apm.network.language.agent.ApplicationMapping; -import org.apache.skywalking.apm.network.language.agent.ApplicationRegisterServiceGrpc; -import org.apache.skywalking.apm.network.language.agent.KeyWithIntegerValue; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.anyString; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class AuthenticationSimpleCheckerTest { - - @Rule - public final GrpcServerRule grpcServerRule = new GrpcServerRule().directExecutor(); - - @Mock - private ModuleManager moduleManager; - - @Before - public void setUp() throws Exception { - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - } - - @Test(expected = StatusRuntimeException.class) - public void build() throws ServerException { - ApplicationRegisterServiceHandler applicationRegisterServiceHandler = new ApplicationRegisterServiceHandler(moduleManager); - MockGRPCServer mockGRPCServer = new MockGRPCServer(grpcServerRule); - mockGRPCServer.initialize(); - - AuthenticationSimpleChecker.INSTANCE.build(mockGRPCServer, applicationRegisterServiceHandler); - grpcServerRule.getServiceRegistry().addService(applicationRegisterServiceHandler); - - ApplicationRegisterServiceGrpc.ApplicationRegisterServiceBlockingStub stub = ApplicationRegisterServiceGrpc.newBlockingStub(grpcServerRule.getChannel()); - Application application = Application.newBuilder().setApplicationCode("test").build(); - - ApplicationMapping applicationMapping = stub.applicationCodeRegister(application); - assertEquals(applicationMapping.getApplication(), KeyWithIntegerValue.getDefaultInstance()); - - AuthenticationSimpleChecker.INSTANCE.setExpectedToken("test"); - AuthenticationSimpleChecker.INSTANCE.build(mockGRPCServer, applicationRegisterServiceHandler); - stub.applicationCodeRegister(application); - - } - - @Test - public void setExpectedToken() { - - } - - class MockGRPCServer extends GRPCServer { - - private GrpcServerRule grpcServerRule; - - public MockGRPCServer(String host, int port) { - super(host, port); - } - - public MockGRPCServer(GrpcServerRule grpcServerRule) { - super("127.0.0.1", 0); - this.grpcServerRule = grpcServerRule; - } - - public void addHandler(ServerServiceDefinition definition) { - grpcServerRule.getServiceRegistry().addService(definition); - } - - - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ApplicationRegisterServiceHandlerTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ApplicationRegisterServiceHandlerTest.java deleted file mode 100644 index 13b4a1a15c50c7494d7065123cb1c3b3c413df9e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ApplicationRegisterServiceHandlerTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler; - -import io.grpc.stub.StreamObserver; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IApplicationIDService; -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.network.language.agent.Application; -import org.apache.skywalking.apm.network.language.agent.ApplicationMapping; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.internal.util.reflection.Whitebox; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class ApplicationRegisterServiceHandlerTest { - - private ApplicationRegisterServiceHandler applicationRegisterServiceHandler; - - @Mock - private IApplicationIDService applicationIDService; - - - @Before - public void setUp() { -// MockitoAnnotations.initMocks(this); - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - applicationRegisterServiceHandler = new ApplicationRegisterServiceHandler(moduleManager); - Whitebox.setInternalState(applicationRegisterServiceHandler, "applicationIDService", applicationIDService); - - } - - @Test - public void applicationCodeRegister() { - Application application = Application.newBuilder().setApplicationCode("test_code").build(); - when(applicationIDService.getOrCreateForApplicationCode(anyString())).thenReturn(1000); - applicationRegisterServiceHandler.applicationCodeRegister(application, new StreamObserver() { - @Override - public void onNext(ApplicationMapping applicationMapping) { - Assert.assertTrue(applicationMapping.getApplication().getValue() == 1000); - } - - @Override - public void onError(Throwable throwable) { - - } - - @Override - public void onCompleted() { - - } - }); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/InstanceDiscoveryServiceHandlerTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/InstanceDiscoveryServiceHandlerTest.java deleted file mode 100644 index 6ec0f458b3c5c80158299b08eadd27f967cebf4c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/InstanceDiscoveryServiceHandlerTest.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler; - -import io.grpc.stub.StreamObserver; -import java.util.UUID; -import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IInstanceIDService; -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.network.language.agent.ApplicationInstance; -import org.apache.skywalking.apm.network.language.agent.ApplicationInstanceHeartbeat; -import org.apache.skywalking.apm.network.language.agent.ApplicationInstanceMapping; -import org.apache.skywalking.apm.network.language.agent.Downstream; -import org.apache.skywalking.apm.network.language.agent.OSInfo; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.internal.util.reflection.Whitebox; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.mockito.Matchers.anyInt; -import static org.mockito.Matchers.anyLong; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class InstanceDiscoveryServiceHandlerTest { - - private InstanceDiscoveryServiceHandler instanceDiscoveryServiceHandler; - - @Mock - private IInstanceIDService instanceIDService; - @Mock - private IInstanceHeartBeatService instanceHeartBeatService; - - @Before - public void setUp() throws Exception { - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - instanceDiscoveryServiceHandler = new InstanceDiscoveryServiceHandler(moduleManager); - Whitebox.setInternalState(instanceDiscoveryServiceHandler, "instanceIDService", instanceIDService); - Whitebox.setInternalState(instanceDiscoveryServiceHandler, "instanceHeartBeatService", instanceHeartBeatService); - } - - @Test - public void registerInstance() { - ApplicationInstance applicationInstance = ApplicationInstance.newBuilder() - .setAgentUUID(UUID.randomUUID().toString()) - .setApplicationId(10) - .setRegisterTime(System.currentTimeMillis()) - .setOsinfo( - OSInfo.newBuilder() - .setOsName("MAC OS") - .setHostname("test") - .addIpv4S("127.0.0.1") - .setProcessNo(123456) - .build() - ).build(); - when(instanceIDService.getOrCreateByAgentUUID(anyInt(), anyString(), anyLong(), anyObject())).thenReturn(100); - instanceDiscoveryServiceHandler.registerInstance(applicationInstance, new StreamObserver() { - @Override - public void onNext(ApplicationInstanceMapping applicationInstanceMapping) { - Assert.assertEquals(100, applicationInstanceMapping.getApplicationInstanceId()); - } - - @Override - public void onError(Throwable throwable) { - - } - - @Override - public void onCompleted() { - - } - }); - } - - @Test - public void heartbeat() { - ApplicationInstanceHeartbeat heartbeat = ApplicationInstanceHeartbeat.newBuilder() - .setApplicationInstanceId(100) - .setHeartbeatTime(System.currentTimeMillis()) - .build(); - instanceDiscoveryServiceHandler.heartbeat(heartbeat, new StreamObserver() { - @Override - public void onNext(Downstream downstream) { - Assert.assertEquals(Downstream.getDefaultInstance(), downstream); - } - - @Override - public void onError(Throwable throwable) { - - } - - @Override - public void onCompleted() { - - } - }); - } -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/JVMMetricsServiceHandlerTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/JVMMetricsServiceHandlerTest.java deleted file mode 100644 index b5963e90ebf97e2f7e92bcdef243124aed6932fd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/JVMMetricsServiceHandlerTest.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler; - -import io.grpc.stub.StreamObserver; -import org.apache.skywalking.apm.collector.analysis.jvm.define.service.ICpuMetricService; -import org.apache.skywalking.apm.collector.analysis.jvm.define.service.IGCMetricService; -import org.apache.skywalking.apm.collector.analysis.jvm.define.service.IMemoryMetricService; -import org.apache.skywalking.apm.collector.analysis.jvm.define.service.IMemoryPoolMetricService; -import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService; -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.network.language.agent.*; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.internal.util.reflection.Whitebox; -import org.mockito.runners.MockitoJUnitRunner; - -import java.lang.management.*; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class JVMMetricsServiceHandlerTest { - - @Mock - private ICpuMetricService cpuMetricService; - @Mock - private IGCMetricService gcMetricService; - @Mock - private IMemoryMetricService memoryMetricService; - @Mock - private IMemoryPoolMetricService memoryPoolMetricService; - @Mock - private IInstanceHeartBeatService instanceHeartBeatService; - - private JVMMetricsServiceHandler jvmMetricsServiceHandler; - - @Before - public void setUp() { - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - jvmMetricsServiceHandler = new JVMMetricsServiceHandler(moduleManager); - Whitebox.setInternalState(jvmMetricsServiceHandler, "cpuMetricService", cpuMetricService); - Whitebox.setInternalState(jvmMetricsServiceHandler, "gcMetricService", gcMetricService); - Whitebox.setInternalState(jvmMetricsServiceHandler, "memoryMetricService", memoryMetricService); - Whitebox.setInternalState(jvmMetricsServiceHandler, "memoryPoolMetricService", memoryPoolMetricService); - Whitebox.setInternalState(jvmMetricsServiceHandler, "instanceHeartBeatService", instanceHeartBeatService); - } - - - @Test - public void collect() { - List beans = ManagementFactory.getGarbageCollectorMXBeans(); - List gcList = new ArrayList<>(); - for (GarbageCollectorMXBean bean : beans) { - gcList.add(GC.newBuilder().setPhrase(GCPhrase.NEW) - .setCount(10) - .setTime(100) - .build()); - } - CPU cpu = CPU.newBuilder() - .setUsagePercent(80.0d) - .build(); - - List memoryList = new LinkedList(); - - MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean(); - MemoryUsage heapMemoryUsage = memoryMXBean.getHeapMemoryUsage(); - Memory.Builder heapMemoryBuilder = Memory.newBuilder(); - heapMemoryBuilder.setIsHeap(true); - heapMemoryBuilder.setInit(heapMemoryUsage.getInit()); - heapMemoryBuilder.setUsed(heapMemoryUsage.getUsed()); - heapMemoryBuilder.setCommitted(heapMemoryUsage.getCommitted()); - heapMemoryBuilder.setMax(heapMemoryUsage.getMax()); - memoryList.add(heapMemoryBuilder.build()); - - MemoryUsage nonHeapMemoryUsage = memoryMXBean.getNonHeapMemoryUsage(); - Memory.Builder nonHeapMemoryBuilder = Memory.newBuilder(); - nonHeapMemoryBuilder.setIsHeap(false); - nonHeapMemoryBuilder.setInit(nonHeapMemoryUsage.getInit()); - nonHeapMemoryBuilder.setUsed(nonHeapMemoryUsage.getUsed()); - nonHeapMemoryBuilder.setCommitted(nonHeapMemoryUsage.getCommitted()); - nonHeapMemoryBuilder.setMax(nonHeapMemoryUsage.getMax()); - memoryList.add(nonHeapMemoryBuilder.build()); - - List memoryPoolMXBeans = ManagementFactory.getMemoryPoolMXBeans(); - List poolList = new LinkedList(); - for (MemoryPoolMXBean memoryPoolMXBean : memoryPoolMXBeans) { - MemoryUsage usage = memoryPoolMXBean.getUsage(); - poolList.add(MemoryPool.newBuilder().setType(PoolType.CODE_CACHE_USAGE) - .setInit(usage.getInit()) - .setMax(usage.getMax()) - .setCommited(usage.getCommitted()) - .setUsed(usage.getUsed()) - .build()); - } - - JVMMetric jvmMetric = JVMMetric.newBuilder() - .addAllGc(gcList) - .setCpu(cpu) - .addAllMemory(memoryList) - .addAllMemoryPool(poolList) - .setTime(System.currentTimeMillis()) - .build(); - JVMMetrics request = JVMMetrics.newBuilder() - .addMetrics(jvmMetric) - .setApplicationInstanceId(120) - .build(); - - jvmMetricsServiceHandler.collect(request, new StreamObserver() { - @Override - public void onNext(Downstream downstream) { - Assert.assertEquals(downstream.isInitialized(), true); - } - - @Override - public void onError(Throwable throwable) { - - } - - @Override - public void onCompleted() { - - } - }); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/NetworkAddressRegisterServiceHandlerTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/NetworkAddressRegisterServiceHandlerTest.java deleted file mode 100644 index cf4d2be54dd07bbf1335aba3b10ab7edf7d9a02c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/NetworkAddressRegisterServiceHandlerTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler; - -import io.grpc.stub.StreamObserver; -import org.apache.skywalking.apm.collector.analysis.register.define.service.INetworkAddressIDService; -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.network.language.agent.NetworkAddressMappings; -import org.apache.skywalking.apm.network.language.agent.NetworkAddresses; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.internal.util.reflection.Whitebox; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.junit.Assert.*; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class NetworkAddressRegisterServiceHandlerTest { - - @Mock - private INetworkAddressIDService networkAddressIDService; - - private NetworkAddressRegisterServiceHandler networkAddressRegisterServiceHandler; - - @Before - public void setUp() throws Exception { - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - networkAddressRegisterServiceHandler = new NetworkAddressRegisterServiceHandler(moduleManager); - Whitebox.setInternalState(networkAddressRegisterServiceHandler, "networkAddressIDService", networkAddressIDService); - } - - @Test - public void batchRegister() { - NetworkAddresses networkAddresses = NetworkAddresses.newBuilder() - .addAddresses("127.0.0.1:6379") - .build(); - when(networkAddressIDService.get(anyString())).thenReturn(1); - networkAddressRegisterServiceHandler.batchRegister(networkAddresses, new StreamObserver() { - @Override - public void onNext(NetworkAddressMappings networkAddressMappings) { - Assert.assertEquals(networkAddressMappings.getAddressIdsList().get(0).getValue(), 1); - } - - @Override - public void onError(Throwable throwable) { - - } - - @Override - public void onCompleted() { - - } - }); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/SegmentCounterTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/SegmentCounterTest.java deleted file mode 100644 index 30f8191d32ed1db5a9b73022262ea8f1c63bafc0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/SegmentCounterTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler; - -import org.junit.Assert; -import org.junit.Test; -import org.mockito.internal.util.reflection.Whitebox; - -import java.util.concurrent.atomic.AtomicLong; - -/** - * @author lican - */ -public class SegmentCounterTest { - - @Test - public void incrementAndGet() { - //set default value in case in other test has increments - Whitebox.setInternalState(SegmentCounter.INSTANCE, "counter", new AtomicLong(0)); - long l = SegmentCounter.INSTANCE.incrementAndGet(); - Assert.assertEquals(1L, l); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ServiceNameDiscoveryServiceHandlerTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ServiceNameDiscoveryServiceHandlerTest.java deleted file mode 100644 index a67632a856e315e3d5a1774adfb898ba40d46489..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/ServiceNameDiscoveryServiceHandlerTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler; - -import io.grpc.stub.StreamObserver; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IServiceNameService; -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.network.language.agent.*; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.internal.util.reflection.Whitebox; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.junit.Assert.*; -import static org.mockito.Matchers.anyInt; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class ServiceNameDiscoveryServiceHandlerTest { - - @Mock - private IServiceNameService serviceNameService; - - private ServiceNameDiscoveryServiceHandler serviceNameDiscoveryServiceHandler; - - @Before - public void setUp() throws Exception { - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - serviceNameDiscoveryServiceHandler = new ServiceNameDiscoveryServiceHandler(moduleManager); - Whitebox.setInternalState(serviceNameDiscoveryServiceHandler, "serviceNameService", serviceNameService); - - } - - @Test - public void discovery() { - ServiceNameElement element = ServiceNameElement.newBuilder() - .setApplicationId(10) - .setServiceName("/hello/world") - .setSrcSpanType(SpanType.Entry) - .build(); - ServiceNameCollection nameCollection = ServiceNameCollection.newBuilder() - .addElements(element) - .build(); - when(serviceNameService.get(anyInt(), anyInt(), anyString())).thenReturn(1); - serviceNameDiscoveryServiceHandler.discovery(nameCollection, new StreamObserver() { - @Override - public void onNext(ServiceNameMappingCollection serviceNameMappingCollection) { - ServiceNameMappingElement mappingElement = serviceNameMappingCollection.getElementsList().get(0); - assertEquals(mappingElement.getElement(), element); - int serviceId = mappingElement.getServiceId(); - assertEquals(serviceId, 1); - } - - @Override - public void onError(Throwable throwable) { - - } - - @Override - public void onCompleted() { - - } - }); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/TraceSegmentServiceHandlerTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/TraceSegmentServiceHandlerTest.java deleted file mode 100644 index dd55a73bf8bb2c1a1567ee2b13d139c4117672bc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/TraceSegmentServiceHandlerTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler; - -import io.grpc.stub.StreamObserver; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.service.ISegmentParseService; -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.network.language.agent.Downstream; -import org.apache.skywalking.apm.network.language.agent.UpstreamSegment; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.internal.util.reflection.Whitebox; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class TraceSegmentServiceHandlerTest { - - private TraceSegmentServiceHandler traceSegmentServiceHandler; - - @Mock - private ISegmentParseService segmentParseService; - - @Before - public void setUp() { - System.setProperty("debug", "true"); - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - traceSegmentServiceHandler = new TraceSegmentServiceHandler(moduleManager); - Whitebox.setInternalState(traceSegmentServiceHandler, "segmentParseService", segmentParseService); - - } - - @Test - public void collect() { - StreamObserver upstreamSegmentStreamObserver = traceSegmentServiceHandler.collect(new StreamObserver() { - @Override - public void onNext(Downstream downstream) { - assertTrue(downstream.isInitialized()); - } - - @Override - public void onError(Throwable throwable) { - assertTrue(throwable instanceof IllegalArgumentException); - } - - @Override - public void onCompleted() { - - - } - }); - UpstreamSegment upstreamSegment = UpstreamSegment.newBuilder().build(); - upstreamSegmentStreamObserver.onNext(upstreamSegment); - upstreamSegmentStreamObserver.onError(new IllegalArgumentException("exception")); - upstreamSegmentStreamObserver.onCompleted(); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/AgentDataMock.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/AgentDataMock.java deleted file mode 100644 index 7fba65379ef0fe5c89ebbd78699348bd2afba0d5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/AgentDataMock.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.mock; - -import io.grpc.ManagedChannel; -import io.grpc.ManagedChannelBuilder; -import io.grpc.stub.StreamObserver; -import java.util.LinkedList; -import java.util.List; -import org.apache.skywalking.apm.network.language.agent.Downstream; -import org.apache.skywalking.apm.network.language.agent.TraceSegmentServiceGrpc; -import org.apache.skywalking.apm.network.language.agent.UpstreamSegment; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class AgentDataMock { - - private static final Logger logger = LoggerFactory.getLogger(TraceSegmentMock.class); - - public static void main(String[] args) throws InterruptedException { - ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 11800).usePlaintext(true).build(); - - List> upstreamSegments = new LinkedList<>(); - upstreamSegments.add(createStreamObserver()); - upstreamSegments.add(createStreamObserver()); - upstreamSegments.add(createStreamObserver()); - upstreamSegments.add(createStreamObserver()); - - RegisterMock registerMock = new RegisterMock(); - registerMock.mock(channel); - - TraceSegmentMock segmentMock = new TraceSegmentMock(); - segmentMock.mock(upstreamSegments, new Long[] {System.currentTimeMillis()}, true); - - Thread.sleep(30000); - - Long[] times = TimeBuilder.INSTANCE.generateTimes(); - logger.info("times size: {}", times.length); - - segmentMock.mock(upstreamSegments, times, false); - - JVMMetricMock jvmMetricMock = new JVMMetricMock(); - jvmMetricMock.mock(channel, times); - - Thread.sleep(60); - } - - private static StreamObserver createStreamObserver() { - ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 11800).usePlaintext(true).build(); - TraceSegmentServiceGrpc.TraceSegmentServiceStub stub = TraceSegmentServiceGrpc.newStub(channel); - StreamObserver segmentStreamObserver = stub.collect(new StreamObserver() { - @Override public void onNext(Downstream downstream) { - } - - @Override public void onError(Throwable throwable) { - } - - @Override public void onCompleted() { - } - }); - - return segmentStreamObserver; - } -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/ConsumerMock.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/ConsumerMock.java deleted file mode 100644 index 90fdfe0cf2aa49247425e90b3ca318ee7bb562a7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/ConsumerMock.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.mock; - -import com.google.protobuf.ByteString; -import io.grpc.stub.StreamObserver; -import org.apache.skywalking.apm.network.language.agent.*; -import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; - -/** - * @author peng-yongsheng - */ -class ConsumerMock { - - void mock(StreamObserver segmentStreamObserver, UniqueId.Builder globalTraceId, - UniqueId.Builder segmentId, long startTimestamp, boolean isPrepare) { - UpstreamSegment.Builder upstreamSegment = UpstreamSegment.newBuilder(); - upstreamSegment.addGlobalTraceIds(globalTraceId); - upstreamSegment.setSegment(createSegment(startTimestamp, segmentId, isPrepare)); - - segmentStreamObserver.onNext(upstreamSegment.build()); - } - - private ByteString createSegment(long startTimestamp, UniqueId.Builder segmentId, boolean isPrepare) { - TraceSegmentObject.Builder segment = TraceSegmentObject.newBuilder(); - segment.setTraceSegmentId(segmentId); - segment.setApplicationId(-1); - segment.setApplicationInstanceId(2); - segment.addSpans(createEntrySpan(startTimestamp, isPrepare)); - segment.addSpans(createLocalSpan(startTimestamp, isPrepare)); - segment.addSpans(createMqEntrySpan(startTimestamp, isPrepare)); - segment.addSpans(createExitSpan(startTimestamp, isPrepare)); - segment.addSpans(createMqEntrySpan2(startTimestamp, isPrepare)); - segment.addSpans(createExitSpan2(startTimestamp, isPrepare)); - - return segment.build().toByteString(); - } - - private SpanObject.Builder createEntrySpan(long startTimestamp, boolean isPrepare) { - SpanObject.Builder span = SpanObject.newBuilder(); - span.setSpanId(0); - span.setSpanType(SpanType.Entry); - span.setSpanLayer(SpanLayer.Http); - span.setParentSpanId(-1); - span.setStartTime(startTimestamp); - span.setEndTime(startTimestamp + 2000); - span.setComponentId(ComponentsDefine.TOMCAT.getId()); - if (isPrepare) { - span.setOperationName("/dubbox-case/case/dubbox-rest"); - } else { - span.setOperationNameId(2); - } - span.setIsError(false); - return span; - } - - private SpanObject.Builder createLocalSpan(long startTimestamp, boolean isPrepare) { - SpanObject.Builder span = SpanObject.newBuilder(); - span.setSpanId(1); - span.setSpanType(SpanType.Local); - span.setParentSpanId(0); - span.setStartTime(startTimestamp + 100); - span.setEndTime(startTimestamp + 1900); - if (isPrepare) { - span.setOperationName("org.apache.skywalking.Local.do"); - } else { - span.setOperationNameId(2); - } - span.setIsError(false); - return span; - } - - private SpanObject.Builder createMqEntrySpan(long startTimestamp, boolean isPrepare) { - SpanObject.Builder span = SpanObject.newBuilder(); - span.setSpanId(2); - span.setSpanType(SpanType.Entry); - span.setSpanLayer(SpanLayer.MQ); - span.setParentSpanId(1); - span.setStartTime(startTimestamp + 110); - span.setEndTime(startTimestamp + 1800); - span.setComponentId(ComponentsDefine.ROCKET_MQ_CONSUMER.getId()); - if (isPrepare) { - span.setOperationName("org.apache.skywalking.RocketMQ"); - } else { - span.setOperationNameId(2); - } - span.setIsError(false); - return span; - } - - private SpanObject.Builder createExitSpan(long startTimestamp, boolean isPrepare) { - SpanObject.Builder span = SpanObject.newBuilder(); - span.setSpanId(3); - span.setSpanType(SpanType.Exit); - span.setSpanLayer(SpanLayer.RPCFramework); - span.setParentSpanId(2); - span.setStartTime(startTimestamp + 120); - span.setEndTime(startTimestamp + 1780); - span.setComponentId(ComponentsDefine.DUBBO.getId()); - if (isPrepare) { - span.setPeer("172.25.0.4:20880"); - span.setOperationName("org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()"); - } else { - span.setOperationNameId(-1); - span.setPeerId(-1); - } - span.setIsError(false); - return span; - } - - private SpanObject.Builder createMqEntrySpan2(long startTimestamp, boolean isPrepare) { - SpanObject.Builder span = SpanObject.newBuilder(); - span.setSpanId(4); - span.setSpanType(SpanType.Entry); - span.setSpanLayer(SpanLayer.MQ); - span.setParentSpanId(1); - span.setStartTime(startTimestamp + 110); - span.setEndTime(startTimestamp + 1800); - span.setComponentId(ComponentsDefine.ROCKET_MQ_CONSUMER.getId()); - if (isPrepare) { - span.setOperationName("org.apache.skywalking.RocketMQ"); - } else { - span.setOperationNameId(2); - } - span.setIsError(false); - return span; - } - - private SpanObject.Builder createExitSpan2(long startTimestamp, boolean isPrepare) { - SpanObject.Builder span = SpanObject.newBuilder(); - span.setSpanId(5); - span.setSpanType(SpanType.Exit); - span.setSpanLayer(SpanLayer.RPCFramework); - span.setParentSpanId(4); - span.setStartTime(startTimestamp + 120); - span.setEndTime(startTimestamp + 1780); - span.setComponentId(ComponentsDefine.DUBBO.getId()); - if (isPrepare) { - span.setPeer("172.25.0.4:20880"); - span.setOperationName("org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()"); - } else { - span.setOperationNameId(-1); - span.setPeerId(-1); - } - span.setIsError(false); - return span; - } -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/JVMMetricMock.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/JVMMetricMock.java deleted file mode 100644 index bb8f492fe45cdd93f11c51c42f9d8d0e4e8ad599..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/JVMMetricMock.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.mock; - -import io.grpc.ManagedChannel; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.atomic.AtomicInteger; -import org.apache.skywalking.apm.network.language.agent.CPU; -import org.apache.skywalking.apm.network.language.agent.GC; -import org.apache.skywalking.apm.network.language.agent.GCPhrase; -import org.apache.skywalking.apm.network.language.agent.JVMMetric; -import org.apache.skywalking.apm.network.language.agent.JVMMetrics; -import org.apache.skywalking.apm.network.language.agent.JVMMetricsServiceGrpc; -import org.apache.skywalking.apm.network.language.agent.Memory; -import org.apache.skywalking.apm.network.language.agent.MemoryPool; -import org.apache.skywalking.apm.network.language.agent.PoolType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -class JVMMetricMock { - - private static final Logger logger = LoggerFactory.getLogger(JVMMetricMock.class); - - void mock(ManagedChannel channel, Long[] times) { - JVMMetricsServiceGrpc.JVMMetricsServiceBlockingStub jvmMetricsServiceBlockingStub = JVMMetricsServiceGrpc.newBlockingStub(channel); - - Set timeSet = new HashSet<>(); - timeSet.addAll(Arrays.asList(times)); - - AtomicInteger increment = new AtomicInteger(0); - timeSet.forEach(timestamp -> { - JVMMetrics.Builder jvmMetrics = JVMMetrics.newBuilder(); - jvmMetrics.setApplicationInstanceId(2); - - JVMMetric.Builder jvmMetricBuilder = JVMMetric.newBuilder(); - jvmMetricBuilder.setTime(timestamp); - - buildCPUMetric(jvmMetricBuilder); - buildGCMetric(jvmMetricBuilder); - buildMemoryMetric(jvmMetricBuilder); - buildMemoryPoolMetric(jvmMetricBuilder); - - jvmMetrics.addMetrics(jvmMetricBuilder.build()); - jvmMetricsServiceBlockingStub.collect(jvmMetrics.build()); - - if (increment.incrementAndGet() % 100 == 0) { - logger.info("sending jvm metric number: {}", increment.get()); - } - }); - logger.info("sending jvm metric number: {}", increment.get()); - } - - private static void buildMemoryPoolMetric(JVMMetric.Builder metricBuilder) { - MemoryPool.Builder codeCache = MemoryPool.newBuilder(); - codeCache.setInit(10); - codeCache.setMax(100); - codeCache.setCommited(10); - codeCache.setUsed(50); - codeCache.setType(PoolType.CODE_CACHE_USAGE); - metricBuilder.addMemoryPool(codeCache); - - MemoryPool.Builder newGen = MemoryPool.newBuilder(); - newGen.setInit(10); - newGen.setMax(100); - newGen.setCommited(10); - newGen.setUsed(50); - newGen.setType(PoolType.NEWGEN_USAGE); - metricBuilder.addMemoryPool(newGen); - - MemoryPool.Builder oldGen = MemoryPool.newBuilder(); - oldGen.setInit(10); - oldGen.setMax(100); - oldGen.setCommited(10); - oldGen.setUsed(50); - oldGen.setType(PoolType.OLDGEN_USAGE); - metricBuilder.addMemoryPool(oldGen); - - MemoryPool.Builder survivor = MemoryPool.newBuilder(); - survivor.setInit(10); - survivor.setMax(100); - survivor.setCommited(10); - survivor.setUsed(50); - survivor.setType(PoolType.SURVIVOR_USAGE); - metricBuilder.addMemoryPool(survivor); - - MemoryPool.Builder permGen = MemoryPool.newBuilder(); - permGen.setInit(10); - permGen.setMax(100); - permGen.setCommited(10); - permGen.setUsed(50); - permGen.setType(PoolType.PERMGEN_USAGE); - metricBuilder.addMemoryPool(permGen); - - MemoryPool.Builder metaSpace = MemoryPool.newBuilder(); - metaSpace.setInit(10); - metaSpace.setMax(100); - metaSpace.setCommited(10); - metaSpace.setUsed(50); - metaSpace.setType(PoolType.METASPACE_USAGE); - metricBuilder.addMemoryPool(metaSpace); - } - - private static void buildMemoryMetric(JVMMetric.Builder metricBuilder) { - Memory.Builder isHeap = Memory.newBuilder(); - isHeap.setInit(20); - isHeap.setMax(100); - isHeap.setCommitted(20); - isHeap.setUsed(60); - isHeap.setIsHeap(true); - metricBuilder.addMemory(isHeap); - - Memory.Builder nonHeap = Memory.newBuilder(); - nonHeap.setInit(20); - nonHeap.setMax(100); - nonHeap.setCommitted(20); - nonHeap.setUsed(60); - nonHeap.setIsHeap(false); - metricBuilder.addMemory(nonHeap); - } - - private static void buildGCMetric(JVMMetric.Builder metricBuilder) { - GC.Builder newGC = GC.newBuilder(); - newGC.setPhrase(GCPhrase.NEW); - newGC.setCount(2); - newGC.setTime(1000); - metricBuilder.addGc(newGC); - - GC.Builder oldGC = GC.newBuilder(); - oldGC.setPhrase(GCPhrase.OLD); - oldGC.setCount(4); - oldGC.setTime(49); - metricBuilder.addGc(oldGC); - } - - private static void buildCPUMetric(JVMMetric.Builder metricBuilder) { - CPU.Builder cpu = CPU.newBuilder(); - cpu.setUsagePercent(20); - metricBuilder.setCpu(cpu.build()); - } -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/ProviderMock.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/ProviderMock.java deleted file mode 100644 index 11538b0a587c8a819146f15606efdf4b7ce5c261..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/ProviderMock.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.mock; - -import com.google.protobuf.ByteString; -import io.grpc.stub.StreamObserver; -import org.apache.skywalking.apm.network.language.agent.RefType; -import org.apache.skywalking.apm.network.language.agent.SpanLayer; -import org.apache.skywalking.apm.network.language.agent.SpanObject; -import org.apache.skywalking.apm.network.language.agent.SpanType; -import org.apache.skywalking.apm.network.language.agent.TraceSegmentObject; -import org.apache.skywalking.apm.network.language.agent.TraceSegmentReference; -import org.apache.skywalking.apm.network.language.agent.UniqueId; -import org.apache.skywalking.apm.network.language.agent.UpstreamSegment; -import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; - -/** - * @author peng-yongsheng - */ -class ProviderMock { - - void mock(StreamObserver segmentStreamObserver, UniqueId.Builder globalTraceId, - UniqueId.Builder segmentId, UniqueId.Builder parentTraceSegmentId, long startTimestamp, boolean isPrepare) { - UpstreamSegment.Builder upstreamSegment = UpstreamSegment.newBuilder(); - upstreamSegment.addGlobalTraceIds(globalTraceId); - upstreamSegment.setSegment(createSegment(startTimestamp, segmentId, parentTraceSegmentId, isPrepare)); - - segmentStreamObserver.onNext(upstreamSegment.build()); - } - - private ByteString createSegment(long startTimestamp, UniqueId.Builder segmentId, - UniqueId.Builder parentTraceSegmentId, boolean isPrepare) { - TraceSegmentObject.Builder segment = TraceSegmentObject.newBuilder(); - segment.setTraceSegmentId(segmentId); - segment.setApplicationId(2); - segment.setApplicationInstanceId(3); - segment.addSpans(createExitSpan(startTimestamp, isPrepare)); - segment.addSpans(createEntrySpan(startTimestamp, parentTraceSegmentId, isPrepare)); - - return segment.build().toByteString(); - } - - private TraceSegmentReference.Builder createReference(UniqueId.Builder parentTraceSegmentId, boolean isPrepare) { - TraceSegmentReference.Builder reference = TraceSegmentReference.newBuilder(); - reference.setParentTraceSegmentId(parentTraceSegmentId); - reference.setParentApplicationInstanceId(2); - reference.setParentSpanId(1); - reference.setEntryApplicationInstanceId(2); - reference.setRefType(RefType.CrossProcess); - - if (isPrepare) { - reference.setParentServiceName("/dubbox-case/case/dubbox-rest"); - reference.setNetworkAddress("172.25.0.4:20880"); - reference.setEntryServiceName("/dubbox-case/case/dubbox-rest"); - } else { - reference.setParentServiceId(2); - reference.setNetworkAddressId(-1); - reference.setEntryServiceId(2); - } - return reference; - } - - private SpanObject.Builder createExitSpan(long startTimestamp, boolean isPrepare) { - SpanObject.Builder span = SpanObject.newBuilder(); - span.setSpanId(1); - span.setSpanType(SpanType.Exit); - span.setSpanLayer(SpanLayer.Database); - span.setParentSpanId(0); - span.setStartTime(startTimestamp + 510); - span.setEndTime(startTimestamp + 1490); - span.setComponentId(ComponentsDefine.MONGO_DRIVER.getId()); - span.setIsError(true); - - if (isPrepare) { - span.setOperationName("mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]"); - span.setPeer("localhost:27017"); - } else { - span.setOperationNameId(-2); - span.setPeerId(1); - } - return span; - } - - private SpanObject.Builder createEntrySpan(long startTimestamp, UniqueId.Builder uniqueId, boolean isPrepare) { - SpanObject.Builder span = SpanObject.newBuilder(); - span.setSpanId(0); - span.setSpanType(SpanType.Entry); - span.setSpanLayer(SpanLayer.RPCFramework); - span.setParentSpanId(-1); - span.setStartTime(startTimestamp + 500); - span.setEndTime(startTimestamp + 1500); - span.setComponentId(ComponentsDefine.DUBBO.getId()); - span.setIsError(false); - span.addRefs(createReference(uniqueId, isPrepare)); - - if (isPrepare) { - span.setOperationName("org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()"); - } else { - span.setOperationNameId(3); - } - return span; - } -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/RegisterMock.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/RegisterMock.java deleted file mode 100644 index 3463d1f54106566bd85522607a56cc7dd7cf692c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/RegisterMock.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.mock; - -import io.grpc.ManagedChannel; -import java.util.UUID; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; -import org.apache.skywalking.apm.network.language.agent.Application; -import org.apache.skywalking.apm.network.language.agent.ApplicationInstance; -import org.apache.skywalking.apm.network.language.agent.ApplicationInstanceHeartbeat; -import org.apache.skywalking.apm.network.language.agent.ApplicationInstanceMapping; -import org.apache.skywalking.apm.network.language.agent.ApplicationMapping; -import org.apache.skywalking.apm.network.language.agent.ApplicationRegisterServiceGrpc; -import org.apache.skywalking.apm.network.language.agent.InstanceDiscoveryServiceGrpc; -import org.apache.skywalking.apm.network.language.agent.OSInfo; -import org.apache.skywalking.apm.network.language.agent.ServiceNameCollection; -import org.apache.skywalking.apm.network.language.agent.ServiceNameDiscoveryServiceGrpc; -import org.apache.skywalking.apm.network.language.agent.ServiceNameElement; -import org.apache.skywalking.apm.network.language.agent.ServiceNameMappingCollection; -import org.apache.skywalking.apm.network.language.agent.SpanType; -import org.apache.skywalking.apm.util.RunnableWithExceptionProtection; -import org.joda.time.DateTime; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -class RegisterMock { - - private static final Logger logger = LoggerFactory.getLogger(RegisterMock.class); - - private ApplicationRegisterServiceGrpc.ApplicationRegisterServiceBlockingStub applicationRegisterServiceBlockingStub; - private InstanceDiscoveryServiceGrpc.InstanceDiscoveryServiceBlockingStub instanceDiscoveryServiceBlockingStub; - private ServiceNameDiscoveryServiceGrpc.ServiceNameDiscoveryServiceBlockingStub serviceNameDiscoveryServiceBlockingStub; - - void mock(ManagedChannel channel) throws InterruptedException { - applicationRegisterServiceBlockingStub = ApplicationRegisterServiceGrpc.newBlockingStub(channel); - instanceDiscoveryServiceBlockingStub = InstanceDiscoveryServiceGrpc.newBlockingStub(channel); - serviceNameDiscoveryServiceBlockingStub = ServiceNameDiscoveryServiceGrpc.newBlockingStub(channel); - registerConsumer(); - registerProvider(); - } - - private void registerConsumer() throws InterruptedException { - Application.Builder application = Application.newBuilder(); - application.setApplicationCode("dubbox-consumer"); - - ApplicationMapping applicationMapping; - do { - applicationMapping = applicationRegisterServiceBlockingStub.applicationCodeRegister(application.build()); - logger.debug("application id: {}", applicationMapping.getApplication().getValue()); - Thread.sleep(20); - } - while (applicationMapping.getApplication().getValue() == 0); - - ApplicationInstance.Builder instance = ApplicationInstance.newBuilder(); - instance.setApplicationId(applicationMapping.getApplication().getValue()); - instance.setAgentUUID(UUID.randomUUID().toString()); - instance.setRegisterTime(new DateTime("2017-01-01T00:01:01.001").getMillis()); - - OSInfo.Builder osInfo = OSInfo.newBuilder(); - osInfo.setHostname("pengys"); - osInfo.setOsName("MacOS XX"); - osInfo.setProcessNo(1001); - osInfo.addIpv4S("10.0.0.3"); - osInfo.addIpv4S("10.0.0.4"); - instance.setOsinfo(osInfo); - - ApplicationInstanceMapping instanceMapping; - do { - instanceMapping = instanceDiscoveryServiceBlockingStub.registerInstance(instance.build()); - logger.debug("instance id: {}", instanceMapping.getApplicationInstanceId()); - Thread.sleep(20); - } - while (instanceMapping.getApplicationInstanceId() == 0); - - ServiceNameCollection.Builder serviceNameCollection = ServiceNameCollection.newBuilder(); - ServiceNameElement.Builder serviceNameElement = ServiceNameElement.newBuilder(); - serviceNameElement.setApplicationId(applicationMapping.getApplication().getValue()); - serviceNameElement.setServiceName("org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()"); - serviceNameElement.setSrcSpanType(SpanType.Exit); - serviceNameCollection.addElements(serviceNameElement); - -// registerServiceName(serviceNameCollection); - - heartBeatScheduled(instanceMapping.getApplicationInstanceId()); - } - - private void registerProvider() throws InterruptedException { - Application.Builder application = Application.newBuilder(); - application.setApplicationCode("dubbox-provider"); - - ApplicationMapping applicationMapping; - do { - applicationMapping = applicationRegisterServiceBlockingStub.applicationCodeRegister(application.build()); - logger.debug("application id: {}", applicationMapping.getApplication().getValue()); - Thread.sleep(20); - } - while (applicationMapping.getApplication().getValue() == 0); - - ApplicationInstance.Builder instance = ApplicationInstance.newBuilder(); - instance.setApplicationId(applicationMapping.getApplication().getValue()); - instance.setAgentUUID(UUID.randomUUID().toString()); - instance.setRegisterTime(new DateTime("2017-01-01T00:01:01.001").getMillis()); - - OSInfo.Builder osInfo = OSInfo.newBuilder(); - osInfo.setHostname("peng-yongsheng"); - osInfo.setOsName("MacOS X"); - osInfo.setProcessNo(1000); - osInfo.addIpv4S("10.0.0.1"); - osInfo.addIpv4S("10.0.0.2"); - instance.setOsinfo(osInfo); - - ApplicationInstanceMapping instanceMapping; - do { - instanceMapping = instanceDiscoveryServiceBlockingStub.registerInstance(instance.build()); - logger.debug("instance id: {}", instanceMapping.getApplicationInstanceId()); - Thread.sleep(20); - } - while (instanceMapping.getApplicationInstanceId() == 0); - - ServiceNameCollection.Builder serviceNameCollection = ServiceNameCollection.newBuilder(); - ServiceNameElement.Builder serviceNameElement = ServiceNameElement.newBuilder(); - serviceNameElement.setApplicationId(applicationMapping.getApplication().getValue()); - serviceNameElement.setServiceName("org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()"); - serviceNameElement.setSrcSpanType(SpanType.Entry); - serviceNameCollection.addElements(serviceNameElement); - -// registerServiceName(serviceNameCollection); - - heartBeatScheduled(instanceMapping.getApplicationInstanceId()); - } - - private void registerServiceName(ServiceNameCollection.Builder serviceNameCollection) throws InterruptedException { - ServiceNameMappingCollection serviceNameMappingCollection; - do { - logger.debug("register service name: {}", serviceNameCollection.getElements(0).getServiceName()); - serviceNameMappingCollection = serviceNameDiscoveryServiceBlockingStub.discovery(serviceNameCollection.build()); - logger.debug("service name mapping collection size: {}", serviceNameMappingCollection.getElementsCount()); - if (serviceNameMappingCollection.getElementsCount() > 0) { - logger.debug("service id: {}", serviceNameMappingCollection.getElements(0).getServiceId()); - } - Thread.sleep(20); - } - while (serviceNameMappingCollection.getElementsCount() == 0 || serviceNameMappingCollection.getElements(0).getServiceId() == 0); - } - - private void heartBeatScheduled(int instanceId) { - Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate( - new RunnableWithExceptionProtection(() -> heartBeat(instanceId), - t -> logger.error("instance heart beat scheduled error.", t)), 4, 1, TimeUnit.SECONDS); - } - - private void heartBeat(int instanceId) { - long now = System.currentTimeMillis(); - logger.debug("instance heart beat, instance id: {}, time: {}", instanceId, now); - ApplicationInstanceHeartbeat.Builder heartbeat = ApplicationInstanceHeartbeat.newBuilder(); - heartbeat.setApplicationInstanceId(instanceId); - heartbeat.setHeartbeatTime(now); - instanceDiscoveryServiceBlockingStub.heartbeat(heartbeat.build()); - } -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/TimeBuilder.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/TimeBuilder.java deleted file mode 100644 index a1eaca7c4b1439a033a2f34ef8a4f833950561aa..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/TimeBuilder.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.mock; - -import java.util.LinkedList; -import java.util.List; -import org.joda.time.DateTime; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public enum TimeBuilder { - INSTANCE; - - private static final Logger logger = LoggerFactory.getLogger(TimeBuilder.class); - - private Duration[] durations = { - new Duration("2017-01-01T00:02:01.001", "2017-01-01T00:05:01.001", 20), - new Duration("2017-02-01T00:02:01.001", "2017-02-01T00:05:01.001", 20), - new Duration("2017-03-01T00:02:01.001", "2017-03-01T00:05:01.001", 20), - - new Duration("2017-04-01T00:02:01.001", "2017-04-01T00:05:01.001", 20), - new Duration("2017-04-02T00:02:01.001", "2017-04-02T00:05:01.001", 20), - new Duration("2017-04-03T00:02:01.001", "2017-04-03T00:05:01.001", 20), - - new Duration("2017-05-01T08:02:01.001", "2017-05-01T08:05:01.001", 20), - new Duration("2017-05-01T09:02:01.001", "2017-05-01T09:05:01.001", 20), - new Duration("2017-05-01T10:02:01.001", "2017-05-01T10:05:01.001", 20), - - new Duration("2017-06-01T1:02:01.001", "2017-06-01T11:02:01.001", 100), - }; - - public Long[] generateTimes() { - List times = new LinkedList<>(); - - for (Duration duration : durations) { - DateTime start = new DateTime(duration.getStart()); - DateTime end = new DateTime(duration.getEnd()); - - while (!start.isAfter(end)) { - for (int i = 0; i < duration.getTps(); i++) { - times.add(start.getMillis()); - } - start = start.plusSeconds(1); - } - } - - return times.toArray(new Long[0]); - } - - class Duration { - private String start; - private String end; - private int tps; - - Duration(String start, String end, int tps) { - this.start = start; - this.end = end; - this.tps = tps; - } - - String getStart() { - return start; - } - - String getEnd() { - return end; - } - - int getTps() { - return tps; - } - } - - public static void main(String[] args) { - Long[] times = TimeBuilder.INSTANCE.generateTimes(); - - for (Long time : times) { - DateTime dateTime = new DateTime(time); - logger.debug("{}-{}-{} {}:{}:{} {}", dateTime.year().getAsText(), dateTime.monthOfYear().getAsString(), - dateTime.dayOfMonth().getAsText(), dateTime.hourOfDay().getAsText(), - dateTime.minuteOfHour().getAsText(), dateTime.secondOfMinute().getAsText(), - dateTime.millisOfSecond().getAsText()); - } - } -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/TraceSegmentMock.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/TraceSegmentMock.java deleted file mode 100644 index ff881ca1a2fb1afc438038e5a0c4ba201a104c44..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/TraceSegmentMock.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.mock; - -import io.grpc.stub.StreamObserver; -import java.util.List; -import org.apache.skywalking.apm.network.language.agent.UniqueId; -import org.apache.skywalking.apm.network.language.agent.UpstreamSegment; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -class TraceSegmentMock { - - private static final Logger logger = LoggerFactory.getLogger(TraceSegmentMock.class); - - void mock(List> upstreamSegments, Long[] times, boolean isPrepare) { - long startTime = System.currentTimeMillis(); - long lastTime = System.currentTimeMillis(); - for (int i = 0; i < times.length; i++) { - long startTimestamp = times[i]; - - UniqueId.Builder globalTraceId = UniqueIdBuilder.INSTANCE.create(); - - ConsumerMock consumerMock = new ConsumerMock(); - UniqueId.Builder consumerSegmentId = UniqueIdBuilder.INSTANCE.create(); - consumerMock.mock(upstreamSegments.get(i % 4), globalTraceId, consumerSegmentId, startTimestamp, isPrepare); - - ProviderMock providerMock = new ProviderMock(); - UniqueId.Builder providerSegmentId = UniqueIdBuilder.INSTANCE.create(); - providerMock.mock(upstreamSegments.get(i % 4), globalTraceId, providerSegmentId, consumerSegmentId, startTimestamp, isPrepare); - - if (i % 10000 == 0) { - logger.info("sending segment number: {}", i); - } - - if (i % 10000 == 0) { - long endTime = System.currentTimeMillis(); - if (endTime - startTime > 0) { - logger.info("tps: {}", ((long)i * 2 * 1000) / (endTime - startTime)); - } - } - - if (i % 5000 == 0) { - long endTime = System.currentTimeMillis(); - long duration = endTime - lastTime; - if (duration > 0 && duration < 1000) { - try { - logger.info("begin sleeping..."); - Thread.sleep(1000 - duration + 100); - logger.info("sleep: {}", 1000 - duration + 100); - } catch (InterruptedException e) { - logger.error(e.getMessage(), e); - } - } else { - try { - logger.info("begin sleeping..."); - Thread.sleep(duration); - logger.info("sleep: {}", duration); - } catch (InterruptedException e) { - logger.error(e.getMessage(), e); - } - } - lastTime = System.currentTimeMillis(); - } - } - logger.info("sending segment number: {}", times.length); - } -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/UniqueIdBuilder.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/UniqueIdBuilder.java deleted file mode 100644 index 248cc0f1f8a36262b1cf5fafe3b549c95ec47964..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/mock/UniqueIdBuilder.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.mock; - -import java.util.concurrent.atomic.AtomicLong; -import org.apache.skywalking.apm.network.language.agent.UniqueId; - -/** - * @author peng-yongsheng - */ -public enum UniqueIdBuilder { - INSTANCE; - - private AtomicLong idPart = new AtomicLong(1); - - UniqueId.Builder create() { - UniqueId.Builder uniqueId = UniqueId.newBuilder(); - uniqueId.addIdParts(idPart.getAndIncrement()); - uniqueId.addIdParts(idPart.getAndIncrement()); - uniqueId.addIdParts(idPart.getAndIncrement()); - return uniqueId; - } -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingHandlerTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingHandlerTest.java deleted file mode 100644 index 4db8a54b11e701a7d6b0adcf200fb0625054dcc4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingHandlerTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.naming; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mock; - -import javax.servlet.http.HttpServletRequest; - -import static org.junit.Assert.assertEquals; - -/** - * @author lican - */ -public class AgentGRPCNamingHandlerTest { - - private AgentGRPCNamingHandler handler; - - @Mock - private HttpServletRequest request; - - @Before - public void setUp() throws Exception { - AgentGRPCNamingListener listener = new AgentGRPCNamingListener(); - listener.addAddress("127.0.0.1:10080"); - handler = new AgentGRPCNamingHandler(listener); - - } - - @Test - public void pathSpec() { - assertEquals(handler.pathSpec(), "/agent/gRPC"); - } - - @Test - public void doGet() throws ArgumentsParseException { - JsonElement jsonElement = handler.doGet(request); - String s = ((JsonArray) jsonElement).get(0).getAsString(); - assertEquals(s, "127.0.0.1:10080"); - } - - @Test(expected = UnsupportedOperationException.class) - public void doPost() throws ArgumentsParseException { - handler.doPost(request); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingListenerTest.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingListenerTest.java deleted file mode 100644 index 997ac4872ef48e0b6e4eef33dd4ee0168c67a6b3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/naming/AgentGRPCNamingListenerTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.grpc.provider.handler.naming; - -import org.junit.Before; -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * @author lican - */ -public class AgentGRPCNamingListenerTest { - - private AgentGRPCNamingListener listener; - - @Before - public void setUp() throws Exception { - listener = new AgentGRPCNamingListener(); - } - - @Test - public void path() { - assertEquals(listener.path(), "/agent_gRPC/gRPC"); - } - - @Test - public void serverJoinNotify() { - listener.serverJoinNotify(null); - } - - @Test - public void serverQuitNotify() { - listener.serverQuitNotify(null); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/core/module/MockModule.java b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/core/module/MockModule.java deleted file mode 100644 index a6cc0bcd44d289fe22e36360b28ecc46a12facb8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/core/module/MockModule.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -import com.google.common.collect.Lists; -import org.apache.skywalking.apm.collector.grpc.manager.service.GRPCManagerService; -import org.apache.skywalking.apm.collector.server.grpc.GRPCServer; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -import java.util.LinkedList; - -import static org.mockito.Matchers.*; -import static org.mockito.Mockito.when; - -/** - * @author lican - */ -public class MockModule extends ModuleDefine { - - public MockModule() throws ServiceNotProvidedException { - ModuleProvider moduleProvider = Mockito.mock(ModuleProvider.class); - LinkedList linkedList = Lists.newLinkedList(); - linkedList.add(moduleProvider); - Whitebox.setInternalState(this, "loadedProviders", linkedList); - when(moduleProvider.getService(any())).then(invocation -> { - Class argumentAt = invocation.getArgumentAt(0, Class.class); - Object mock = Mockito.mock(argumentAt); - if (mock instanceof GRPCManagerService) { - when(((GRPCManagerService) mock).createIfAbsent(anyString(), anyInt())).then(invocation1 -> { - GRPCServer grpcServer = new GRPCServer("127.0.0.1", 18098); - grpcServer.initialize(); - return grpcServer; - }); - } - return mock; - }); - } - - @Override - public String name() { - return null; - } - - @Override - public Class[] services() { - return new Class[0]; - } - - -} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/resources/log4j2.xml b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/resources/log4j2.xml deleted file mode 100644 index 92f26c58547aaad949cbb87c273144cb6bc3f919..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/resources/log4j2.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/apm-collector/apm-collector-agent/agent-grpc/pom.xml b/apm-collector/apm-collector-agent/agent-grpc/pom.xml deleted file mode 100644 index 218601bd703810950e95e7e32be0c2f9078273ef..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-grpc/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - apm-collector-agent - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - agent-grpc - pom - - agent-grpc-define - agent-grpc-provider - - \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/pom.xml b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/pom.xml deleted file mode 100644 index 35e3c76f6ac74455ad1b4625fa130eff6e935d9b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - agent-jetty - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - agent-jetty-define - \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/define/AgentJettyModule.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/define/AgentJettyModule.java deleted file mode 100644 index 4adc6642794ef9210ff1046db33afc53de1192a0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/define/AgentJettyModule.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.define; - -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; - -/** - * @author peng-yongsheng - */ -public class AgentJettyModule extends ModuleDefine { - - public static final String NAME = "agent_jetty"; - - @Override public String name() { - return NAME; - } - - @Override public Class[] services() { - return new Class[0]; - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/pom.xml b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/pom.xml deleted file mode 100644 index 59d775a5f68f1bede21e089e7b8a1c2f613be001..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/pom.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - agent-jetty - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - agent-jetty-provider - jar - - - - org.apache.skywalking - agent-jetty-define - ${project.version} - - - org.apache.skywalking - collector-cluster-define - ${project.version} - - - org.apache.skywalking - collector-naming-define - ${project.version} - - - org.apache.skywalking - collector-jetty-manager-define - ${project.version} - - - org.apache.skywalking - register-define - ${project.version} - - - org.apache.skywalking - segment-parser-define - ${project.version} - - - org.apache.skywalking - jvm-define - ${project.version} - - - org.apache.skywalking - metric-define - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyConfig.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyConfig.java deleted file mode 100644 index d6c86c32b4d2a476feea3470ffe2cab2389c2a2a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider; - -import org.apache.skywalking.apm.collector.server.jetty.JettyServerConfig; - -/** - * @author peng-yongsheng - */ -class AgentModuleJettyConfig extends JettyServerConfig { -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyProvider.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyProvider.java deleted file mode 100644 index d099759cda203be0f285e0bfafb676fb991acdac..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyProvider.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider; - -import org.apache.skywalking.apm.collector.agent.jetty.define.AgentJettyModule; -import org.apache.skywalking.apm.collector.agent.jetty.provider.handler.ApplicationRegisterServletHandler; -import org.apache.skywalking.apm.collector.agent.jetty.provider.handler.InstanceDiscoveryServletHandler; -import org.apache.skywalking.apm.collector.agent.jetty.provider.handler.InstanceHeartBeatServletHandler; -import org.apache.skywalking.apm.collector.agent.jetty.provider.handler.NetworkAddressRegisterServletHandler; -import org.apache.skywalking.apm.collector.agent.jetty.provider.handler.ServiceNameDiscoveryServiceHandler; -import org.apache.skywalking.apm.collector.agent.jetty.provider.handler.TraceSegmentServletHandler; -import org.apache.skywalking.apm.collector.agent.jetty.provider.handler.naming.AgentJettyNamingHandler; -import org.apache.skywalking.apm.collector.agent.jetty.provider.handler.naming.AgentJettyNamingListener; -import org.apache.skywalking.apm.collector.cluster.ClusterModule; -import org.apache.skywalking.apm.collector.cluster.service.ModuleListenerService; -import org.apache.skywalking.apm.collector.cluster.service.ModuleRegisterService; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; -import org.apache.skywalking.apm.collector.jetty.manager.JettyManagerModule; -import org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService; -import org.apache.skywalking.apm.collector.naming.NamingModule; -import org.apache.skywalking.apm.collector.naming.service.NamingHandlerRegisterService; -import org.apache.skywalking.apm.collector.server.jetty.JettyServer; - -/** - * @author peng-yongsheng - */ -public class AgentModuleJettyProvider extends ModuleProvider { - - public static final String NAME = "jetty"; - private final AgentModuleJettyConfig config; - - public AgentModuleJettyProvider() { - super(); - this.config = new AgentModuleJettyConfig(); - } - - @Override public String name() { - return NAME; - } - - @Override public Class module() { - return AgentJettyModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() { - } - - @Override public void start() { - ModuleRegisterService moduleRegisterService = getManager().find(ClusterModule.NAME).getService(ModuleRegisterService.class); - moduleRegisterService.register(AgentJettyModule.NAME, this.name(), new AgentModuleJettyRegistration(config.getHost(), config.getPort(), config.getContextPath())); - - AgentJettyNamingListener namingListener = new AgentJettyNamingListener(); - ModuleListenerService moduleListenerService = getManager().find(ClusterModule.NAME).getService(ModuleListenerService.class); - moduleListenerService.addListener(namingListener); - - NamingHandlerRegisterService namingHandlerRegisterService = getManager().find(NamingModule.NAME).getService(NamingHandlerRegisterService.class); - namingHandlerRegisterService.register(new AgentJettyNamingHandler(namingListener)); - - JettyManagerService managerService = getManager().find(JettyManagerModule.NAME).getService(JettyManagerService.class); - JettyServer jettyServer = managerService.createIfAbsent(config.getHost(), config.getPort(), config.getContextPath()); - addHandlers(jettyServer); - } - - @Override public void notifyAfterCompleted() { - } - - @Override public String[] requiredModules() { - return new String[] {ClusterModule.NAME, NamingModule.NAME, JettyManagerModule.NAME}; - } - - private void addHandlers(JettyServer jettyServer) { - jettyServer.addHandler(new TraceSegmentServletHandler(getManager())); - jettyServer.addHandler(new ApplicationRegisterServletHandler(getManager())); - jettyServer.addHandler(new InstanceDiscoveryServletHandler(getManager())); - jettyServer.addHandler(new InstanceHeartBeatServletHandler(getManager())); - jettyServer.addHandler(new ServiceNameDiscoveryServiceHandler(getManager())); - jettyServer.addHandler(new NetworkAddressRegisterServletHandler(getManager())); - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyRegistration.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyRegistration.java deleted file mode 100644 index 5dac3275d9a2fad1af047c3c43b6ff22cbbd5e89..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyRegistration.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider; - -import org.apache.skywalking.apm.collector.cluster.ModuleRegistration; - -/** - * @author peng-yongsheng - */ -public class AgentModuleJettyRegistration extends ModuleRegistration { - - private final String host; - private final int port; - private final String contextPath; - - public AgentModuleJettyRegistration(String host, int port, String contextPath) { - this.host = host; - this.port = port; - this.contextPath = contextPath; - } - - @Override public Value buildValue() { - return new Value(host, port, contextPath); - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ApplicationRegisterServletHandler.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ApplicationRegisterServletHandler.java deleted file mode 100644 index 100692d9c7778580eb27dd68d20bfd69bb6d1d10..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ApplicationRegisterServletHandler.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import java.io.IOException; -import javax.servlet.http.HttpServletRequest; -import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IApplicationIDService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException; -import org.apache.skywalking.apm.collector.server.jetty.JettyJsonHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class ApplicationRegisterServletHandler extends JettyJsonHandler { - - private static final Logger logger = LoggerFactory.getLogger(ApplicationRegisterServletHandler.class); - - private final IApplicationIDService applicationIDService; - private Gson gson = new Gson(); - private static final String APPLICATION_CODE = "c"; - private static final String APPLICATION_ID = "i"; - - public ApplicationRegisterServletHandler(ModuleManager moduleManager) { - this.applicationIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IApplicationIDService.class); - } - - @Override public String pathSpec() { - return "/application/register"; - } - - @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException { - throw new UnsupportedOperationException(); - } - - @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException { - JsonArray responseArray = new JsonArray(); - try { - JsonArray applicationCodes = gson.fromJson(req.getReader(), JsonArray.class); - for (int i = 0; i < applicationCodes.size(); i++) { - String applicationCode = applicationCodes.get(i).getAsString(); - int applicationId = applicationIDService.getOrCreateForApplicationCode(applicationCode); - JsonObject mapping = new JsonObject(); - mapping.addProperty(APPLICATION_CODE, applicationCode); - mapping.addProperty(APPLICATION_ID, applicationId); - responseArray.add(mapping); - } - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - return responseArray; - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceDiscoveryServletHandler.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceDiscoveryServletHandler.java deleted file mode 100644 index d0a1a083b2a38033ebb3038ca34eb09a15c79375..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceDiscoveryServletHandler.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import java.io.IOException; -import javax.servlet.http.HttpServletRequest; -import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule; -import org.apache.skywalking.apm.collector.analysis.register.define.service.AgentOsInfo; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IInstanceIDService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException; -import org.apache.skywalking.apm.collector.server.jetty.JettyJsonHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class InstanceDiscoveryServletHandler extends JettyJsonHandler { - - private static final Logger logger = LoggerFactory.getLogger(InstanceDiscoveryServletHandler.class); - - private final IInstanceIDService instanceIDService; - private final Gson gson = new Gson(); - - private static final String APPLICATION_ID = "ai"; - private static final String AGENT_UUID = "au"; - private static final String REGISTER_TIME = "rt"; - private static final String INSTANCE_ID = "ii"; - private static final String OS_INFO = "oi"; - - public InstanceDiscoveryServletHandler(ModuleManager moduleManager) { - this.instanceIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IInstanceIDService.class); - } - - @Override public String pathSpec() { - return "/instance/register"; - } - - @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException { - throw new UnsupportedOperationException(); - } - - @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException { - JsonObject responseJson = new JsonObject(); - try { - JsonObject instance = gson.fromJson(req.getReader(), JsonObject.class); - int applicationId = instance.get(APPLICATION_ID).getAsInt(); - String agentUUID = instance.get(AGENT_UUID).getAsString(); - long registerTime = instance.get(REGISTER_TIME).getAsLong(); - JsonObject osInfoJson = instance.get(OS_INFO).getAsJsonObject(); - AgentOsInfo osInfo = gson.fromJson(osInfoJson, AgentOsInfo.class); - - int instanceId = instanceIDService.getOrCreateByAgentUUID(applicationId, agentUUID, registerTime, osInfo); - responseJson.addProperty(APPLICATION_ID, applicationId); - responseJson.addProperty(INSTANCE_ID, instanceId); - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - return responseJson; - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceHeartBeatServletHandler.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceHeartBeatServletHandler.java deleted file mode 100644 index 32841b9b54d7a496dbb5315c009d60d85bef6d94..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceHeartBeatServletHandler.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import java.io.IOException; -import javax.servlet.http.HttpServletRequest; -import org.apache.skywalking.apm.collector.analysis.metric.define.AnalysisMetricModule; -import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException; -import org.apache.skywalking.apm.collector.server.jetty.JettyJsonHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class InstanceHeartBeatServletHandler extends JettyJsonHandler { - - private static final Logger logger = LoggerFactory.getLogger(InstanceHeartBeatServletHandler.class); - - private final IInstanceHeartBeatService instanceHeartBeatService; - private final Gson gson = new Gson(); - - private static final String INSTANCE_ID = "ii"; - private static final String HEARTBEAT_TIME = "ht"; - - public InstanceHeartBeatServletHandler(ModuleManager moduleManager) { - this.instanceHeartBeatService = moduleManager.find(AnalysisMetricModule.NAME).getService(IInstanceHeartBeatService.class); - } - - @Override public String pathSpec() { - return "/instance/heartbeat"; - } - - @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException { - throw new UnsupportedOperationException(); - } - - @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException, IOException { - JsonObject responseJson = new JsonObject(); - try { - JsonObject heartBeat = gson.fromJson(req.getReader(), JsonObject.class); - int instanceId = heartBeat.get(INSTANCE_ID).getAsInt(); - long heartBeatTime = heartBeat.get(HEARTBEAT_TIME).getAsLong(); - - instanceHeartBeatService.heartBeat(instanceId, heartBeatTime); - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - return responseJson; - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/NetworkAddressRegisterServletHandler.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/NetworkAddressRegisterServletHandler.java deleted file mode 100644 index 1da81e2bbab817e2ef80f1464a9fc1f7364b3eaa..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/NetworkAddressRegisterServletHandler.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler; - -import com.google.gson.*; -import java.io.IOException; -import javax.servlet.http.HttpServletRequest; -import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule; -import org.apache.skywalking.apm.collector.analysis.register.define.service.INetworkAddressIDService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.server.jetty.JettyJsonHandler; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class NetworkAddressRegisterServletHandler extends JettyJsonHandler { - - private static final Logger logger = LoggerFactory.getLogger(NetworkAddressRegisterServletHandler.class); - - private final INetworkAddressIDService networkAddressIDService; - private Gson gson = new Gson(); - private static final String NETWORK_ADDRESS = "n"; - private static final String ADDRESS_ID = "i"; - - public NetworkAddressRegisterServletHandler(ModuleManager moduleManager) { - this.networkAddressIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(INetworkAddressIDService.class); - } - - @Override public String pathSpec() { - return "/networkAddress/register"; - } - - @Override protected JsonElement doGet(HttpServletRequest req) { - throw new UnsupportedOperationException(); - } - - @Override protected JsonElement doPost(HttpServletRequest req) { - JsonArray responseArray = new JsonArray(); - try { - JsonArray networkAddresses = gson.fromJson(req.getReader(), JsonArray.class); - for (int i = 0; i < networkAddresses.size(); i++) { - String networkAddress = networkAddresses.get(i).getAsString(); - - if (logger.isDebugEnabled()) { - logger.debug("network address register, network address: {}", networkAddress); - } - - int addressId = networkAddressIDService.get(networkAddress); - JsonObject mapping = new JsonObject(); - mapping.addProperty(ADDRESS_ID, addressId); - mapping.addProperty(NETWORK_ADDRESS, networkAddress); - responseArray.add(mapping); - } - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - return responseArray; - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ServiceNameDiscoveryServiceHandler.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ServiceNameDiscoveryServiceHandler.java deleted file mode 100644 index 4bc4ac7c33d717f00c54e0f5e6e49a7d881be32e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ServiceNameDiscoveryServiceHandler.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import java.io.IOException; -import javax.servlet.http.HttpServletRequest; -import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IServiceNameService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException; -import org.apache.skywalking.apm.collector.server.jetty.JettyJsonHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class ServiceNameDiscoveryServiceHandler extends JettyJsonHandler { - - private static final Logger logger = LoggerFactory.getLogger(ServiceNameDiscoveryServiceHandler.class); - - private final IServiceNameService serviceNameService; - private final Gson gson = new Gson(); - - private static final String APPLICATION_ID = "ai"; - private static final String SERVICE_NAME = "sn"; - private static final String SRC_SPAN_TYPE = "st"; - private static final String SERVICE_ID = "si"; - private static final String ELEMENT = "el"; - - public ServiceNameDiscoveryServiceHandler(ModuleManager moduleManager) { - this.serviceNameService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IServiceNameService.class); - } - - @Override public String pathSpec() { - return "/servicename/discovery"; - } - - @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException { - throw new UnsupportedOperationException(); - } - - @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException { - JsonArray responseArray = new JsonArray(); - try { - JsonArray services = gson.fromJson(req.getReader(), JsonArray.class); - for (JsonElement service : services) { - int applicationId = service.getAsJsonObject().get(APPLICATION_ID).getAsInt(); - String serviceName = service.getAsJsonObject().get(SERVICE_NAME).getAsString(); - int srcSpanType = service.getAsJsonObject().get(SRC_SPAN_TYPE).getAsInt(); - - int serviceId = serviceNameService.getOrCreate(applicationId, srcSpanType, serviceName); - if (serviceId != 0) { - JsonObject responseJson = new JsonObject(); - responseJson.addProperty(SERVICE_ID, serviceId); - responseJson.add(ELEMENT, service); - responseArray.add(responseJson); - } - } - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - return responseArray; - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/TraceSegmentServletHandler.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/TraceSegmentServletHandler.java deleted file mode 100644 index 83f91436b8f012e2d3ae394780f0eda685e919fa..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/TraceSegmentServletHandler.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler; - -import com.google.gson.JsonElement; -import com.google.gson.stream.JsonReader; -import java.io.*; -import javax.servlet.http.HttpServletRequest; -import org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader.*; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.AnalysisSegmentParserModule; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.service.ISegmentParseService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.server.jetty.JettyJsonHandler; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class TraceSegmentServletHandler extends JettyJsonHandler { - - private static final Logger logger = LoggerFactory.getLogger(TraceSegmentServletHandler.class); - - private final ISegmentParseService segmentParseService; - - public TraceSegmentServletHandler(ModuleManager moduleManager) { - this.segmentParseService = moduleManager.find(AnalysisSegmentParserModule.NAME).getService(ISegmentParseService.class); - } - - @Override public String pathSpec() { - return "/segments"; - } - - @Override protected JsonElement doGet(HttpServletRequest req) { - throw new UnsupportedOperationException(); - } - - @Override protected JsonElement doPost(HttpServletRequest req) { - if (logger.isDebugEnabled()) { - logger.debug("receive stream segment"); - } - - try { - BufferedReader bufferedReader = req.getReader(); - read(bufferedReader); - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - - return null; - } - - private TraceSegmentJsonReader jsonReader = new TraceSegmentJsonReader(); - - private void read(BufferedReader bufferedReader) throws IOException { - JsonReader reader = new JsonReader(bufferedReader); - - reader.beginArray(); - while (reader.hasNext()) { - TraceSegment traceSegment = jsonReader.read(reader); - segmentParseService.parse(traceSegment.getUpstreamSegment(), ISegmentParseService.Source.Agent); - } - reader.endArray(); - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingHandler.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingHandler.java deleted file mode 100644 index f9114c691262697f6a809cc863486d72c1156b65..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingHandler.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.naming; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import java.util.Set; -import javax.servlet.http.HttpServletRequest; -import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException; -import org.apache.skywalking.apm.collector.server.jetty.JettyJsonHandler; - -/** - * @author peng-yongsheng - */ -public class AgentJettyNamingHandler extends JettyJsonHandler { - - private final AgentJettyNamingListener namingListener; - - public AgentJettyNamingHandler(AgentJettyNamingListener namingListener) { - this.namingListener = namingListener; - } - - @Override public String pathSpec() { - return "/agent/jetty"; - } - - @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException { - Set servers = namingListener.getAddresses(); - JsonArray serverArray = new JsonArray(); - servers.forEach(serverArray::add); - return serverArray; - } - - @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException { - throw new UnsupportedOperationException(); - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingListener.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingListener.java deleted file mode 100644 index 863569045c38adeb787bcec35623ecfc06555b4b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingListener.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.naming; - -import org.apache.skywalking.apm.collector.agent.jetty.define.AgentJettyModule; -import org.apache.skywalking.apm.collector.agent.jetty.provider.AgentModuleJettyProvider; -import org.apache.skywalking.apm.collector.cluster.ClusterModuleListener; - -/** - * @author peng-yongsheng - */ -public class AgentJettyNamingListener extends ClusterModuleListener { - - public static final String PATH = "/" + AgentJettyModule.NAME + "/" + AgentModuleJettyProvider.NAME; - - @Override public String path() { - return PATH; - } - - @Override public void serverJoinNotify(String serverAddress) { - - } - - @Override public void serverQuitNotify(String serverAddress) { - - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/KeyWithStringValueJsonReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/KeyWithStringValueJsonReader.java deleted file mode 100644 index 55024913e13eabe3e6bfce117223649fd639cfbb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/KeyWithStringValueJsonReader.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader; - -import com.google.gson.stream.JsonReader; -import java.io.IOException; -import org.apache.skywalking.apm.network.language.agent.KeyWithStringValue; - -/** - * @author peng-yongsheng - */ -public class KeyWithStringValueJsonReader implements StreamJsonReader { - - private static final String KEY = "k"; - private static final String VALUE = "v"; - - @Override public KeyWithStringValue read(JsonReader reader) throws IOException { - KeyWithStringValue.Builder builder = KeyWithStringValue.newBuilder(); - - reader.beginObject(); - while (reader.hasNext()) { - switch (reader.nextName()) { - case KEY: - builder.setKey(reader.nextString()); - break; - case VALUE: - builder.setValue(reader.nextString()); - break; - default: - reader.skipValue(); - break; - } - } - reader.endObject(); - - return builder.build(); - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/LogJsonReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/LogJsonReader.java deleted file mode 100644 index aeb5f9058ffbd3251242086e7a22ba0275ec9c10..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/LogJsonReader.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader; - -import com.google.gson.stream.JsonReader; -import java.io.IOException; -import org.apache.skywalking.apm.network.language.agent.LogMessage; - -/** - * @author peng-yongsheng - */ -public class LogJsonReader implements StreamJsonReader { - - private KeyWithStringValueJsonReader keyWithStringValueJsonReader = new KeyWithStringValueJsonReader(); - - private static final String TIME = "ti"; - private static final String LOG_DATA = "ld"; - - @Override public LogMessage read(JsonReader reader) throws IOException { - LogMessage.Builder builder = LogMessage.newBuilder(); - - reader.beginObject(); - while (reader.hasNext()) { - switch (reader.nextName()) { - case TIME: - builder.setTime(reader.nextLong()); - break; - case LOG_DATA: - reader.beginArray(); - while (reader.hasNext()) { - builder.addData(keyWithStringValueJsonReader.read(reader)); - } - reader.endArray(); - break; - default: - reader.skipValue(); - break; - } - } - reader.endObject(); - - return builder.build(); - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/ReferenceJsonReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/ReferenceJsonReader.java deleted file mode 100644 index 2536b63682b8b0bea7b1ac3010fb3255e2847a27..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/ReferenceJsonReader.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader; - -import com.google.gson.stream.JsonReader; -import java.io.IOException; -import org.apache.skywalking.apm.network.language.agent.TraceSegmentReference; - -/** - * @author peng-yongsheng - */ -public class ReferenceJsonReader implements StreamJsonReader { - - private UniqueIdJsonReader uniqueIdJsonReader = new UniqueIdJsonReader(); - - private static final String PARENT_TRACE_SEGMENT_ID = "pts"; - private static final String PARENT_APPLICATION_INSTANCE_ID = "pii"; - private static final String PARENT_SPAN_ID = "psp"; - private static final String PARENT_SERVICE_ID = "psi"; - private static final String PARENT_SERVICE_NAME = "psn"; - private static final String NETWORK_ADDRESS_ID = "ni"; - private static final String NETWORK_ADDRESS = "nn"; - private static final String ENTRY_APPLICATION_INSTANCE_ID = "eii"; - private static final String ENTRY_SERVICE_ID = "esi"; - private static final String ENTRY_SERVICE_NAME = "esn"; - private static final String REF_TYPE_VALUE = "rv"; - - @Override public TraceSegmentReference read(JsonReader reader) throws IOException { - TraceSegmentReference.Builder builder = TraceSegmentReference.newBuilder(); - - reader.beginObject(); - while (reader.hasNext()) { - switch (reader.nextName()) { - case PARENT_TRACE_SEGMENT_ID: - builder.setParentTraceSegmentId(uniqueIdJsonReader.read(reader)); - break; - case PARENT_APPLICATION_INSTANCE_ID: - builder.setParentApplicationInstanceId(reader.nextInt()); - break; - case PARENT_SPAN_ID: - builder.setParentSpanId(reader.nextInt()); - break; - case PARENT_SERVICE_ID: - builder.setParentServiceId(reader.nextInt()); - break; - case PARENT_SERVICE_NAME: - builder.setParentServiceName(reader.nextString()); - break; - case NETWORK_ADDRESS_ID: - builder.setNetworkAddressId(reader.nextInt()); - break; - case NETWORK_ADDRESS: - builder.setNetworkAddress(reader.nextString()); - break; - case ENTRY_APPLICATION_INSTANCE_ID: - builder.setEntryApplicationInstanceId(reader.nextInt()); - break; - case ENTRY_SERVICE_ID: - builder.setEntryServiceId(reader.nextInt()); - break; - case ENTRY_SERVICE_NAME: - builder.setEntryServiceName(reader.nextString()); - break; - case REF_TYPE_VALUE: - builder.setRefTypeValue(reader.nextInt()); - break; - default: - reader.skipValue(); - break; - } - } - reader.endObject(); - - return builder.build(); - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SegmentJsonReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SegmentJsonReader.java deleted file mode 100644 index 77f32f6b008b4674e9b2362908c9a113b1e3b4a6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SegmentJsonReader.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader; - -import com.google.gson.stream.JsonReader; -import java.io.IOException; -import org.apache.skywalking.apm.network.language.agent.TraceSegmentObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class SegmentJsonReader implements StreamJsonReader { - - private static final Logger logger = LoggerFactory.getLogger(SegmentJsonReader.class); - - private UniqueIdJsonReader uniqueIdJsonReader = new UniqueIdJsonReader(); - private SpanJsonReader spanJsonReader = new SpanJsonReader(); - - private static final String TRACE_SEGMENT_ID = "ts"; - private static final String APPLICATION_ID = "ai"; - private static final String APPLICATION_INSTANCE_ID = "ii"; - private static final String SPANS = "ss"; - - @Override public TraceSegmentObject.Builder read(JsonReader reader) throws IOException { - TraceSegmentObject.Builder builder = TraceSegmentObject.newBuilder(); - - reader.beginObject(); - while (reader.hasNext()) { - switch (reader.nextName()) { - case TRACE_SEGMENT_ID: - builder.setTraceSegmentId(uniqueIdJsonReader.read(reader)); - if (logger.isDebugEnabled()) { - StringBuilder segmentId = new StringBuilder(); - builder.getTraceSegmentId().getIdPartsList().forEach(idPart -> segmentId.append(idPart)); - logger.debug("segment id: {}", segmentId); - } - break; - case APPLICATION_ID: - builder.setApplicationId(reader.nextInt()); - break; - case APPLICATION_INSTANCE_ID: - builder.setApplicationInstanceId(reader.nextInt()); - break; - case SPANS: - reader.beginArray(); - while (reader.hasNext()) { - builder.addSpans(spanJsonReader.read(reader)); - } - reader.endArray(); - break; - default: - reader.skipValue(); - break; - } - } - reader.endObject(); - - return builder; - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SpanJsonReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SpanJsonReader.java deleted file mode 100644 index 174ac8ec4d8b2ec249b2957fcd8bbddfb6dbd121..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SpanJsonReader.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader; - -import com.google.gson.stream.JsonReader; -import java.io.IOException; -import org.apache.skywalking.apm.network.language.agent.SpanObject; - -/** - * @author peng-yongsheng - */ -public class SpanJsonReader implements StreamJsonReader { - - private KeyWithStringValueJsonReader keyWithStringValueJsonReader = new KeyWithStringValueJsonReader(); - private LogJsonReader logJsonReader = new LogJsonReader(); - private ReferenceJsonReader referenceJsonReader = new ReferenceJsonReader(); - - private static final String SPAN_ID = "si"; - private static final String SPAN_TYPE_VALUE = "tv"; - private static final String SPAN_LAYER_VALUE = "lv"; - private static final String PARENT_SPAN_ID = "ps"; - private static final String START_TIME = "st"; - private static final String END_TIME = "et"; - private static final String COMPONENT_ID = "ci"; - private static final String COMPONENT_NAME = "cn"; - private static final String OPERATION_NAME_ID = "oi"; - private static final String OPERATION_NAME = "on"; - private static final String PEER_ID = "pi"; - private static final String PEER = "pn"; - private static final String IS_ERROR = "ie"; - private static final String TRACE_SEGMENT_REFERENCE = "rs"; - private static final String TAGS = "to"; - private static final String LOGS = "lo"; - - @Override public SpanObject read(JsonReader reader) throws IOException { - SpanObject.Builder builder = SpanObject.newBuilder(); - - reader.beginObject(); - while (reader.hasNext()) { - switch (reader.nextName()) { - case SPAN_ID: - builder.setSpanId(reader.nextInt()); - break; - case SPAN_TYPE_VALUE: - builder.setSpanTypeValue(reader.nextInt()); - break; - case SPAN_LAYER_VALUE: - builder.setSpanLayerValue(reader.nextInt()); - break; - case PARENT_SPAN_ID: - builder.setParentSpanId(reader.nextInt()); - break; - case START_TIME: - builder.setStartTime(reader.nextLong()); - break; - case END_TIME: - builder.setEndTime(reader.nextLong()); - break; - case COMPONENT_ID: - builder.setComponentId(reader.nextInt()); - break; - case COMPONENT_NAME: - builder.setComponent(reader.nextString()); - break; - case OPERATION_NAME_ID: - builder.setOperationNameId(reader.nextInt()); - break; - case OPERATION_NAME: - builder.setOperationName(reader.nextString()); - break; - case PEER_ID: - builder.setPeerId(reader.nextInt()); - break; - case PEER: - builder.setPeer(reader.nextString()); - break; - case IS_ERROR: - builder.setIsError(reader.nextBoolean()); - break; - case TRACE_SEGMENT_REFERENCE: - reader.beginArray(); - while (reader.hasNext()) { - builder.addRefs(referenceJsonReader.read(reader)); - } - reader.endArray(); - break; - case TAGS: - reader.beginArray(); - while (reader.hasNext()) { - builder.addTags(keyWithStringValueJsonReader.read(reader)); - } - reader.endArray(); - break; - case LOGS: - reader.beginArray(); - while (reader.hasNext()) { - builder.addLogs(logJsonReader.read(reader)); - } - reader.endArray(); - break; - default: - reader.skipValue(); - break; - } - } - reader.endObject(); - - return builder.build(); - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/StreamJsonReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/StreamJsonReader.java deleted file mode 100644 index 0b757c4ce7e71f4ffd36152b99ed71ec436b7d53..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/StreamJsonReader.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader; - -import com.google.gson.stream.JsonReader; -import java.io.IOException; - -/** - * @author peng-yongsheng - */ -public interface StreamJsonReader { - T read(JsonReader reader) throws IOException; -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/TraceSegment.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/TraceSegment.java deleted file mode 100644 index 154645b9ed41247a684bf44c5c52430b18f39e4b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/TraceSegment.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader; - -import org.apache.skywalking.apm.network.language.agent.TraceSegmentObject; -import org.apache.skywalking.apm.network.language.agent.UniqueId; -import org.apache.skywalking.apm.network.language.agent.UpstreamSegment; - -/** - * @author peng-yongsheng - */ -public class TraceSegment { - - private UpstreamSegment.Builder builder; - - public TraceSegment() { - builder = UpstreamSegment.newBuilder(); - } - - public void addGlobalTraceId(UniqueId.Builder globalTraceId) { - builder.addGlobalTraceIds(globalTraceId); - } - - public void setTraceSegmentBuilder(TraceSegmentObject.Builder traceSegmentBuilder) { - builder.setSegment(traceSegmentBuilder.build().toByteString()); - } - - public UpstreamSegment getUpstreamSegment() { - return builder.build(); - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/TraceSegmentJsonReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/TraceSegmentJsonReader.java deleted file mode 100644 index c2a64c14255d14bb3fefc4dae0aa411b1e244838..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/TraceSegmentJsonReader.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader; - -import com.google.gson.stream.JsonReader; -import java.io.IOException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class TraceSegmentJsonReader implements StreamJsonReader { - - private static final Logger logger = LoggerFactory.getLogger(TraceSegmentJsonReader.class); - - private UniqueIdJsonReader uniqueIdJsonReader = new UniqueIdJsonReader(); - private SegmentJsonReader segmentJsonReader = new SegmentJsonReader(); - - private static final String GLOBAL_TRACE_IDS = "gt"; - private static final String SEGMENT = "sg"; - - @Override public TraceSegment read(JsonReader reader) throws IOException { - TraceSegment traceSegment = new TraceSegment(); - - reader.beginObject(); - while (reader.hasNext()) { - switch (reader.nextName()) { - case GLOBAL_TRACE_IDS: - reader.beginArray(); - while (reader.hasNext()) { - traceSegment.addGlobalTraceId(uniqueIdJsonReader.read(reader)); - } - reader.endArray(); - - break; - case SEGMENT: - traceSegment.setTraceSegmentBuilder(segmentJsonReader.read(reader)); - break; - default: - reader.skipValue(); - break; - } - } - reader.endObject(); - - return traceSegment; - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/UniqueIdJsonReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/UniqueIdJsonReader.java deleted file mode 100644 index c2d48abbbeac3ff212389a9016c3d86079ab7e77..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/UniqueIdJsonReader.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader; - -import com.google.gson.stream.JsonReader; -import java.io.IOException; -import org.apache.skywalking.apm.network.language.agent.UniqueId; - -/** - * @author peng-yongsheng - */ -public class UniqueIdJsonReader implements StreamJsonReader { - - @Override public UniqueId.Builder read(JsonReader reader) throws IOException { - UniqueId.Builder builder = UniqueId.newBuilder(); - - reader.beginArray(); - while (reader.hasNext()) { - builder.addIdParts(reader.nextLong()); - } - reader.endArray(); - return builder; - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index d481e10a695234ddb60e6227b542f13a35e18b9d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.agent.jetty.provider.AgentModuleJettyProvider \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/DelegatingServletInputStream.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/DelegatingServletInputStream.java deleted file mode 100644 index c88b1613f2fe999c3d7e148257f0135407156772..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/DelegatingServletInputStream.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector; - -import org.junit.Assert; - -import javax.servlet.ReadListener; -import javax.servlet.ServletInputStream; -import java.io.IOException; -import java.io.InputStream; - -/** - * @author lican - */ -public class DelegatingServletInputStream extends ServletInputStream { - - private final InputStream sourceStream; - - - /** - * Create a DelegatingServletInputStream for the given source stream. - * @param sourceStream the source stream (never null) - */ - public DelegatingServletInputStream(InputStream sourceStream) { - Assert.assertNotNull("Source InputStream must not be null",sourceStream); - this.sourceStream = sourceStream; - } - - /** - * Return the underlying source stream (never null). - */ - public final InputStream getSourceStream() { - return this.sourceStream; - } - - - public int read() throws IOException { - return this.sourceStream.read(); - } - - public void close() throws IOException { - super.close(); - this.sourceStream.close(); - } - - @Override - public boolean isFinished() { - return false; - } - - @Override - public boolean isReady() { - return false; - } - - @Override - public void setReadListener(ReadListener readListener) { - - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyProviderTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyProviderTest.java deleted file mode 100644 index f09acca70f973f32ef11bc6122f41d918a62b843..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyProviderTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider; - -import org.apache.skywalking.apm.collector.agent.jetty.define.AgentJettyModule; -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.internal.util.reflection.Whitebox; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.junit.Assert.*; -import static org.mockito.Matchers.anyString; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class AgentModuleJettyProviderTest { - - - @Mock - private ModuleManager moduleManager; - - @Mock - private AgentModuleJettyConfig config; - - private AgentModuleJettyProvider provider; - - @Before - public void setUp() throws Exception { - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - provider = new AgentModuleJettyProvider(); - Whitebox.setInternalState(provider, "manager", moduleManager); - Whitebox.setInternalState(provider, "config", config); - - } - - @Test - public void name() { - assertEquals(provider.name(), "jetty"); - } - - @Test - public void module() { - assertEquals(provider.module(), AgentJettyModule.class); - } - - @Test - public void createConfigBeanIfAbsent() { - assertEquals(provider.createConfigBeanIfAbsent(), config); - } - - @Test - public void prepare() { - provider.prepare(); - } - - @Test - public void start() { - provider.start(); - } - - @Test - public void notifyAfterCompleted() { - provider.notifyAfterCompleted(); - } - - @Test - public void requiredModules() { - assertTrue(provider.requiredModules().length > 0); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyRegistrationTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyRegistrationTest.java deleted file mode 100644 index 1524eca9cebfce6d7788d67dcb424346d5e8e215..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/AgentModuleJettyRegistrationTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider; - -import org.apache.skywalking.apm.collector.cluster.ModuleRegistration; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.junit.Assert.*; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class AgentModuleJettyRegistrationTest { - - private AgentModuleJettyRegistration registration; - - @Before - public void setUp() throws Exception { - registration = new AgentModuleJettyRegistration("127.0.0.1", 8080, "/"); - } - - @Test - public void buildValue() { - ModuleRegistration.Value value = registration.buildValue(); - Assert.assertEquals(value.getHostPort(), "127.0.0.1:8080"); - assertEquals(value.getContextPath(), "/"); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/ApplicationRegisterPost.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/ApplicationRegisterPost.java deleted file mode 100644 index fa31599f08e3450cf83d574ad60a3cb26d1b91a1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/ApplicationRegisterPost.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider; - -import com.google.gson.JsonElement; -import java.io.IOException; - -/** - * @author peng-yongsheng - */ -public class ApplicationRegisterPost { - - public void send(String jsonFile) throws IOException { - JsonElement application = JsonFileReader.INSTANCE.read(jsonFile); - HttpClientTools.INSTANCE.post("http://localhost:12800/application/register", application.toString()); - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/HttpClientTools.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/HttpClientTools.java deleted file mode 100644 index 5d96d57ee42b54e4d9ca4214fcf8710e668283b7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/HttpClientTools.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider; - -import java.io.IOException; -import java.net.URI; -import java.util.List; -import org.apache.http.Consts; -import org.apache.http.HttpEntity; -import org.apache.http.NameValuePair; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.util.EntityUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public enum HttpClientTools { - INSTANCE; - - private static final Logger logger = LoggerFactory.getLogger(HttpClientTools.class); - - public String get(String url, List params) throws IOException { - CloseableHttpClient httpClient = HttpClients.createDefault(); - try { - HttpGet httpget = new HttpGet(url); - String paramStr = EntityUtils.toString(new UrlEncodedFormEntity(params)); - httpget.setURI(new URI(httpget.getURI().toString() + "?" + paramStr)); - logger.debug("executing get request {}", httpget.getURI()); - - try (CloseableHttpResponse response = httpClient.execute(httpget)) { - HttpEntity entity = response.getEntity(); - if (entity != null) { - return EntityUtils.toString(entity); - } - } - } catch (Exception e) { - logger.error(e.getMessage(), e); - } finally { - try { - httpClient.close(); - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - } - return null; - } - - public String post(String url, String data) throws IOException { - CloseableHttpClient httpClient = HttpClients.createDefault(); - try { - HttpPost httppost = new HttpPost(url); - httppost.setEntity(new StringEntity(data, Consts.UTF_8)); - logger.debug("executing post request {}", httppost.getURI()); - try (CloseableHttpResponse response = httpClient.execute(httppost)) { - HttpEntity entity = response.getEntity(); - if (entity != null) { - return EntityUtils.toString(entity); - } - } - } catch (Exception e) { - logger.error(e.getMessage(), e); - } finally { - try { - httpClient.close(); - } catch (Exception e) { - logger.error(e.getMessage(), e); - } - } - return null; - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/InstanceRegisterPost.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/InstanceRegisterPost.java deleted file mode 100644 index 97cfb127814ec717b6764906487ed0ca6371fabb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/InstanceRegisterPost.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider; - -import com.google.gson.JsonElement; -import java.io.IOException; - -/** - * @author peng-yongsheng - */ -public class InstanceRegisterPost { - - public void send(String jsonFile) throws IOException { - JsonElement instance = JsonFileReader.INSTANCE.read(jsonFile); - HttpClientTools.INSTANCE.post("http://localhost:12800/instance/register", instance.toString()); - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/JsonFileReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/JsonFileReader.java deleted file mode 100644 index cf48637b89a89b687db6176eb0ac080b7fa437c0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/JsonFileReader.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider; - -import com.google.gson.JsonElement; -import com.google.gson.JsonParser; -import java.io.FileNotFoundException; -import java.io.FileReader; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public enum JsonFileReader { - INSTANCE; - - private final Logger logger = LoggerFactory.getLogger(JsonFileReader.class); - - public JsonElement read(String fileName) throws FileNotFoundException { - String path = this.getClass().getClassLoader().getResource(fileName).getFile(); - logger.debug("path: {}", path); - JsonParser jsonParser = new JsonParser(); - return jsonParser.parse(new FileReader(path)); - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/SegmentPost.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/SegmentPost.java deleted file mode 100644 index 6f6a108be597af4d85022adb2db83e304073e46b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/SegmentPost.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider; - -import com.google.gson.JsonElement; -import java.io.IOException; - -/** - * @author peng-yongsheng - */ -public class SegmentPost { - - public static void main(String[] args) throws IOException { - ApplicationRegisterPost applicationRegisterPost = new ApplicationRegisterPost(); - applicationRegisterPost.send("json/application-register-consumer.json"); - applicationRegisterPost.send("json/application-register-provider.json"); - - InstanceRegisterPost instanceRegisterPost = new InstanceRegisterPost(); - instanceRegisterPost.send("json/instance-register-consumer.json"); - instanceRegisterPost.send("json/instance-register-provider.json"); - - ServiceNameRegisterPost serviceNameRegisterPost = new ServiceNameRegisterPost(); - serviceNameRegisterPost.send("json/servicename-register-consumer.json"); - serviceNameRegisterPost.send("json/servicename-register-provider.json"); - - JsonElement provider = JsonFileReader.INSTANCE.read("json/dubbox-provider.json"); - JsonElement consumer = JsonFileReader.INSTANCE.read("json/dubbox-consumer.json"); - - for (int i = 0; i < 1; i++) { - HttpClientTools.INSTANCE.post("http://localhost:12800/segments", provider.toString()); - HttpClientTools.INSTANCE.post("http://localhost:12800/segments", consumer.toString()); - } - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/ServiceNameRegisterPost.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/ServiceNameRegisterPost.java deleted file mode 100644 index af40d62be4e7b460f966b8733c7668857659f3de..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/ServiceNameRegisterPost.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider; - -import com.google.gson.JsonElement; -import java.io.IOException; - -/** - * @author peng-yongsheng - */ -public class ServiceNameRegisterPost { - - public void send(String jsonFile) throws IOException { - JsonElement instance = JsonFileReader.INSTANCE.read(jsonFile); - HttpClientTools.INSTANCE.post("http://localhost:12800/servicename/discovery", instance.toString()); - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ApplicationRegisterServletHandlerTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ApplicationRegisterServletHandlerTest.java deleted file mode 100644 index 423e01a8f1979be27f5fed67dbd3f322c7aa9095..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ApplicationRegisterServletHandlerTest.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import org.apache.skywalking.apm.collector.DelegatingServletInputStream; -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -import javax.servlet.http.HttpServletRequest; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStreamReader; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.anyString; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class ApplicationRegisterServletHandlerTest { - - private ApplicationRegisterServletHandler applicationRegisterServletHandler; - - @Mock - private ModuleManager moduleManager; - @Mock - private HttpServletRequest request; - - private Gson gson = new Gson(); - - @Before - public void setUp() throws Exception { - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - applicationRegisterServletHandler = new ApplicationRegisterServletHandler(moduleManager); - } - - @Test - public void pathSpec() { - assertEquals(applicationRegisterServletHandler.pathSpec(), "/application/register"); - } - - @Test(expected = UnsupportedOperationException.class) - public void doGet() throws ArgumentsParseException { - applicationRegisterServletHandler.doGet(request); - } - - @Test - public void doPost() throws ArgumentsParseException, IOException { - JsonArray array = new JsonArray(); - array.add("test_code"); - String s = gson.toJson(array); - Mockito.when(request.getReader()).then(invocation -> { - DelegatingServletInputStream delegatingServletInputStream = new DelegatingServletInputStream(new ByteArrayInputStream(s.getBytes())); - return new BufferedReader(new InputStreamReader(delegatingServletInputStream)); - }); - JsonElement jsonElement = applicationRegisterServletHandler.doPost(request); - JsonObject jsonObject = (JsonObject) ((JsonArray) jsonElement).get(0); - assertEquals(jsonObject.get("c").getAsString(), "test_code"); - assertEquals(jsonObject.get("i").getAsInt(), 0); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceDiscoveryServletHandlerTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceDiscoveryServletHandlerTest.java deleted file mode 100644 index f23d13305da469b4ee42f54bdb12ba212ea148c8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceDiscoveryServletHandlerTest.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import org.apache.skywalking.apm.collector.DelegatingServletInputStream; -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -import javax.servlet.http.HttpServletRequest; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStreamReader; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.anyString; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class InstanceDiscoveryServletHandlerTest { - - @Mock - private ModuleManager moduleManager; - @Mock - private HttpServletRequest request; - - private Gson gson = new Gson(); - - private InstanceDiscoveryServletHandler instanceDiscoveryServletHandler; - - @Before - public void setUp() throws Exception { - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - instanceDiscoveryServletHandler = new InstanceDiscoveryServletHandler(moduleManager); - - } - - @Test - public void pathSpec() { - assertEquals(instanceDiscoveryServletHandler.pathSpec(), "/instance/register"); - } - - @Test(expected = UnsupportedOperationException.class) - public void doGet() throws ArgumentsParseException { - instanceDiscoveryServletHandler.doGet(request); - } - - @Test - public void doPost() throws ArgumentsParseException, IOException { - JsonObject jsonObject = new JsonObject(); - jsonObject.addProperty("ai", 1); - jsonObject.addProperty("au", "123"); - jsonObject.addProperty("rt", System.currentTimeMillis()); - JsonObject osInfo = new JsonObject(); - osInfo.addProperty("osName", "test"); - jsonObject.add("oi", osInfo); - String s = gson.toJson(jsonObject); - Mockito.when(request.getReader()).then(invocation -> { - DelegatingServletInputStream delegatingServletInputStream = new DelegatingServletInputStream(new ByteArrayInputStream(s.getBytes())); - return new BufferedReader(new InputStreamReader(delegatingServletInputStream)); - }); - JsonElement jsonElement = instanceDiscoveryServletHandler.doPost(request); - int ii = ((JsonObject) jsonElement).get("ii").getAsInt(); - assertEquals(ii, 0); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceHeartBeatServletHandlerTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceHeartBeatServletHandlerTest.java deleted file mode 100644 index 028b9654cdf436c661866a670e86feadb8feb0ef..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/InstanceHeartBeatServletHandlerTest.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import org.apache.skywalking.apm.collector.DelegatingServletInputStream; -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -import javax.servlet.http.HttpServletRequest; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStreamReader; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.anyString; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class InstanceHeartBeatServletHandlerTest { - - @Mock - private ModuleManager moduleManager; - @Mock - private HttpServletRequest request; - - private Gson gson = new Gson(); - - private InstanceHeartBeatServletHandler heartBeatServletHandler; - - @Before - public void setUp() throws Exception { - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - heartBeatServletHandler = new InstanceHeartBeatServletHandler(moduleManager); - - } - - @Test - public void pathSpec() { - assertEquals(heartBeatServletHandler.pathSpec(), "/instance/heartbeat"); - } - - @Test(expected = UnsupportedOperationException.class) - public void doGet() throws ArgumentsParseException { - heartBeatServletHandler.doGet(request); - } - - @Test - public void doPost() throws IOException, ArgumentsParseException { - JsonObject jsonObject = new JsonObject(); - jsonObject.addProperty("ii", 1); - jsonObject.addProperty("ht", System.currentTimeMillis()); - String s = gson.toJson(jsonObject); - Mockito.when(request.getReader()).then(invocation -> { - DelegatingServletInputStream delegatingServletInputStream = new DelegatingServletInputStream(new ByteArrayInputStream(s.getBytes())); - return new BufferedReader(new InputStreamReader(delegatingServletInputStream)); - }); - JsonElement jsonElement = heartBeatServletHandler.doPost(request); - assertTrue(jsonElement.isJsonObject()); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/NetworkAddressRegisterServletHandlerTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/NetworkAddressRegisterServletHandlerTest.java deleted file mode 100644 index 5d544a80e1a2ac4c978a9b758c650dfe9e20f878..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/NetworkAddressRegisterServletHandlerTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import org.apache.skywalking.apm.collector.DelegatingServletInputStream; -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -import javax.servlet.http.HttpServletRequest; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStreamReader; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.anyString; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class NetworkAddressRegisterServletHandlerTest { - - private NetworkAddressRegisterServletHandler handler; - - @Mock - private ModuleManager moduleManager; - @Mock - private HttpServletRequest request; - - private Gson gson = new Gson(); - - @Before - public void setUp() throws Exception { - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - handler = new NetworkAddressRegisterServletHandler(moduleManager); - } - - @Test - public void pathSpec() { - assertEquals(handler.pathSpec(), "/networkAddress/register"); - } - - @Test(expected = UnsupportedOperationException.class) - public void doGet() throws ArgumentsParseException { - handler.doGet(request); - } - - @Test - public void doPost() throws ArgumentsParseException, IOException { - JsonArray array = new JsonArray(); - array.add("127.0.0.1:6379"); - array.add("127.0.0.2:6379"); - String s = gson.toJson(array); - Mockito.when(request.getReader()).then(invocation -> { - DelegatingServletInputStream delegatingServletInputStream = new DelegatingServletInputStream(new ByteArrayInputStream(s.getBytes())); - return new BufferedReader(new InputStreamReader(delegatingServletInputStream)); - }); - JsonElement jsonElement = handler.doPost(request); - Assert.assertTrue(jsonElement.isJsonArray()); - JsonArray js = (JsonArray) jsonElement; - assertTrue(js.size() > 0); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ServiceNameDiscoveryServiceHandlerTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ServiceNameDiscoveryServiceHandlerTest.java deleted file mode 100644 index 226f79d5e58df0bdb003c3719ad0f1e68b951caf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/ServiceNameDiscoveryServiceHandlerTest.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import org.apache.skywalking.apm.collector.DelegatingServletInputStream; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IServiceNameService; -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; -import org.mockito.runners.MockitoJUnitRunner; - -import javax.servlet.http.HttpServletRequest; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStreamReader; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.anyInt; -import static org.mockito.Matchers.anyString; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class ServiceNameDiscoveryServiceHandlerTest { - - @Mock - private ModuleManager moduleManager; - @Mock - private HttpServletRequest request; - - private ServiceNameDiscoveryServiceHandler handler; - - private Gson gson = new Gson(); - - @Mock - private IServiceNameService serviceNameService; - - @Before - public void setUp() throws Exception { - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - handler = new ServiceNameDiscoveryServiceHandler(moduleManager); - Whitebox.setInternalState(handler, "serviceNameService", serviceNameService); - } - - @Test - public void pathSpec() { - assertEquals(handler.pathSpec(), "/servicename/discovery"); - } - - @Test(expected = UnsupportedOperationException.class) - public void doGet() throws ArgumentsParseException { - handler.doGet(request); - } - - @Test - public void doPost() throws IOException, ArgumentsParseException { - JsonObject json = new JsonObject(); - json.addProperty("ai", 1); - json.addProperty("sn", "test"); - json.addProperty("st", 5); - - JsonArray array = new JsonArray(); - array.add(json); - - String s = gson.toJson(array); - - when(serviceNameService.getOrCreate(anyInt(), anyInt(), anyString())).thenReturn(2); - - Mockito.when(request.getReader()).then(invocation -> { - DelegatingServletInputStream delegatingServletInputStream = new DelegatingServletInputStream(new ByteArrayInputStream(s.getBytes())); - return new BufferedReader(new InputStreamReader(delegatingServletInputStream)); - }); - JsonElement jsonElement = handler.doPost(request); - int serviceId = jsonElement.getAsJsonArray().get(0).getAsJsonObject().get("si").getAsInt(); - assertEquals(serviceId, 2); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/TraceSegmentServletHandlerTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/TraceSegmentServletHandlerTest.java deleted file mode 100644 index d3ff32016fa97dfb8bf5dde343f6c3b74d34bade..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/TraceSegmentServletHandlerTest.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import org.apache.skywalking.apm.collector.DelegatingServletInputStream; -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -import javax.servlet.http.HttpServletRequest; - -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStreamReader; - -import static org.mockito.Matchers.anyString; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class TraceSegmentServletHandlerTest { - - @Mock - private ModuleManager moduleManager; - @Mock - private HttpServletRequest request; - - private Gson gson = new Gson(); - - private TraceSegmentServletHandler handler; - - @Before - public void setUp() throws Exception { - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - - handler = new TraceSegmentServletHandler(moduleManager); - } - - @Test - public void pathSpec() { - Assert.assertEquals(handler.pathSpec(), "/segments"); - } - - @Test(expected = UnsupportedOperationException.class) - public void doGet() throws ArgumentsParseException { - handler.doGet(request); - } - - @Test - public void doPost() throws IOException, ArgumentsParseException { - - JsonArray array = new JsonArray(); - array.add(230150); - array.add(185809); - array.add(24040000); - JsonArray gtArray = new JsonArray(); - gtArray.add(array); - JsonObject json = new JsonObject(); - json.add("gt", gtArray); - json.add("sg", new JsonObject()); - - JsonArray finalArr = new JsonArray(); - finalArr.add(json); - - String s = gson.toJson(finalArr); - - Mockito.when(request.getReader()).then(invocation -> { - DelegatingServletInputStream delegatingServletInputStream = new DelegatingServletInputStream(new ByteArrayInputStream(s.getBytes())); - return new BufferedReader(new InputStreamReader(delegatingServletInputStream)); - }); - - JsonElement jsonElement = handler.doPost(request); - - Assert.assertNull(jsonElement); - - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingHandlerTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingHandlerTest.java deleted file mode 100644 index bfc830a2048c405c3d678a2e191568b85954af50..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingHandlerTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.naming; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; - -import javax.servlet.http.HttpServletRequest; - -import static org.junit.Assert.assertEquals; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class AgentJettyNamingHandlerTest { - - private AgentJettyNamingHandler agentJettyNamingHandler; - @Mock - private HttpServletRequest request; - - private String address = "127.0.0.1:8080"; - - @Before - public void setUp() { - AgentJettyNamingListener agentJettyNamingListener = new AgentJettyNamingListener(); - agentJettyNamingListener.addAddress(address); - agentJettyNamingHandler = new AgentJettyNamingHandler(agentJettyNamingListener); - - } - - @Test - public void pathSpec() { - assertEquals(agentJettyNamingHandler.pathSpec(), "/agent/jetty"); - } - - @Test - public void doGet() throws ArgumentsParseException { - JsonElement jsonElement = agentJettyNamingHandler.doGet(request); - assertEquals(((JsonArray) jsonElement).get(0).getAsString(), address); - - } - - @Test(expected = UnsupportedOperationException.class) - public void doPost() throws ArgumentsParseException { - agentJettyNamingHandler.doPost(request); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingListenerTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingListenerTest.java deleted file mode 100644 index c1608defd24f532cfe7ace7a1d587f9afed094e8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/naming/AgentJettyNamingListenerTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.naming; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.junit.Assert.assertEquals; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class AgentJettyNamingListenerTest { - - private AgentJettyNamingListener agentJettyNamingListener; - - @Before - public void setUp() throws Exception { - agentJettyNamingListener = new AgentJettyNamingListener(); - - } - - @Test - public void path() { - assertEquals(agentJettyNamingListener.path(), "/agent_jetty/jetty"); - } - - @Test - public void serverJoinNotify() { - agentJettyNamingListener.serverJoinNotify(null); - } - - @Test - public void serverQuitNotify() { - agentJettyNamingListener.serverQuitNotify(null); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/BaseReader.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/BaseReader.java deleted file mode 100644 index 46c7e07d0ef1b258e4fe215e78c8a5ba7d46cc9d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/BaseReader.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.stream.JsonReader; - -import java.io.ByteArrayInputStream; -import java.io.InputStreamReader; - -/** - * @author lican - */ -public class BaseReader { - - private Gson gson = new Gson(); - - protected JsonReader getReader(JsonElement element) { - return new JsonReader(new InputStreamReader(new ByteArrayInputStream(gson.toJson(element).getBytes()))); - } -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/KeyWithStringValueJsonReaderTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/KeyWithStringValueJsonReaderTest.java deleted file mode 100644 index 35ef275711651b538cbf579624f96d257f31254b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/KeyWithStringValueJsonReaderTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader; - -import com.google.gson.Gson; -import com.google.gson.JsonObject; -import org.apache.skywalking.apm.network.language.agent.KeyWithStringValue; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; - -import java.io.IOException; - -import static org.junit.Assert.assertEquals; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class KeyWithStringValueJsonReaderTest extends BaseReader { - - private KeyWithStringValueJsonReader jsonReader; - - @Before - public void setUp() throws Exception { - jsonReader = new KeyWithStringValueJsonReader(); - } - - @Test - public void read() throws IOException { - Gson gson = new Gson(); - JsonObject jsonObject = new JsonObject(); - jsonObject.addProperty("k", "hello"); - jsonObject.addProperty("v", "world"); - KeyWithStringValue read = jsonReader.read(getReader(jsonObject)); - assertEquals(read.getKey(),"hello"); - assertEquals(read.getValue(),"world"); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/LogJsonReaderTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/LogJsonReaderTest.java deleted file mode 100644 index 5b66b9e6ef1ae69def0ec8d0a8fa866b9af4b172..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/LogJsonReaderTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import org.apache.skywalking.apm.network.language.agent.LogMessage; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; - -import java.io.IOException; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class LogJsonReaderTest extends BaseReader { - - private LogJsonReader logJsonReader; - - @Before - public void setUp() throws Exception { - logJsonReader = new LogJsonReader(); - } - - @Test - public void read() throws IOException { - Gson gson = new Gson(); - JsonObject jsonObject = new JsonObject(); - jsonObject.addProperty("k", "hello"); - jsonObject.addProperty("v", "world"); - - JsonArray array = new JsonArray(); - array.add(jsonObject); - - long l = System.currentTimeMillis(); - - JsonObject json = new JsonObject(); - json.addProperty("ti", l); - json.add("ld", array); - - LogMessage read = logJsonReader.read(getReader(json)); - - Assert.assertEquals(read.getTime(), l); - } - - -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/ReferenceJsonReaderTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/ReferenceJsonReaderTest.java deleted file mode 100644 index e705f907b68295497875f8e0dfd7aeb733f9aff8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/ReferenceJsonReaderTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import org.apache.skywalking.apm.network.language.agent.TraceSegmentReference; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; - -import java.io.IOException; - -import static org.junit.Assert.assertTrue; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class ReferenceJsonReaderTest extends BaseReader { - - private ReferenceJsonReader referenceJsonReader; - - @Before - public void setUp() throws Exception { - referenceJsonReader = new ReferenceJsonReader(); - } - - /** - * { - * "pts": [230150, 185809, 24040000], //parentTraceSegmentId - * "pii": 2, //parentApplicationInstanceId - * "psp": 1, //parentSpanId - * "psi": 0, //parentServiceId - * "psn": "/dubbox-case/case/dubbox-rest", //parentServiceName - * "ni": 0, //networkAddressId - * "nn": "172.25.0.4:20880", //networkAddress - * "eii": 2, //entryApplicationInstanceId - * "esi": 0, //entryServiceId - * "esn": "/dubbox-case/case/dubbox-rest", //entryServiceName - * "rv": 0 //RefType - * } - */ - @Test - public void read() throws IOException { - Gson gson = new Gson(); - JsonObject jsonObject = new JsonObject(); - JsonArray ptsArray = new JsonArray(); - ptsArray.add(230150L); - ptsArray.add(185809L); - ptsArray.add(24040000L); - - jsonObject.add("pts", ptsArray); - jsonObject.addProperty("pii", 2); - jsonObject.addProperty("psp", 1); - jsonObject.addProperty("psi", 0); - jsonObject.addProperty("psn", "/dubbox-case/case/dubbox-rest"); - jsonObject.addProperty("ni", 0); - jsonObject.addProperty("nn", "172.25.0.4:20880"); - jsonObject.addProperty("eii", 2); - jsonObject.addProperty("esi", 0); - jsonObject.addProperty("esn", "/dubbox-case/case/dubbox-rest"); -// jsonObject.addProperty("rn", 0); - //add - jsonObject.addProperty("rv", 1); - - TraceSegmentReference read = referenceJsonReader.read(getReader(jsonObject)); - assertTrue(read.getParentTraceSegmentId().getIdPartsList().size() == 3); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SegmentJsonReaderTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SegmentJsonReaderTest.java deleted file mode 100644 index 011694a659e07daa6ce2c2f4dc067d11501b2515..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SegmentJsonReaderTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader; - -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import org.apache.skywalking.apm.network.language.agent.TraceSegmentObject; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; - -import java.io.IOException; - -import static org.junit.Assert.assertTrue; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class SegmentJsonReaderTest extends BaseReader { - - private SegmentJsonReader segmentJsonReader; - - @Before - public void setUp() throws Exception { - segmentJsonReader = new SegmentJsonReader(); - } - - /** - * { //TraceSegmentObject - * "ts": [137150, 185809, 48780000], - * "ai": 2, //applicationId - * "ii": 3, //applicationInstanceId - * "ss": []//SpanObject - */ - @Test - public void read() throws IOException { - JsonArray tsArray = new JsonArray(); - tsArray.add(137150); - tsArray.add(185809); - tsArray.add(48780000); - - JsonObject json = new JsonObject(); - json.add("ts", tsArray); - json.addProperty("ai", 2); - json.addProperty("ii", 3); - json.add("ss", new JsonArray()); - TraceSegmentObject.Builder read = segmentJsonReader.read(getReader(json)); - TraceSegmentObject build = read.build(); - assertTrue(build.getTraceSegmentId().getIdPartsList().size() == 3); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SpanJsonReaderTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SpanJsonReaderTest.java deleted file mode 100644 index ecac2870505228dc548f979eda5c7b45a32a697c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/SpanJsonReaderTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader; - -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import org.apache.skywalking.apm.network.language.agent.SpanObject; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; - -import java.io.IOException; - -import static org.junit.Assert.assertEquals; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class SpanJsonReaderTest extends BaseReader { - - private SpanJsonReader spanJsonReader; - - @Before - public void setUp() throws Exception { - spanJsonReader = new SpanJsonReader(); - } - - /** - * { - * "si": 0, //spanId - * "tv": 0, //SpanType - * "lv": 2, //SpanLayer - * "ps": -1, //parentSpanId - * "st": 1501858094726, //startTime - * "et": 1501858096804, //endTime - * "ci": 3, //componentId - * "cn": "", //component - * "oi": 0, //operationNameId - * "on": "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()", //operationName - * "pi": 0, //peerId - * "pn": "", //peer - * "ie": false, //isError - * "rs": [ //TraceSegmentReference], - * "to": [ //KeyWithStringValue ], - * "lo": [] //log - * } - */ - @Test - public void read() throws IOException { - JsonObject json = new JsonObject(); - json.addProperty("si", 1); - json.addProperty("tv", 0); - json.addProperty("lv", 2); - json.addProperty("ps", -1); - json.addProperty("st", 1501858094726L); - json.addProperty("et", 1501858096804L); - json.addProperty("ci", 3); - json.addProperty("cn", "redis"); - json.addProperty("oi", 0); - json.addProperty("on", "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()"); - json.addProperty("pi", 0); - json.addProperty("pn", "127.0.0.1:6379"); - json.addProperty("ie", false); - json.add("rs", new JsonArray()); - json.add("to", new JsonArray()); - json.add("lo", new JsonArray()); - SpanObject read = spanJsonReader.read(getReader(json)); - assertEquals(read.getSpanId(), 1); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/TraceSegmentJsonReaderTest.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/TraceSegmentJsonReaderTest.java deleted file mode 100644 index e834f23dbf6ba98952c8e0951cdd0596354bb02f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/agent/jetty/provider/handler/reader/TraceSegmentJsonReaderTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.agent.jetty.provider.handler.reader; - -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import org.apache.skywalking.apm.network.language.agent.UniqueId; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; - -import java.io.IOException; -import java.util.List; - -import static org.junit.Assert.assertTrue; - -/** - * @author lican - */ -@RunWith(MockitoJUnitRunner.class) -public class TraceSegmentJsonReaderTest extends BaseReader { - - private TraceSegmentJsonReader traceSegmentJsonReader; - - @Before - public void setUp() throws Exception { - traceSegmentJsonReader = new TraceSegmentJsonReader(); - } - - /** - * { - * "gt": [[230150, 185809, 24040000]], - * "sg": { }//TraceSegmentObject - */ - @Test - public void read() throws IOException { - JsonArray array = new JsonArray(); - array.add(230150); - array.add(185809); - array.add(24040000); - JsonArray gtArray = new JsonArray(); - gtArray.add(array); - JsonObject json = new JsonObject(); - json.add("gt", gtArray); - json.add("sg", new JsonObject()); - TraceSegment read = traceSegmentJsonReader.read(getReader(json)); - List globalTraceIdsList = read.getUpstreamSegment().getGlobalTraceIdsList(); - assertTrue(globalTraceIdsList.size() == 1); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/core/module/MockModule.java b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/core/module/MockModule.java deleted file mode 100644 index b7ca4bae3e5063388aba518f3298f549a1b89060..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/core/module/MockModule.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -import com.google.common.collect.Lists; -import org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService; -import org.apache.skywalking.apm.collector.server.jetty.JettyServer; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; -import org.powermock.api.mockito.PowerMockito; - -import java.util.LinkedList; - -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyInt; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.when; - -/** - * @author lican - */ -public class MockModule extends ModuleDefine { - - public MockModule() throws ServiceNotProvidedException { - ModuleProvider moduleProvider = Mockito.mock(ModuleProvider.class); - LinkedList linkedList = Lists.newLinkedList(); - linkedList.add(moduleProvider); - Whitebox.setInternalState(this, "loadedProviders", linkedList); - when(moduleProvider.getService(any())).then(invocation -> { - Class argumentAt = invocation.getArgumentAt(0, Class.class); - Object mock = Mockito.mock(argumentAt); - if (mock instanceof JettyManagerService) { - PowerMockito.when(((JettyManagerService) mock).createIfAbsent(anyString(), anyInt(), anyString())).then(invocation1 -> { - JettyServer jettyServer = new JettyServer("127.0.0.1", 10806, "/"); - jettyServer.initialize(); - return jettyServer; - }); - - } - return mock; - }); - } - - @Override - public String name() { - return null; - } - - @Override - public Class[] services() { - return new Class[0]; - } - - -} diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/application-register-consumer.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/application-register-consumer.json deleted file mode 100644 index b7f2436357dc70996fcf365ebb2c41e21ad5165b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/application-register-consumer.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "dubbox-consumer" -] \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/application-register-provider.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/application-register-provider.json deleted file mode 100644 index 08a2c156bcd2c6d35764ffe02b30b1a47a9929d6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/application-register-provider.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "dubbox-provider" -] \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-consumer.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-consumer.json deleted file mode 100644 index 06bb8fe87f7c4c9166e8a128574677d54eae1c48..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-consumer.json +++ /dev/null @@ -1,61 +0,0 @@ -[ - { - "gt": [[230150, 185809, 24040000]], //trace_id 链路编码 - "sg": { - "ts": [230150, 185809, 24040000], //segment_id 一个应用中的一个实例在链路中产生的编号 - "ai": -1, //应用ID,应用启动注册时产生 - "ii": 2, //实例ID,应用启动注册时产生 - "rs": [], //链路的上下文信息,头节点,所以为空 - "ss": [ //一个埋点(手动埋点或者自动埋点) - { - "si": 1, //埋点编号 - "tv": 1, //埋点类型(手动、入口、出口) - "lv": 2, //层(RPCFramework,Database,Http) - "ps": 0, //上级埋点编号 - "st": 1501858094526, //开始时间 - "et": 1501858097004, //结束时间 - "ci": 3, //组件编号(Tomcat、Mysql、Dubbo...) - "cn": "", //组件名称 - "oi": 0, //埋点的服务ID - "on": "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()", //埋点的服务名 - "pi": 0, //地址注册的ID,调用抓取后注册 - "pn": "172.25.0.4:20880", //地址 - "ie": false, //是否发生错误,是否有Exception - "to": [ //与链路分析关系较小的TAG,SQL也在其中 - { - "k": "url", - "v": "rest://172.25.0.4:20880/org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()" - } - ], - "lo": [] //日志,与链路分析完全无关,只作为展示使用,手动埋点时可以任意追加,kv的形式,例如收集一些业务相关的信息 - }, - { - "si": 0, - "tv": 0, - "lv": 3, - "ps": -1, - "st": 1501858092409, - "et": 1501858097033, - "ci": 1, - "cn": "", - "oi": 0, - "on": "/dubbox-case/case/dubbox-rest", - "pi": 0, - "pn": "", - "ie": false, - "to": [ - { - "k": "url", - "v": "http://localhost:18080/dubbox-case/case/dubbox-rest" - }, - { - "k": "http.method", - "v": "GET" - } - ], - "lo": [] - } - ] - } - } -] \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-provider.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-provider.json deleted file mode 100644 index 856cfc03cae760de5821a2de4a67ada5a130f7c0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/dubbox-provider.json +++ /dev/null @@ -1,70 +0,0 @@ -[ - { - "gt": [[230150, 185809, 24040000]], //trace_id 链路编码,与调用方相同 - "sg": { - "ts": [137150, 185809, 48780000], //segment_id,新产生 - "ai": 2, - "ii": 3, - "ss": [ - { - "si": 0, - "tv": 0, - "lv": 2, - "ps": -1, - "st": 1501858094726, - "et": 1501858096804, - "ci": 3, - "cn": "", - "oi": 0, - "on": "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()", - "pi": 0, - "pn": "", - "ie": false, - "rs": [ - { - "pts": [230150, 185809, 24040000], //上级的segment_id 一个应用中的一个实例在链路中产生的编号 - "pii": 2, //上级的实例编号 - "psp": 1, //上级的埋点编号span_id - "psi": 0, //上级的服务编号(org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()注册后的ID) - "psn": "/dubbox-case/case/dubbox-rest", //上级的服务名 - "ni": 0, //上级调用时使用的地址注册后的ID - "nn": "172.25.0.4:20880", //上级的地址 - "eii": 2, //入口的实例编号 - "esi": 0, //入口的服务编号 - "esn": "/dubbox-case/case/dubbox-rest", //入口的服务名词 - "rn": 0 //调用方式(CrossProcess,CrossThread) - } - ], - "to": [ - { - "k": "url", - "v": "rest://172.25.0.4:20880/org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()" - }, - { - "k": "http.method", - "v": "GET" - } - ], - "lo": [] - }, - { - "si": 1, - "tv": 1, - "lv": 1, - "ps": 0, - "st": 1501858094726, - "et": 1501858095804, - "ci": 9, - "cn": "", - "oi": 0, - "on": "mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]", - "pi": 0, - "pn": "localhost:27017", - "ie": false, - "to": [], - "lo": [] - } - ] - } - } -] \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-consumer.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-consumer.json deleted file mode 100644 index e2cb6e068d662afb6d4fa58033673edc6333eb5c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-consumer.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "ai": -1, - "au": "dubbox-consumer", - "rt": 1501858094526, - "oi": { - "osName": "MacOS XX", - "hostName": "pengys", - "processId": "1001", - "ipv4s": [ - "10.0.0.3", - "10.0.0.4" - ] - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-provider.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-provider.json deleted file mode 100644 index 304de7c4f878154d746d23f89229f8a8b2892a79..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/instance-register-provider.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "ai": 2, - "au": "dubbox-provider", - "rt": 1501858094526, - "oi": { - "osName": "MacOS X", - "hostName": "peng-yongsheng", - "processId": "1000", - "ipv4s": [ - "10.0.0.1", - "10.0.0.2" - ] - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/servicename-register-consumer.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/servicename-register-consumer.json deleted file mode 100644 index 9cc919204c1c1647e90512eb4c7803aeb7eb8826..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/servicename-register-consumer.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "ai": -1, - "sn": "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()" - } -] \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/servicename-register-provider.json b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/servicename-register-provider.json deleted file mode 100644 index 0e9a961532e672304bf6ce352865cceb3fa16210..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/src/test/resources/json/servicename-register-provider.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "ai": 2, - "sn": "org.skywaking.apm.testcase.dubbo.services.GreetService.doBusiness()" - } -] \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/pom.xml b/apm-collector/apm-collector-agent/agent-jetty/pom.xml deleted file mode 100644 index 283050bf7c74ed8464971a939dfff83892761535..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/agent-jetty/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - apm-collector-agent - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - agent-jetty - pom - - agent-jetty-define - agent-jetty-provider - - \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/pom.xml b/apm-collector/apm-collector-agent/pom.xml deleted file mode 100644 index 63be8dedb105ede7dd38ae3d198880af0ca794db..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-agent/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - apm-collector - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - apm-collector-agent - pom - - agent-grpc - agent-jetty - - - - - org.apache.skywalking - apm-collector-core - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/pom.xml b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/pom.xml deleted file mode 100644 index d0770fd11c8caa5dec227bef5ab10590cb1f21d7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - analysis-alarm - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - alarm-define - jar - \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/AnalysisAlarmModule.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/AnalysisAlarmModule.java deleted file mode 100644 index 5b123a5f351413da225a797a065bf072d3597032..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/AnalysisAlarmModule.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.define; - -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; - -/** - * @author peng-yongsheng - */ -public class AnalysisAlarmModule extends ModuleDefine { - - public static final String NAME = "analysis_alarm"; - - @Override public String name() { - return NAME; - } - - @Override public Class[] services() { - return new Class[0]; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmGraphIdDefine.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmGraphIdDefine.java deleted file mode 100644 index 91cafc79ab64d20b2c68309e8c0d47282f1f3336..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmGraphIdDefine.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.define.graph; - -/** - * @author peng-yongsheng - */ -public class AlarmGraphIdDefine { - public static final int SERVICE_METRIC_ALARM_GRAPH_ID = 500; - public static final int INSTANCE_METRIC_ALARM_GRAPH_ID = 501; - public static final int APPLICATION_METRIC_ALARM_GRAPH_ID = 502; - public static final int SERVICE_REFERENCE_METRIC_ALARM_GRAPH_ID = 503; - public static final int INSTANCE_REFERENCE_METRIC_ALARM_GRAPH_ID = 504; - public static final int APPLICATION_REFERENCE_METRIC_ALARM_GRAPH_ID = 505; -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmWorkerIdDefine.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmWorkerIdDefine.java deleted file mode 100644 index d36427468c5c5cbffcd877876bbc1b02263f5bfc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmWorkerIdDefine.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.define.graph; - -/** - * @author peng-yongsheng - */ -public class AlarmWorkerIdDefine { - public static final int SERVICE_METRIC_ALARM_ASSERT_WORKER_ID = 5000; - public static final int SERVICE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID = 5001; - public static final int SERVICE_METRIC_ALARM_REMOTE_WORKER_ID = 5002; - public static final int SERVICE_METRIC_ALARM_PERSISTENCE_WORKER_ID = 5003; - public static final int SERVICE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID = 5004; - public static final int SERVICE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID = 5005; - - public static final int INSTANCE_METRIC_ALARM_ASSERT_WORKER_ID = 5010; - public static final int INSTANCE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID = 5011; - public static final int INSTANCE_METRIC_ALARM_REMOTE_WORKER_ID = 5012; - public static final int INSTANCE_METRIC_ALARM_PERSISTENCE_WORKER_ID = 5013; - public static final int INSTANCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID = 5014; - public static final int INSTANCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID = 5015; - - public static final int APPLICATION_METRIC_ALARM_ASSERT_WORKER_ID = 5020; - public static final int APPLICATION_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID = 5021; - public static final int APPLICATION_METRIC_ALARM_REMOTE_WORKER_ID = 5022; - public static final int APPLICATION_METRIC_ALARM_PERSISTENCE_WORKER_ID = 5023; - public static final int APPLICATION_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID = 5024; - - public static final int SERVICE_REFERENCE_METRIC_ALARM_ASSERT_WORKER_ID = 5030; - public static final int SERVICE_REFERENCE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID = 5031; - public static final int SERVICE_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID = 5032; - public static final int SERVICE_REFERENCE_METRIC_ALARM_PERSISTENCE_WORKER_ID = 5033; - public static final int SERVICE_REFERENCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID = 5034; - public static final int SERVICE_REFERENCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID = 5035; - - public static final int INSTANCE_REFERENCE_METRIC_ALARM_ASSERT_WORKER_ID = 5040; - public static final int INSTANCE_REFERENCE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID = 5041; - public static final int INSTANCE_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID = 5042; - public static final int INSTANCE_REFERENCE_METRIC_ALARM_PERSISTENCE_WORKER_ID = 5043; - public static final int INSTANCE_REFERENCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID = 5044; - public static final int INSTANCE_REFERENCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID = 5045; - - public static final int APPLICATION_REFERENCE_METRIC_ALARM_ASSERT_WORKER_ID = 5050; - public static final int APPLICATION_REFERENCE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID = 5051; - public static final int APPLICATION_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID = 5052; - public static final int APPLICATION_REFERENCE_METRIC_ALARM_PERSISTENCE_WORKER_ID = 5053; - public static final int APPLICATION_REFERENCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID = 5054; - public static final int APPLICATION_REFERENCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID = 5055; - - public static final int APPLICATION_METRIC_ALARM_LIST_MINUTE_PERSISTENCE_WORKER_ID = 5051; - public static final int APPLICATION_METRIC_ALARM_LIST_HOUR_PERSISTENCE_WORKER_ID = 5052; - public static final int APPLICATION_METRIC_ALARM_LIST_DAY_PERSISTENCE_WORKER_ID = 5053; - public static final int APPLICATION_METRIC_ALARM_LIST_MONTH_PERSISTENCE_WORKER_ID = 5054; - public static final int APPLICATION_METRIC_ALARM_LIST_HOUR_TRANSFORM_NODE_ID = 5055; - public static final int APPLICATION_METRIC_ALARM_LIST_DAY_TRANSFORM_NODE_ID = 5056; - public static final int APPLICATION_METRIC_ALARM_LIST_MONTH_TRANSFORM_NODE_ID = 5057; -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine deleted file mode 100644 index 5c95ca418110e6c953f000c9e16e2d3ce64de30e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.analysis.alarm.define.AnalysisAlarmModule \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/pom.xml b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/pom.xml deleted file mode 100644 index 445f10be5d9e0ef3157df32f4ed4cce7bb5546ed..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - analysis-alarm - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - alarm-provider - jar - - - - org.apache.skywalking - alarm-define - ${project.version} - - - org.apache.skywalking - metric-define - ${project.version} - - - org.apache.skywalking - collector-configuration-define - ${project.version} - - - org.apache.skywalking - collector-storage-define - ${project.version} - - - org.apache.skywalking - collector-cache-define - ${project.version} - - - org.apache.skywalking - analysis-worker-model - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/AnalysisAlarmModuleConfig.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/AnalysisAlarmModuleConfig.java deleted file mode 100644 index 7df976a1253d26f7753e69c4ba7d4177490656d4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/AnalysisAlarmModuleConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author peng-yongsheng - */ -class AnalysisAlarmModuleConfig extends ModuleConfig { -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/AnalysisAlarmModuleProvider.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/AnalysisAlarmModuleProvider.java deleted file mode 100644 index f6725e97b1641deb3f971d084a0ec4cd555ef450..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/AnalysisAlarmModuleProvider.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.AnalysisAlarmModule; -import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application.*; -import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance.*; -import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service.*; -import org.apache.skywalking.apm.collector.analysis.metric.define.AnalysisMetricModule; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.analysis.worker.timer.PersistenceTimer; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.table.alarm.*; - -/** - * @author peng-yongsheng - */ -public class AnalysisAlarmModuleProvider extends ModuleProvider { - - private final AnalysisAlarmModuleConfig config; - - public AnalysisAlarmModuleProvider() { - super(); - this.config = new AnalysisAlarmModuleConfig(); - } - - @Override public String name() { - return "default"; - } - - @Override public Class module() { - return AnalysisAlarmModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() { - } - - @Override public void start() { - WorkerCreateListener workerCreateListener = new WorkerCreateListener(); - - new ServiceMetricAlarmGraph(getManager(), workerCreateListener).create(); - new InstanceMetricAlarmGraph(getManager(), workerCreateListener).create(); - new ApplicationMetricAlarmGraph(getManager(), workerCreateListener).create(); - new ServiceReferenceMetricAlarmGraph(getManager(), workerCreateListener).create(); - new InstanceReferenceMetricAlarmGraph(getManager(), workerCreateListener).create(); - new ApplicationReferenceMetricAlarmGraph(getManager(), workerCreateListener).create(); - - registerRemoteData(); - - PersistenceTimer.INSTANCE.start(getManager(), workerCreateListener.getPersistenceWorkers()); - } - - @Override public void notifyAfterCompleted() { - } - - @Override public String[] requiredModules() { - return new String[] {RemoteModule.NAME, AnalysisMetricModule.NAME, ConfigurationModule.NAME, StorageModule.NAME}; - } - - private void registerRemoteData() { - RemoteDataRegisterService remoteDataRegisterService = getManager().find(RemoteModule.NAME).getService(RemoteDataRegisterService.class); - remoteDataRegisterService.register(ApplicationAlarm.class, new ApplicationAlarm.InstanceCreator()); - remoteDataRegisterService.register(ApplicationAlarmList.class, new ApplicationAlarmList.InstanceCreator()); - remoteDataRegisterService.register(ApplicationReferenceAlarm.class, new ApplicationReferenceAlarm.InstanceCreator()); - remoteDataRegisterService.register(ApplicationReferenceAlarmList.class, new ApplicationReferenceAlarmList.InstanceCreator()); - remoteDataRegisterService.register(InstanceAlarm.class, new InstanceAlarm.InstanceCreator()); - remoteDataRegisterService.register(InstanceAlarmList.class, new InstanceAlarmList.InstanceCreator()); - remoteDataRegisterService.register(InstanceReferenceAlarm.class, new InstanceReferenceAlarm.InstanceCreator()); - remoteDataRegisterService.register(InstanceReferenceAlarmList.class, new InstanceReferenceAlarmList.InstanceCreator()); - remoteDataRegisterService.register(ServiceAlarm.class, new ServiceAlarm.InstanceCreator()); - remoteDataRegisterService.register(ServiceAlarmList.class, new ServiceAlarmList.InstanceCreator()); - remoteDataRegisterService.register(ServiceReferenceAlarm.class, new ServiceReferenceAlarm.InstanceCreator()); - remoteDataRegisterService.register(ServiceReferenceAlarmList.class, new ServiceReferenceAlarmList.InstanceCreator()); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/AlarmAssertWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/AlarmAssertWorker.java deleted file mode 100644 index 13a3bfd2b092347ae4d2d471e146b28ddd5b720d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/AlarmAssertWorker.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker; - -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; -import org.apache.skywalking.apm.collector.core.data.StreamData; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.NumberFormatUtils; -import org.apache.skywalking.apm.collector.storage.table.Metric; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.alarm.Alarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public abstract class AlarmAssertWorker extends AbstractLocalAsyncWorker { - - private static final Logger logger = LoggerFactory.getLogger(AlarmAssertWorker.class); - - public AlarmAssertWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override protected final void onWork(INPUT inputMetric) throws WorkerException { - errorRateAlarmAssert(inputMetric); - averageResponseTimeAlarmAssert(inputMetric); - } - - protected abstract OUTPUT newAlarmObject(String id, INPUT inputMetric); - - protected abstract void generateAlarmContent(OUTPUT alarm, double threshold); - - protected abstract Double calleeErrorRateThreshold(); - - protected abstract Double callerErrorRateThreshold(); - - private void errorRateAlarmAssert(INPUT inputMetric) { - Double errorRate = Double.valueOf(inputMetric.getTransactionErrorCalls()) / Double.valueOf(inputMetric.getTransactionCalls()); - errorRate = NumberFormatUtils.rateNumberFormat(errorRate); - - if (inputMetric.getSourceValue().equals(MetricSource.Callee.getValue())) { - if (errorRate >= calleeErrorRateThreshold()) { - String id = String.valueOf(MetricSource.Callee.getValue()) + Const.ID_SPLIT + AlarmType.ERROR_RATE.getValue(); - OUTPUT alarm = newAlarmObject(id, inputMetric); - alarm.setAlarmType(AlarmType.ERROR_RATE.getValue()); - alarm.setLastTimeBucket(inputMetric.getTimeBucket()); - alarm.setSourceValue(MetricSource.Callee.getValue()); - generateAlarmContent(alarm, calleeErrorRateThreshold()); - - onNext(alarm); - } - } else if (inputMetric.getSourceValue().equals(MetricSource.Caller.getValue())) { - if (errorRate >= callerErrorRateThreshold()) { - String id = String.valueOf(MetricSource.Caller.getValue()) + Const.ID_SPLIT + AlarmType.ERROR_RATE.getValue(); - OUTPUT alarm = newAlarmObject(id, inputMetric); - alarm.setAlarmType(AlarmType.ERROR_RATE.getValue()); - alarm.setLastTimeBucket(inputMetric.getTimeBucket()); - alarm.setSourceValue(MetricSource.Caller.getValue()); - generateAlarmContent(alarm, callerErrorRateThreshold()); - - onNext(alarm); - } - } else { - logger.error("Please check the metric source, the value must be {} or {}, but {}", MetricSource.Caller.getValue(), MetricSource.Callee.getValue(), inputMetric.getSourceValue()); - } - } - - protected abstract Double calleeAverageResponseTimeThreshold(); - - protected abstract Double callerAverageResponseTimeThreshold(); - - private void averageResponseTimeAlarmAssert(INPUT inputMetric) { - Long transactionSuccessDurationSum = inputMetric.getTransactionDurationSum() - inputMetric.getTransactionErrorDurationSum(); - Long transactionSuccessCalls = inputMetric.getTransactionCalls() - inputMetric.getTransactionErrorCalls(); - Double averageResponseTime = Double.valueOf(transactionSuccessDurationSum) / Double.valueOf(transactionSuccessCalls); - - if (inputMetric.getSourceValue().equals(MetricSource.Callee.getValue())) { - if (averageResponseTime >= calleeAverageResponseTimeThreshold()) { - String id = String.valueOf(MetricSource.Callee.getValue()) + Const.ID_SPLIT + AlarmType.SLOW_RTT.getValue(); - OUTPUT alarm = newAlarmObject(id, inputMetric); - alarm.setAlarmType(AlarmType.SLOW_RTT.getValue()); - alarm.setLastTimeBucket(inputMetric.getTimeBucket()); - alarm.setSourceValue(MetricSource.Callee.getValue()); - generateAlarmContent(alarm, calleeAverageResponseTimeThreshold()); - - onNext(alarm); - } - } else if (inputMetric.getSourceValue().equals(MetricSource.Caller.getValue())) { - if (averageResponseTime >= callerAverageResponseTimeThreshold()) { - String id = String.valueOf(MetricSource.Caller.getValue()) + Const.ID_SPLIT + AlarmType.SLOW_RTT.getValue(); - OUTPUT alarm = newAlarmObject(id, inputMetric); - alarm.setAlarmType(AlarmType.SLOW_RTT.getValue()); - alarm.setLastTimeBucket(inputMetric.getTimeBucket()); - alarm.setSourceValue(MetricSource.Caller.getValue()); - generateAlarmContent(alarm, callerAverageResponseTimeThreshold()); - - onNext(alarm); - } - } else { - logger.error("Please check the metric source, the value must be {} or {}, but {}", MetricSource.Caller.getValue(), MetricSource.Callee.getValue(), inputMetric.getSourceValue()); - } - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/AlarmAssertWorkerProvider.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/AlarmAssertWorkerProvider.java deleted file mode 100644 index d954181469f440f8959f0554a16dc03ae17b8e40..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/AlarmAssertWorkerProvider.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker; - -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider; -import org.apache.skywalking.apm.collector.core.data.StreamData; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.table.Metric; -import org.apache.skywalking.apm.collector.storage.table.alarm.Alarm; - -/** - * @author peng-yongsheng - */ -public abstract class AlarmAssertWorkerProvider> extends AbstractLocalAsyncWorkerProvider { - - public AlarmAssertWorkerProvider(ModuleManager moduleManager) { - super(moduleManager); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmAssertWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmAssertWorker.java deleted file mode 100644 index c1c92c3d765daa901747f5674b0e74ff5f6ca3ae..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmAssertWorker.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorker; -import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorkerProvider; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IApplicationAlarmRuleConfig; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.register.Application; - -/** - * @author peng-yongsheng - */ -public class ApplicationMetricAlarmAssertWorker extends AlarmAssertWorker { - - private final IApplicationAlarmRuleConfig applicationAlarmRuleConfig; - private final ApplicationCacheService applicationCacheService; - - public ApplicationMetricAlarmAssertWorker(ModuleManager moduleManager) { - super(moduleManager); - this.applicationAlarmRuleConfig = moduleManager.find(ConfigurationModule.NAME).getService(IApplicationAlarmRuleConfig.class); - this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class); - } - - @Override public int id() { - return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_ASSERT_WORKER_ID; - } - - @Override protected ApplicationAlarm newAlarmObject(String id, ApplicationMetric inputMetric) { - ApplicationAlarm applicationAlarm = new ApplicationAlarm(); - applicationAlarm.setId(id + Const.ID_SPLIT + inputMetric.getApplicationId()); - applicationAlarm.setApplicationId(inputMetric.getApplicationId()); - return applicationAlarm; - } - - @Override protected void generateAlarmContent(ApplicationAlarm alarm, double threshold) { - Application application = applicationCacheService.getApplicationById(alarm.getApplicationId()); - - String clientOrServer = "server"; - if (MetricSource.Caller.getValue() == alarm.getSourceValue()) { - clientOrServer = "client"; - } - - if (AlarmType.ERROR_RATE.getValue() == alarm.getAlarmType()) { - alarm.setAlarmContent("The success rate of " + application.getApplicationCode() + ", detected from " + clientOrServer + " side, is lower than " + threshold + " rate."); - } else if (AlarmType.SLOW_RTT.getValue() == alarm.getAlarmType()) { - alarm.setAlarmContent("Response time of " + application.getApplicationCode() + ", detected from " + clientOrServer + " side, is slower than " + threshold + " ms."); - } - } - - @Override protected Double calleeErrorRateThreshold() { - return applicationAlarmRuleConfig.calleeErrorRateThreshold(); - } - - @Override protected Double callerErrorRateThreshold() { - return applicationAlarmRuleConfig.callerErrorRateThreshold(); - } - - @Override protected Double calleeAverageResponseTimeThreshold() { - return applicationAlarmRuleConfig.calleeAverageResponseTimeThreshold(); - } - - @Override protected Double callerAverageResponseTimeThreshold() { - return applicationAlarmRuleConfig.callerAverageResponseTimeThreshold(); - } - - public static class Factory extends AlarmAssertWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationMetricAlarmAssertWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationMetricAlarmAssertWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmGraph.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmGraph.java deleted file mode 100644 index 4963ad049f650f2de01a47bf0d3feb3cbfc48383..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmGraph.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; - -/** - * @author peng-yongsheng - */ -public class ApplicationMetricAlarmGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public ApplicationMetricAlarmGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - Graph graph = GraphManager.INSTANCE.createIfAbsent(AlarmGraphIdDefine.APPLICATION_METRIC_ALARM_GRAPH_ID, ApplicationMetric.class); - - graph.addNode(new ApplicationMetricAlarmAssertWorker.Factory(moduleManager).create(workerCreateListener)) - .addNext(new ApplicationMetricAlarmRemoteWorker.Factory(moduleManager, remoteSenderService, AlarmGraphIdDefine.APPLICATION_METRIC_ALARM_GRAPH_ID).create(workerCreateListener)) - .addNext(new ApplicationMetricAlarmPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - graph.toFinder().findNode(AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_REMOTE_WORKER_ID, ApplicationAlarm.class) - .addNext(new ApplicationMetricAlarmToListNodeProcessor()) - .addNext(new ApplicationMetricAlarmListMinutePersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - graph.toFinder().findNode(AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_MINUTE_PERSISTENCE_WORKER_ID, ApplicationAlarmList.class) - .addNext(new ApplicationMetricAlarmListHourTransformNode()) - .addNext(new ApplicationMetricAlarmListHourPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - graph.toFinder().findNode(AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_MINUTE_PERSISTENCE_WORKER_ID, ApplicationAlarmList.class) - .addNext(new ApplicationMetricAlarmListDayTransformNode()) - .addNext(new ApplicationMetricAlarmListDayPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - graph.toFinder().findNode(AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_MINUTE_PERSISTENCE_WORKER_ID, ApplicationAlarmList.class) - .addNext(new ApplicationMetricAlarmListMonthTransformNode()) - .addNext(new ApplicationMetricAlarmListMonthPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - link(graph); - } - - private void link(Graph graph) { - GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.APPLICATION_METRIC_GRAPH_ID, ApplicationMetric.class) - .toFinder().findNode(MetricWorkerIdDefine.APPLICATION_MINUTE_METRIC_PERSISTENCE_WORKER_ID, ApplicationMetric.class) - .addNext(new NodeProcessor() { - @Override public int id() { - return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID; - } - - @Override public void process(ApplicationMetric instanceMetric, - Next next) { - graph.start(instanceMetric); - } - }); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListCopy.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListCopy.java deleted file mode 100644 index 95c7fb258352631260d0734036cc1b62dcda4745..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListCopy.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; - -/** - * @author peng-yongsheng - */ -public class ApplicationMetricAlarmListCopy { - - public static ApplicationAlarmList copy(ApplicationAlarmList applicationAlarmList) { - ApplicationAlarmList newApplicationAlarmList = new ApplicationAlarmList(); - newApplicationAlarmList.setMetricId(applicationAlarmList.getMetricId()); - - newApplicationAlarmList.setAlarmContent(applicationAlarmList.getAlarmContent()); - newApplicationAlarmList.setAlarmType(applicationAlarmList.getAlarmType()); - newApplicationAlarmList.setSourceValue(applicationAlarmList.getSourceValue()); - newApplicationAlarmList.setApplicationId(applicationAlarmList.getApplicationId()); - newApplicationAlarmList.setTimeBucket(newApplicationAlarmList.getTimeBucket()); - return newApplicationAlarmList; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListDayPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListDayPersistenceWorker.java deleted file mode 100644 index f5b4e7e550da41344e45b2d4ff443282eb399107..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListDayPersistenceWorker.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; - -/** - * @author peng-yongsheng - */ -public class ApplicationMetricAlarmListDayPersistenceWorker extends MergePersistenceWorker { - - public ApplicationMetricAlarmListDayPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_DAY_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationAlarmListDayPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationMetricAlarmListDayPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationMetricAlarmListDayPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListDayTransformNode.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListDayTransformNode.java deleted file mode 100644 index d79065b98ea0415652b8776d0f08464d1074a25c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListDayTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; - -/** - * @author peng-yongsheng - */ -public class ApplicationMetricAlarmListDayTransformNode implements NodeProcessor { - - @Override public int id() { - return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_DAY_TRANSFORM_NODE_ID; - } - - @Override - public void process(ApplicationAlarmList applicationAlarmList, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(applicationAlarmList.getTimeBucket()); - - ApplicationAlarmList newApplicationAlarmList = ApplicationMetricAlarmListCopy.copy(applicationAlarmList); - newApplicationAlarmList.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationAlarmList.getMetricId()); - newApplicationAlarmList.setTimeBucket(timeBucket); - next.execute(newApplicationAlarmList); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListHourPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListHourPersistenceWorker.java deleted file mode 100644 index 54af03d3114f20c5bce25bf915118c7f2007633a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListHourPersistenceWorker.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; - -/** - * @author peng-yongsheng - */ -public class ApplicationMetricAlarmListHourPersistenceWorker extends MergePersistenceWorker { - - public ApplicationMetricAlarmListHourPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_HOUR_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationAlarmListHourPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationMetricAlarmListHourPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationMetricAlarmListHourPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListHourTransformNode.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListHourTransformNode.java deleted file mode 100644 index 9d860904851df0512cefcead1e0af853f041d3e4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListHourTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; - -/** - * @author peng-yongsheng - */ -public class ApplicationMetricAlarmListHourTransformNode implements NodeProcessor { - - @Override public int id() { - return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_HOUR_TRANSFORM_NODE_ID; - } - - @Override - public void process(ApplicationAlarmList applicationAlarmList, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(applicationAlarmList.getTimeBucket()); - - ApplicationAlarmList newApplicationAlarmList = ApplicationMetricAlarmListCopy.copy(applicationAlarmList); - newApplicationAlarmList.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationAlarmList.getMetricId()); - newApplicationAlarmList.setTimeBucket(timeBucket); - next.execute(newApplicationAlarmList); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListMinutePersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListMinutePersistenceWorker.java deleted file mode 100644 index 7b82af3462c6ff16356381f0087b47c869071a17..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListMinutePersistenceWorker.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; - -/** - * @author peng-yongsheng - */ -public class ApplicationMetricAlarmListMinutePersistenceWorker extends MergePersistenceWorker { - - public ApplicationMetricAlarmListMinutePersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_MINUTE_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationAlarmListMinutePersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationMetricAlarmListMinutePersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationMetricAlarmListMinutePersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListMonthPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListMonthPersistenceWorker.java deleted file mode 100644 index 9bdacd8becc53df5cb9c95a6bfaa30f36c440f8f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListMonthPersistenceWorker.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; - -/** - * @author peng-yongsheng - */ -public class ApplicationMetricAlarmListMonthPersistenceWorker extends MergePersistenceWorker { - - public ApplicationMetricAlarmListMonthPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_MONTH_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationAlarmListMonthPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationMetricAlarmListMonthPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationMetricAlarmListMonthPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListMonthTransformNode.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListMonthTransformNode.java deleted file mode 100644 index 9bfb204132326982b88961274f2247a92ade9c08..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListMonthTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; - -/** - * @author peng-yongsheng - */ -public class ApplicationMetricAlarmListMonthTransformNode implements NodeProcessor { - - @Override public int id() { - return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_LIST_MONTH_TRANSFORM_NODE_ID; - } - - @Override - public void process(ApplicationAlarmList applicationAlarmList, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(applicationAlarmList.getTimeBucket()); - - ApplicationAlarmList newApplicationAlarmList = ApplicationMetricAlarmListCopy.copy(applicationAlarmList); - newApplicationAlarmList.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationAlarmList.getMetricId()); - newApplicationAlarmList.setTimeBucket(timeBucket); - next.execute(newApplicationAlarmList); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmPersistenceWorker.java deleted file mode 100644 index 294971986cc72c097247a7592f934745792330ab..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmPersistenceWorker.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm; - -/** - * @author peng-yongsheng - */ -public class ApplicationMetricAlarmPersistenceWorker extends MergePersistenceWorker { - - public ApplicationMetricAlarmPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationAlarmPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationMetricAlarmPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationMetricAlarmPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmRemoteWorker.java deleted file mode 100644 index 8bf49284be18a3cef2ef239c3031bd3e608b96d0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmRemoteWorker.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.remote.service.Selector; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm; - -/** - * @author peng-yongsheng - */ -public class ApplicationMetricAlarmRemoteWorker extends AbstractRemoteWorker { - - public ApplicationMetricAlarmRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_REMOTE_WORKER_ID; - } - - @Override public Selector selector() { - return Selector.HashCode; - } - - @Override protected void onWork(ApplicationAlarm message) throws WorkerException { - onNext(message); - } - - public static class Factory extends AbstractRemoteWorkerProvider { - - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public ApplicationMetricAlarmRemoteWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationMetricAlarmRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmToListNodeProcessor.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmToListNodeProcessor.java deleted file mode 100644 index de9e4a67f8401d9399064e6e443ccc8410d7455b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmToListNodeProcessor.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; - -/** - * @author peng-yongsheng - */ -public class ApplicationMetricAlarmToListNodeProcessor implements NodeProcessor { - - @Override public int id() { - return AlarmWorkerIdDefine.APPLICATION_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID; - } - - @Override public void process(ApplicationAlarm applicationAlarm, Next next) { - String metricId = applicationAlarm.getSourceValue() - + Const.ID_SPLIT + applicationAlarm.getAlarmType() - + Const.ID_SPLIT + applicationAlarm.getApplicationId(); - - String id = applicationAlarm.getLastTimeBucket() + Const.ID_SPLIT + metricId; - - ApplicationAlarmList applicationAlarmList = new ApplicationAlarmList(); - applicationAlarmList.setId(id); - applicationAlarmList.setMetricId(metricId); - applicationAlarmList.setApplicationId(applicationAlarm.getApplicationId()); - applicationAlarmList.setSourceValue(applicationAlarm.getSourceValue()); - applicationAlarmList.setAlarmType(applicationAlarm.getAlarmType()); - applicationAlarmList.setTimeBucket(applicationAlarm.getLastTimeBucket()); - applicationAlarmList.setAlarmContent(applicationAlarm.getAlarmContent()); - next.execute(applicationAlarmList); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmAssertWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmAssertWorker.java deleted file mode 100644 index efdefb0084e99944a5e17312448f0379a37054ce..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmAssertWorker.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorker; -import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorkerProvider; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IApplicationReferenceAlarmRuleConfig; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.register.Application; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMetricAlarmAssertWorker extends AlarmAssertWorker { - - private final ApplicationCacheService applicationCacheService; - private final IApplicationReferenceAlarmRuleConfig applicationReferenceAlarmRuleConfig; - - public ApplicationReferenceMetricAlarmAssertWorker(ModuleManager moduleManager) { - super(moduleManager); - this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class); - this.applicationReferenceAlarmRuleConfig = moduleManager.find(ConfigurationModule.NAME).getService(IApplicationReferenceAlarmRuleConfig.class); - } - - @Override public int id() { - return AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_ASSERT_WORKER_ID; - } - - @Override protected ApplicationReferenceAlarm newAlarmObject(String id, ApplicationReferenceMetric inputMetric) { - ApplicationReferenceAlarm applicationReferenceAlarm = new ApplicationReferenceAlarm(); - applicationReferenceAlarm.setId(id + Const.ID_SPLIT + inputMetric.getFrontApplicationId() + Const.ID_SPLIT + inputMetric.getBehindApplicationId()); - applicationReferenceAlarm.setFrontApplicationId(inputMetric.getFrontApplicationId()); - applicationReferenceAlarm.setBehindApplicationId(inputMetric.getBehindApplicationId()); - return applicationReferenceAlarm; - } - - @Override protected void generateAlarmContent(ApplicationReferenceAlarm alarm, double threshold) { - Application application = applicationCacheService.getApplicationById(alarm.getBehindApplicationId()); - - String clientOrServer = "server"; - if (MetricSource.Caller.getValue() == alarm.getSourceValue()) { - clientOrServer = "client"; - } - - if (AlarmType.ERROR_RATE.getValue() == alarm.getAlarmType()) { - alarm.setAlarmContent("The success rate of " + application.getApplicationCode() + ", detected from " + clientOrServer + " side, is lower than " + threshold + " rate."); - } else if (AlarmType.SLOW_RTT.getValue() == alarm.getAlarmType()) { - alarm.setAlarmContent("Response time of " + application.getApplicationCode() + ", detected from " + clientOrServer + " side, is slower than " + threshold + " ms."); - } - } - - @Override protected Double calleeErrorRateThreshold() { - return applicationReferenceAlarmRuleConfig.calleeErrorRateThreshold(); - } - - @Override protected Double callerErrorRateThreshold() { - return applicationReferenceAlarmRuleConfig.callerErrorRateThreshold(); - } - - @Override protected Double calleeAverageResponseTimeThreshold() { - return applicationReferenceAlarmRuleConfig.calleeAverageResponseTimeThreshold(); - } - - @Override protected Double callerAverageResponseTimeThreshold() { - return applicationReferenceAlarmRuleConfig.callerAverageResponseTimeThreshold(); - } - - public static class Factory extends AlarmAssertWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationReferenceMetricAlarmAssertWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationReferenceMetricAlarmAssertWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmGraph.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmGraph.java deleted file mode 100644 index 121aed10a31a4b7de2ffb8806f4876016d4bd610..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmGraph.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMetricAlarmGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public ApplicationReferenceMetricAlarmGraph(ModuleManager moduleManager, - WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - Graph graph = GraphManager.INSTANCE.createIfAbsent(AlarmGraphIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_GRAPH_ID, ApplicationReferenceMetric.class); - - graph.addNode(new ApplicationReferenceMetricAlarmAssertWorker.Factory(moduleManager).create(workerCreateListener)) - .addNext(new ApplicationReferenceMetricAlarmRemoteWorker.Factory(moduleManager, remoteSenderService, AlarmGraphIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_GRAPH_ID).create(workerCreateListener)) - .addNext(new ApplicationReferenceMetricAlarmPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - graph.toFinder().findNode(AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID, ApplicationReferenceAlarm.class) - .addNext(new ApplicationReferenceMetricAlarmToListNodeProcessor()) - .addNext(new ApplicationReferenceMetricAlarmListPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - link(graph); - } - - private void link(Graph graph) { - GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.APPLICATION_REFERENCE_METRIC_GRAPH_ID, ApplicationReferenceMetric.class) - .toFinder().findNode(MetricWorkerIdDefine.APPLICATION_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID, ApplicationReferenceMetric.class) - .addNext(new NodeProcessor() { - @Override public int id() { - return AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID; - } - - @Override public void process(ApplicationReferenceMetric applicationReferenceMetric, - Next next) { - graph.start(applicationReferenceMetric); - } - }); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmListPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmListPersistenceWorker.java deleted file mode 100644 index a13d035cab57ad3cc1a164c097b0c3d660d2781c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmListPersistenceWorker.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationReferenceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmList; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMetricAlarmListPersistenceWorker extends MergePersistenceWorker { - - public ApplicationReferenceMetricAlarmListPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationReferenceAlarmListPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override - public ApplicationReferenceMetricAlarmListPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationReferenceMetricAlarmListPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmPersistenceWorker.java deleted file mode 100644 index 875878274702b553c71d2062ea7e87fadb46a603..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmPersistenceWorker.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationReferenceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMetricAlarmPersistenceWorker extends MergePersistenceWorker { - - public ApplicationReferenceMetricAlarmPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationReferenceAlarmPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationReferenceMetricAlarmPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationReferenceMetricAlarmPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmRemoteWorker.java deleted file mode 100644 index f52cfc74a345ca0c57b0d66d5fb1b3eaa4712aa5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmRemoteWorker.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.remote.service.Selector; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMetricAlarmRemoteWorker extends AbstractRemoteWorker { - - public ApplicationReferenceMetricAlarmRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID; - } - - @Override public Selector selector() { - return Selector.HashCode; - } - - @Override protected void onWork(ApplicationReferenceAlarm message) throws WorkerException { - onNext(message); - } - - public static class Factory extends AbstractRemoteWorkerProvider { - - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public ApplicationReferenceMetricAlarmRemoteWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationReferenceMetricAlarmRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmToListNodeProcessor.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmToListNodeProcessor.java deleted file mode 100644 index de4874adb54170c73aed7f2baad2ff47538c9b1c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationReferenceMetricAlarmToListNodeProcessor.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.application; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmList; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMetricAlarmToListNodeProcessor implements NodeProcessor { - - @Override public int id() { - return AlarmWorkerIdDefine.APPLICATION_REFERENCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID; - } - - @Override - public void process(ApplicationReferenceAlarm applicationReferenceAlarm, Next next) { - String id = applicationReferenceAlarm.getLastTimeBucket() + Const.ID_SPLIT + applicationReferenceAlarm.getSourceValue() - + Const.ID_SPLIT + applicationReferenceAlarm.getAlarmType() - + Const.ID_SPLIT + applicationReferenceAlarm.getFrontApplicationId() - + Const.ID_SPLIT + applicationReferenceAlarm.getBehindApplicationId(); - - ApplicationReferenceAlarmList applicationReferenceAlarmList = new ApplicationReferenceAlarmList(); - applicationReferenceAlarmList.setId(id); - applicationReferenceAlarmList.setFrontApplicationId(applicationReferenceAlarm.getFrontApplicationId()); - applicationReferenceAlarmList.setBehindApplicationId(applicationReferenceAlarm.getBehindApplicationId()); - applicationReferenceAlarmList.setSourceValue(applicationReferenceAlarm.getSourceValue()); - applicationReferenceAlarmList.setAlarmType(applicationReferenceAlarm.getAlarmType()); - applicationReferenceAlarmList.setTimeBucket(applicationReferenceAlarm.getLastTimeBucket()); - applicationReferenceAlarmList.setAlarmContent(applicationReferenceAlarm.getAlarmContent()); - next.execute(applicationReferenceAlarmList); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmAssertWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmAssertWorker.java deleted file mode 100644 index c6cd3993218562f5b3df49fbda03f04db30bf8e1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmAssertWorker.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance; - -import com.google.gson.Gson; -import com.google.gson.JsonObject; -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorker; -import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorkerProvider; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IInstanceAlarmRuleConfig; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceUIDAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarm; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.register.Instance; - -/** - * @author peng-yongsheng - */ -public class InstanceMetricAlarmAssertWorker extends AlarmAssertWorker { - - private final Gson gson = new Gson(); - private final IInstanceUIDAO instanceDAO; - private final IInstanceAlarmRuleConfig instanceAlarmRuleConfig; - - public InstanceMetricAlarmAssertWorker(ModuleManager moduleManager) { - super(moduleManager); - this.instanceDAO = moduleManager.find(StorageModule.NAME).getService(IInstanceUIDAO.class); - this.instanceAlarmRuleConfig = moduleManager.find(ConfigurationModule.NAME).getService(IInstanceAlarmRuleConfig.class); - } - - @Override public int id() { - return AlarmWorkerIdDefine.INSTANCE_METRIC_ALARM_ASSERT_WORKER_ID; - } - - @Override protected InstanceAlarm newAlarmObject(String id, InstanceMetric inputMetric) { - InstanceAlarm instanceAlarm = new InstanceAlarm(); - instanceAlarm.setId(id + Const.ID_SPLIT + inputMetric.getInstanceId()); - instanceAlarm.setApplicationId(inputMetric.getApplicationId()); - instanceAlarm.setInstanceId(inputMetric.getInstanceId()); - return instanceAlarm; - } - - @Override protected void generateAlarmContent(InstanceAlarm alarm, double threshold) { - Instance instance = instanceDAO.getInstance(alarm.getInstanceId()); - JsonObject osInfo = gson.fromJson(instance.getOsInfo(), JsonObject.class); - String serverName = Const.UNKNOWN; - if (osInfo != null && osInfo.has("hostName")) { - serverName = osInfo.get("hostName").getAsString(); - } - - String clientOrServer = "server"; - if (MetricSource.Caller.getValue() == alarm.getSourceValue()) { - clientOrServer = "client"; - } - - if (AlarmType.ERROR_RATE.getValue() == alarm.getAlarmType()) { - alarm.setAlarmContent("The success rate of " + serverName + ", detected from " + clientOrServer + " side, is lower than " + threshold + " rate."); - } else if (AlarmType.SLOW_RTT.getValue() == alarm.getAlarmType()) { - alarm.setAlarmContent("Response time of " + serverName + ", detected from " + clientOrServer + " side, is slower than " + threshold + " ms."); - } - } - - @Override protected Double calleeErrorRateThreshold() { - return instanceAlarmRuleConfig.calleeErrorRateThreshold(); - } - - @Override protected Double callerErrorRateThreshold() { - return instanceAlarmRuleConfig.callerErrorRateThreshold(); - } - - @Override protected Double calleeAverageResponseTimeThreshold() { - return instanceAlarmRuleConfig.calleeAverageResponseTimeThreshold(); - } - - @Override protected Double callerAverageResponseTimeThreshold() { - return instanceAlarmRuleConfig.callerAverageResponseTimeThreshold(); - } - - public static class Factory extends AlarmAssertWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceMetricAlarmAssertWorker workerInstance(ModuleManager moduleManager) { - return new InstanceMetricAlarmAssertWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmGraph.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmGraph.java deleted file mode 100644 index 5954314bb904af7c3e88e2d4848b3e74675d6148..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmGraph.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarm; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; - -/** - * @author peng-yongsheng - */ -public class InstanceMetricAlarmGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public InstanceMetricAlarmGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - Graph graph = GraphManager.INSTANCE.createIfAbsent(AlarmGraphIdDefine.INSTANCE_METRIC_ALARM_GRAPH_ID, InstanceMetric.class); - - graph.addNode(new InstanceMetricAlarmAssertWorker.Factory(moduleManager).create(workerCreateListener)) - .addNext(new InstanceMetricAlarmRemoteWorker.Factory(moduleManager, remoteSenderService, AlarmGraphIdDefine.INSTANCE_METRIC_ALARM_GRAPH_ID).create(workerCreateListener)) - .addNext(new InstanceMetricAlarmPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - graph.toFinder().findNode(AlarmWorkerIdDefine.INSTANCE_METRIC_ALARM_REMOTE_WORKER_ID, InstanceAlarm.class) - .addNext(new InstanceMetricAlarmToListNodeProcessor()) - .addNext(new InstanceMetricAlarmListPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - link(graph); - } - - private void link(Graph graph) { - GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.INSTANCE_METRIC_GRAPH_ID, InstanceMetric.class) - .toFinder().findNode(MetricWorkerIdDefine.INSTANCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID, InstanceMetric.class) - .addNext(new NodeProcessor() { - @Override public int id() { - return AlarmWorkerIdDefine.INSTANCE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID; - } - - @Override public void process(InstanceMetric instanceMetric, - Next next) { - graph.start(instanceMetric); - } - }); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmListPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmListPersistenceWorker.java deleted file mode 100644 index 921647093147ae786c5b4371b37f111976677b6b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmListPersistenceWorker.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmList; - -/** - * @author peng-yongsheng - */ -public class InstanceMetricAlarmListPersistenceWorker extends MergePersistenceWorker { - - public InstanceMetricAlarmListPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.INSTANCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IInstanceAlarmListPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceMetricAlarmListPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new InstanceMetricAlarmListPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmPersistenceWorker.java deleted file mode 100644 index b97cad8e6bf6531b6487bfe44ee3af8a4dd708c8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmPersistenceWorker.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarm; - -/** - * @author peng-yongsheng - */ -public class InstanceMetricAlarmPersistenceWorker extends MergePersistenceWorker { - - public InstanceMetricAlarmPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.INSTANCE_METRIC_ALARM_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IInstanceAlarmPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceMetricAlarmPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new InstanceMetricAlarmPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmRemoteWorker.java deleted file mode 100644 index 0edad65d658cebd06cba10dbed403b0d60971da8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmRemoteWorker.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.remote.service.Selector; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarm; - -/** - * @author peng-yongsheng - */ -public class InstanceMetricAlarmRemoteWorker extends AbstractRemoteWorker { - - public InstanceMetricAlarmRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.INSTANCE_METRIC_ALARM_REMOTE_WORKER_ID; - } - - @Override public Selector selector() { - return Selector.HashCode; - } - - @Override protected void onWork(InstanceAlarm message) throws WorkerException { - onNext(message); - } - - public static class Factory extends AbstractRemoteWorkerProvider { - - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public InstanceMetricAlarmRemoteWorker workerInstance(ModuleManager moduleManager) { - return new InstanceMetricAlarmRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmToListNodeProcessor.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmToListNodeProcessor.java deleted file mode 100644 index 463a64e7d89558d14d018be66e287085f518d7b8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmToListNodeProcessor.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmList; - -/** - * @author peng-yongsheng - */ -public class InstanceMetricAlarmToListNodeProcessor implements NodeProcessor { - - @Override public int id() { - return AlarmWorkerIdDefine.INSTANCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID; - } - - @Override public void process(InstanceAlarm instanceAlarm, Next next) { - String id = instanceAlarm.getLastTimeBucket() + Const.ID_SPLIT + instanceAlarm.getSourceValue() - + Const.ID_SPLIT + instanceAlarm.getAlarmType() - + Const.ID_SPLIT + instanceAlarm.getInstanceId(); - - InstanceAlarmList instanceAlarmList = new InstanceAlarmList(); - instanceAlarmList.setId(id); - instanceAlarmList.setApplicationId(instanceAlarm.getApplicationId()); - instanceAlarmList.setInstanceId(instanceAlarm.getInstanceId()); - instanceAlarmList.setSourceValue(instanceAlarm.getSourceValue()); - instanceAlarmList.setAlarmType(instanceAlarm.getAlarmType()); - instanceAlarmList.setTimeBucket(instanceAlarm.getLastTimeBucket()); - instanceAlarmList.setAlarmContent(instanceAlarm.getAlarmContent()); - next.execute(instanceAlarmList); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmAssertWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmAssertWorker.java deleted file mode 100644 index 9f5ffc389c7e3ed76ba9f736e0800b112c0ac735..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmAssertWorker.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance; - -import com.google.gson.Gson; -import com.google.gson.JsonObject; -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorker; -import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorkerProvider; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IInstanceReferenceAlarmRuleConfig; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceUIDAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarm; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.register.Instance; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMetricAlarmAssertWorker extends AlarmAssertWorker { - - private Gson gson = new Gson(); - private final IInstanceUIDAO instanceDAO; - private final IInstanceReferenceAlarmRuleConfig instanceReferenceAlarmRuleConfig; - - public InstanceReferenceMetricAlarmAssertWorker(ModuleManager moduleManager) { - super(moduleManager); - this.instanceDAO = moduleManager.find(StorageModule.NAME).getService(IInstanceUIDAO.class); - this.instanceReferenceAlarmRuleConfig = moduleManager.find(ConfigurationModule.NAME).getService(IInstanceReferenceAlarmRuleConfig.class); - } - - @Override public int id() { - return AlarmWorkerIdDefine.INSTANCE_REFERENCE_METRIC_ALARM_ASSERT_WORKER_ID; - } - - @Override protected InstanceReferenceAlarm newAlarmObject(String id, InstanceReferenceMetric inputMetric) { - InstanceReferenceAlarm instanceReferenceAlarm = new InstanceReferenceAlarm(); - instanceReferenceAlarm.setId(id + Const.ID_SPLIT + inputMetric.getFrontInstanceId() + Const.ID_SPLIT + inputMetric.getBehindInstanceId()); - instanceReferenceAlarm.setFrontApplicationId(inputMetric.getFrontApplicationId()); - instanceReferenceAlarm.setBehindApplicationId(inputMetric.getBehindApplicationId()); - instanceReferenceAlarm.setFrontInstanceId(inputMetric.getFrontInstanceId()); - instanceReferenceAlarm.setBehindInstanceId(inputMetric.getBehindInstanceId()); - return instanceReferenceAlarm; - } - - @Override protected void generateAlarmContent(InstanceReferenceAlarm alarm, double threshold) { - Instance instance = instanceDAO.getInstance(alarm.getBehindInstanceId()); - JsonObject osInfo = gson.fromJson(instance.getOsInfo(), JsonObject.class); - String serverName = Const.UNKNOWN; - if (osInfo != null && osInfo.has("hostName")) { - serverName = osInfo.get("hostName").getAsString(); - } - - String clientOrServer = "server"; - if (MetricSource.Caller.getValue() == alarm.getSourceValue()) { - clientOrServer = "client"; - } - - if (AlarmType.ERROR_RATE.getValue() == alarm.getAlarmType()) { - alarm.setAlarmContent("The success rate of " + serverName + ", detected from " + clientOrServer + " side, is lower than " + threshold + "."); - } else if (AlarmType.SLOW_RTT.getValue() == alarm.getAlarmType()) { - alarm.setAlarmContent("Response time of " + serverName + ", detected from " + clientOrServer + " side, is slower than " + threshold + "."); - } - } - - @Override protected Double calleeErrorRateThreshold() { - return instanceReferenceAlarmRuleConfig.calleeErrorRateThreshold(); - } - - @Override protected Double callerErrorRateThreshold() { - return instanceReferenceAlarmRuleConfig.callerErrorRateThreshold(); - } - - @Override protected Double calleeAverageResponseTimeThreshold() { - return instanceReferenceAlarmRuleConfig.calleeAverageResponseTimeThreshold(); - } - - @Override protected Double callerAverageResponseTimeThreshold() { - return instanceReferenceAlarmRuleConfig.callerAverageResponseTimeThreshold(); - } - - public static class Factory extends AlarmAssertWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceReferenceMetricAlarmAssertWorker workerInstance(ModuleManager moduleManager) { - return new InstanceReferenceMetricAlarmAssertWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmGraph.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmGraph.java deleted file mode 100644 index 7ef12e1a68f813cedb96133a2220cd5ddd14228e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmGraph.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarm; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMetricAlarmGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public InstanceReferenceMetricAlarmGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - Graph graph = GraphManager.INSTANCE.createIfAbsent(AlarmGraphIdDefine.INSTANCE_REFERENCE_METRIC_ALARM_GRAPH_ID, InstanceReferenceMetric.class); - - graph.addNode(new InstanceReferenceMetricAlarmAssertWorker.Factory(moduleManager).create(workerCreateListener)) - .addNext(new InstanceReferenceMetricAlarmRemoteWorker.Factory(moduleManager, remoteSenderService, AlarmGraphIdDefine.INSTANCE_REFERENCE_METRIC_ALARM_GRAPH_ID).create(workerCreateListener)) - .addNext(new InstanceReferenceMetricAlarmPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - graph.toFinder().findNode(AlarmWorkerIdDefine.INSTANCE_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID, InstanceReferenceAlarm.class) - .addNext(new InstanceReferenceMetricAlarmToListNodeProcessor()) - .addNext(new InstanceReferenceMetricAlarmListPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - link(graph); - } - - private void link(Graph graph) { - GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.INSTANCE_REFERENCE_METRIC_GRAPH_ID, InstanceReferenceMetric.class) - .toFinder().findNode(MetricWorkerIdDefine.INSTANCE_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID, InstanceReferenceMetric.class) - .addNext(new NodeProcessor() { - @Override public int id() { - return AlarmWorkerIdDefine.INSTANCE_REFERENCE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID; - } - - @Override public void process(InstanceReferenceMetric instanceReferenceMetric, - Next next) { - graph.start(instanceReferenceMetric); - } - }); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmListPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmListPersistenceWorker.java deleted file mode 100644 index 53f84fd5308aa6afb614e98ab444245a797e186b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmListPersistenceWorker.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceReferenceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmList; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMetricAlarmListPersistenceWorker extends MergePersistenceWorker { - - public InstanceReferenceMetricAlarmListPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.INSTANCE_REFERENCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IInstanceReferenceAlarmListPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceReferenceMetricAlarmListPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new InstanceReferenceMetricAlarmListPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmPersistenceWorker.java deleted file mode 100644 index f91b868e1e34b33e81543acaeba40832b414463d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmPersistenceWorker.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceReferenceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarm; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMetricAlarmPersistenceWorker extends MergePersistenceWorker { - - public InstanceReferenceMetricAlarmPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.INSTANCE_REFERENCE_METRIC_ALARM_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IInstanceReferenceAlarmPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceReferenceMetricAlarmPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new InstanceReferenceMetricAlarmPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmRemoteWorker.java deleted file mode 100644 index 24840ec79782945cb3651bc9684adabb60f1f11c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmRemoteWorker.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.remote.service.Selector; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarm; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMetricAlarmRemoteWorker extends AbstractRemoteWorker { - - public InstanceReferenceMetricAlarmRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.INSTANCE_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID; - } - - @Override public Selector selector() { - return Selector.HashCode; - } - - @Override protected void onWork(InstanceReferenceAlarm message) throws WorkerException { - onNext(message); - } - - public static class Factory extends AbstractRemoteWorkerProvider { - - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public InstanceReferenceMetricAlarmRemoteWorker workerInstance(ModuleManager moduleManager) { - return new InstanceReferenceMetricAlarmRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmToListNodeProcessor.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmToListNodeProcessor.java deleted file mode 100644 index 553ddebe2f4ac77ca37086e4566f772d10406241..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmToListNodeProcessor.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmList; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMetricAlarmToListNodeProcessor implements NodeProcessor { - - @Override public int id() { - return AlarmWorkerIdDefine.INSTANCE_REFERENCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID; - } - - @Override - public void process(InstanceReferenceAlarm instanceReferenceAlarm, Next next) { - String id = instanceReferenceAlarm.getLastTimeBucket() + Const.ID_SPLIT + instanceReferenceAlarm.getSourceValue() - + Const.ID_SPLIT + instanceReferenceAlarm.getAlarmType() - + Const.ID_SPLIT + instanceReferenceAlarm.getFrontInstanceId() - + Const.ID_SPLIT + instanceReferenceAlarm.getBehindInstanceId(); - - InstanceReferenceAlarmList instanceReferenceAlarmList = new InstanceReferenceAlarmList(); - instanceReferenceAlarmList.setId(id); - instanceReferenceAlarmList.setFrontApplicationId(instanceReferenceAlarm.getFrontApplicationId()); - instanceReferenceAlarmList.setBehindApplicationId(instanceReferenceAlarm.getBehindApplicationId()); - instanceReferenceAlarmList.setFrontInstanceId(instanceReferenceAlarm.getFrontInstanceId()); - instanceReferenceAlarmList.setBehindInstanceId(instanceReferenceAlarm.getBehindInstanceId()); - instanceReferenceAlarmList.setSourceValue(instanceReferenceAlarm.getSourceValue()); - instanceReferenceAlarmList.setAlarmType(instanceReferenceAlarm.getAlarmType()); - instanceReferenceAlarmList.setTimeBucket(instanceReferenceAlarm.getLastTimeBucket()); - instanceReferenceAlarmList.setAlarmContent(instanceReferenceAlarm.getAlarmContent()); - next.execute(instanceReferenceAlarmList); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmAssertWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmAssertWorker.java deleted file mode 100644 index e5680d9647c3e7f74b4ebc384b2b0c6dc87ead84..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmAssertWorker.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorker; -import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorkerProvider; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IServiceAlarmRuleConfig; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarm; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; - -/** - * @author peng-yongsheng - */ -public class ServiceMetricAlarmAssertWorker extends AlarmAssertWorker { - - private final ServiceNameCacheService serviceNameCacheService; - private final IServiceAlarmRuleConfig serviceAlarmRuleConfig; - - public ServiceMetricAlarmAssertWorker(ModuleManager moduleManager) { - super(moduleManager); - this.serviceNameCacheService = moduleManager.find(CacheModule.NAME).getService(ServiceNameCacheService.class); - this.serviceAlarmRuleConfig = moduleManager.find(ConfigurationModule.NAME).getService(IServiceAlarmRuleConfig.class); - } - - @Override public int id() { - return AlarmWorkerIdDefine.SERVICE_METRIC_ALARM_ASSERT_WORKER_ID; - } - - @Override protected ServiceAlarm newAlarmObject(String id, ServiceMetric inputMetric) { - ServiceAlarm serviceAlarm = new ServiceAlarm(); - serviceAlarm.setId(id + Const.ID_SPLIT + inputMetric.getServiceId()); - serviceAlarm.setApplicationId(inputMetric.getApplicationId()); - serviceAlarm.setInstanceId(inputMetric.getInstanceId()); - serviceAlarm.setServiceId(inputMetric.getServiceId()); - return serviceAlarm; - } - - @Override protected void generateAlarmContent(ServiceAlarm alarm, double threshold) { - ServiceName serviceName = serviceNameCacheService.get(alarm.getServiceId()); - - String clientOrServer = "server"; - if (MetricSource.Caller.getValue() == alarm.getSourceValue()) { - clientOrServer = "client"; - } - - if (AlarmType.ERROR_RATE.getValue() == alarm.getAlarmType()) { - alarm.setAlarmContent("The success rate of " + serviceName.getServiceName() + ", detected from " + clientOrServer + " side, is lower than " + threshold + " rate."); - } else if (AlarmType.SLOW_RTT.getValue() == alarm.getAlarmType()) { - alarm.setAlarmContent("Response time of " + serviceName.getServiceName() + ", detected from " + clientOrServer + " side, is slower than " + threshold + " ms."); - } - } - - @Override protected Double calleeErrorRateThreshold() { - return serviceAlarmRuleConfig.calleeErrorRateThreshold(); - } - - @Override protected Double callerErrorRateThreshold() { - return serviceAlarmRuleConfig.callerErrorRateThreshold(); - } - - @Override protected Double calleeAverageResponseTimeThreshold() { - return serviceAlarmRuleConfig.calleeAverageResponseTimeThreshold(); - } - - @Override protected Double callerAverageResponseTimeThreshold() { - return serviceAlarmRuleConfig.callerAverageResponseTimeThreshold(); - } - - public static class Factory extends AlarmAssertWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceMetricAlarmAssertWorker workerInstance(ModuleManager moduleManager) { - return new ServiceMetricAlarmAssertWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmGraph.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmGraph.java deleted file mode 100644 index 18d87ad6dcdf620476e91d068ae1a1faa0aa424b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmGraph.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarm; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; - -/** - * @author peng-yongsheng - */ -public class ServiceMetricAlarmGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public ServiceMetricAlarmGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - Graph graph = GraphManager.INSTANCE.createIfAbsent(AlarmGraphIdDefine.SERVICE_METRIC_ALARM_GRAPH_ID, ServiceMetric.class); - - graph.addNode(new ServiceMetricAlarmAssertWorker.Factory(moduleManager).create(workerCreateListener)) - .addNext(new ServiceMetricAlarmRemoteWorker.Factory(moduleManager, remoteSenderService, AlarmGraphIdDefine.SERVICE_METRIC_ALARM_GRAPH_ID).create(workerCreateListener)) - .addNext(new ServiceMetricAlarmPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - graph.toFinder().findNode(AlarmWorkerIdDefine.SERVICE_METRIC_ALARM_REMOTE_WORKER_ID, ServiceAlarm.class) - .addNext(new ServiceMetricAlarmToListNodeProcessor()) - .addNext(new ServiceMetricAlarmListPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - link(graph); - } - - private void link(Graph graph) { - GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.SERVICE_METRIC_GRAPH_ID, ServiceMetric.class) - .toFinder().findNode(MetricWorkerIdDefine.SERVICE_MINUTE_METRIC_PERSISTENCE_WORKER_ID, ServiceMetric.class) - .addNext(new NodeProcessor() { - @Override public int id() { - return AlarmWorkerIdDefine.SERVICE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID; - } - - @Override public void process(ServiceMetric serviceMetric, - Next next) { - graph.start(serviceMetric); - } - }); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmListPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmListPersistenceWorker.java deleted file mode 100644 index 4d1339678ba56012b7de58b375ff3864da4bb70a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmListPersistenceWorker.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmList; - -/** - * @author peng-yongsheng - */ -public class ServiceMetricAlarmListPersistenceWorker extends MergePersistenceWorker { - - public ServiceMetricAlarmListPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.SERVICE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IServiceAlarmListPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceMetricAlarmListPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ServiceMetricAlarmListPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmPersistenceWorker.java deleted file mode 100644 index ea83f68cce33cec4be83a4b3cb9efa8c327fc014..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmPersistenceWorker.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarm; - -/** - * @author peng-yongsheng - */ -public class ServiceMetricAlarmPersistenceWorker extends MergePersistenceWorker { - - public ServiceMetricAlarmPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.SERVICE_METRIC_ALARM_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IServiceAlarmPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceMetricAlarmPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ServiceMetricAlarmPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmRemoteWorker.java deleted file mode 100644 index 538dd7553f20832f7b666384a74f4613cd70158b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmRemoteWorker.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.remote.service.Selector; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarm; - -/** - * @author peng-yongsheng - */ -public class ServiceMetricAlarmRemoteWorker extends AbstractRemoteWorker { - - public ServiceMetricAlarmRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.SERVICE_METRIC_ALARM_REMOTE_WORKER_ID; - } - - @Override public Selector selector() { - return Selector.HashCode; - } - - @Override protected void onWork(ServiceAlarm message) throws WorkerException { - onNext(message); - } - - public static class Factory extends AbstractRemoteWorkerProvider { - - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public ServiceMetricAlarmRemoteWorker workerInstance(ModuleManager moduleManager) { - return new ServiceMetricAlarmRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmToListNodeProcessor.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmToListNodeProcessor.java deleted file mode 100644 index ab0d6a8022e3f95cf24322966cb4501c2b20d45e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmToListNodeProcessor.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmList; - -/** - * @author peng-yongsheng - */ -public class ServiceMetricAlarmToListNodeProcessor implements NodeProcessor { - - @Override public int id() { - return AlarmWorkerIdDefine.SERVICE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID; - } - - @Override public void process(ServiceAlarm serviceAlarm, Next next) { - String id = serviceAlarm.getLastTimeBucket() + Const.ID_SPLIT + serviceAlarm.getSourceValue() - + Const.ID_SPLIT + serviceAlarm.getAlarmType() - + Const.ID_SPLIT + serviceAlarm.getServiceId(); - - ServiceAlarmList serviceAlarmList = new ServiceAlarmList(); - serviceAlarmList.setId(id); - serviceAlarmList.setApplicationId(serviceAlarm.getApplicationId()); - serviceAlarmList.setInstanceId(serviceAlarm.getInstanceId()); - serviceAlarmList.setServiceId(serviceAlarm.getServiceId()); - serviceAlarmList.setSourceValue(serviceAlarm.getSourceValue()); - serviceAlarmList.setAlarmType(serviceAlarm.getAlarmType()); - serviceAlarmList.setTimeBucket(serviceAlarm.getLastTimeBucket()); - serviceAlarmList.setAlarmContent(serviceAlarm.getAlarmContent()); - next.execute(serviceAlarmList); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmAssertWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmAssertWorker.java deleted file mode 100644 index a454b6a530ffd94a5ebba67d053083c70adde390..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmAssertWorker.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorker; -import org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorkerProvider; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IServiceReferenceAlarmRuleConfig; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarm; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMetricAlarmAssertWorker extends AlarmAssertWorker { - - private final ServiceNameCacheService serviceNameCacheService; - private final IServiceReferenceAlarmRuleConfig serviceReferenceAlarmRuleConfig; - - ServiceReferenceMetricAlarmAssertWorker(ModuleManager moduleManager) { - super(moduleManager); - this.serviceNameCacheService = moduleManager.find(CacheModule.NAME).getService(ServiceNameCacheService.class); - this.serviceReferenceAlarmRuleConfig = moduleManager.find(ConfigurationModule.NAME).getService(IServiceReferenceAlarmRuleConfig.class); - } - - @Override public int id() { - return AlarmWorkerIdDefine.SERVICE_REFERENCE_METRIC_ALARM_ASSERT_WORKER_ID; - } - - @Override protected ServiceReferenceAlarm newAlarmObject(String id, ServiceReferenceMetric inputMetric) { - ServiceReferenceAlarm serviceReferenceAlarm = new ServiceReferenceAlarm(); - serviceReferenceAlarm.setId(id + Const.ID_SPLIT + inputMetric.getFrontServiceId() + Const.ID_SPLIT + inputMetric.getBehindServiceId()); - serviceReferenceAlarm.setFrontApplicationId(inputMetric.getFrontApplicationId()); - serviceReferenceAlarm.setBehindApplicationId(inputMetric.getBehindApplicationId()); - serviceReferenceAlarm.setFrontInstanceId(inputMetric.getFrontInstanceId()); - serviceReferenceAlarm.setBehindInstanceId(inputMetric.getBehindInstanceId()); - serviceReferenceAlarm.setFrontServiceId(inputMetric.getFrontServiceId()); - serviceReferenceAlarm.setBehindServiceId(inputMetric.getBehindServiceId()); - return serviceReferenceAlarm; - } - - @Override protected void generateAlarmContent(ServiceReferenceAlarm alarm, double threshold) { - ServiceName serviceName = serviceNameCacheService.get(alarm.getBehindServiceId()); - - String clientOrServer = "server"; - if (MetricSource.Caller.getValue() == alarm.getSourceValue()) { - clientOrServer = "client"; - } - - if (AlarmType.ERROR_RATE.getValue() == alarm.getAlarmType()) { - alarm.setAlarmContent("The success rate of " + serviceName.getServiceName() + ", detected from " + clientOrServer + " side, is lower than " + threshold + " rate."); - } else if (AlarmType.SLOW_RTT.getValue() == alarm.getAlarmType()) { - alarm.setAlarmContent("Response time of " + serviceName.getServiceName() + ", detected from " + clientOrServer + " side, is slower than " + threshold + " ms."); - } - } - - @Override protected Double calleeErrorRateThreshold() { - return serviceReferenceAlarmRuleConfig.calleeErrorRateThreshold(); - } - - @Override protected Double callerErrorRateThreshold() { - return serviceReferenceAlarmRuleConfig.callerErrorRateThreshold(); - } - - @Override protected Double calleeAverageResponseTimeThreshold() { - return serviceReferenceAlarmRuleConfig.calleeAverageResponseTimeThreshold(); - } - - @Override protected Double callerAverageResponseTimeThreshold() { - return serviceReferenceAlarmRuleConfig.callerAverageResponseTimeThreshold(); - } - - public static class Factory extends AlarmAssertWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceReferenceMetricAlarmAssertWorker workerInstance(ModuleManager moduleManager) { - return new ServiceReferenceMetricAlarmAssertWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmGraph.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmGraph.java deleted file mode 100644 index eda88d4309023505f1f69ca2a2a32b016782aa62..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmGraph.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarm; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMetricAlarmGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public ServiceReferenceMetricAlarmGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - Graph graph = GraphManager.INSTANCE.createIfAbsent(AlarmGraphIdDefine.SERVICE_REFERENCE_METRIC_ALARM_GRAPH_ID, ServiceReferenceMetric.class); - - graph.addNode(new ServiceReferenceMetricAlarmAssertWorker.Factory(moduleManager).create(workerCreateListener)) - .addNext(new ServiceReferenceMetricAlarmRemoteWorker.Factory(moduleManager, remoteSenderService, AlarmGraphIdDefine.SERVICE_REFERENCE_METRIC_ALARM_GRAPH_ID).create(workerCreateListener)) - .addNext(new ServiceReferenceMetricAlarmPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - graph.toFinder().findNode(AlarmWorkerIdDefine.SERVICE_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID, ServiceReferenceAlarm.class) - .addNext(new ServiceReferenceMetricAlarmToListNodeProcessor()) - .addNext(new ServiceReferenceMetricAlarmListPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - link(graph); - } - - private void link(Graph graph) { - GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.SERVICE_REFERENCE_METRIC_GRAPH_ID, ServiceReferenceMetric.class) - .toFinder().findNode(MetricWorkerIdDefine.SERVICE_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID, ServiceReferenceMetric.class) - .addNext(new NodeProcessor() { - @Override public int id() { - return AlarmWorkerIdDefine.SERVICE_REFERENCE_METRIC_ALARM_GRAPH_BRIDGE_WORKER_ID; - } - - @Override public void process(ServiceReferenceMetric serviceReferenceMetric, - Next next) { - graph.start(serviceReferenceMetric); - } - }); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmListPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmListPersistenceWorker.java deleted file mode 100644 index 0957f53bce517f7c858d9f7dd66eafc3f2c2cc76..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmListPersistenceWorker.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceReferenceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmList; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMetricAlarmListPersistenceWorker extends MergePersistenceWorker { - - public ServiceReferenceMetricAlarmListPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.SERVICE_REFERENCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IServiceReferenceAlarmListPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceReferenceMetricAlarmListPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ServiceReferenceMetricAlarmListPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmPersistenceWorker.java deleted file mode 100644 index 2273485a92277b2bc9b74c4b962934f86e3eb7c9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmPersistenceWorker.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceReferenceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarm; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMetricAlarmPersistenceWorker extends MergePersistenceWorker { - - public ServiceReferenceMetricAlarmPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.SERVICE_REFERENCE_METRIC_ALARM_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IServiceReferenceAlarmPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceReferenceMetricAlarmPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ServiceReferenceMetricAlarmPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmRemoteWorker.java deleted file mode 100644 index 7914d8b1254d0e7490b77cd751b997672c0b9502..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmRemoteWorker.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.remote.service.Selector; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarm; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMetricAlarmRemoteWorker extends AbstractRemoteWorker { - - public ServiceReferenceMetricAlarmRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return AlarmWorkerIdDefine.SERVICE_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID; - } - - @Override public Selector selector() { - return Selector.HashCode; - } - - @Override protected void onWork(ServiceReferenceAlarm message) throws WorkerException { - onNext(message); - } - - public static class Factory extends AbstractRemoteWorkerProvider { - - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public ServiceReferenceMetricAlarmRemoteWorker workerInstance(ModuleManager moduleManager) { - return new ServiceReferenceMetricAlarmRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmToListNodeProcessor.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmToListNodeProcessor.java deleted file mode 100644 index 2d1fb048a4d39c5996fbf67bf30e221ba4ea2060..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceReferenceMetricAlarmToListNodeProcessor.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service; - -import org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmList; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMetricAlarmToListNodeProcessor implements NodeProcessor { - - @Override public int id() { - return AlarmWorkerIdDefine.SERVICE_REFERENCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID; - } - - @Override public void process(ServiceReferenceAlarm serviceReferenceAlarm, Next next) { - String id = serviceReferenceAlarm.getLastTimeBucket() + Const.ID_SPLIT + serviceReferenceAlarm.getSourceValue() - + Const.ID_SPLIT + serviceReferenceAlarm.getAlarmType() - + Const.ID_SPLIT + serviceReferenceAlarm.getFrontServiceId() - + Const.ID_SPLIT + serviceReferenceAlarm.getBehindServiceId(); - - ServiceReferenceAlarmList serviceReferenceAlarmList = new ServiceReferenceAlarmList(); - serviceReferenceAlarmList.setId(id); - serviceReferenceAlarmList.setFrontApplicationId(serviceReferenceAlarm.getFrontApplicationId()); - serviceReferenceAlarmList.setBehindApplicationId(serviceReferenceAlarm.getBehindApplicationId()); - serviceReferenceAlarmList.setFrontInstanceId(serviceReferenceAlarm.getFrontInstanceId()); - serviceReferenceAlarmList.setBehindInstanceId(serviceReferenceAlarm.getBehindInstanceId()); - serviceReferenceAlarmList.setFrontServiceId(serviceReferenceAlarm.getFrontServiceId()); - serviceReferenceAlarmList.setBehindServiceId(serviceReferenceAlarm.getBehindServiceId()); - serviceReferenceAlarmList.setSourceValue(serviceReferenceAlarm.getSourceValue()); - serviceReferenceAlarmList.setAlarmType(serviceReferenceAlarm.getAlarmType()); - serviceReferenceAlarmList.setTimeBucket(serviceReferenceAlarm.getLastTimeBucket()); - serviceReferenceAlarmList.setAlarmContent(serviceReferenceAlarm.getAlarmContent()); - next.execute(serviceReferenceAlarmList); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index ec63fccad70f5092ddfdb65053ee9c03a7fe5950..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.analysis.alarm.provider.AnalysisAlarmModuleProvider \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/pom.xml b/apm-collector/apm-collector-analysis/analysis-alarm/pom.xml deleted file mode 100644 index 9f1d441975a0a324a4173dee6eab4e8188a0850c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-alarm/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - apm-collector-analysis - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - analysis-alarm - pom - - alarm-define - alarm-provider - - \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/pom.xml b/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/pom.xml deleted file mode 100644 index 10fec99edb204f0962ca96165d8d68ef308a6996..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - analysis-baseline - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - baseline-computing-define - jar - \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/src/main/java/org/apache/skywalking/apm/collector/analysis/baseline/computing/define/AnalysisBaselineComputingModule.java b/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/src/main/java/org/apache/skywalking/apm/collector/analysis/baseline/computing/define/AnalysisBaselineComputingModule.java deleted file mode 100644 index 1b824b09f68f64b74842dcc12e89b72d2833d40c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/src/main/java/org/apache/skywalking/apm/collector/analysis/baseline/computing/define/AnalysisBaselineComputingModule.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.baseline.computing.define; - -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; - -/** - * The AnalysisBaselineComputingModule defines the required service interfaces. - * - * @author wu-sheng, peng-yongsheng - */ -public class AnalysisBaselineComputingModule extends ModuleDefine { - - public static final String NAME = "analysis_baseline-computing"; - - @Override public String name() { - return NAME; - } - - @Override public Class[] services() { - return new Class[0]; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine deleted file mode 100644 index 7b6c22e79fd5ab806e582163fcd3436beb7fa38b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.analysis.baseline.computing.define.AnalysisBaselineComputingModule \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/pom.xml b/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/pom.xml deleted file mode 100644 index b0e43dcd7eb41c435b3727de28f8143974d22748..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - analysis-baseline - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - baseline-computing-provider - jar - - - - org.apache.skywalking - baseline-computing-define - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/baseline/computing/provider/AnalysisBaselineComputingModuleConfig.java b/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/baseline/computing/provider/AnalysisBaselineComputingModuleConfig.java deleted file mode 100644 index 1ed1bcdc5c30913daaa8640fd65c7468493aae58..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/baseline/computing/provider/AnalysisBaselineComputingModuleConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.baseline.computing.provider; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author peng-yongsheng - */ -class AnalysisBaselineComputingModuleConfig extends ModuleConfig { -} diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/baseline/computing/provider/AnalysisBaselineComputingModuleProvider.java b/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/baseline/computing/provider/AnalysisBaselineComputingModuleProvider.java deleted file mode 100644 index d4913573e54bc4e7b6c252b500dfbc2b2fb8b756..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/baseline/computing/provider/AnalysisBaselineComputingModuleProvider.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.baseline.computing.provider; - -import org.apache.skywalking.apm.collector.analysis.baseline.computing.define.AnalysisBaselineComputingModule; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; - -/** - * The AnalysisBaselineComputingModuleProvider is the default implementation of {@link - * AnalysisBaselineComputingModule} - * - * @author wu-sheng - */ -public class AnalysisBaselineComputingModuleProvider extends ModuleProvider { - - private static final String NAME = "default"; - private final AnalysisBaselineComputingModuleConfig config; - - public AnalysisBaselineComputingModuleProvider() { - super(); - this.config = new AnalysisBaselineComputingModuleConfig(); - } - - @Override public String name() { - return NAME; - } - - @Override public Class module() { - return AnalysisBaselineComputingModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() { - } - - @Override public void start() { - } - - @Override public void notifyAfterCompleted() { - } - - @Override public String[] requiredModules() { - return new String[0]; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index 1dcb74f56aafa77eac768341b2e36074a1eb08d2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/src/main/resources/META-INF/services/org.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.analysis.baseline.computing.provider.AnalysisBaselineComputingModuleProvider diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/pom.xml b/apm-collector/apm-collector-analysis/analysis-baseline/pom.xml deleted file mode 100644 index dbf8ec888018306a273fa6e85220242d2f535fc6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-baseline/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - apm-collector-analysis - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - analysis-baseline - pom - - baseline-computing-define - baseline-computing-provider - - \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/pom.xml b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/pom.xml deleted file mode 100644 index 4d6972f1952719f71d93cd8f9ca4e74ccfc6bba3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - analysis-jvm - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - jvm-define - \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/AnalysisJVMModule.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/AnalysisJVMModule.java deleted file mode 100644 index 677e3baf0413f87b10eaf7ad785f9b3f2b188376..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/AnalysisJVMModule.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.define; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.service.ICpuMetricService; -import org.apache.skywalking.apm.collector.analysis.jvm.define.service.IGCMetricService; -import org.apache.skywalking.apm.collector.analysis.jvm.define.service.IMemoryMetricService; -import org.apache.skywalking.apm.collector.analysis.jvm.define.service.IMemoryPoolMetricService; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; - -/** - * @author peng-yongsheng - */ -public class AnalysisJVMModule extends ModuleDefine { - - public static final String NAME = "analysis_jvm"; - - @Override public String name() { - return NAME; - } - - @Override public Class[] services() { - return new Class[] { - ICpuMetricService.class, IGCMetricService.class, - IMemoryMetricService.class, IMemoryPoolMetricService.class - }; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/graph/GraphIdDefine.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/graph/GraphIdDefine.java deleted file mode 100644 index 28f4695943792767c4a2e2b0cd1a1feb761de40f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/graph/GraphIdDefine.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.define.graph; - -/** - * @author peng-yongsheng - */ -public class GraphIdDefine { - public static final int CPU_METRIC_PERSISTENCE_GRAPH_ID = 300; - public static final int GC_METRIC_PERSISTENCE_GRAPH_ID = 301; - public static final int MEMORY_METRIC_PERSISTENCE_GRAPH_ID = 303; - public static final int MEMORY_POOL_METRIC_PERSISTENCE_GRAPH_ID = 304; -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/graph/WorkerIdDefine.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/graph/WorkerIdDefine.java deleted file mode 100644 index e6a1f3a59f4326129431a8418739f337864bb75d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/graph/WorkerIdDefine.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.define.graph; - -/** - * @author peng-yongsheng - */ -public class WorkerIdDefine { - public static final int CPU_METRIC_BRIDGE_NODE_ID = 3000; - public static final int CPU_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 3002; - public static final int CPU_HOUR_METRIC_PERSISTENCE_WORKER_ID = 3004; - public static final int CPU_HOUR_METRIC_TRANSFORM_NODE_ID = 3005; - public static final int CPU_DAY_METRIC_PERSISTENCE_WORKER_ID = 3006; - public static final int CPU_DAY_METRIC_TRANSFORM_NODE_ID = 3007; - public static final int CPU_MONTH_METRIC_PERSISTENCE_WORKER_ID = 3008; - public static final int CPU_MONTH_METRIC_TRANSFORM_NODE_ID = 3009; - - public static final int GC_METRIC_BRIDGE_NODE_ID = 3100; - public static final int GC_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 3102; - public static final int GC_HOUR_METRIC_PERSISTENCE_WORKER_ID = 3104; - public static final int GC_HOUR_METRIC_TRANSFORM_NODE_ID = 3105; - public static final int GC_DAY_METRIC_PERSISTENCE_WORKER_ID = 3106; - public static final int GC_DAY_METRIC_TRANSFORM_NODE_ID = 3107; - public static final int GC_MONTH_METRIC_PERSISTENCE_WORKER_ID = 3108; - public static final int GC_MONTH_METRIC_TRANSFORM_NODE_ID = 3109; - - public static final int MEMORY_METRIC_BRIDGE_NODE_ID = 3200; - public static final int MEMORY_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 3202; - public static final int MEMORY_HOUR_METRIC_PERSISTENCE_WORKER_ID = 3204; - public static final int MEMORY_HOUR_METRIC_TRANSFORM_NODE_ID = 3205; - public static final int MEMORY_DAY_METRIC_PERSISTENCE_WORKER_ID = 3206; - public static final int MEMORY_DAY_METRIC_TRANSFORM_NODE_ID = 3207; - public static final int MEMORY_MONTH_METRIC_PERSISTENCE_WORKER_ID = 3208; - public static final int MEMORY_MONTH_METRIC_TRANSFORM_NODE_ID = 3209; - - public static final int MEMORY_POOL_METRIC_BRIDGE_NODE_ID = 3300; - public static final int MEMORY_POOL_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 3302; - public static final int MEMORY_POOL_HOUR_METRIC_PERSISTENCE_WORKER_ID = 3304; - public static final int MEMORY_POOL_HOUR_METRIC_TRANSFORM_NODE_ID = 3305; - public static final int MEMORY_POOL_DAY_METRIC_PERSISTENCE_WORKER_ID = 3306; - public static final int MEMORY_POOL_DAY_METRIC_TRANSFORM_NODE_ID = 3307; - public static final int MEMORY_POOL_MONTH_METRIC_PERSISTENCE_WORKER_ID = 3308; - public static final int MEMORY_POOL_MONTH_METRIC_TRANSFORM_NODE_ID = 3309; -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/ICpuMetricService.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/ICpuMetricService.java deleted file mode 100644 index 45fc3885fc21ce79339ac4b87f6a74047e58df9f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/ICpuMetricService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.define.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface ICpuMetricService extends Service { - void send(int instanceId, long timeBucket, double usagePercent); -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/IGCMetricService.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/IGCMetricService.java deleted file mode 100644 index a4abf193c9af9716bc2a5833b7d2adcf46897efd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/IGCMetricService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.define.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface IGCMetricService extends Service { - void send(int instanceId, long timeBucket, int phraseValue, long count, long duration); -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/IMemoryMetricService.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/IMemoryMetricService.java deleted file mode 100644 index 522d45ec39b075b3f70b6e0bafa751df4b878204..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/IMemoryMetricService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.define.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface IMemoryMetricService extends Service { - void send(int instanceId, long timeBucket, boolean isHeap, long init, long max, long used, long committed); -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/IMemoryPoolMetricService.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/IMemoryPoolMetricService.java deleted file mode 100644 index 81215ddec465021549e2cc930055db7205484b76..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/define/service/IMemoryPoolMetricService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.define.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface IMemoryPoolMetricService extends Service { - void send(int instanceId, long timeBucket, int poolType, long init, long max, long used, long committed); -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine deleted file mode 100644 index dc562cb089ec3371a2b35a5af035ce485e9b677b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.analysis.jvm.define.AnalysisJVMModule \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/pom.xml b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/pom.xml deleted file mode 100644 index 3034c2f0d9e692f6d560df0cfaa293867fddaeec..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - analysis-jvm - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - jvm-provider - jar - - - - org.apache.skywalking - jvm-define - ${project.version} - - - org.apache.skywalking - collector-storage-define - ${project.version} - - - org.apache.skywalking - analysis-worker-model - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/AnalysisJVMModuleConfig.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/AnalysisJVMModuleConfig.java deleted file mode 100644 index 4eec76e8fb77763362e017791945d0b37300b40e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/AnalysisJVMModuleConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author peng-yongsheng - */ -class AnalysisJVMModuleConfig extends ModuleConfig { -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/AnalysisJVMModuleProvider.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/AnalysisJVMModuleProvider.java deleted file mode 100644 index 57c5b611d782331474755d12820f9d69740433b3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/AnalysisJVMModuleProvider.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.AnalysisJVMModule; -import org.apache.skywalking.apm.collector.analysis.jvm.define.service.*; -import org.apache.skywalking.apm.collector.analysis.jvm.provider.service.*; -import org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu.CpuMetricPersistenceGraph; -import org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc.GCMetricPersistenceGraph; -import org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory.MemoryMetricPersistenceGraph; -import org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool.MemoryPoolMetricPersistenceGraph; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.analysis.worker.timer.PersistenceTimer; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.storage.StorageModule; - -/** - * @author peng-yongsheng - */ -public class AnalysisJVMModuleProvider extends ModuleProvider { - - public static final String NAME = "default"; - private final AnalysisJVMModuleConfig config; - - public AnalysisJVMModuleProvider() { - super(); - this.config = new AnalysisJVMModuleConfig(); - } - - @Override public String name() { - return NAME; - } - - @Override public Class module() { - return AnalysisJVMModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() throws ServiceNotProvidedException { - this.registerServiceImplementation(ICpuMetricService.class, new CpuMetricService()); - this.registerServiceImplementation(IGCMetricService.class, new GCMetricService()); - this.registerServiceImplementation(IMemoryMetricService.class, new MemoryMetricService()); - this.registerServiceImplementation(IMemoryPoolMetricService.class, new MemoryPoolMetricService()); - } - - @Override public void start() { - WorkerCreateListener workerCreateListener = new WorkerCreateListener(); - - graphCreate(workerCreateListener); - - PersistenceTimer.INSTANCE.start(getManager(), workerCreateListener.getPersistenceWorkers()); - } - - @Override public void notifyAfterCompleted() { - } - - @Override public String[] requiredModules() { - return new String[] {StorageModule.NAME, RemoteModule.NAME}; - } - - private void graphCreate(WorkerCreateListener workerCreateListener) { - new CpuMetricPersistenceGraph(getManager(), workerCreateListener).create(); - new GCMetricPersistenceGraph(getManager(), workerCreateListener).create(); - new MemoryMetricPersistenceGraph(getManager(), workerCreateListener).create(); - new MemoryPoolMetricPersistenceGraph(getManager(), workerCreateListener).create(); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/CpuMetricService.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/CpuMetricService.java deleted file mode 100644 index 6e982ee1adc06123ad1e3d27d11a6040235ece9c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/CpuMetricService.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.service; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.jvm.define.service.ICpuMetricService; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class CpuMetricService implements ICpuMetricService { - - private final Logger logger = LoggerFactory.getLogger(CpuMetricService.class); - - private Graph cpuMetricGraph; - - private Graph getCpuMetricGraph() { - if (isNull(cpuMetricGraph)) { - cpuMetricGraph = GraphManager.INSTANCE.findGraph(GraphIdDefine.CPU_METRIC_PERSISTENCE_GRAPH_ID, CpuMetric.class); - } - return cpuMetricGraph; - } - - @Override public void send(int instanceId, long timeBucket, double usagePercent) { - String metricId = String.valueOf(instanceId); - String id = timeBucket + Const.ID_SPLIT + metricId; - - CpuMetric cpuMetric = new CpuMetric(); - cpuMetric.setId(id); - cpuMetric.setMetricId(metricId); - cpuMetric.setInstanceId(instanceId); - cpuMetric.setUsagePercent(usagePercent); - cpuMetric.setTimes(1L); - cpuMetric.setTimeBucket(timeBucket); - - logger.debug("push to cpu metric graph, id: {}", cpuMetric.getId()); - getCpuMetricGraph().start(cpuMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/GCMetricService.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/GCMetricService.java deleted file mode 100644 index 38c252f8630a9155dfb0f966af2768769addc396..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/GCMetricService.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.service; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.jvm.define.service.IGCMetricService; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class GCMetricService implements IGCMetricService { - - private static final Logger logger = LoggerFactory.getLogger(GCMetricService.class); - - private Graph gcMetricGraph; - - private Graph getGcMetricGraph() { - if (isNull(gcMetricGraph)) { - gcMetricGraph = GraphManager.INSTANCE.findGraph(GraphIdDefine.GC_METRIC_PERSISTENCE_GRAPH_ID, GCMetric.class); - } - return gcMetricGraph; - } - - @Override public void send(int instanceId, long timeBucket, int phraseValue, long count, long duration) { - String metricId = instanceId + Const.ID_SPLIT + String.valueOf(phraseValue); - String id = timeBucket + Const.ID_SPLIT + metricId; - - GCMetric gcMetric = new GCMetric(); - gcMetric.setId(id); - gcMetric.setMetricId(metricId); - gcMetric.setInstanceId(instanceId); - gcMetric.setPhrase(phraseValue); - gcMetric.setCount(count); - gcMetric.setDuration(duration); - gcMetric.setTimes(1L); - gcMetric.setTimeBucket(timeBucket); - - if (logger.isDebugEnabled()) { - logger.debug("push to gc metric graph, id: {}", gcMetric.getId()); - } - getGcMetricGraph().start(gcMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/MemoryMetricService.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/MemoryMetricService.java deleted file mode 100644 index b0a816d6febec0949e84e53b538df0f9752c0bed..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/MemoryMetricService.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.service; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.jvm.define.service.IMemoryMetricService; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.util.BooleanUtils; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class MemoryMetricService implements IMemoryMetricService { - - private final Logger logger = LoggerFactory.getLogger(MemoryMetricService.class); - - private Graph memoryMetricGraph; - - private Graph getMemoryMetricGraph() { - if (isNull(memoryMetricGraph)) { - this.memoryMetricGraph = GraphManager.INSTANCE.findGraph(GraphIdDefine.MEMORY_METRIC_PERSISTENCE_GRAPH_ID, MemoryMetric.class); - } - return memoryMetricGraph; - } - - @Override - public void send(int instanceId, long timeBucket, boolean isHeap, long init, long max, long used, long committed) { - String metricId = instanceId + Const.ID_SPLIT + BooleanUtils.booleanToValue(isHeap); - String id = timeBucket + Const.ID_SPLIT + metricId; - - MemoryMetric memoryMetric = new MemoryMetric(); - memoryMetric.setId(id); - memoryMetric.setMetricId(metricId); - memoryMetric.setInstanceId(instanceId); - memoryMetric.setIsHeap(BooleanUtils.booleanToValue(isHeap)); - memoryMetric.setInit(init); - memoryMetric.setMax(max); - memoryMetric.setUsed(used); - memoryMetric.setCommitted(committed); - memoryMetric.setTimes(1L); - memoryMetric.setTimeBucket(timeBucket); - - logger.debug("push to memory metric graph, id: {}", memoryMetric.getId()); - getMemoryMetricGraph().start(memoryMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/MemoryPoolMetricService.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/MemoryPoolMetricService.java deleted file mode 100644 index 3ecca23dff0843dc39f81f7a572488e1ba8327a5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/MemoryPoolMetricService.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.service; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.jvm.define.service.IMemoryPoolMetricService; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolMetricService implements IMemoryPoolMetricService { - - private final Logger logger = LoggerFactory.getLogger(MemoryPoolMetricService.class); - - private Graph memoryPoolMetricGraph; - - private Graph getMemoryPoolMetricGraph() { - if (isNull(memoryPoolMetricGraph)) { - this.memoryPoolMetricGraph = GraphManager.INSTANCE.findGraph(GraphIdDefine.MEMORY_POOL_METRIC_PERSISTENCE_GRAPH_ID, MemoryPoolMetric.class); - } - return memoryPoolMetricGraph; - } - - @Override - public void send(int instanceId, long timeBucket, int poolType, long init, long max, long used, long committed) { - String metricId = instanceId + Const.ID_SPLIT + String.valueOf(poolType); - String id = timeBucket + Const.ID_SPLIT + metricId; - - MemoryPoolMetric memoryPoolMetric = new MemoryPoolMetric(); - memoryPoolMetric.setId(id); - memoryPoolMetric.setMetricId(metricId); - memoryPoolMetric.setInstanceId(instanceId); - memoryPoolMetric.setPoolType(poolType); - memoryPoolMetric.setInit(init); - memoryPoolMetric.setMax(max); - memoryPoolMetric.setUsed(used); - memoryPoolMetric.setCommitted(committed); - memoryPoolMetric.setTimes(1L); - memoryPoolMetric.setTimeBucket(timeBucket); - - logger.debug("push to memory pool metric graph, id: {}", memoryPoolMetric.getId()); - getMemoryPoolMetricGraph().start(memoryPoolMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuDayMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuDayMetricPersistenceWorker.java deleted file mode 100644 index 93adefc8dc1ed6ddca7c8ad1a083acbc5e4f75bf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuDayMetricPersistenceWorker.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; - -/** - * @author peng-yongsheng - */ -public class CpuDayMetricPersistenceWorker extends MergePersistenceWorker { - - private CpuDayMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return WorkerIdDefine.CPU_DAY_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(ICpuDayMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public CpuDayMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new CpuDayMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuDayMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuDayMetricTransformNode.java deleted file mode 100644 index 8cd0286c1b9b1b9d85f5a4ec8c5612adf3b46d33..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuDayMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; - -/** - * @author peng-yongsheng - */ -public class CpuDayMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return WorkerIdDefine.CPU_DAY_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(CpuMetric cpuMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(cpuMetric.getTimeBucket()); - - CpuMetric newCpuMetric = CpuMetricCopy.copy(cpuMetric); - newCpuMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + cpuMetric.getMetricId()); - newCpuMetric.setTimeBucket(timeBucket); - next.execute(newCpuMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuHourMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuHourMetricPersistenceWorker.java deleted file mode 100644 index 5c8059de84010b8ce4320b00b734b6ec4f9b3b45..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuHourMetricPersistenceWorker.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; - -/** - * @author peng-yongsheng - */ -public class CpuHourMetricPersistenceWorker extends MergePersistenceWorker { - - private CpuHourMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return WorkerIdDefine.CPU_HOUR_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(ICpuHourMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public CpuHourMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new CpuHourMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuHourMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuHourMetricTransformNode.java deleted file mode 100644 index a6c648db52e77b9ae37be98cd24876d2b46726d8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuHourMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; - -/** - * @author peng-yongsheng - */ -public class CpuHourMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return WorkerIdDefine.CPU_HOUR_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(CpuMetric cpuMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(cpuMetric.getTimeBucket()); - - CpuMetric newCpuMetric = CpuMetricCopy.copy(cpuMetric); - newCpuMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + cpuMetric.getMetricId()); - newCpuMetric.setTimeBucket(timeBucket); - next.execute(newCpuMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricBridgeNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricBridgeNode.java deleted file mode 100644 index 745b73b6f742e280472f06efcaf297f9191359f1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricBridgeNode.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; - -/** - * @author peng-yongsheng - */ -public class CpuMetricBridgeNode implements NodeProcessor { - - @Override public int id() { - return WorkerIdDefine.CPU_METRIC_BRIDGE_NODE_ID; - } - - @Override public void process(CpuMetric metric, Next next) { - next.execute(metric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricCopy.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricCopy.java deleted file mode 100644 index 067b0734415e4401bed82ea28d3b65bd7f76c5c5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricCopy.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu; - -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; - -/** - * @author peng-yongsheng - */ -public class CpuMetricCopy { - - public static CpuMetric copy(CpuMetric cpuMetric) { - CpuMetric newCpuMetric = new CpuMetric(); - newCpuMetric.setId(cpuMetric.getId()); - newCpuMetric.setMetricId(cpuMetric.getMetricId()); - - newCpuMetric.setInstanceId(cpuMetric.getInstanceId()); - newCpuMetric.setUsagePercent(cpuMetric.getUsagePercent()); - newCpuMetric.setTimes(cpuMetric.getTimes()); - - newCpuMetric.setTimeBucket(cpuMetric.getTimeBucket()); - return newCpuMetric; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricPersistenceGraph.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricPersistenceGraph.java deleted file mode 100644 index 817be24e789c6a49e70b0e9eaf67415cc6e20bad..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricPersistenceGraph.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Node; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; - -/** - * @author peng-yongsheng - */ -public class CpuMetricPersistenceGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public CpuMetricPersistenceGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - Node bridgeNode = GraphManager.INSTANCE.createIfAbsent(GraphIdDefine.CPU_METRIC_PERSISTENCE_GRAPH_ID, CpuMetric.class) - .addNode(new CpuMetricBridgeNode()); - - bridgeNode.addNext(new CpuMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - bridgeNode.addNext(new CpuHourMetricTransformNode()) - .addNext(new CpuHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - bridgeNode.addNext(new CpuDayMetricTransformNode()) - .addNext(new CpuDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - bridgeNode.addNext(new CpuMonthMetricTransformNode()) - .addNext(new CpuMonthMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMinuteMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMinuteMetricPersistenceWorker.java deleted file mode 100644 index cb2c0cc2fde3715121ebd5339076f97edd6d3187..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMinuteMetricPersistenceWorker.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; - -/** - * @author peng-yongsheng - */ -public class CpuMinuteMetricPersistenceWorker extends MergePersistenceWorker { - - private CpuMinuteMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return WorkerIdDefine.CPU_MINUTE_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(ICpuMinuteMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public CpuMinuteMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new CpuMinuteMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMonthMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMonthMetricPersistenceWorker.java deleted file mode 100644 index 62f497cbac07dd719d7d318e88665b06aafad079..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMonthMetricPersistenceWorker.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; - -/** - * @author peng-yongsheng - */ -public class CpuMonthMetricPersistenceWorker extends MergePersistenceWorker { - - private CpuMonthMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return WorkerIdDefine.CPU_MONTH_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(ICpuMonthMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public CpuMonthMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new CpuMonthMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMonthMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMonthMetricTransformNode.java deleted file mode 100644 index c58da7e57ad16f7befd3fab2e88b5bd873957ae7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMonthMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; - -/** - * @author peng-yongsheng - */ -public class CpuMonthMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return WorkerIdDefine.CPU_MONTH_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(CpuMetric cpuMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(cpuMetric.getTimeBucket()); - - CpuMetric newCpuMetric = CpuMetricCopy.copy(cpuMetric); - newCpuMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + cpuMetric.getMetricId()); - newCpuMetric.setTimeBucket(timeBucket); - next.execute(newCpuMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCDayMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCDayMetricPersistenceWorker.java deleted file mode 100644 index be441fa32ab93a834a935d40cb4193b7a3e922e3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCDayMetricPersistenceWorker.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; - -/** - * @author peng-yongsheng - */ -public class GCDayMetricPersistenceWorker extends MergePersistenceWorker { - - private GCDayMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return WorkerIdDefine.GC_DAY_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IGCDayMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public GCDayMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new GCDayMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCDayMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCDayMetricTransformNode.java deleted file mode 100644 index d1e143498d0de8a804621c0cfb23b93bf730ce0d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCDayMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; - -/** - * @author peng-yongsheng - */ -public class GCDayMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return WorkerIdDefine.GC_DAY_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(GCMetric gcMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(gcMetric.getTimeBucket()); - - GCMetric newGCMetric = GCMetricCopy.copy(gcMetric); - newGCMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + gcMetric.getMetricId()); - newGCMetric.setTimeBucket(timeBucket); - next.execute(newGCMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCHourMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCHourMetricPersistenceWorker.java deleted file mode 100644 index 5ccfee3d04cf4a8523696e174fa7d8a80e6c8e54..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCHourMetricPersistenceWorker.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; - -/** - * @author peng-yongsheng - */ -public class GCHourMetricPersistenceWorker extends MergePersistenceWorker { - - private GCHourMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return WorkerIdDefine.GC_HOUR_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IGCHourMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public GCHourMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new GCHourMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCHourMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCHourMetricTransformNode.java deleted file mode 100644 index 08abe1900f7b13e8463bd03212ef3c890a248a3a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCHourMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; - -/** - * @author peng-yongsheng - */ -public class GCHourMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return WorkerIdDefine.GC_HOUR_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(GCMetric gcMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(gcMetric.getTimeBucket()); - - GCMetric newGCMetric = GCMetricCopy.copy(gcMetric); - newGCMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + gcMetric.getMetricId()); - newGCMetric.setTimeBucket(timeBucket); - next.execute(newGCMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMetricBridgeNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMetricBridgeNode.java deleted file mode 100644 index 97e23e77217083d6205023651aa96482ff9f0552..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMetricBridgeNode.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; - -/** - * @author peng-yongsheng - */ -public class GCMetricBridgeNode implements NodeProcessor { - - @Override public int id() { - return WorkerIdDefine.GC_METRIC_BRIDGE_NODE_ID; - } - - @Override public void process(GCMetric metric, Next next) { - next.execute(metric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMetricCopy.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMetricCopy.java deleted file mode 100644 index 9c0b534474b5708b74c89517c562f6e37a4e7033..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMetricCopy.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc; - -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; - -/** - * @author peng-yongsheng - */ -public class GCMetricCopy { - - public static GCMetric copy(GCMetric gcMetric) { - GCMetric newGCMetric = new GCMetric(); - newGCMetric.setId(gcMetric.getId()); - newGCMetric.setMetricId(gcMetric.getMetricId()); - - newGCMetric.setInstanceId(gcMetric.getInstanceId()); - newGCMetric.setPhrase(gcMetric.getPhrase()); - - newGCMetric.setCount(gcMetric.getCount()); - newGCMetric.setDuration(gcMetric.getDuration()); - newGCMetric.setTimes(gcMetric.getTimes()); - - newGCMetric.setTimeBucket(gcMetric.getTimeBucket()); - return newGCMetric; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMetricPersistenceGraph.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMetricPersistenceGraph.java deleted file mode 100644 index 507f1bbcc5ee4cef655dc9ef1086a8ae13aceb1d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMetricPersistenceGraph.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Node; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; - -/** - * @author peng-yongsheng - */ -public class GCMetricPersistenceGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public GCMetricPersistenceGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - Node bridgeNode = GraphManager.INSTANCE.createIfAbsent(GraphIdDefine.GC_METRIC_PERSISTENCE_GRAPH_ID, GCMetric.class) - .addNode(new GCMetricBridgeNode()); - - bridgeNode.addNext(new GCMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - bridgeNode.addNext(new GCHourMetricTransformNode()) - .addNext(new GCHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - bridgeNode.addNext(new GCDayMetricTransformNode()) - .addNext(new GCDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - bridgeNode.addNext(new GCMonthMetricTransformNode()) - .addNext(new GCMonthMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMinuteMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMinuteMetricPersistenceWorker.java deleted file mode 100644 index 260d610474d08944baf1819476800a42a5d65a3c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMinuteMetricPersistenceWorker.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; - -/** - * @author peng-yongsheng - */ -public class GCMinuteMetricPersistenceWorker extends MergePersistenceWorker { - - private GCMinuteMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return WorkerIdDefine.GC_MINUTE_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IGCMinuteMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public GCMinuteMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new GCMinuteMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMonthMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMonthMetricPersistenceWorker.java deleted file mode 100644 index 7887797a050e944fd8561d8039d0dba0e07dd41d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMonthMetricPersistenceWorker.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; - -/** - * @author peng-yongsheng - */ -public class GCMonthMetricPersistenceWorker extends MergePersistenceWorker { - - private GCMonthMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return WorkerIdDefine.GC_MONTH_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IGCMonthMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public GCMonthMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new GCMonthMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMonthMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMonthMetricTransformNode.java deleted file mode 100644 index 644b16c882f16087950d4faba0ba60949c659e14..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/gc/GCMonthMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.gc; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; - -/** - * @author peng-yongsheng - */ -public class GCMonthMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return WorkerIdDefine.GC_MONTH_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(GCMetric gcMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(gcMetric.getTimeBucket()); - - GCMetric newGCMetric = GCMetricCopy.copy(gcMetric); - newGCMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + gcMetric.getMetricId()); - newGCMetric.setTimeBucket(timeBucket); - next.execute(newGCMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryDayMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryDayMetricPersistenceWorker.java deleted file mode 100644 index 12031510a1a893fba7acf4f4170bc8519da377b3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryDayMetricPersistenceWorker.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryDayMetricPersistenceWorker extends MergePersistenceWorker { - - public MemoryDayMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return WorkerIdDefine.MEMORY_DAY_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IMemoryDayMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public MemoryDayMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new MemoryDayMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryDayMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryDayMetricTransformNode.java deleted file mode 100644 index 092998d0849e8fd3941f576768c9065eb1091a8d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryDayMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryDayMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return WorkerIdDefine.MEMORY_DAY_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(MemoryMetric memoryMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(memoryMetric.getTimeBucket()); - - MemoryMetric newMemoryMetric = MemoryMetricCopy.copy(memoryMetric); - newMemoryMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + memoryMetric.getMetricId()); - newMemoryMetric.setTimeBucket(timeBucket); - next.execute(newMemoryMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryHourMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryHourMetricPersistenceWorker.java deleted file mode 100644 index 3de68c7e285ccc28fd70c15f077643cb8ee5bfb1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryHourMetricPersistenceWorker.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryHourMetricPersistenceWorker extends MergePersistenceWorker { - - public MemoryHourMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return WorkerIdDefine.MEMORY_HOUR_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IMemoryHourMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public MemoryHourMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new MemoryHourMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryHourMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryHourMetricTransformNode.java deleted file mode 100644 index dbe15da56db49981fc2dc36b1e07ea8c52459816..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryHourMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryHourMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return WorkerIdDefine.MEMORY_HOUR_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(MemoryMetric memoryMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(memoryMetric.getTimeBucket()); - - MemoryMetric newMemoryMetric = MemoryMetricCopy.copy(memoryMetric); - newMemoryMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + memoryMetric.getMetricId()); - newMemoryMetric.setTimeBucket(timeBucket); - next.execute(newMemoryMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMetricBridgeNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMetricBridgeNode.java deleted file mode 100644 index 2137690f4afe7f5ec5d0ad8c86869b08b1aec865..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMetricBridgeNode.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryMetricBridgeNode implements NodeProcessor { - - @Override public int id() { - return WorkerIdDefine.MEMORY_METRIC_BRIDGE_NODE_ID; - } - - @Override public void process(MemoryMetric metric, Next next) { - next.execute(metric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMetricCopy.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMetricCopy.java deleted file mode 100644 index 55b9b134edbbcbf9f1c59a745710ef5cfe1a80d7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMetricCopy.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory; - -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryMetricCopy { - - public static MemoryMetric copy(MemoryMetric memoryMetric) { - MemoryMetric newMemoryMetric = new MemoryMetric(); - newMemoryMetric.setId(memoryMetric.getId()); - newMemoryMetric.setMetricId(memoryMetric.getMetricId()); - - newMemoryMetric.setInstanceId(memoryMetric.getInstanceId()); - newMemoryMetric.setIsHeap(memoryMetric.getIsHeap()); - - newMemoryMetric.setInit(memoryMetric.getInit()); - newMemoryMetric.setMax(memoryMetric.getMax()); - newMemoryMetric.setUsed(memoryMetric.getUsed()); - newMemoryMetric.setCommitted(memoryMetric.getCommitted()); - newMemoryMetric.setTimes(memoryMetric.getTimes()); - - newMemoryMetric.setTimeBucket(memoryMetric.getTimeBucket()); - return newMemoryMetric; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMetricPersistenceGraph.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMetricPersistenceGraph.java deleted file mode 100644 index 67263c93c296b241e2c2bb351933bb757a0fc5c1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMetricPersistenceGraph.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Node; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryMetricPersistenceGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public MemoryMetricPersistenceGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - Node bridgeNode = GraphManager.INSTANCE.createIfAbsent(GraphIdDefine.MEMORY_METRIC_PERSISTENCE_GRAPH_ID, MemoryMetric.class) - .addNode(new MemoryMetricBridgeNode()); - - bridgeNode.addNext(new MemoryMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - bridgeNode.addNext(new MemoryHourMetricTransformNode()) - .addNext(new MemoryHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - bridgeNode.addNext(new MemoryDayMetricTransformNode()) - .addNext(new MemoryDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - bridgeNode.addNext(new MemoryMonthMetricTransformNode()) - .addNext(new MemoryMonthMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMinuteMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMinuteMetricPersistenceWorker.java deleted file mode 100644 index 09c6b0a8ba1ffa463a62da073fc932f20ae1ae7f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMinuteMetricPersistenceWorker.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryMinuteMetricPersistenceWorker extends MergePersistenceWorker { - - public MemoryMinuteMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return WorkerIdDefine.MEMORY_MINUTE_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IMemoryMinuteMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public MemoryMinuteMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new MemoryMinuteMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMonthMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMonthMetricPersistenceWorker.java deleted file mode 100644 index ea74d191867c77f5c62c7995de068bc5720e4cec..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMonthMetricPersistenceWorker.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryMonthMetricPersistenceWorker extends MergePersistenceWorker { - - public MemoryMonthMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return WorkerIdDefine.MEMORY_MONTH_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IMemoryMonthMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public MemoryMonthMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new MemoryMonthMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMonthMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMonthMetricTransformNode.java deleted file mode 100644 index f13a165f962e805e1c3fe6c922bed173915cfb08..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memory/MemoryMonthMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memory; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryMonthMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return WorkerIdDefine.MEMORY_MONTH_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(MemoryMetric memoryMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(memoryMetric.getTimeBucket()); - - MemoryMetric newMemoryMetric = MemoryMetricCopy.copy(memoryMetric); - newMemoryMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + memoryMetric.getMetricId()); - newMemoryMetric.setTimeBucket(timeBucket); - next.execute(newMemoryMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolDayMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolDayMetricPersistenceWorker.java deleted file mode 100644 index 3b0b8a6060d86c902ec857b51088afe178232a3c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolDayMetricPersistenceWorker.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolDayMetricPersistenceWorker extends MergePersistenceWorker { - - @Override public int id() { - return WorkerIdDefine.MEMORY_POOL_DAY_METRIC_PERSISTENCE_WORKER_ID; - } - - public MemoryPoolDayMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IMemoryPoolDayMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public MemoryPoolDayMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new MemoryPoolDayMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolDayMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolDayMetricTransformNode.java deleted file mode 100644 index a303dedd290155970e186a1f6f5ac0753a60ea7b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolDayMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolDayMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return WorkerIdDefine.MEMORY_POOL_DAY_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(MemoryPoolMetric memoryPoolMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(memoryPoolMetric.getTimeBucket()); - - MemoryPoolMetric newMemoryPoolMetric = MemoryPoolMetricCopy.copy(memoryPoolMetric); - newMemoryPoolMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + memoryPoolMetric.getMetricId()); - newMemoryPoolMetric.setTimeBucket(timeBucket); - next.execute(newMemoryPoolMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolHourMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolHourMetricPersistenceWorker.java deleted file mode 100644 index 7ef3cb50b981d8ae471e7bd4fb1187e5c5c5793a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolHourMetricPersistenceWorker.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolHourMetricPersistenceWorker extends MergePersistenceWorker { - - @Override public int id() { - return WorkerIdDefine.MEMORY_POOL_HOUR_METRIC_PERSISTENCE_WORKER_ID; - } - - public MemoryPoolHourMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IMemoryPoolHourMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public MemoryPoolHourMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new MemoryPoolHourMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolHourMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolHourMetricTransformNode.java deleted file mode 100644 index 7ac28df1a777956fff9c01b0f091b6a28db923e3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolHourMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolHourMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return WorkerIdDefine.MEMORY_POOL_HOUR_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(MemoryPoolMetric memoryPoolMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(memoryPoolMetric.getTimeBucket()); - - MemoryPoolMetric newMemoryPoolMetric = MemoryPoolMetricCopy.copy(memoryPoolMetric); - newMemoryPoolMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + memoryPoolMetric.getMetricId()); - newMemoryPoolMetric.setTimeBucket(timeBucket); - next.execute(newMemoryPoolMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMetricBridgeNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMetricBridgeNode.java deleted file mode 100644 index 3220ea87665c94b039ab1b1e6785ad450ede99a4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMetricBridgeNode.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolMetricBridgeNode implements NodeProcessor { - - @Override public int id() { - return WorkerIdDefine.MEMORY_POOL_METRIC_BRIDGE_NODE_ID; - } - - @Override public void process(MemoryPoolMetric metric, Next next) { - next.execute(metric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMetricCopy.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMetricCopy.java deleted file mode 100644 index 4b805f52f1ecbf72190304d9b8d40da9eecf2d15..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMetricCopy.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool; - -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolMetricCopy { - - public static MemoryPoolMetric copy(MemoryPoolMetric memoryPoolMetric) { - MemoryPoolMetric newMemoryPoolMetric = new MemoryPoolMetric(); - newMemoryPoolMetric.setId(memoryPoolMetric.getId()); - newMemoryPoolMetric.setMetricId(memoryPoolMetric.getMetricId()); - - newMemoryPoolMetric.setInstanceId(memoryPoolMetric.getInstanceId()); - - newMemoryPoolMetric.setInit(memoryPoolMetric.getInit()); - newMemoryPoolMetric.setMax(memoryPoolMetric.getMax()); - newMemoryPoolMetric.setUsed(memoryPoolMetric.getUsed()); - newMemoryPoolMetric.setCommitted(memoryPoolMetric.getCommitted()); - newMemoryPoolMetric.setPoolType(memoryPoolMetric.getPoolType()); - newMemoryPoolMetric.setTimes(memoryPoolMetric.getTimes()); - - newMemoryPoolMetric.setTimeBucket(memoryPoolMetric.getTimeBucket()); - return newMemoryPoolMetric; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMetricPersistenceGraph.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMetricPersistenceGraph.java deleted file mode 100644 index 199e1d725019521768b961ba1d04b34a7eda6c2b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMetricPersistenceGraph.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Node; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolMetricPersistenceGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public MemoryPoolMetricPersistenceGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - Node bridgeNode = GraphManager.INSTANCE.createIfAbsent(GraphIdDefine.MEMORY_POOL_METRIC_PERSISTENCE_GRAPH_ID, MemoryPoolMetric.class) - .addNode(new MemoryPoolMetricBridgeNode()); - - bridgeNode.addNext(new MemoryPoolMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - bridgeNode.addNext(new MemoryPoolHourMetricTransformNode()) - .addNext(new MemoryPoolHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - bridgeNode.addNext(new MemoryPoolDayMetricTransformNode()) - .addNext(new MemoryPoolDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - bridgeNode.addNext(new MemoryPoolMonthMetricTransformNode()) - .addNext(new MemoryPoolMonthMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMinuteMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMinuteMetricPersistenceWorker.java deleted file mode 100644 index d2fab7f4c9710b09aceb82319458815d7f6ac544..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMinuteMetricPersistenceWorker.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolMinuteMetricPersistenceWorker extends MergePersistenceWorker { - - @Override public int id() { - return WorkerIdDefine.MEMORY_POOL_MINUTE_METRIC_PERSISTENCE_WORKER_ID; - } - - public MemoryPoolMinuteMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IMemoryPoolMinuteMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public MemoryPoolMinuteMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new MemoryPoolMinuteMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMonthMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMonthMetricPersistenceWorker.java deleted file mode 100644 index a0e5ba6210b687eabc23b757fb46d677d0b8cd84..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMonthMetricPersistenceWorker.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolMonthMetricPersistenceWorker extends MergePersistenceWorker { - - @Override public int id() { - return WorkerIdDefine.MEMORY_POOL_MONTH_METRIC_PERSISTENCE_WORKER_ID; - } - - public MemoryPoolMonthMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IMemoryPoolMonthMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public MemoryPoolMonthMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new MemoryPoolMonthMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMonthMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMonthMetricTransformNode.java deleted file mode 100644 index 6630a4088ddff136adb8dbe7c1100ff598005983..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/memorypool/MemoryPoolMonthMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.memorypool; - -import org.apache.skywalking.apm.collector.analysis.jvm.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolMonthMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return WorkerIdDefine.MEMORY_POOL_MONTH_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(MemoryPoolMetric memoryPoolMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(memoryPoolMetric.getTimeBucket()); - - MemoryPoolMetric newMemoryPoolMetric = MemoryPoolMetricCopy.copy(memoryPoolMetric); - newMemoryPoolMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + memoryPoolMetric.getMetricId()); - newMemoryPoolMetric.setTimeBucket(timeBucket); - next.execute(newMemoryPoolMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index 3f6d9af35061bdd6787cab54b54654e2f7107864..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.analysis.jvm.provider.AnalysisJVMModuleProvider \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/pom.xml b/apm-collector/apm-collector-analysis/analysis-jvm/pom.xml deleted file mode 100644 index a7c4fe4cb640023b1acbad2bc1fcae24ee41f34d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-jvm/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - apm-collector-analysis - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - analysis-jvm - pom - - jvm-define - jvm-provider - - \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/pom.xml b/apm-collector/apm-collector-analysis/analysis-metric/metric-define/pom.xml deleted file mode 100644 index f05dc34dd93c5b2dad51df68f6cb85eb57fe2646..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - analysis-metric - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - metric-define - jar - \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/AnalysisMetricModule.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/AnalysisMetricModule.java deleted file mode 100644 index 21c47af644a917343ac39ccfaf1c591dd50a0024..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/AnalysisMetricModule.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.define; - -import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; - -/** - * @author peng-yongsheng - */ -public class AnalysisMetricModule extends ModuleDefine { - - public static final String NAME = "analysis_metric"; - - @Override public String name() { - return NAME; - } - - @Override public Class[] services() { - return new Class[] {IInstanceHeartBeatService.class}; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/graph/MetricGraphIdDefine.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/graph/MetricGraphIdDefine.java deleted file mode 100644 index 4f97d316a7d575aa3b69b6e36e84f5efcda25ed2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/graph/MetricGraphIdDefine.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.define.graph; - -/** - * @author peng-yongsheng - */ -public class MetricGraphIdDefine { - public static final int SERVICE_REFERENCE_METRIC_GRAPH_ID = 400; - public static final int INSTANCE_REFERENCE_METRIC_GRAPH_ID = 401; - public static final int APPLICATION_REFERENCE_METRIC_GRAPH_ID = 402; - - public static final int SERVICE_METRIC_GRAPH_ID = 403; - public static final int INSTANCE_METRIC_GRAPH_ID = 404; - public static final int APPLICATION_METRIC_GRAPH_ID = 405; - - public static final int APPLICATION_COMPONENT_GRAPH_ID = 406; - public static final int APPLICATION_MAPPING_GRAPH_ID = 407; - public static final int RESPONSE_TIME_DISTRIBUTION_GRAPH_ID = 408; - public static final int GLOBAL_TRACE_GRAPH_ID = 409; - public static final int SEGMENT_DURATION_GRAPH_ID = 410; - public static final int INSTANCE_MAPPING_GRAPH_ID = 411; - - public static final int INSTANCE_HEART_BEAT_PERSISTENCE_GRAPH_ID = 412; - public static final int SERVICE_HEART_BEAT_PERSISTENCE_GRAPH_ID = 413; -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/graph/MetricWorkerIdDefine.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/graph/MetricWorkerIdDefine.java deleted file mode 100644 index 581c9a9479460f1a3fe490ae251ef139d1a9fa6b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/graph/MetricWorkerIdDefine.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.define.graph; - -/** - * @author peng-yongsheng - */ -public class MetricWorkerIdDefine { - public static final int SERVICE_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4010; - public static final int SERVICE_REFERENCE_MINUTE_METRIC_REMOTE_WORKER_ID = 4011; - public static final int SERVICE_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 4012; - public static final int SERVICE_REFERENCE_HOUR_METRIC_PERSISTENCE_WORKER_ID = 4013; - public static final int SERVICE_REFERENCE_HOUR_METRIC_TRANSFORM_NODE_ID = 4014; - public static final int SERVICE_REFERENCE_DAY_METRIC_PERSISTENCE_WORKER_ID = 4015; - public static final int SERVICE_REFERENCE_DAY_METRIC_TRANSFORM_NODE_ID = 4016; - public static final int SERVICE_REFERENCE_MONTH_METRIC_PERSISTENCE_WORKER_ID = 4017; - public static final int SERVICE_REFERENCE_MONTH_METRIC_TRANSFORM_NODE_ID = 4018; - - public static final int INSTANCE_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4020; - public static final int INSTANCE_REFERENCE_MINUTE_METRIC_REMOTE_WORKER_ID = 4021; - public static final int INSTANCE_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 4022; - public static final int INSTANCE_REFERENCE_HOUR_METRIC_PERSISTENCE_WORKER_ID = 4023; - public static final int INSTANCE_REFERENCE_HOUR_METRIC_TRANSFORM_NODE_ID = 4024; - public static final int INSTANCE_REFERENCE_DAY_METRIC_PERSISTENCE_WORKER_ID = 4025; - public static final int INSTANCE_REFERENCE_DAY_METRIC_TRANSFORM_NODE_ID = 4026; - public static final int INSTANCE_REFERENCE_MONTH_METRIC_PERSISTENCE_WORKER_ID = 4027; - public static final int INSTANCE_REFERENCE_MONTH_METRIC_TRANSFORM_NODE_ID = 4028; - - public static final int APPLICATION_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4030; - public static final int APPLICATION_REFERENCE_MINUTE_METRIC_REMOTE_WORKER_ID = 4031; - public static final int APPLICATION_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 4032; - public static final int APPLICATION_REFERENCE_HOUR_METRIC_PERSISTENCE_WORKER_ID = 4033; - public static final int APPLICATION_REFERENCE_HOUR_METRIC_TRANSFORM_NODE_ID = 4034; - public static final int APPLICATION_REFERENCE_DAY_METRIC_PERSISTENCE_WORKER_ID = 4035; - public static final int APPLICATION_REFERENCE_DAY_METRIC_TRANSFORM_NODE_ID = 4036; - public static final int APPLICATION_REFERENCE_MONTH_METRIC_PERSISTENCE_WORKER_ID = 4037; - public static final int APPLICATION_REFERENCE_MONTH_METRIC_TRANSFORM_NODE_ID = 4038; - - public static final int SERVICE_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4040; - public static final int SERVICE_MINUTE_METRIC_REMOTE_WORKER_ID = 4041; - public static final int SERVICE_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 4042; - public static final int SERVICE_HOUR_METRIC_PERSISTENCE_WORKER_ID = 4043; - public static final int SERVICE_HOUR_METRIC_TRANSFORM_NODE_ID = 4044; - public static final int SERVICE_DAY_METRIC_PERSISTENCE_WORKER_ID = 4045; - public static final int SERVICE_DAY_METRIC_TRANSFORM_NODE_ID = 4046; - public static final int SERVICE_MONTH_METRIC_PERSISTENCE_WORKER_ID = 4047; - public static final int SERVICE_MONTH_METRIC_TRANSFORM_NODE_ID = 4048; - - public static final int INSTANCE_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4050; - public static final int INSTANCE_MINUTE_METRIC_REMOTE_WORKER_ID = 4051; - public static final int INSTANCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 4052; - public static final int INSTANCE_HOUR_METRIC_PERSISTENCE_WORKER_ID = 4053; - public static final int INSTANCE_HOUR_METRIC_TRANSFORM_NODE_ID = 4054; - public static final int INSTANCE_DAY_METRIC_PERSISTENCE_WORKER_ID = 4055; - public static final int INSTANCE_DAY_METRIC_TRANSFORM_NODE_ID = 4056; - public static final int INSTANCE_MONTH_METRIC_PERSISTENCE_WORKER_ID = 4057; - public static final int INSTANCE_MONTH_METRIC_TRANSFORM_NODE_ID = 4058; - - public static final int APPLICATION_MINUTE_METRIC_AGGREGATION_WORKER_ID = 4060; - public static final int APPLICATION_MINUTE_METRIC_REMOTE_WORKER_ID = 4061; - public static final int APPLICATION_MINUTE_METRIC_PERSISTENCE_WORKER_ID = 4062; - public static final int APPLICATION_HOUR_METRIC_PERSISTENCE_WORKER_ID = 4063; - public static final int APPLICATION_HOUR_METRIC_TRANSFORM_NODE_ID = 4064; - public static final int APPLICATION_DAY_METRIC_PERSISTENCE_WORKER_ID = 4065; - public static final int APPLICATION_DAY_METRIC_TRANSFORM_NODE_ID = 4066; - public static final int APPLICATION_MONTH_METRIC_PERSISTENCE_WORKER_ID = 4067; - public static final int APPLICATION_MONTH_METRIC_TRANSFORM_NODE_ID = 4068; - - public static final int INSTANCE_MAPPING_MINUTE_AGGREGATION_WORKER_ID = 4070; - public static final int INSTANCE_MAPPING_MINUTE_REMOTE_WORKER_ID = 4071; - public static final int INSTANCE_MAPPING_MINUTE_PERSISTENCE_WORKER_ID = 4072; - public static final int INSTANCE_MAPPING_HOUR_PERSISTENCE_WORKER_ID = 4073; - public static final int INSTANCE_MAPPING_HOUR_TRANSFORM_NODE_ID = 4074; - public static final int INSTANCE_MAPPING_DAY_PERSISTENCE_WORKER_ID = 4075; - public static final int INSTANCE_MAPPING_DAY_TRANSFORM_NODE_ID = 4076; - public static final int INSTANCE_MAPPING_MONTH_PERSISTENCE_WORKER_ID = 4077; - public static final int INSTANCE_MAPPING_MONTH_TRANSFORM_NODE_ID = 4078; - - public static final int APPLICATION_MAPPING_MINUTE_AGGREGATION_WORKER_ID = 4080; - public static final int APPLICATION_MAPPING_MINUTE_REMOTE_WORKER_ID = 4081; - public static final int APPLICATION_MAPPING_MINUTE_PERSISTENCE_WORKER_ID = 4082; - public static final int APPLICATION_MAPPING_HOUR_PERSISTENCE_WORKER_ID = 4083; - public static final int APPLICATION_MAPPING_HOUR_TRANSFORM_NODE_ID = 4084; - public static final int APPLICATION_MAPPING_DAY_PERSISTENCE_WORKER_ID = 4085; - public static final int APPLICATION_MAPPING_DAY_TRANSFORM_NODE_ID = 4086; - public static final int APPLICATION_MAPPING_MONTH_PERSISTENCE_WORKER_ID = 4087; - public static final int APPLICATION_MAPPING_MONTH_TRANSFORM_NODE_ID = 4088; - - public static final int APPLICATION_COMPONENT_MINUTE_AGGREGATION_WORKER_ID = 4090; - public static final int APPLICATION_COMPONENT_MINUTE_REMOTE_WORKER_ID = 4091; - public static final int APPLICATION_COMPONENT_MINUTE_PERSISTENCE_WORKER_ID = 4092; - public static final int APPLICATION_COMPONENT_HOUR_PERSISTENCE_WORKER_ID = 4093; - public static final int APPLICATION_COMPONENT_HOUR_TRANSFORM_NODE_ID = 4094; - public static final int APPLICATION_COMPONENT_DAY_PERSISTENCE_WORKER_ID = 4095; - public static final int APPLICATION_COMPONENT_DAY_TRANSFORM_NODE_ID = 4096; - public static final int APPLICATION_COMPONENT_MONTH_PERSISTENCE_WORKER_ID = 4097; - public static final int APPLICATION_COMPONENT_MONTH_TRANSFORM_NODE_ID = 4098; - - public static final int RESPONSE_TIME_DISTRIBUTION_MINUTE_AGGREGATION_WORKER_ID = 4100; - public static final int RESPONSE_TIME_DISTRIBUTION_MINUTE_REMOTE_WORKER_ID = 4101; - public static final int RESPONSE_TIME_DISTRIBUTION_MINUTE_PERSISTENCE_WORKER_ID = 4102; - public static final int RESPONSE_TIME_DISTRIBUTION_HOUR_PERSISTENCE_WORKER_ID = 4103; - public static final int RESPONSE_TIME_DISTRIBUTION_HOUR_TRANSFORM_NODE_ID = 4104; - public static final int RESPONSE_TIME_DISTRIBUTION_DAY_PERSISTENCE_WORKER_ID = 4105; - public static final int RESPONSE_TIME_DISTRIBUTION_DAY_TRANSFORM_NODE_ID = 4106; - public static final int RESPONSE_TIME_DISTRIBUTION_MONTH_PERSISTENCE_WORKER_ID = 4107; - public static final int RESPONSE_TIME_DISTRIBUTION_MONTH_TRANSFORM_NODE_ID = 4108; - - public static final int GLOBAL_TRACE_PERSISTENCE_WORKER_ID = 4110; - public static final int SEGMENT_DURATION_PERSISTENCE_WORKER_ID = 4120; - - public static final int INSTANCE_REFERENCE_GRAPH_BRIDGE_WORKER_ID = 4130; - public static final int APPLICATION_REFERENCE_GRAPH_BRIDGE_WORKER_ID = 4140; - public static final int SERVICE_METRIC_GRAPH_BRIDGE_WORKER_ID = 4150; - public static final int INSTANCE_METRIC_GRAPH_BRIDGE_WORKER_ID = 4160; - public static final int APPLICATION_METRIC_GRAPH_BRIDGE_WORKER_ID = 4170; - - public static final int INST_HEART_BEAT_PERSISTENCE_WORKER_ID = 4180; - - public static final int SERVICE_NAME_HEART_BEAT_AGGREGATION_WORKER_ID = 4190; - public static final int SERVICE_NAME_HEART_BEAT_REMOTE_WORKER_ID = 4191; - public static final int SERVICE_NAME_HEART_BEAT_PERSISTENCE_WORKER_ID = 4192; -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/service/IInstanceHeartBeatService.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/service/IInstanceHeartBeatService.java deleted file mode 100644 index bcce416ea846341da17a9c6bbd07b10ea12c7c7a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/define/service/IInstanceHeartBeatService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.define.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface IInstanceHeartBeatService extends Service { - void heartBeat(int instanceId, long heartBeatTime); -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine deleted file mode 100644 index 28fa6613649eb118e961ed89c724213756d46c12..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.analysis.metric.define.AnalysisMetricModule \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/pom.xml b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/pom.xml deleted file mode 100644 index 7eafa1f20c564fe72889157bfef4b3240860f91f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - analysis-metric - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - metric-provider - jar - - - - org.apache.skywalking - metric-define - ${project.version} - - - org.apache.skywalking - segment-parser-define - ${project.version} - - - org.apache.skywalking - collector-configuration-define - ${project.version} - - - org.apache.skywalking - collector-cache-define - ${project.version} - - - org.apache.skywalking - collector-storage-define - ${project.version} - - - org.apache.skywalking - analysis-worker-model - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/AnalysisMetricModuleConfig.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/AnalysisMetricModuleConfig.java deleted file mode 100644 index 2030486bae1bc360df20a4688379ea1107412945..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/AnalysisMetricModuleConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author peng-yongsheng - */ -class AnalysisMetricModuleConfig extends ModuleConfig { -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/AnalysisMetricModuleProvider.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/AnalysisMetricModuleProvider.java deleted file mode 100644 index 35db2d9e36beb193ea748268573981959cb24028..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/AnalysisMetricModuleProvider.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider; - -import org.apache.skywalking.apm.collector.analysis.metric.define.AnalysisMetricModule; -import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService; -import org.apache.skywalking.apm.collector.analysis.metric.provider.service.InstanceHeartBeatService; -import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component.*; -import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping.*; -import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.metric.ApplicationMetricGraph; -import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.refmetric.ApplicationReferenceMetricGraph; -import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global.*; -import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global.std.*; -import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.heartbeat.InstanceHeartBeatPersistenceGraph; -import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.mapping.*; -import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.metric.InstanceMetricGraph; -import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.refmetric.InstanceReferenceMetricGraph; -import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.segment.*; -import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.heartbeat.*; -import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.metric.ServiceMetricGraph; -import org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.refmetric.*; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.AnalysisSegmentParserModule; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.service.ISegmentParserListenerRegister; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.analysis.worker.timer.PersistenceTimer; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.table.application.*; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.instance.*; -import org.apache.skywalking.apm.collector.storage.table.service.*; - -/** - * @author peng-yongsheng - */ -public class AnalysisMetricModuleProvider extends ModuleProvider { - - public static final String NAME = "default"; - private final AnalysisMetricModuleConfig config; - - public AnalysisMetricModuleProvider() { - super(); - this.config = new AnalysisMetricModuleConfig(); - } - - @Override public String name() { - return NAME; - } - - @Override public Class module() { - return AnalysisMetricModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() throws ServiceNotProvidedException { - this.registerServiceImplementation(IInstanceHeartBeatService.class, new InstanceHeartBeatService()); - } - - @Override public void start() { - segmentParserListenerRegister(); - - WorkerCreateListener workerCreateListener = new WorkerCreateListener(); - - graphCreate(workerCreateListener); - - registerRemoteData(); - - PersistenceTimer.INSTANCE.start(getManager(), workerCreateListener.getPersistenceWorkers()); - } - - @Override public void notifyAfterCompleted() { - } - - @Override public String[] requiredModules() { - return new String[] {AnalysisSegmentParserModule.NAME, ConfigurationModule.NAME, CacheModule.NAME, StorageModule.NAME}; - } - - private void segmentParserListenerRegister() { - ISegmentParserListenerRegister segmentParserListenerRegister = getManager().find(AnalysisSegmentParserModule.NAME).getService(ISegmentParserListenerRegister.class); - segmentParserListenerRegister.register(new ServiceReferenceMetricSpanListener.Factory()); - segmentParserListenerRegister.register(new ApplicationComponentSpanListener.Factory()); - segmentParserListenerRegister.register(new ApplicationMappingSpanListener.Factory()); - segmentParserListenerRegister.register(new InstanceMappingSpanListener.Factory()); - segmentParserListenerRegister.register(new GlobalTraceSpanListener.Factory()); - segmentParserListenerRegister.register(new SegmentDurationSpanListener.Factory()); - segmentParserListenerRegister.register(new ResponseTimeDistributionSpanListener.Factory()); - segmentParserListenerRegister.register(new ServiceNameSpanListener.Factory()); - } - - private void graphCreate(WorkerCreateListener workerCreateListener) { - new ServiceReferenceMetricGraph(getManager(), workerCreateListener).create(); - new ServiceMetricGraph(getManager(), workerCreateListener).create(); - new ServiceNameHeartBeatGraph(getManager(), workerCreateListener).create(); - - new InstanceHeartBeatPersistenceGraph(getManager(), workerCreateListener).create(); - new InstanceMappingGraph(getManager(), workerCreateListener).create(); - new InstanceReferenceMetricGraph(getManager(), workerCreateListener).create(); - new InstanceMetricGraph(getManager(), workerCreateListener).create(); - - new ApplicationComponentGraph(getManager(), workerCreateListener).create(); - new ApplicationMappingGraph(getManager(), workerCreateListener).create(); - new ApplicationReferenceMetricGraph(getManager(), workerCreateListener).create(); - new ApplicationMetricGraph(getManager(), workerCreateListener).create(); - - new GlobalTraceGraph(getManager(), workerCreateListener).create(); - new ResponseTimeDistributionGraph(getManager(), workerCreateListener).create(); - new SegmentDurationGraph(getManager(), workerCreateListener).create(); - } - - private void registerRemoteData() { - RemoteDataRegisterService remoteDataRegisterService = getManager().find(RemoteModule.NAME).getService(RemoteDataRegisterService.class); - remoteDataRegisterService.register(ApplicationComponent.class, new ApplicationComponent.InstanceCreator()); - remoteDataRegisterService.register(ApplicationMapping.class, new ApplicationMapping.InstanceCreator()); - remoteDataRegisterService.register(ApplicationMetric.class, new ApplicationMetric.InstanceCreator()); - remoteDataRegisterService.register(ApplicationReferenceMetric.class, new ApplicationReferenceMetric.InstanceCreator()); - remoteDataRegisterService.register(InstanceMapping.class, new InstanceMapping.InstanceCreator()); - remoteDataRegisterService.register(InstanceMetric.class, new InstanceMetric.InstanceCreator()); - remoteDataRegisterService.register(InstanceReferenceMetric.class, new InstanceReferenceMetric.InstanceCreator()); - remoteDataRegisterService.register(ServiceMetric.class, new ServiceMetric.InstanceCreator()); - remoteDataRegisterService.register(ServiceReferenceMetric.class, new ServiceReferenceMetric.InstanceCreator()); - remoteDataRegisterService.register(ResponseTimeDistribution.class, new ResponseTimeDistribution.InstanceCreator()); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/service/InstanceHeartBeatService.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/service/InstanceHeartBeatService.java deleted file mode 100644 index 1409f02377865fe2c186886ad5763a87ff150c87..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/service/InstanceHeartBeatService.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.service; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.register.Instance; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class InstanceHeartBeatService implements IInstanceHeartBeatService { - - private static final Logger logger = LoggerFactory.getLogger(InstanceHeartBeatService.class); - - private Graph heartBeatGraph; - - private Graph getHeartBeatGraph() { - if (isNull(heartBeatGraph)) { - this.heartBeatGraph = GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.INSTANCE_HEART_BEAT_PERSISTENCE_GRAPH_ID, Instance.class); - } - return heartBeatGraph; - } - - @Override public void heartBeat(int instanceId, long heartBeatTime) { - Instance instance = new Instance(); - instance.setId(String.valueOf(instanceId)); - instance.setHeartBeatTime(TimeBucketUtils.INSTANCE.getSecondTimeBucket(heartBeatTime)); - instance.setInstanceId(instanceId); - - if (logger.isDebugEnabled()) { - logger.debug("push to instance heart beat persistence worker, id: {}", instance.getId()); - } - getHeartBeatGraph().start(instance); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentCopy.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentCopy.java deleted file mode 100644 index 510ac814e5d6c5d4fe39516c631a23816176ef0c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentCopy.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component; - -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentCopy { - - public static ApplicationComponent copy(ApplicationComponent applicationComponent) { - ApplicationComponent newApplicationComponent = new ApplicationComponent(); - newApplicationComponent.setId(applicationComponent.getId()); - newApplicationComponent.setMetricId(applicationComponent.getMetricId()); - - newApplicationComponent.setComponentId(applicationComponent.getComponentId()); - newApplicationComponent.setApplicationId(applicationComponent.getApplicationId()); - newApplicationComponent.setTimeBucket(newApplicationComponent.getTimeBucket()); - return newApplicationComponent; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentDayPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentDayPersistenceWorker.java deleted file mode 100644 index 0311eff6b375fc32bdc2194a5d49099b20894caa..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentDayPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentDayPersistenceWorker extends MergePersistenceWorker { - - private ApplicationComponentDayPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_COMPONENT_DAY_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationComponentDayPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationComponentDayPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationComponentDayPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationComponentTable.TABLE + "/day") - @Override protected void onWork(ApplicationComponent input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentDayTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentDayTransformNode.java deleted file mode 100644 index ff72a0f1f64d02aa779644e5b3d15cacc06731bb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentDayTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentDayTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_COMPONENT_DAY_TRANSFORM_NODE_ID; - } - - @Override - public void process(ApplicationComponent applicationComponent, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(applicationComponent.getTimeBucket()); - - ApplicationComponent newApplicationComponent = ApplicationComponentCopy.copy(applicationComponent); - newApplicationComponent.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationComponent.getMetricId()); - newApplicationComponent.setTimeBucket(timeBucket); - next.execute(newApplicationComponent); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentGraph.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentGraph.java deleted file mode 100644 index 07370b779e983c38d409c3ccfb8d87f343bddbb3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentGraph.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Node; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public ApplicationComponentGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - Node remoteNode = GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.APPLICATION_COMPONENT_GRAPH_ID, ApplicationComponent.class) - .addNode(new ApplicationComponentMinuteAggregationWorker.Factory(moduleManager).create(workerCreateListener)) - .addNext(new ApplicationComponentMinuteRemoteWorker.Factory(moduleManager, remoteSenderService, MetricGraphIdDefine.APPLICATION_COMPONENT_GRAPH_ID).create(workerCreateListener)); - - remoteNode.addNext(new ApplicationComponentMinutePersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ApplicationComponentHourTransformNode()) - .addNext(new ApplicationComponentHourPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ApplicationComponentDayTransformNode()) - .addNext(new ApplicationComponentDayPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ApplicationComponentMonthTransformNode()) - .addNext(new ApplicationComponentMonthPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentHourPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentHourPersistenceWorker.java deleted file mode 100644 index b050b5927a855c1485b36d98cd88d6c5d37aef36..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentHourPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentHourPersistenceWorker extends MergePersistenceWorker { - - private ApplicationComponentHourPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_COMPONENT_HOUR_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationComponentHourPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationComponentHourPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationComponentHourPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationComponentTable.TABLE + "/hour") - @Override protected void onWork(ApplicationComponent input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentHourTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentHourTransformNode.java deleted file mode 100644 index 6c90cb65e7fb45197fbeed17828ff75ce883a428..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentHourTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentHourTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_COMPONENT_HOUR_TRANSFORM_NODE_ID; - } - - @Override - public void process(ApplicationComponent applicationComponent, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(applicationComponent.getTimeBucket()); - - ApplicationComponent newApplicationComponent = ApplicationComponentCopy.copy(applicationComponent); - newApplicationComponent.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationComponent.getMetricId()); - newApplicationComponent.setTimeBucket(timeBucket); - next.execute(newApplicationComponent); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMinuteAggregationWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMinuteAggregationWorker.java deleted file mode 100644 index 3ca4287b3b350f030b6f96a16128150a493f473e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMinuteAggregationWorker.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.AggregationWorker; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentMinuteAggregationWorker extends AggregationWorker { - - private ApplicationComponentMinuteAggregationWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_COMPONENT_MINUTE_AGGREGATION_WORKER_ID; - } - - public static class Factory extends AbstractLocalAsyncWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationComponentMinuteAggregationWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationComponentMinuteAggregationWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/aggregation/onWork/" + ApplicationComponentTable.TABLE) - @Override protected void onWork(ApplicationComponent message) throws WorkerException { - super.onWork(message); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMinutePersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMinutePersistenceWorker.java deleted file mode 100644 index a01b128f6ef3502579c738a82224f840ffbd9b69..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMinutePersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentMinutePersistenceWorker extends MergePersistenceWorker { - - private ApplicationComponentMinutePersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_COMPONENT_MINUTE_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationComponentMinutePersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationComponentMinutePersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationComponentMinutePersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationComponentTable.TABLE + "/minute") - @Override protected void onWork(ApplicationComponent message) { - super.onWork(message); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMinuteRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMinuteRemoteWorker.java deleted file mode 100644 index 71c6caff4bdcb2fc1b2957e89056ba4d02e8d05e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMinuteRemoteWorker.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.remote.service.Selector; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentMinuteRemoteWorker extends AbstractRemoteWorker { - - private ApplicationComponentMinuteRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_COMPONENT_MINUTE_REMOTE_WORKER_ID; - } - - @Override protected void onWork(ApplicationComponent applicationComponent) { - onNext(applicationComponent); - } - - @Override public Selector selector() { - return Selector.HashCode; - } - - public static class Factory extends AbstractRemoteWorkerProvider { - - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public ApplicationComponentMinuteRemoteWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationComponentMinuteRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMonthPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMonthPersistenceWorker.java deleted file mode 100644 index 5ef244348f08c3df7b71e8823f74363239eecfbc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMonthPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentMonthPersistenceWorker extends MergePersistenceWorker { - - private ApplicationComponentMonthPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_COMPONENT_MONTH_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationComponentMonthPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationComponentMonthPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationComponentMonthPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationComponentTable.TABLE + "/month") - @Override protected void onWork(ApplicationComponent message) { - super.onWork(message); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMonthTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMonthTransformNode.java deleted file mode 100644 index 35ee9fe630c0fceeb1c93509578c5baa4e67f362..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentMonthTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentMonthTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_COMPONENT_MONTH_TRANSFORM_NODE_ID; - } - - @Override - public void process(ApplicationComponent applicationComponent, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(applicationComponent.getTimeBucket()); - - ApplicationComponent newApplicationComponent = ApplicationComponentCopy.copy(applicationComponent); - newApplicationComponent.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationComponent.getMetricId()); - newApplicationComponent.setTimeBucket(timeBucket); - next.execute(newApplicationComponent); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentSpanListener.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentSpanListener.java deleted file mode 100644 index 4511305ae317c63fa9b3e1318ba250274138f19e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/component/ApplicationComponentSpanListener.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.component; - -import java.util.*; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.*; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.*; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.graph.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentSpanListener implements EntrySpanListener, ExitSpanListener { - - private final ApplicationCacheService applicationCacheService; - private final List applicationComponents = new LinkedList<>(); - - private ApplicationComponentSpanListener(ModuleManager moduleManager) { - this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class); - } - - @Override public boolean containsPoint(Point point) { - return Point.Entry.equals(point) || Point.Exit.equals(point); - } - - @Override - public void parseExit(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreInfo) { - int applicationIdFromPeerId = applicationCacheService.getApplicationIdByAddressId(spanDecorator.getPeerId()); - - String metricId = applicationIdFromPeerId + Const.ID_SPLIT + String.valueOf(spanDecorator.getComponentId()); - - ApplicationComponent applicationComponent = new ApplicationComponent(); - applicationComponent.setMetricId(metricId); - applicationComponent.setComponentId(spanDecorator.getComponentId()); - applicationComponent.setApplicationId(applicationIdFromPeerId); - applicationComponent.setId(segmentCoreInfo.getMinuteTimeBucket() + Const.ID_SPLIT + applicationComponent.getMetricId()); - applicationComponent.setTimeBucket(segmentCoreInfo.getMinuteTimeBucket()); - applicationComponents.add(applicationComponent); - } - - @Override - public void parseEntry(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreInfo) { - String metricId = String.valueOf(segmentCoreInfo.getApplicationId()) + Const.ID_SPLIT + String.valueOf(spanDecorator.getComponentId()); - - ApplicationComponent applicationComponent = new ApplicationComponent(); - applicationComponent.setMetricId(metricId); - applicationComponent.setComponentId(spanDecorator.getComponentId()); - applicationComponent.setApplicationId(segmentCoreInfo.getApplicationId()); - applicationComponent.setId(segmentCoreInfo.getMinuteTimeBucket() + Const.ID_SPLIT + applicationComponent.getMetricId()); - applicationComponent.setTimeBucket(segmentCoreInfo.getMinuteTimeBucket()); - applicationComponents.add(applicationComponent); - } - - @Override public void build() { - Graph graph = GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.APPLICATION_COMPONENT_GRAPH_ID, ApplicationComponent.class); - applicationComponents.forEach(graph::start); - } - - public static class Factory implements SpanListenerFactory { - - @GraphComputingMetric(name = "/segment/parse/createSpanListeners/applicationComponentSpanListener") - @Override public SpanListener create(ModuleManager moduleManager) { - return new ApplicationComponentSpanListener(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingCopy.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingCopy.java deleted file mode 100644 index 3797f1d5fa0646bb7708601297039c7c0577a900..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingCopy.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping; - -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingCopy { - - public static ApplicationMapping copy(ApplicationMapping applicationMapping) { - ApplicationMapping newApplicationMapping = new ApplicationMapping(); - newApplicationMapping.setId(applicationMapping.getId()); - newApplicationMapping.setMetricId(applicationMapping.getMetricId()); - newApplicationMapping.setTimeBucket(applicationMapping.getTimeBucket()); - - newApplicationMapping.setApplicationId(applicationMapping.getApplicationId()); - newApplicationMapping.setMappingApplicationId(applicationMapping.getMappingApplicationId()); - return newApplicationMapping; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingDayPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingDayPersistenceWorker.java deleted file mode 100644 index 3c5478bfcced6ec71084cc0926d52ed1dd9e2a00..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingDayPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingDayPersistenceWorker extends MergePersistenceWorker { - - private ApplicationMappingDayPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_MAPPING_DAY_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationMappingDayPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationMappingDayPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationMappingDayPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationMappingTable.TABLE + "/day") - @Override protected void onWork(ApplicationMapping input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingDayTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingDayTransformNode.java deleted file mode 100644 index a4b84b1c3fd43fa54beb5acd4ba261a849d586a5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingDayTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingDayTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_MAPPING_DAY_TRANSFORM_NODE_ID; - } - - @Override - public void process(ApplicationMapping applicationMapping, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(applicationMapping.getTimeBucket()); - - ApplicationMapping newApplicationMapping = ApplicationMappingCopy.copy(applicationMapping); - newApplicationMapping.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationMapping.getMetricId()); - newApplicationMapping.setTimeBucket(timeBucket); - next.execute(newApplicationMapping); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingGraph.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingGraph.java deleted file mode 100644 index 4ed6857c8c4bc0bb2888f3457e7b1c8ad666d06d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingGraph.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Node; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public ApplicationMappingGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - Node remoteNode = GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.APPLICATION_MAPPING_GRAPH_ID, ApplicationMapping.class) - .addNode(new ApplicationMappingMinuteAggregationWorker.Factory(moduleManager).create(workerCreateListener)) - .addNext(new ApplicationMappingMinuteRemoteWorker.Factory(moduleManager, remoteSenderService, MetricGraphIdDefine.APPLICATION_MAPPING_GRAPH_ID).create(workerCreateListener)); - - remoteNode.addNext(new ApplicationMappingMinutePersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ApplicationMappingHourTransformNode()) - .addNext(new ApplicationMappingHourPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ApplicationMappingDayTransformNode()) - .addNext(new ApplicationMappingDayPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ApplicationMappingMonthTransformNode()) - .addNext(new ApplicationMappingMonthPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingHourPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingHourPersistenceWorker.java deleted file mode 100644 index fb67780c582e4531ff7c8ac689f6324f526cb118..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingHourPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingHourPersistenceWorker extends MergePersistenceWorker { - - private ApplicationMappingHourPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_MAPPING_HOUR_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationMappingHourPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationMappingHourPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationMappingHourPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationMappingTable.TABLE + "/hour") - @Override protected void onWork(ApplicationMapping input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingHourTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingHourTransformNode.java deleted file mode 100644 index 2fb129265a4a648efb6d2dc3cd87fb9780cb8b63..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingHourTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingHourTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_MAPPING_HOUR_TRANSFORM_NODE_ID; - } - - @Override - public void process(ApplicationMapping applicationMapping, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(applicationMapping.getTimeBucket()); - - ApplicationMapping newApplicationMapping = ApplicationMappingCopy.copy(applicationMapping); - newApplicationMapping.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationMapping.getMetricId()); - newApplicationMapping.setTimeBucket(timeBucket); - next.execute(newApplicationMapping); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMinuteAggregationWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMinuteAggregationWorker.java deleted file mode 100644 index 823703af54e24bb181c946265c1c02ee08fbc45f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMinuteAggregationWorker.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.AggregationWorker; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingMinuteAggregationWorker extends AggregationWorker { - - private ApplicationMappingMinuteAggregationWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_MAPPING_MINUTE_AGGREGATION_WORKER_ID; - } - - public static class Factory extends AbstractLocalAsyncWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationMappingMinuteAggregationWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationMappingMinuteAggregationWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/aggregation/onWork/" + ApplicationMappingTable.TABLE) - @Override protected void onWork(ApplicationMapping message) throws WorkerException { - super.onWork(message); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMinutePersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMinutePersistenceWorker.java deleted file mode 100644 index ff6fa8a9df64f57d166aa38b6d2dbaf20ae673dd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMinutePersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingMinutePersistenceWorker extends MergePersistenceWorker { - - private ApplicationMappingMinutePersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_MAPPING_MINUTE_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationMappingMinutePersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationMappingMinutePersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationMappingMinutePersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationMappingTable.TABLE + "/minute") - @Override protected void onWork(ApplicationMapping input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMinuteRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMinuteRemoteWorker.java deleted file mode 100644 index b8d6a3df7b35dea5cb41cb8820cd2953a81f5c4a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMinuteRemoteWorker.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.remote.service.Selector; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingMinuteRemoteWorker extends AbstractRemoteWorker { - - private ApplicationMappingMinuteRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_MAPPING_MINUTE_REMOTE_WORKER_ID; - } - - @Override protected void onWork(ApplicationMapping applicationMapping) { - onNext(applicationMapping); - } - - @Override public Selector selector() { - return Selector.HashCode; - } - - public static class Factory extends AbstractRemoteWorkerProvider { - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public ApplicationMappingMinuteRemoteWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationMappingMinuteRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMonthPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMonthPersistenceWorker.java deleted file mode 100644 index f838e41191b7bd5d5258b933f7db5332f6a6a493..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMonthPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingMonthPersistenceWorker extends MergePersistenceWorker { - - private ApplicationMappingMonthPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_MAPPING_MONTH_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationMappingMonthPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationMappingMonthPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationMappingMonthPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationMappingTable.TABLE + "/month") - @Override protected void onWork(ApplicationMapping input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMonthTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMonthTransformNode.java deleted file mode 100644 index 1ea1ce0683e652cae565d6d22c5d5f94b12f261d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingMonthTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingMonthTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_MAPPING_MONTH_TRANSFORM_NODE_ID; - } - - @Override - public void process(ApplicationMapping applicationMapping, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(applicationMapping.getTimeBucket()); - - ApplicationMapping newApplicationMapping = ApplicationMappingCopy.copy(applicationMapping); - newApplicationMapping.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationMapping.getMetricId()); - newApplicationMapping.setTimeBucket(timeBucket); - next.execute(newApplicationMapping); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingSpanListener.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingSpanListener.java deleted file mode 100644 index 8a0d4859c2f1e84d0adf7a51ab19034b1fddf59b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/mapping/ApplicationMappingSpanListener.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.mapping; - -import java.util.*; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.*; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.*; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.graph.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.network.language.agent.SpanLayer; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingSpanListener implements EntrySpanListener { - - private static final Logger logger = LoggerFactory.getLogger(ApplicationMappingSpanListener.class); - - private final ApplicationCacheService applicationCacheService; - private List applicationMappings = new LinkedList<>(); - - private ApplicationMappingSpanListener(ModuleManager moduleManager) { - this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class); - } - - @Override public boolean containsPoint(Point point) { - return Point.Entry.equals(point); - } - - @Override public void parseEntry(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreInfo) { - if (logger.isDebugEnabled()) { - logger.debug("application mapping listener parse reference"); - } - - if (!spanDecorator.getSpanLayer().equals(SpanLayer.MQ)) { - if (spanDecorator.getRefsCount() > 0) { - for (int i = 0; i < spanDecorator.getRefsCount(); i++) { - ApplicationMapping applicationMapping = new ApplicationMapping(); - applicationMapping.setApplicationId(segmentCoreInfo.getApplicationId()); - - int addressId = spanDecorator.getRefs(i).getNetworkAddressId(); - int mappingApplicationId = applicationCacheService.getApplicationIdByAddressId(addressId); - applicationMapping.setMappingApplicationId(mappingApplicationId); - - String metricId = String.valueOf(segmentCoreInfo.getApplicationId()) + Const.ID_SPLIT + String.valueOf(applicationMapping.getMappingApplicationId()); - applicationMapping.setMetricId(metricId); - applicationMapping.setId(segmentCoreInfo.getMinuteTimeBucket() + Const.ID_SPLIT + applicationMapping.getMetricId()); - applicationMapping.setTimeBucket(segmentCoreInfo.getMinuteTimeBucket()); - applicationMappings.add(applicationMapping); - } - } - } - } - - @Override public void build() { - if (logger.isDebugEnabled()) { - logger.debug("application mapping listener build"); - } - - Graph graph = GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.APPLICATION_MAPPING_GRAPH_ID, ApplicationMapping.class); - applicationMappings.forEach(applicationMapping -> { - if (logger.isDebugEnabled()) { - logger.debug("push to application mapping aggregation worker, id: {}", applicationMapping.getId()); - } - - graph.start(applicationMapping); - }); - } - - public static class Factory implements SpanListenerFactory { - - @GraphComputingMetric(name = "/segment/parse/createSpanListeners/applicationMappingSpanListener") - @Override public SpanListener create(ModuleManager moduleManager) { - return new ApplicationMappingSpanListener(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationDayMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationDayMetricPersistenceWorker.java deleted file mode 100644 index 113f5c76246197427553aa715d5acebf3530c920..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationDayMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationDayMetricPersistenceWorker extends MergePersistenceWorker { - - private ApplicationDayMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_DAY_METRIC_PERSISTENCE_WORKER_ID; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationDayMetricPersistenceDAO.class); - } - - @Override protected boolean needMergeDBData() { - return true; - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationDayMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationDayMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationMetricTable.TABLE + "/day") - @Override protected void onWork(ApplicationMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationDayMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationDayMetricTransformNode.java deleted file mode 100644 index d88c194e1ea75a5a7b296e991e8573048140f615..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationDayMetricTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; - -/** - * @author peng-yongsheng - */ -public class ApplicationDayMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_DAY_METRIC_TRANSFORM_NODE_ID; - } - - @Override - public void process(ApplicationMetric applicationMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(applicationMetric.getTimeBucket()); - - ApplicationMetric newApplicationMetric = ApplicationMetricCopy.copy(applicationMetric); - newApplicationMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationMetric.getMetricId()); - newApplicationMetric.setTimeBucket(timeBucket); - next.execute(newApplicationMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationHourMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationHourMetricPersistenceWorker.java deleted file mode 100644 index 4bce929926dfcea356ece46e934170f431d2830e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationHourMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationHourMetricPersistenceWorker extends MergePersistenceWorker { - - private ApplicationHourMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_HOUR_METRIC_PERSISTENCE_WORKER_ID; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationHourMetricPersistenceDAO.class); - } - - @Override protected boolean needMergeDBData() { - return true; - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationHourMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationHourMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationMetricTable.TABLE + "/hour") - @Override protected void onWork(ApplicationMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationHourMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationHourMetricTransformNode.java deleted file mode 100644 index 9c78004739ef2eae65c5b7a17baa4e09ab6b856c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationHourMetricTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; - -/** - * @author peng-yongsheng - */ -public class ApplicationHourMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_HOUR_METRIC_TRANSFORM_NODE_ID; - } - - @Override - public void process(ApplicationMetric applicationMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(applicationMetric.getTimeBucket()); - - ApplicationMetric newApplicationMetric = ApplicationMetricCopy.copy(applicationMetric); - newApplicationMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationMetric.getMetricId()); - newApplicationMetric.setTimeBucket(timeBucket); - next.execute(newApplicationMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMetricCopy.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMetricCopy.java deleted file mode 100644 index 266399d2cf9b520fd295c39ffb6da85f71b4d366..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMetricCopy.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.metric; - -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; - -/** - * @author peng-yongsheng - */ -public class ApplicationMetricCopy { - - public static ApplicationMetric copy(ApplicationMetric applicationMetric) { - ApplicationMetric newApplicationMetric = new ApplicationMetric(); - newApplicationMetric.setId(applicationMetric.getId()); - newApplicationMetric.setMetricId(applicationMetric.getMetricId()); - newApplicationMetric.setSourceValue(applicationMetric.getSourceValue()); - - newApplicationMetric.setApplicationId(applicationMetric.getApplicationId()); - - newApplicationMetric.setTransactionCalls(applicationMetric.getTransactionCalls()); - newApplicationMetric.setTransactionDurationSum(applicationMetric.getTransactionDurationSum()); - newApplicationMetric.setTransactionErrorCalls(applicationMetric.getTransactionErrorCalls()); - newApplicationMetric.setTransactionErrorDurationSum(applicationMetric.getTransactionErrorDurationSum()); - - newApplicationMetric.setBusinessTransactionCalls(applicationMetric.getBusinessTransactionCalls()); - newApplicationMetric.setBusinessTransactionDurationSum(applicationMetric.getBusinessTransactionDurationSum()); - newApplicationMetric.setBusinessTransactionErrorCalls(applicationMetric.getBusinessTransactionErrorCalls()); - newApplicationMetric.setBusinessTransactionErrorDurationSum(applicationMetric.getBusinessTransactionErrorDurationSum()); - - newApplicationMetric.setMqTransactionCalls(applicationMetric.getMqTransactionCalls()); - newApplicationMetric.setMqTransactionDurationSum(applicationMetric.getMqTransactionDurationSum()); - newApplicationMetric.setMqTransactionErrorCalls(applicationMetric.getMqTransactionErrorCalls()); - newApplicationMetric.setMqTransactionErrorDurationSum(applicationMetric.getMqTransactionErrorDurationSum()); - - newApplicationMetric.setSatisfiedCount(applicationMetric.getSatisfiedCount()); - newApplicationMetric.setToleratingCount(applicationMetric.getToleratingCount()); - newApplicationMetric.setFrustratedCount(applicationMetric.getFrustratedCount()); - - newApplicationMetric.setTimeBucket(applicationMetric.getTimeBucket()); - - return newApplicationMetric; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMetricGraph.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMetricGraph.java deleted file mode 100644 index 16771f1a807498221b1b97bffb20b94f62f68d26..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMetricGraph.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.Node; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ApplicationMetricGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public ApplicationMetricGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - Graph graph = GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.APPLICATION_METRIC_GRAPH_ID, ApplicationReferenceMetric.class); - - Node remoteNode = graph.addNode(new ApplicationMinuteMetricAggregationWorker.Factory(moduleManager).create(workerCreateListener)) - .addNext(new ApplicationMinuteMetricRemoteWorker.Factory(moduleManager, remoteSenderService, MetricGraphIdDefine.APPLICATION_METRIC_GRAPH_ID).create(workerCreateListener)); - - remoteNode.addNext(new ApplicationMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ApplicationHourMetricTransformNode()) - .addNext(new ApplicationHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ApplicationDayMetricTransformNode()) - .addNext(new ApplicationDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ApplicationMonthMetricTransformNode()) - .addNext(new ApplicationMonthMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - link(graph); - } - - private void link(Graph graph) { - GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.APPLICATION_REFERENCE_METRIC_GRAPH_ID, ApplicationReferenceMetric.class) - .toFinder().findNode(MetricWorkerIdDefine.APPLICATION_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID, ApplicationReferenceMetric.class) - .addNext(new NodeProcessor() { - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_METRIC_GRAPH_BRIDGE_WORKER_ID; - } - - @Override - public void process(ApplicationReferenceMetric applicationReferenceMetric, - Next next) { - graph.start(applicationReferenceMetric); - } - }); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMinuteMetricAggregationWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMinuteMetricAggregationWorker.java deleted file mode 100644 index 08249705face7307a053fa14dc6eff1cd61597a5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMinuteMetricAggregationWorker.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.AggregationWorker; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ApplicationMinuteMetricAggregationWorker extends AggregationWorker { - - private ApplicationMinuteMetricAggregationWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_MINUTE_METRIC_AGGREGATION_WORKER_ID; - } - - @Override protected ApplicationMetric transform(ApplicationReferenceMetric applicationReferenceMetric) { - Integer applicationId = applicationReferenceMetric.getBehindApplicationId(); - Long timeBucket = applicationReferenceMetric.getTimeBucket(); - - String metricId = String.valueOf(applicationId) - + Const.ID_SPLIT + applicationReferenceMetric.getSourceValue(); - - String id = String.valueOf(timeBucket) - + Const.ID_SPLIT + metricId; - - ApplicationMetric applicationMetric = new ApplicationMetric(); - applicationMetric.setId(id); - applicationMetric.setMetricId(metricId); - - applicationMetric.setApplicationId(applicationId); - applicationMetric.setSourceValue(applicationReferenceMetric.getSourceValue()); - - applicationMetric.setTransactionCalls(applicationReferenceMetric.getTransactionCalls()); - applicationMetric.setTransactionDurationSum(applicationReferenceMetric.getTransactionDurationSum()); - applicationMetric.setTransactionErrorCalls(applicationReferenceMetric.getTransactionErrorCalls()); - applicationMetric.setTransactionErrorDurationSum(applicationReferenceMetric.getTransactionErrorDurationSum()); - - applicationMetric.setBusinessTransactionCalls(applicationReferenceMetric.getBusinessTransactionCalls()); - applicationMetric.setBusinessTransactionDurationSum(applicationReferenceMetric.getBusinessTransactionDurationSum()); - applicationMetric.setBusinessTransactionErrorCalls(applicationReferenceMetric.getBusinessTransactionErrorCalls()); - applicationMetric.setBusinessTransactionErrorDurationSum(applicationReferenceMetric.getBusinessTransactionErrorDurationSum()); - - applicationMetric.setMqTransactionCalls(applicationReferenceMetric.getMqTransactionCalls()); - applicationMetric.setMqTransactionDurationSum(applicationReferenceMetric.getMqTransactionDurationSum()); - applicationMetric.setMqTransactionErrorCalls(applicationReferenceMetric.getMqTransactionErrorCalls()); - applicationMetric.setMqTransactionErrorDurationSum(applicationReferenceMetric.getMqTransactionErrorDurationSum()); - - applicationMetric.setSatisfiedCount(applicationReferenceMetric.getSatisfiedCount()); - applicationMetric.setToleratingCount(applicationReferenceMetric.getToleratingCount()); - applicationMetric.setFrustratedCount(applicationReferenceMetric.getFrustratedCount()); - - applicationMetric.setTimeBucket(timeBucket); - - return applicationMetric; - } - - public static class Factory extends AbstractLocalAsyncWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationMinuteMetricAggregationWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationMinuteMetricAggregationWorker(moduleManager); - } - - @Override public int queueSize() { - return 256; - } - } - - @GraphComputingMetric(name = "/aggregate/onWork/" + ApplicationMetricTable.TABLE) - @Override protected void onWork(ApplicationReferenceMetric message) throws WorkerException { - super.onWork(message); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMinuteMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMinuteMetricPersistenceWorker.java deleted file mode 100644 index c834b17bcc6db816c91f4fe33a9359784b5a1f6b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMinuteMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMinuteMetricPersistenceWorker extends MergePersistenceWorker { - - private ApplicationMinuteMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_MINUTE_METRIC_PERSISTENCE_WORKER_ID; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationMinuteMetricPersistenceDAO.class); - } - - @Override protected boolean needMergeDBData() { - return true; - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationMinuteMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationMinuteMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationMetricTable.TABLE + "/minute") - @Override protected void onWork(ApplicationMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMinuteMetricRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMinuteMetricRemoteWorker.java deleted file mode 100644 index dffdc2e84c08f20c8ed05288766607b5ede29122..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMinuteMetricRemoteWorker.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.remote.service.Selector; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; - -/** - * @author peng-yongsheng - */ -public class ApplicationMinuteMetricRemoteWorker extends AbstractRemoteWorker { - - private ApplicationMinuteMetricRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_MINUTE_METRIC_REMOTE_WORKER_ID; - } - - @Override protected void onWork(ApplicationMetric applicationMetric) { - onNext(applicationMetric); - } - - @Override public Selector selector() { - return Selector.HashCode; - } - - public static class Factory extends AbstractRemoteWorkerProvider { - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public ApplicationMinuteMetricRemoteWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationMinuteMetricRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMonthMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMonthMetricPersistenceWorker.java deleted file mode 100644 index b20a63e31df0b9781119a1628777257411350b96..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMonthMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMonthMetricPersistenceWorker extends MergePersistenceWorker { - - private ApplicationMonthMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_MONTH_METRIC_PERSISTENCE_WORKER_ID; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationMonthMetricPersistenceDAO.class); - } - - @Override protected boolean needMergeDBData() { - return true; - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationMonthMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationMonthMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationMetricTable.TABLE + "/month") - @Override protected void onWork(ApplicationMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMonthMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMonthMetricTransformNode.java deleted file mode 100644 index 6becd28ba178dee003f81b84f14fc8abcfa56713..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/metric/ApplicationMonthMetricTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; - -/** - * @author peng-yongsheng - */ -public class ApplicationMonthMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_MONTH_METRIC_TRANSFORM_NODE_ID; - } - - @Override - public void process(ApplicationMetric applicationMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(applicationMetric.getTimeBucket()); - - ApplicationMetric newApplicationMetric = ApplicationMetricCopy.copy(applicationMetric); - newApplicationMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationMetric.getMetricId()); - newApplicationMetric.setTimeBucket(timeBucket); - next.execute(newApplicationMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceDayMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceDayMetricPersistenceWorker.java deleted file mode 100644 index ea067414091f363a13a594cd15cbe40e7d67ff04..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceDayMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceDayMetricPersistenceWorker extends MergePersistenceWorker { - - private ApplicationReferenceDayMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_REFERENCE_DAY_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationReferenceDayMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationReferenceDayMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationReferenceDayMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationReferenceMetricTable.TABLE + "/day") - @Override protected void onWork(ApplicationReferenceMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceDayMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceDayMetricTransformNode.java deleted file mode 100644 index 75af43d88bd04650768f8d6623a78efe5ef9ef16..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceDayMetricTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceDayMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_REFERENCE_DAY_METRIC_TRANSFORM_NODE_ID; - } - - @Override - public void process(ApplicationReferenceMetric applicationReferenceMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(applicationReferenceMetric.getTimeBucket()); - - ApplicationReferenceMetric newApplicationReferenceMetric = ApplicationReferenceMetricCopy.copy(applicationReferenceMetric); - newApplicationReferenceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationReferenceMetric.getMetricId()); - newApplicationReferenceMetric.setTimeBucket(timeBucket); - next.execute(newApplicationReferenceMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceHourMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceHourMetricPersistenceWorker.java deleted file mode 100644 index 98d2d13b963a116fed9ab6e2521e33415a215943..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceHourMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceHourMetricPersistenceWorker extends MergePersistenceWorker { - - private ApplicationReferenceHourMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_REFERENCE_HOUR_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationReferenceHourMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationReferenceHourMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationReferenceHourMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationReferenceMetricTable.TABLE + "/hour") - @Override protected void onWork(ApplicationReferenceMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceHourMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceHourMetricTransformNode.java deleted file mode 100644 index eb768da22012a9ae7731587e3d6dd640bda457bb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceHourMetricTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceHourMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_REFERENCE_HOUR_METRIC_TRANSFORM_NODE_ID; - } - - @Override - public void process(ApplicationReferenceMetric applicationReferenceMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(applicationReferenceMetric.getTimeBucket()); - - ApplicationReferenceMetric newApplicationReferenceMetric = ApplicationReferenceMetricCopy.copy(applicationReferenceMetric); - newApplicationReferenceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationReferenceMetric.getMetricId()); - newApplicationReferenceMetric.setTimeBucket(timeBucket); - next.execute(newApplicationReferenceMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMetricCopy.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMetricCopy.java deleted file mode 100644 index 4cf5b4ef3980a693d7ca5a4171436b07206b9f6b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMetricCopy.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.refmetric; - -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMetricCopy { - - public static ApplicationReferenceMetric copy(ApplicationReferenceMetric applicationReferenceMetric) { - ApplicationReferenceMetric newApplicationReferenceMetric = new ApplicationReferenceMetric(); - newApplicationReferenceMetric.setId(applicationReferenceMetric.getId()); - newApplicationReferenceMetric.setMetricId(applicationReferenceMetric.getMetricId()); - newApplicationReferenceMetric.setSourceValue(applicationReferenceMetric.getSourceValue()); - - newApplicationReferenceMetric.setFrontApplicationId(applicationReferenceMetric.getFrontApplicationId()); - newApplicationReferenceMetric.setBehindApplicationId(applicationReferenceMetric.getBehindApplicationId()); - - newApplicationReferenceMetric.setTransactionCalls(applicationReferenceMetric.getTransactionCalls()); - newApplicationReferenceMetric.setTransactionDurationSum(applicationReferenceMetric.getTransactionDurationSum()); - newApplicationReferenceMetric.setTransactionErrorCalls(applicationReferenceMetric.getTransactionErrorCalls()); - newApplicationReferenceMetric.setTransactionErrorDurationSum(applicationReferenceMetric.getTransactionErrorDurationSum()); - - newApplicationReferenceMetric.setBusinessTransactionCalls(applicationReferenceMetric.getBusinessTransactionCalls()); - newApplicationReferenceMetric.setBusinessTransactionDurationSum(applicationReferenceMetric.getBusinessTransactionDurationSum()); - newApplicationReferenceMetric.setBusinessTransactionErrorCalls(applicationReferenceMetric.getBusinessTransactionErrorCalls()); - newApplicationReferenceMetric.setBusinessTransactionErrorDurationSum(applicationReferenceMetric.getBusinessTransactionErrorDurationSum()); - - newApplicationReferenceMetric.setMqTransactionCalls(applicationReferenceMetric.getMqTransactionCalls()); - newApplicationReferenceMetric.setMqTransactionDurationSum(applicationReferenceMetric.getMqTransactionDurationSum()); - newApplicationReferenceMetric.setMqTransactionErrorCalls(applicationReferenceMetric.getMqTransactionErrorCalls()); - newApplicationReferenceMetric.setMqTransactionErrorDurationSum(applicationReferenceMetric.getMqTransactionErrorDurationSum()); - - newApplicationReferenceMetric.setSatisfiedCount(applicationReferenceMetric.getSatisfiedCount()); - newApplicationReferenceMetric.setToleratingCount(applicationReferenceMetric.getToleratingCount()); - newApplicationReferenceMetric.setFrustratedCount(applicationReferenceMetric.getFrustratedCount()); - - newApplicationReferenceMetric.setTimeBucket(applicationReferenceMetric.getTimeBucket()); - - return newApplicationReferenceMetric; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMetricGraph.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMetricGraph.java deleted file mode 100644 index f6bcf8b17258a6ed44c1adc44e95a075862306b7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMetricGraph.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.Node; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMetricGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public ApplicationReferenceMetricGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - Graph graph = GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.APPLICATION_REFERENCE_METRIC_GRAPH_ID, InstanceReferenceMetric.class); - - Node remoteNode = graph.addNode(new ApplicationReferenceMinuteMetricAggregationWorker.Factory(moduleManager).create(workerCreateListener)) - .addNext(new ApplicationReferenceMinuteMetricRemoteWorker.Factory(moduleManager, remoteSenderService, MetricGraphIdDefine.APPLICATION_REFERENCE_METRIC_GRAPH_ID).create(workerCreateListener)); - - remoteNode.addNext(new ApplicationReferenceMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ApplicationReferenceHourMetricTransformNode()) - .addNext(new ApplicationReferenceHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ApplicationReferenceDayMetricTransformNode()) - .addNext(new ApplicationReferenceDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ApplicationReferenceMonthMetricTransformNode()) - .addNext(new ApplicationReferenceMonthMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - link(graph); - } - - private void link(Graph graph) { - GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.INSTANCE_REFERENCE_METRIC_GRAPH_ID, InstanceReferenceMetric.class) - .toFinder().findNode(MetricWorkerIdDefine.INSTANCE_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID, InstanceReferenceMetric.class) - .addNext(new NodeProcessor() { - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_REFERENCE_GRAPH_BRIDGE_WORKER_ID; - } - - @Override public void process(InstanceReferenceMetric instanceReferenceMetric, - Next next) { - graph.start(instanceReferenceMetric); - } - }); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMinuteMetricAggregationWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMinuteMetricAggregationWorker.java deleted file mode 100644 index b3de61d7038f3f6e1d4d0ef9589b895b9cc2ea67..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMinuteMetricAggregationWorker.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.AggregationWorker; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.InstanceCacheService; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IApdexThresholdService; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.ApdexThresholdUtils; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMinuteMetricAggregationWorker extends AggregationWorker { - - private final InstanceCacheService instanceCacheService; - private final IApdexThresholdService apdexThresholdService; - - private ApplicationReferenceMinuteMetricAggregationWorker(ModuleManager moduleManager) { - super(moduleManager); - this.instanceCacheService = moduleManager.find(CacheModule.NAME).getService(InstanceCacheService.class); - this.apdexThresholdService = moduleManager.find(ConfigurationModule.NAME).getService(IApdexThresholdService.class); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID; - } - - @Override protected ApplicationReferenceMetric transform(InstanceReferenceMetric instanceReferenceMetric) { - Integer frontApplicationId = instanceCacheService.getApplicationId(instanceReferenceMetric.getFrontInstanceId()); - Integer behindApplicationId = instanceCacheService.getApplicationId(instanceReferenceMetric.getBehindInstanceId()); - - String metricId = frontApplicationId - + Const.ID_SPLIT + behindApplicationId - + Const.ID_SPLIT + instanceReferenceMetric.getSourceValue(); - - String id = instanceReferenceMetric.getTimeBucket() - + Const.ID_SPLIT + metricId; - - ApplicationReferenceMetric applicationReferenceMetric = new ApplicationReferenceMetric(); - applicationReferenceMetric.setId(id); - applicationReferenceMetric.setMetricId(metricId); - applicationReferenceMetric.setFrontApplicationId(frontApplicationId); - applicationReferenceMetric.setBehindApplicationId(behindApplicationId); - applicationReferenceMetric.setSourceValue(instanceReferenceMetric.getSourceValue()); - - applicationReferenceMetric.setTransactionCalls(instanceReferenceMetric.getTransactionCalls()); - applicationReferenceMetric.setTransactionErrorCalls(instanceReferenceMetric.getTransactionErrorCalls()); - applicationReferenceMetric.setTransactionDurationSum(instanceReferenceMetric.getTransactionDurationSum()); - applicationReferenceMetric.setTransactionErrorDurationSum(instanceReferenceMetric.getTransactionErrorDurationSum()); - - applicationReferenceMetric.setBusinessTransactionCalls(instanceReferenceMetric.getBusinessTransactionCalls()); - applicationReferenceMetric.setBusinessTransactionErrorCalls(instanceReferenceMetric.getBusinessTransactionErrorCalls()); - applicationReferenceMetric.setBusinessTransactionDurationSum(instanceReferenceMetric.getBusinessTransactionDurationSum()); - applicationReferenceMetric.setBusinessTransactionErrorDurationSum(instanceReferenceMetric.getBusinessTransactionErrorDurationSum()); - - applicationReferenceMetric.setMqTransactionCalls(instanceReferenceMetric.getMqTransactionCalls()); - applicationReferenceMetric.setMqTransactionErrorCalls(instanceReferenceMetric.getMqTransactionErrorCalls()); - applicationReferenceMetric.setMqTransactionDurationSum(instanceReferenceMetric.getMqTransactionDurationSum()); - applicationReferenceMetric.setMqTransactionErrorDurationSum(instanceReferenceMetric.getMqTransactionErrorDurationSum()); - - ApdexThresholdUtils.Apdex apdex = ApdexThresholdUtils.compute(apdexThresholdService.getApplicationApdexThreshold(behindApplicationId), instanceReferenceMetric.getTransactionDurationSum()); - if (ApdexThresholdUtils.Apdex.Satisfied.equals(apdex)) { - applicationReferenceMetric.setSatisfiedCount(1L); - } else if (ApdexThresholdUtils.Apdex.Tolerating.equals(apdex)) { - applicationReferenceMetric.setToleratingCount(1L); - } else { - applicationReferenceMetric.setFrustratedCount(1L); - } - - applicationReferenceMetric.setTimeBucket(instanceReferenceMetric.getTimeBucket()); - - return applicationReferenceMetric; - } - - public static class Factory extends AbstractLocalAsyncWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationReferenceMinuteMetricAggregationWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationReferenceMinuteMetricAggregationWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/aggregate/onWork/" + ApplicationReferenceMetricTable.TABLE) - @Override protected void onWork(InstanceReferenceMetric message) throws WorkerException { - super.onWork(message); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMinuteMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMinuteMetricPersistenceWorker.java deleted file mode 100644 index 1ba51f21727041e24fe724da490cfd58c4c65566..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMinuteMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMinuteMetricPersistenceWorker extends MergePersistenceWorker { - - private ApplicationReferenceMinuteMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationReferenceMinuteMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationReferenceMinuteMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationReferenceMinuteMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationReferenceMetricTable.TABLE + "/minute") - @Override protected void onWork(ApplicationReferenceMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMinuteMetricRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMinuteMetricRemoteWorker.java deleted file mode 100644 index d11329fc6d7ed082bafded2a764d232b0844dcfc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMinuteMetricRemoteWorker.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.remote.service.Selector; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMinuteMetricRemoteWorker extends AbstractRemoteWorker { - - private ApplicationReferenceMinuteMetricRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_REFERENCE_MINUTE_METRIC_REMOTE_WORKER_ID; - } - - @Override protected void onWork(ApplicationReferenceMetric applicationReferenceMetric) { - onNext(applicationReferenceMetric); - } - - @Override public Selector selector() { - return Selector.HashCode; - } - - public static class Factory extends AbstractRemoteWorkerProvider { - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public ApplicationReferenceMinuteMetricRemoteWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationReferenceMinuteMetricRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMonthMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMonthMetricPersistenceWorker.java deleted file mode 100644 index 3fb3e3bd5cf2970cb60bd196f56ef365d48ed286..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMonthMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMonthMetricPersistenceWorker extends MergePersistenceWorker { - - private ApplicationReferenceMonthMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_REFERENCE_MONTH_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IApplicationReferenceMonthMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationReferenceMonthMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationReferenceMonthMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ApplicationReferenceMetricTable.TABLE + "/month") - @Override protected void onWork(ApplicationReferenceMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMonthMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMonthMetricTransformNode.java deleted file mode 100644 index 426aee5c4d433b701ac8e53d7eec659b85f2c5dd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/application/refmetric/ApplicationReferenceMonthMetricTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.application.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMonthMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.APPLICATION_REFERENCE_MONTH_METRIC_TRANSFORM_NODE_ID; - } - - @Override - public void process(ApplicationReferenceMetric applicationReferenceMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(applicationReferenceMetric.getTimeBucket()); - - ApplicationReferenceMetric newApplicationReferenceMetric = ApplicationReferenceMetricCopy.copy(applicationReferenceMetric); - newApplicationReferenceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationReferenceMetric.getMetricId()); - newApplicationReferenceMetric.setTimeBucket(timeBucket); - next.execute(newApplicationReferenceMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/GlobalTraceGraph.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/GlobalTraceGraph.java deleted file mode 100644 index d2579ab27a4043c858abef1da82772102560bb42..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/GlobalTraceGraph.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.table.global.GlobalTrace; - -/** - * @author peng-yongsheng - */ -public class GlobalTraceGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public GlobalTraceGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.GLOBAL_TRACE_GRAPH_ID, GlobalTrace.class) - .addNode(new GlobalTracePersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/GlobalTracePersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/GlobalTracePersistenceWorker.java deleted file mode 100644 index bf5b8cb483a3e7a0c785c76ffbdae0aab4af546d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/GlobalTracePersistenceWorker.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.*; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.IGlobalTracePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.global.*; - -/** - * @author peng-yongsheng - */ -public class GlobalTracePersistenceWorker extends NonMergePersistenceWorker { - - private GlobalTracePersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.GLOBAL_TRACE_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return false; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IGlobalTracePersistenceDAO.class); - } - - public static class Factory extends NonMergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public GlobalTracePersistenceWorker workerInstance(ModuleManager moduleManager) { - return new GlobalTracePersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + GlobalTraceTable.TABLE) - @Override protected void onWork(GlobalTrace input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/GlobalTraceSpanListener.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/GlobalTraceSpanListener.java deleted file mode 100644 index 285949d6d2df37289353f3474fe79263bb4fd3ab..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/GlobalTraceSpanListener.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global; - -import java.util.*; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.SegmentCoreInfo; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.*; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.graph.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.global.GlobalTrace; -import org.apache.skywalking.apm.network.language.agent.UniqueId; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class GlobalTraceSpanListener implements GlobalTraceIdsListener { - - private static final Logger logger = LoggerFactory.getLogger(GlobalTraceSpanListener.class); - - private final List globalTraceIds = new LinkedList<>(); - private SegmentCoreInfo segmentCoreInfo; - - @Override public boolean containsPoint(Point point) { - return Point.GlobalTraceIds.equals(point); - } - - @Override public void parseGlobalTraceId(UniqueId uniqueId, SegmentCoreInfo segmentCoreInfo) { - StringBuilder globalTraceIdBuilder = new StringBuilder(); - for (int i = 0; i < uniqueId.getIdPartsList().size(); i++) { - if (i == 0) { - globalTraceIdBuilder.append(uniqueId.getIdPartsList().get(i)); - } else { - globalTraceIdBuilder.append(".").append(uniqueId.getIdPartsList().get(i)); - } - } - globalTraceIds.add(globalTraceIdBuilder.toString()); - this.segmentCoreInfo = segmentCoreInfo; - } - - @Override public void build() { - if (logger.isDebugEnabled()) { - logger.debug("global trace listener build"); - } - - Graph graph = GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.GLOBAL_TRACE_GRAPH_ID, GlobalTrace.class); - globalTraceIds.forEach(globalTraceId -> { - GlobalTrace globalTrace = new GlobalTrace(); - globalTrace.setId(segmentCoreInfo.getSegmentId() + Const.ID_SPLIT + globalTraceId); - globalTrace.setTraceId(globalTraceId); - globalTrace.setSegmentId(segmentCoreInfo.getSegmentId()); - globalTrace.setTimeBucket(segmentCoreInfo.getMinuteTimeBucket()); - graph.start(globalTrace); - }); - } - - public static class Factory implements SpanListenerFactory { - - @GraphComputingMetric(name = "/segment/parse/createSpanListeners/globalTraceSpanListener") - @Override public SpanListener create(ModuleManager moduleManager) { - return new GlobalTraceSpanListener(); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionCopy.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionCopy.java deleted file mode 100644 index ad0b4091b06c70fd5a55999ae7cf8270d5362fc0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionCopy.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global.std; - -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionCopy { - - public static ResponseTimeDistribution copy(ResponseTimeDistribution responseTimeDistribution) { - ResponseTimeDistribution newResponseTimeDistribution = new ResponseTimeDistribution(); - newResponseTimeDistribution.setId(responseTimeDistribution.getId()); - newResponseTimeDistribution.setMetricId(responseTimeDistribution.getMetricId()); - newResponseTimeDistribution.setTimeBucket(responseTimeDistribution.getTimeBucket()); - - newResponseTimeDistribution.setStep(responseTimeDistribution.getStep()); - newResponseTimeDistribution.setCalls(responseTimeDistribution.getCalls()); - newResponseTimeDistribution.setSuccessCalls(responseTimeDistribution.getSuccessCalls()); - newResponseTimeDistribution.setErrorCalls(responseTimeDistribution.getErrorCalls()); - return newResponseTimeDistribution; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionDayPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionDayPersistenceWorker.java deleted file mode 100644 index 99fe25952c6508f8fda1b948e05f60e945cab469..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionDayPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global.std; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionDayPersistenceWorker extends MergePersistenceWorker { - - private ResponseTimeDistributionDayPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.RESPONSE_TIME_DISTRIBUTION_DAY_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IResponseTimeDistributionDayPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ResponseTimeDistributionDayPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ResponseTimeDistributionDayPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ResponseTimeDistributionTable.TABLE + "/day") - @Override protected void onWork(ResponseTimeDistribution input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionDayTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionDayTransformNode.java deleted file mode 100644 index 4eec989380330e412ec07e074300879fc6846602..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionDayTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global.std; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionDayTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.RESPONSE_TIME_DISTRIBUTION_DAY_TRANSFORM_NODE_ID; - } - - @Override - public void process(ResponseTimeDistribution responseTimeDistribution, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(responseTimeDistribution.getTimeBucket()); - - ResponseTimeDistribution newResponseTimeDistribution = ResponseTimeDistributionCopy.copy(responseTimeDistribution); - newResponseTimeDistribution.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + responseTimeDistribution.getMetricId()); - newResponseTimeDistribution.setTimeBucket(timeBucket); - next.execute(newResponseTimeDistribution); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionGraph.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionGraph.java deleted file mode 100644 index f670bcbeca292dc365dc1677c4e26d34c5d8463d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionGraph.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global.std; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Node; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public ResponseTimeDistributionGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - Node remoteNode = GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.RESPONSE_TIME_DISTRIBUTION_GRAPH_ID, ResponseTimeDistribution.class) - .addNode(new ResponseTimeDistributionMinuteAggregationWorker.Factory(moduleManager).create(workerCreateListener)) - .addNext(new ResponseTimeDistributionMinuteRemoteWorker.Factory(moduleManager, remoteSenderService, MetricGraphIdDefine.RESPONSE_TIME_DISTRIBUTION_GRAPH_ID).create(workerCreateListener)); - - remoteNode.addNext(new ResponseTimeDistributionMinutePersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ResponseTimeDistributionHourTransformNode()) - .addNext(new ResponseTimeDistributionHourPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ResponseTimeDistributionDayTransformNode()) - .addNext(new ResponseTimeDistributionDayPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ResponseTimeDistributionMonthTransformNode()) - .addNext(new ResponseTimeDistributionMonthPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionHourPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionHourPersistenceWorker.java deleted file mode 100644 index 2b851fe3c95f50462d08d49976d37f7a323f6f91..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionHourPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global.std; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionHourPersistenceWorker extends MergePersistenceWorker { - - private ResponseTimeDistributionHourPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.RESPONSE_TIME_DISTRIBUTION_HOUR_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IResponseTimeDistributionHourPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ResponseTimeDistributionHourPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ResponseTimeDistributionHourPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ResponseTimeDistributionTable.TABLE + "/hour") - @Override protected void onWork(ResponseTimeDistribution input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionHourTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionHourTransformNode.java deleted file mode 100644 index 03948296b2eb814d5af5b153ede4a8a55c85e705..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionHourTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global.std; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionHourTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.RESPONSE_TIME_DISTRIBUTION_HOUR_TRANSFORM_NODE_ID; - } - - @Override - public void process(ResponseTimeDistribution responseTimeDistribution, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(responseTimeDistribution.getTimeBucket()); - - ResponseTimeDistribution newResponseTimeDistribution = ResponseTimeDistributionCopy.copy(responseTimeDistribution); - newResponseTimeDistribution.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + responseTimeDistribution.getMetricId()); - newResponseTimeDistribution.setTimeBucket(timeBucket); - next.execute(newResponseTimeDistribution); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionMinuteAggregationWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionMinuteAggregationWorker.java deleted file mode 100644 index df1601a6de34779604de3be534faa5009c1b657d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionMinuteAggregationWorker.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global.std; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.AggregationWorker; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionMinuteAggregationWorker extends AggregationWorker { - - private ResponseTimeDistributionMinuteAggregationWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.RESPONSE_TIME_DISTRIBUTION_MINUTE_AGGREGATION_WORKER_ID; - } - - public static class Factory extends AbstractLocalAsyncWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ResponseTimeDistributionMinuteAggregationWorker workerInstance(ModuleManager moduleManager) { - return new ResponseTimeDistributionMinuteAggregationWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/aggregation/onWork/" + ResponseTimeDistributionTable.TABLE) - @Override protected void onWork(ResponseTimeDistribution message) throws WorkerException { - super.onWork(message); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionMinutePersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionMinutePersistenceWorker.java deleted file mode 100644 index 9907f97965a15882f50322802501341a1be0d78d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionMinutePersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global.std; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionMinutePersistenceWorker extends MergePersistenceWorker { - - private ResponseTimeDistributionMinutePersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.RESPONSE_TIME_DISTRIBUTION_MINUTE_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IResponseTimeDistributionMinutePersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ResponseTimeDistributionMinutePersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ResponseTimeDistributionMinutePersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ResponseTimeDistributionTable.TABLE + "/minute") - @Override protected void onWork(ResponseTimeDistribution input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionMinuteRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionMinuteRemoteWorker.java deleted file mode 100644 index 49a83de838471a6535845ede86059f961be81116..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionMinuteRemoteWorker.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global.std; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.remote.service.Selector; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionMinuteRemoteWorker extends AbstractRemoteWorker { - - private ResponseTimeDistributionMinuteRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.RESPONSE_TIME_DISTRIBUTION_MINUTE_REMOTE_WORKER_ID; - } - - @Override protected void onWork(ResponseTimeDistribution responseTimeDistribution) { - onNext(responseTimeDistribution); - } - - @Override public Selector selector() { - return Selector.HashCode; - } - - public static class Factory extends AbstractRemoteWorkerProvider { - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public ResponseTimeDistributionMinuteRemoteWorker workerInstance(ModuleManager moduleManager) { - return new ResponseTimeDistributionMinuteRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionMonthPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionMonthPersistenceWorker.java deleted file mode 100644 index 72cc7d10ed1efa627f8d0b03a1965e82f66ab218..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionMonthPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global.std; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionMonthPersistenceWorker extends MergePersistenceWorker { - - private ResponseTimeDistributionMonthPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.RESPONSE_TIME_DISTRIBUTION_MONTH_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IResponseTimeDistributionMonthPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ResponseTimeDistributionMonthPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ResponseTimeDistributionMonthPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ResponseTimeDistributionTable.TABLE + "/month") - @Override protected void onWork(ResponseTimeDistribution input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionMonthTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionMonthTransformNode.java deleted file mode 100644 index 13f2f738c68c1c450b6ceea5a118235a43779256..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionMonthTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global.std; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionMonthTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.RESPONSE_TIME_DISTRIBUTION_MONTH_TRANSFORM_NODE_ID; - } - - @Override - public void process(ResponseTimeDistribution responseTimeDistribution, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(responseTimeDistribution.getTimeBucket()); - - ResponseTimeDistribution newResponseTimeDistribution = ResponseTimeDistributionCopy.copy(responseTimeDistribution); - newResponseTimeDistribution.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + responseTimeDistribution.getMetricId()); - newResponseTimeDistribution.setTimeBucket(timeBucket); - next.execute(newResponseTimeDistribution); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListener.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListener.java deleted file mode 100644 index e467d524469c55c8a7c7793699db7a894d246b72..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListener.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global.std; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.*; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.*; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IResponseTimeDistributionConfigService; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.graph.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionSpanListener implements FirstSpanListener { - - private static final Logger logger = LoggerFactory.getLogger(ResponseTimeDistributionSpanListener.class); - - private ResponseTimeDistribution distribution; - private final IResponseTimeDistributionConfigService configService; - - ResponseTimeDistributionSpanListener(ModuleManager moduleManager) { - this.distribution = new ResponseTimeDistribution(); - this.configService = moduleManager.find(ConfigurationModule.NAME).getService(IResponseTimeDistributionConfigService.class); - } - - @Override public boolean containsPoint(Point point) { - return Point.First.equals(point); - } - - @Override - public void parseFirst(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreInfo) { - int step = getStep((int)(segmentCoreInfo.getEndTime() - segmentCoreInfo.getStartTime())); - distribution.setStep(step); - distribution.setMetricId(String.valueOf(step)); - distribution.setId(segmentCoreInfo.getMinuteTimeBucket() + Const.ID_SPLIT + distribution.getMetricId()); - - distribution.setCalls(1); - distribution.setTimeBucket(segmentCoreInfo.getMinuteTimeBucket()); - - if (segmentCoreInfo.isError()) { - distribution.setErrorCalls(1); - } else { - distribution.setSuccessCalls(1); - } - } - - @Override public void build() { - Graph graph = GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.RESPONSE_TIME_DISTRIBUTION_GRAPH_ID, ResponseTimeDistribution.class); - graph.start(distribution); - logger.debug("push to response time distribution aggregation worker, id: {}", distribution.getId()); - } - - int getStep(int duration) { - int responseTimeStep = configService.getResponseTimeStep(); - int countOfResponseTimeSteps = configService.getCountOfResponseTimeSteps(); - int totalTimeOfResponseTimeSteps = configService.getTotalTimeOfResponseTimeSteps(); - - if (duration > totalTimeOfResponseTimeSteps) { - return countOfResponseTimeSteps; - } else if (duration <= responseTimeStep) { - return 0; - } else { - return (int) Math.ceil((double) duration / (double) responseTimeStep) - 1; - } - } - - public static class Factory implements SpanListenerFactory { - - @GraphComputingMetric(name = "/segment/parse/createSpanListeners/responseTimeDistributionSpanListener") - @Override public SpanListener create(ModuleManager moduleManager) { - return new ResponseTimeDistributionSpanListener(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/heartbeat/InstHeartBeatPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/heartbeat/InstHeartBeatPersistenceWorker.java deleted file mode 100644 index 2800046469dae2604d60a9298dd9ed7612fba373..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/heartbeat/InstHeartBeatPersistenceWorker.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.heartbeat; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.IInstanceHeartBeatPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.register.Instance; - -/** - * @author peng-yongsheng - */ -public class InstHeartBeatPersistenceWorker extends MergePersistenceWorker { - - private InstHeartBeatPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INST_HEART_BEAT_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IInstanceHeartBeatPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstHeartBeatPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new InstHeartBeatPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/instance/heartbeat") - @Override protected void onWork(Instance input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/heartbeat/InstanceHeartBeatPersistenceGraph.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/heartbeat/InstanceHeartBeatPersistenceGraph.java deleted file mode 100644 index 7eab8f0809929fbadc81543385eaeea3c58c7390..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/heartbeat/InstanceHeartBeatPersistenceGraph.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.heartbeat; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.table.register.Instance; - -/** - * @author peng-yongsheng - */ -public class InstanceHeartBeatPersistenceGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public InstanceHeartBeatPersistenceGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.INSTANCE_HEART_BEAT_PERSISTENCE_GRAPH_ID, Instance.class) - .addNode(new InstHeartBeatPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingCopy.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingCopy.java deleted file mode 100644 index 684d7a41808a56f03279dce56e76fd0a44480b6a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingCopy.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.mapping; - -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingCopy { - - public static InstanceMapping copy(InstanceMapping instanceMapping) { - InstanceMapping newInstanceMapping = new InstanceMapping(); - newInstanceMapping.setId(instanceMapping.getId()); - newInstanceMapping.setMetricId(instanceMapping.getMetricId()); - - newInstanceMapping.setApplicationId(instanceMapping.getApplicationId()); - newInstanceMapping.setInstanceId(instanceMapping.getInstanceId()); - newInstanceMapping.setAddressId(instanceMapping.getAddressId()); - newInstanceMapping.setTimeBucket(instanceMapping.getTimeBucket()); - return newInstanceMapping; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingDayPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingDayPersistenceWorker.java deleted file mode 100644 index 1b4bc296b5cde827ae353d3303a1986c0e4a46e9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingDayPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingDayPersistenceWorker extends MergePersistenceWorker { - - private InstanceMappingDayPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_MAPPING_DAY_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IInstanceMappingDayPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceMappingDayPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new InstanceMappingDayPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + InstanceMappingTable.TABLE + "/day") - @Override protected void onWork(InstanceMapping input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingDayTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingDayTransformNode.java deleted file mode 100644 index ce0c49c05ed2e5828719c8c6736072e11039ff0c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingDayTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingDayTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_MAPPING_DAY_TRANSFORM_NODE_ID; - } - - @Override public void process(InstanceMapping instanceMapping, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(instanceMapping.getTimeBucket()); - - InstanceMapping newInstanceMapping = InstanceMappingCopy.copy(instanceMapping); - newInstanceMapping.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + instanceMapping.getMetricId()); - newInstanceMapping.setTimeBucket(timeBucket); - next.execute(newInstanceMapping); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingGraph.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingGraph.java deleted file mode 100644 index 0d2cd1bda00557c29ae8a51be4a731e486a2ca33..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingGraph.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Node; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public InstanceMappingGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - Node remoteNode = GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.INSTANCE_MAPPING_GRAPH_ID, InstanceMapping.class) - .addNode(new InstanceMappingMinuteAggregationWorker.Factory(moduleManager).create(workerCreateListener)) - .addNext(new InstanceMappingMinuteRemoteWorker.Factory(moduleManager, remoteSenderService, MetricGraphIdDefine.INSTANCE_MAPPING_GRAPH_ID).create(workerCreateListener)); - - remoteNode.addNext(new InstanceMappingMinutePersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new InstanceMappingHourTransformNode()) - .addNext(new InstanceMappingHourPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new InstanceMappingDayTransformNode()) - .addNext(new InstanceMappingDayPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new InstanceMappingMonthTransformNode()) - .addNext(new InstanceMappingMonthPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingHourPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingHourPersistenceWorker.java deleted file mode 100644 index 6c9f25c258723d188e17c1705f933dde16b3b71e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingHourPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingHourPersistenceWorker extends MergePersistenceWorker { - - private InstanceMappingHourPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_MAPPING_HOUR_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IInstanceMappingHourPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceMappingHourPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new InstanceMappingHourPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + InstanceMappingTable.TABLE + "/hour") - @Override protected void onWork(InstanceMapping input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingHourTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingHourTransformNode.java deleted file mode 100644 index 5acc7c3899847b6a2391411c50139ad79d565b5d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingHourTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingHourTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_MAPPING_HOUR_TRANSFORM_NODE_ID; - } - - @Override public void process(InstanceMapping instanceMapping, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(instanceMapping.getTimeBucket()); - - InstanceMapping newInstanceMapping = InstanceMappingCopy.copy(instanceMapping); - newInstanceMapping.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + instanceMapping.getMetricId()); - newInstanceMapping.setTimeBucket(timeBucket); - next.execute(newInstanceMapping); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMinuteAggregationWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMinuteAggregationWorker.java deleted file mode 100644 index ec35a2c58b1c344b8dd6fa9f254ed5ac98965414..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMinuteAggregationWorker.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.AggregationWorker; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingMinuteAggregationWorker extends AggregationWorker { - - private InstanceMappingMinuteAggregationWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_MAPPING_MINUTE_AGGREGATION_WORKER_ID; - } - - public static class Factory extends AbstractLocalAsyncWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceMappingMinuteAggregationWorker workerInstance(ModuleManager moduleManager) { - return new InstanceMappingMinuteAggregationWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/aggregate/onWork/" + InstanceMappingTable.TABLE) - @Override protected void onWork(InstanceMapping message) throws WorkerException { - super.onWork(message); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMinutePersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMinutePersistenceWorker.java deleted file mode 100644 index 5655e58fd21b2730ac0d74bacdd11f29895a126d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMinutePersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingMinutePersistenceWorker extends MergePersistenceWorker { - - private InstanceMappingMinutePersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_MAPPING_MINUTE_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IInstanceMappingMinutePersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceMappingMinutePersistenceWorker workerInstance(ModuleManager moduleManager) { - return new InstanceMappingMinutePersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + InstanceMappingTable.TABLE + "/minute") - @Override protected void onWork(InstanceMapping input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMinuteRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMinuteRemoteWorker.java deleted file mode 100644 index c01ebee1e098aecaf0936acb3ca5d6c5ec8e018a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMinuteRemoteWorker.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.remote.service.Selector; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingMinuteRemoteWorker extends AbstractRemoteWorker { - - private InstanceMappingMinuteRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_MAPPING_MINUTE_REMOTE_WORKER_ID; - } - - @Override protected void onWork(InstanceMapping instanceMapping) { - onNext(instanceMapping); - } - - @Override public Selector selector() { - return Selector.HashCode; - } - - public static class Factory extends AbstractRemoteWorkerProvider { - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public InstanceMappingMinuteRemoteWorker workerInstance(ModuleManager moduleManager) { - return new InstanceMappingMinuteRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMonthPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMonthPersistenceWorker.java deleted file mode 100644 index 02ce3d14030a6a71d91693292c714aa71e3c522c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMonthPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingMonthPersistenceWorker extends MergePersistenceWorker { - - private InstanceMappingMonthPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_MAPPING_MONTH_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IInstanceMappingMonthPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceMappingMonthPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new InstanceMappingMonthPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + InstanceMappingTable.TABLE + "/month") - @Override protected void onWork(InstanceMapping input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMonthTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMonthTransformNode.java deleted file mode 100644 index 46cd3063194125b11e9fb256b2e80bffb47da527..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingMonthTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.mapping; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingMonthTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_MAPPING_MONTH_TRANSFORM_NODE_ID; - } - - @Override public void process(InstanceMapping instanceMapping, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(instanceMapping.getTimeBucket()); - - InstanceMapping newInstanceMapping = InstanceMappingCopy.copy(instanceMapping); - newInstanceMapping.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + instanceMapping.getMetricId()); - newInstanceMapping.setTimeBucket(timeBucket); - next.execute(newInstanceMapping); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingSpanListener.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingSpanListener.java deleted file mode 100644 index 8213a327eebbfbfa80dc386d67ce4ce291e2bba2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/mapping/InstanceMappingSpanListener.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.mapping; - -import java.util.*; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.*; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.*; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.graph.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingSpanListener implements EntrySpanListener { - - private static final Logger logger = LoggerFactory.getLogger(InstanceMappingSpanListener.class); - - private List instanceMappings = new LinkedList<>(); - - @Override public boolean containsPoint(Point point) { - return Point.Entry.equals(point); - } - - @Override public void parseEntry(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreInfo) { - if (logger.isDebugEnabled()) { - logger.debug("instance mapping listener parse reference"); - } - - if (spanDecorator.getRefsCount() > 0) { - for (int i = 0; i < spanDecorator.getRefsCount(); i++) { - InstanceMapping instanceMapping = new InstanceMapping(); - instanceMapping.setApplicationId(segmentCoreInfo.getApplicationId()); - instanceMapping.setInstanceId(segmentCoreInfo.getApplicationInstanceId()); - instanceMapping.setAddressId(spanDecorator.getRefs(i).getNetworkAddressId()); - String metricId = String.valueOf(segmentCoreInfo.getApplicationInstanceId()) + Const.ID_SPLIT + String.valueOf(instanceMapping.getAddressId()); - instanceMapping.setMetricId(metricId); - instanceMapping.setId(segmentCoreInfo.getMinuteTimeBucket() + Const.ID_SPLIT + instanceMapping.getMetricId()); - instanceMapping.setTimeBucket(segmentCoreInfo.getMinuteTimeBucket()); - instanceMappings.add(instanceMapping); - } - } - } - - @Override public void build() { - if (logger.isDebugEnabled()) { - logger.debug("instance mapping listener build"); - } - - Graph graph = GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.INSTANCE_MAPPING_GRAPH_ID, InstanceMapping.class); - instanceMappings.forEach(instanceMapping -> { - if (logger.isDebugEnabled()) { - logger.debug("push to instance mapping aggregation worker, id: {}", instanceMapping.getId()); - } - - graph.start(instanceMapping); - }); - } - - public static class Factory implements SpanListenerFactory { - - @GraphComputingMetric(name = "/segment/parse/createSpanListeners/instanceMappingSpanListener") - @Override public SpanListener create(ModuleManager moduleManager) { - return new InstanceMappingSpanListener(); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceDayMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceDayMetricPersistenceWorker.java deleted file mode 100644 index af209f668b0bf6d620a443b2ac09d3137435038b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceDayMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceDayMetricPersistenceWorker extends MergePersistenceWorker { - - private InstanceDayMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_DAY_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IInstanceDayMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceDayMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new InstanceDayMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + InstanceMetricTable.TABLE + "/day") - @Override protected void onWork(InstanceMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceDayMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceDayMetricTransformNode.java deleted file mode 100644 index 5d4859ebb7659f3d9d146a54ec33b0da226f4396..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceDayMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; - -/** - * @author peng-yongsheng - */ -public class InstanceDayMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_DAY_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(InstanceMetric instanceMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(instanceMetric.getTimeBucket()); - - InstanceMetric newInstanceMetric = InstanceMetricCopy.copy(instanceMetric); - newInstanceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + instanceMetric.getMetricId()); - newInstanceMetric.setTimeBucket(timeBucket); - next.execute(newInstanceMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceHourMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceHourMetricPersistenceWorker.java deleted file mode 100644 index bdda4d6ba87501e94b732846bb2688c85e600875..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceHourMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceHourMetricPersistenceWorker extends MergePersistenceWorker { - - private InstanceHourMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_HOUR_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IInstanceHourMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceHourMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new InstanceHourMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + InstanceMetricTable.TABLE + "/hour") - @Override protected void onWork(InstanceMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceHourMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceHourMetricTransformNode.java deleted file mode 100644 index ac947cc34859e3826208496b12486af011ec2c8d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceHourMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; - -/** - * @author peng-yongsheng - */ -public class InstanceHourMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_HOUR_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(InstanceMetric instanceMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(instanceMetric.getTimeBucket()); - - InstanceMetric newInstanceMetric = InstanceMetricCopy.copy(instanceMetric); - newInstanceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + instanceMetric.getMetricId()); - newInstanceMetric.setTimeBucket(timeBucket); - next.execute(newInstanceMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMetricCopy.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMetricCopy.java deleted file mode 100644 index 0c4c5142cca6fd1bdbba286b70e336ad51a2fe2e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMetricCopy.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.metric; - -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; - -/** - * @author peng-yongsheng - */ -public class InstanceMetricCopy { - - public static InstanceMetric copy(InstanceMetric instanceMetric) { - InstanceMetric newInstanceMetric = new InstanceMetric(); - newInstanceMetric.setId(instanceMetric.getId()); - newInstanceMetric.setMetricId(instanceMetric.getMetricId()); - newInstanceMetric.setSourceValue(instanceMetric.getSourceValue()); - - newInstanceMetric.setApplicationId(instanceMetric.getApplicationId()); - newInstanceMetric.setInstanceId(instanceMetric.getInstanceId()); - - newInstanceMetric.setTransactionCalls(instanceMetric.getTransactionCalls()); - newInstanceMetric.setTransactionDurationSum(instanceMetric.getTransactionDurationSum()); - newInstanceMetric.setTransactionErrorCalls(instanceMetric.getTransactionErrorCalls()); - newInstanceMetric.setTransactionErrorDurationSum(instanceMetric.getTransactionErrorDurationSum()); - - newInstanceMetric.setBusinessTransactionCalls(instanceMetric.getBusinessTransactionCalls()); - newInstanceMetric.setBusinessTransactionDurationSum(instanceMetric.getBusinessTransactionDurationSum()); - newInstanceMetric.setBusinessTransactionErrorCalls(instanceMetric.getBusinessTransactionErrorCalls()); - newInstanceMetric.setBusinessTransactionErrorDurationSum(instanceMetric.getBusinessTransactionErrorDurationSum()); - - newInstanceMetric.setMqTransactionCalls(instanceMetric.getMqTransactionCalls()); - newInstanceMetric.setMqTransactionDurationSum(instanceMetric.getMqTransactionDurationSum()); - newInstanceMetric.setMqTransactionErrorCalls(instanceMetric.getMqTransactionErrorCalls()); - newInstanceMetric.setMqTransactionErrorDurationSum(instanceMetric.getMqTransactionErrorDurationSum()); - - newInstanceMetric.setTimeBucket(instanceMetric.getTimeBucket()); - return newInstanceMetric; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMetricGraph.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMetricGraph.java deleted file mode 100644 index 68ff79a9d139dbf84fe2ed2be7123c1ba6ab0469..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMetricGraph.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.Node; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class InstanceMetricGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public InstanceMetricGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - Graph graph = GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.INSTANCE_METRIC_GRAPH_ID, InstanceReferenceMetric.class); - - Node remoteNode = graph.addNode(new InstanceMinuteMetricAggregationWorker.Factory(moduleManager).create(workerCreateListener)) - .addNext(new InstanceMinuteMetricRemoteWorker.Factory(moduleManager, remoteSenderService, MetricGraphIdDefine.INSTANCE_METRIC_GRAPH_ID).create(workerCreateListener)); - - remoteNode.addNext(new InstanceMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new InstanceHourMetricTransformNode()) - .addNext(new InstanceHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new InstanceDayMetricTransformNode()) - .addNext(new InstanceDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new InstanceMonthMetricTransformNode()) - .addNext(new InstanceMonthMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - link(graph); - } - - private void link(Graph graph) { - GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.INSTANCE_REFERENCE_METRIC_GRAPH_ID, InstanceReferenceMetric.class) - .toFinder().findNode(MetricWorkerIdDefine.INSTANCE_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID, InstanceReferenceMetric.class) - .addNext(new NodeProcessor() { - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_METRIC_GRAPH_BRIDGE_WORKER_ID; - } - - @Override - public void process(InstanceReferenceMetric instanceReferenceMetric, - Next next) { - graph.start(instanceReferenceMetric); - } - }); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMinuteMetricAggregationWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMinuteMetricAggregationWorker.java deleted file mode 100644 index 36ff02bf722ab35db8cdfd5be25e2b973bc31139..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMinuteMetricAggregationWorker.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.AggregationWorker; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class InstanceMinuteMetricAggregationWorker extends AggregationWorker { - - private InstanceMinuteMetricAggregationWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_MINUTE_METRIC_AGGREGATION_WORKER_ID; - } - - @Override protected InstanceMetric transform(InstanceReferenceMetric instanceReferenceMetric) { - String metricId = instanceReferenceMetric.getBehindInstanceId() + Const.ID_SPLIT + instanceReferenceMetric.getSourceValue(); - String id = instanceReferenceMetric.getTimeBucket() + Const.ID_SPLIT + metricId; - - InstanceMetric instanceMetric = new InstanceMetric(); - instanceMetric.setId(id); - instanceMetric.setMetricId(metricId); - - instanceMetric.setApplicationId(instanceReferenceMetric.getBehindApplicationId()); - instanceMetric.setInstanceId(instanceReferenceMetric.getBehindInstanceId()); - instanceMetric.setSourceValue(instanceReferenceMetric.getSourceValue()); - - instanceMetric.setTransactionCalls(instanceReferenceMetric.getTransactionCalls()); - instanceMetric.setTransactionErrorCalls(instanceReferenceMetric.getTransactionErrorCalls()); - instanceMetric.setTransactionDurationSum(instanceReferenceMetric.getTransactionDurationSum()); - instanceMetric.setTransactionErrorDurationSum(instanceReferenceMetric.getTransactionErrorDurationSum()); - - instanceMetric.setBusinessTransactionCalls(instanceReferenceMetric.getBusinessTransactionCalls()); - instanceMetric.setBusinessTransactionErrorCalls(instanceReferenceMetric.getBusinessTransactionErrorCalls()); - instanceMetric.setBusinessTransactionDurationSum(instanceReferenceMetric.getBusinessTransactionDurationSum()); - instanceMetric.setBusinessTransactionErrorDurationSum(instanceReferenceMetric.getBusinessTransactionErrorDurationSum()); - - instanceMetric.setMqTransactionCalls(instanceReferenceMetric.getMqTransactionCalls()); - instanceMetric.setMqTransactionErrorCalls(instanceReferenceMetric.getMqTransactionErrorCalls()); - instanceMetric.setMqTransactionDurationSum(instanceReferenceMetric.getMqTransactionDurationSum()); - instanceMetric.setMqTransactionErrorDurationSum(instanceReferenceMetric.getMqTransactionErrorDurationSum()); - - instanceMetric.setTimeBucket(instanceReferenceMetric.getTimeBucket()); - return instanceMetric; - } - - public static class Factory extends AbstractLocalAsyncWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceMinuteMetricAggregationWorker workerInstance(ModuleManager moduleManager) { - return new InstanceMinuteMetricAggregationWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/aggregate/onWork/" + InstanceMetricTable.TABLE) - @Override protected void onWork(InstanceReferenceMetric message) throws WorkerException { - super.onWork(message); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMinuteMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMinuteMetricPersistenceWorker.java deleted file mode 100644 index 3ed4e8c4d39ccc850343da6e748d4d827263728c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMinuteMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMinuteMetricPersistenceWorker extends MergePersistenceWorker { - - private InstanceMinuteMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IInstanceMinuteMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceMinuteMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new InstanceMinuteMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + InstanceMetricTable.TABLE + "/minute") - @Override protected void onWork(InstanceMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMinuteMetricRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMinuteMetricRemoteWorker.java deleted file mode 100644 index f311e12d437afaf71ca069cc0b3a70d23925945c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMinuteMetricRemoteWorker.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.remote.service.Selector; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; - -/** - * @author peng-yongsheng - */ -public class InstanceMinuteMetricRemoteWorker extends AbstractRemoteWorker { - - private InstanceMinuteMetricRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_MINUTE_METRIC_REMOTE_WORKER_ID; - } - - @Override public Selector selector() { - return Selector.HashCode; - } - - @Override protected void onWork(InstanceMetric instanceMetric) { - onNext(instanceMetric); - } - - public static class Factory extends AbstractRemoteWorkerProvider { - - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public InstanceMinuteMetricRemoteWorker workerInstance(ModuleManager moduleManager) { - return new InstanceMinuteMetricRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMonthMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMonthMetricPersistenceWorker.java deleted file mode 100644 index 09b7fd270c91bc464468c9b2069460e5bb40b789..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMonthMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMonthMetricPersistenceWorker extends MergePersistenceWorker { - - private InstanceMonthMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_MONTH_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IInstanceMonthMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceMonthMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new InstanceMonthMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + InstanceMetricTable.TABLE + "/month") - @Override protected void onWork(InstanceMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMonthMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMonthMetricTransformNode.java deleted file mode 100644 index 6bf9a83a6d80233aed4bb10cdc06b392a78c5d52..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/metric/InstanceMonthMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; - -/** - * @author peng-yongsheng - */ -public class InstanceMonthMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_MONTH_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(InstanceMetric instanceMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(instanceMetric.getTimeBucket()); - - InstanceMetric newInstanceMetric = InstanceMetricCopy.copy(instanceMetric); - newInstanceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + instanceMetric.getMetricId()); - newInstanceMetric.setTimeBucket(timeBucket); - next.execute(newInstanceMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceDayMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceDayMetricPersistenceWorker.java deleted file mode 100644 index 882101f6136257c356c80684ff42c68efcbdd0b1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceDayMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceDayMetricPersistenceWorker extends MergePersistenceWorker { - - private InstanceReferenceDayMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_REFERENCE_DAY_METRIC_PERSISTENCE_WORKER_ID; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IInstanceReferenceDayMetricPersistenceDAO.class); - } - - @Override protected boolean needMergeDBData() { - return true; - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceReferenceDayMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new InstanceReferenceDayMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + InstanceReferenceMetricTable.TABLE + "/day") - @Override protected void onWork(InstanceReferenceMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceDayMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceDayMetricTransformNode.java deleted file mode 100644 index 0fa8e9d265be4f170d34babedec0409f367cbce6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceDayMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceDayMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_REFERENCE_DAY_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(InstanceReferenceMetric instanceReferenceMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(instanceReferenceMetric.getTimeBucket()); - - InstanceReferenceMetric newInstanceReferenceMetric = InstanceReferenceMetricCopy.copy(instanceReferenceMetric); - newInstanceReferenceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + instanceReferenceMetric.getMetricId()); - newInstanceReferenceMetric.setTimeBucket(timeBucket); - next.execute(newInstanceReferenceMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceHourMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceHourMetricPersistenceWorker.java deleted file mode 100644 index 9303b0cb1d800eb203e4c8c3da68d859cf1e1331..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceHourMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceHourMetricPersistenceWorker extends MergePersistenceWorker { - - private InstanceReferenceHourMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_REFERENCE_HOUR_METRIC_PERSISTENCE_WORKER_ID; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IInstanceReferenceHourMetricPersistenceDAO.class); - } - - @Override protected boolean needMergeDBData() { - return true; - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceReferenceHourMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new InstanceReferenceHourMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + InstanceReferenceMetricTable.TABLE + "/hour") - @Override protected void onWork(InstanceReferenceMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceHourMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceHourMetricTransformNode.java deleted file mode 100644 index 363506200a34cea2288231dad3572f55d3820c06..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceHourMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceHourMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_REFERENCE_HOUR_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(InstanceReferenceMetric instanceReferenceMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(instanceReferenceMetric.getTimeBucket()); - - InstanceReferenceMetric newInstanceReferenceMetric = InstanceReferenceMetricCopy.copy(instanceReferenceMetric); - newInstanceReferenceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + instanceReferenceMetric.getMetricId()); - newInstanceReferenceMetric.setTimeBucket(timeBucket); - next.execute(newInstanceReferenceMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMetricCopy.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMetricCopy.java deleted file mode 100644 index 5a3457003a37c1d81a764bcde54b0d44e5a3f50c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMetricCopy.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.refmetric; - -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMetricCopy { - - public static InstanceReferenceMetric copy(InstanceReferenceMetric instanceReferenceMetric) { - InstanceReferenceMetric newInstanceReferenceMetric = new InstanceReferenceMetric(); - newInstanceReferenceMetric.setId(instanceReferenceMetric.getId()); - newInstanceReferenceMetric.setMetricId(instanceReferenceMetric.getMetricId()); - newInstanceReferenceMetric.setSourceValue(instanceReferenceMetric.getSourceValue()); - - newInstanceReferenceMetric.setFrontApplicationId(instanceReferenceMetric.getFrontApplicationId()); - newInstanceReferenceMetric.setFrontInstanceId(instanceReferenceMetric.getFrontInstanceId()); - newInstanceReferenceMetric.setBehindApplicationId(instanceReferenceMetric.getBehindApplicationId()); - newInstanceReferenceMetric.setBehindInstanceId(instanceReferenceMetric.getBehindInstanceId()); - - newInstanceReferenceMetric.setTransactionCalls(instanceReferenceMetric.getTransactionCalls()); - newInstanceReferenceMetric.setTransactionDurationSum(instanceReferenceMetric.getTransactionDurationSum()); - newInstanceReferenceMetric.setTransactionErrorCalls(instanceReferenceMetric.getTransactionErrorCalls()); - newInstanceReferenceMetric.setTransactionErrorDurationSum(instanceReferenceMetric.getTransactionErrorDurationSum()); - - newInstanceReferenceMetric.setBusinessTransactionCalls(instanceReferenceMetric.getBusinessTransactionCalls()); - newInstanceReferenceMetric.setBusinessTransactionDurationSum(instanceReferenceMetric.getBusinessTransactionDurationSum()); - newInstanceReferenceMetric.setBusinessTransactionErrorCalls(instanceReferenceMetric.getBusinessTransactionErrorCalls()); - newInstanceReferenceMetric.setBusinessTransactionErrorDurationSum(instanceReferenceMetric.getBusinessTransactionErrorDurationSum()); - - newInstanceReferenceMetric.setMqTransactionCalls(instanceReferenceMetric.getMqTransactionCalls()); - newInstanceReferenceMetric.setMqTransactionDurationSum(instanceReferenceMetric.getMqTransactionDurationSum()); - newInstanceReferenceMetric.setMqTransactionErrorCalls(instanceReferenceMetric.getMqTransactionErrorCalls()); - newInstanceReferenceMetric.setMqTransactionErrorDurationSum(instanceReferenceMetric.getMqTransactionErrorDurationSum()); - - newInstanceReferenceMetric.setTimeBucket(instanceReferenceMetric.getTimeBucket()); - - return newInstanceReferenceMetric; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMetricGraph.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMetricGraph.java deleted file mode 100644 index 8a9fa79ae559ed1d1629afa5bde7f878135b09fb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMetricGraph.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.Node; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMetricGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public InstanceReferenceMetricGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - Graph graph = GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.INSTANCE_REFERENCE_METRIC_GRAPH_ID, ServiceReferenceMetric.class); - - Node remoteNode = graph.addNode(new InstanceReferenceMinuteMetricAggregationWorker.Factory(moduleManager).create(workerCreateListener)) - .addNext(new InstanceReferenceMinuteMetricRemoteWorker.Factory(moduleManager, remoteSenderService, MetricGraphIdDefine.INSTANCE_REFERENCE_METRIC_GRAPH_ID).create(workerCreateListener)); - - remoteNode.addNext(new InstanceReferenceMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new InstanceReferenceHourMetricTransformNode()) - .addNext(new InstanceReferenceHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new InstanceReferenceDayMetricTransformNode()) - .addNext(new InstanceReferenceDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new InstanceReferenceMonthMetricTransformNode()) - .addNext(new InstanceReferenceMonthMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - link(graph); - } - - private void link(Graph graph) { - GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.SERVICE_REFERENCE_METRIC_GRAPH_ID, ServiceReferenceMetric.class) - .toFinder().findNode(MetricWorkerIdDefine.SERVICE_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID, ServiceReferenceMetric.class) - .addNext(new NodeProcessor() { - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_REFERENCE_GRAPH_BRIDGE_WORKER_ID; - } - - @Override - public void process(ServiceReferenceMetric serviceReferenceMetric, Next next) { - graph.start(serviceReferenceMetric); - } - }); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMinuteMetricAggregationWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMinuteMetricAggregationWorker.java deleted file mode 100644 index 7604f7bef3009e70e2dffc90b5b5a29aa05fc6c4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMinuteMetricAggregationWorker.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.AggregationWorker; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMinuteMetricAggregationWorker extends AggregationWorker { - - private InstanceReferenceMinuteMetricAggregationWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID; - } - - @Override protected InstanceReferenceMetric transform(ServiceReferenceMetric serviceReferenceMetric) { - String metricId = serviceReferenceMetric.getFrontInstanceId() - + Const.ID_SPLIT + serviceReferenceMetric.getBehindInstanceId() - + Const.ID_SPLIT + serviceReferenceMetric.getSourceValue(); - - String id = serviceReferenceMetric.getTimeBucket() - + Const.ID_SPLIT + metricId; - - InstanceReferenceMetric instanceReferenceMetric = new InstanceReferenceMetric(); - instanceReferenceMetric.setId(id); - instanceReferenceMetric.setMetricId(metricId); - instanceReferenceMetric.setFrontApplicationId(serviceReferenceMetric.getFrontApplicationId()); - instanceReferenceMetric.setFrontInstanceId(serviceReferenceMetric.getFrontInstanceId()); - instanceReferenceMetric.setBehindApplicationId(serviceReferenceMetric.getBehindApplicationId()); - instanceReferenceMetric.setBehindInstanceId(serviceReferenceMetric.getBehindInstanceId()); - instanceReferenceMetric.setSourceValue(serviceReferenceMetric.getSourceValue()); - - instanceReferenceMetric.setTransactionCalls(serviceReferenceMetric.getTransactionCalls()); - instanceReferenceMetric.setTransactionErrorCalls(serviceReferenceMetric.getTransactionErrorCalls()); - instanceReferenceMetric.setTransactionDurationSum(serviceReferenceMetric.getTransactionDurationSum()); - instanceReferenceMetric.setTransactionErrorDurationSum(serviceReferenceMetric.getTransactionErrorDurationSum()); - - instanceReferenceMetric.setBusinessTransactionCalls(serviceReferenceMetric.getBusinessTransactionCalls()); - instanceReferenceMetric.setBusinessTransactionErrorCalls(serviceReferenceMetric.getBusinessTransactionErrorCalls()); - instanceReferenceMetric.setBusinessTransactionDurationSum(serviceReferenceMetric.getBusinessTransactionDurationSum()); - instanceReferenceMetric.setBusinessTransactionErrorDurationSum(serviceReferenceMetric.getBusinessTransactionErrorDurationSum()); - - instanceReferenceMetric.setMqTransactionCalls(serviceReferenceMetric.getMqTransactionCalls()); - instanceReferenceMetric.setMqTransactionErrorCalls(serviceReferenceMetric.getMqTransactionErrorCalls()); - instanceReferenceMetric.setMqTransactionDurationSum(serviceReferenceMetric.getMqTransactionDurationSum()); - instanceReferenceMetric.setMqTransactionErrorDurationSum(serviceReferenceMetric.getMqTransactionErrorDurationSum()); - - instanceReferenceMetric.setTimeBucket(serviceReferenceMetric.getTimeBucket()); - return instanceReferenceMetric; - } - - public static class Factory extends AbstractLocalAsyncWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceReferenceMinuteMetricAggregationWorker workerInstance(ModuleManager moduleManager) { - return new InstanceReferenceMinuteMetricAggregationWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/aggregate/onWork/" + InstanceReferenceMetricTable.TABLE) - @Override protected void onWork(ServiceReferenceMetric message) throws WorkerException { - super.onWork(message); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMinuteMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMinuteMetricPersistenceWorker.java deleted file mode 100644 index 5cde21c5a822505438246c77c5b2939f88135a49..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMinuteMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMinuteMetricPersistenceWorker extends MergePersistenceWorker { - - private InstanceReferenceMinuteMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IInstanceReferenceMinuteMetricPersistenceDAO.class); - } - - @Override protected boolean needMergeDBData() { - return true; - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceReferenceMinuteMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new InstanceReferenceMinuteMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + InstanceReferenceMetricTable.TABLE + "/minute") - @Override protected void onWork(InstanceReferenceMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMinuteMetricRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMinuteMetricRemoteWorker.java deleted file mode 100644 index 3d528d55a93a1c50df4dc08ea232248d9f2568c5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMinuteMetricRemoteWorker.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.remote.service.Selector; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMinuteMetricRemoteWorker extends AbstractRemoteWorker { - - private InstanceReferenceMinuteMetricRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_REFERENCE_MINUTE_METRIC_REMOTE_WORKER_ID; - } - - @Override public Selector selector() { - return Selector.HashCode; - } - - @Override protected void onWork(InstanceReferenceMetric instanceReferenceMetric) { - onNext(instanceReferenceMetric); - } - - public static class Factory extends AbstractRemoteWorkerProvider { - - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public InstanceReferenceMinuteMetricRemoteWorker workerInstance(ModuleManager moduleManager) { - return new InstanceReferenceMinuteMetricRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMonthMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMonthMetricPersistenceWorker.java deleted file mode 100644 index e0732e97fc30a69a309b29ba206b1feb584dd28f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMonthMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMonthMetricPersistenceWorker extends MergePersistenceWorker { - - private InstanceReferenceMonthMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_REFERENCE_MONTH_METRIC_PERSISTENCE_WORKER_ID; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IInstanceReferenceMonthMetricPersistenceDAO.class); - } - - @Override protected boolean needMergeDBData() { - return true; - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceReferenceMonthMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new InstanceReferenceMonthMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + InstanceReferenceMetricTable.TABLE + "/month") - @Override protected void onWork(InstanceReferenceMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMonthMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMonthMetricTransformNode.java deleted file mode 100644 index dfad097ccce14620c3f2051a70dcd89fc16ebe15..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/instance/refmetric/InstanceReferenceMonthMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.instance.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMonthMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.INSTANCE_REFERENCE_MONTH_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(InstanceReferenceMetric instanceReferenceMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(instanceReferenceMetric.getTimeBucket()); - - InstanceReferenceMetric newInstanceReferenceMetric = InstanceReferenceMetricCopy.copy(instanceReferenceMetric); - newInstanceReferenceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + instanceReferenceMetric.getMetricId()); - newInstanceReferenceMetric.setTimeBucket(timeBucket); - next.execute(newInstanceReferenceMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/segment/SegmentDurationGraph.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/segment/SegmentDurationGraph.java deleted file mode 100644 index af8fd2813df137d0c2622397615ef4608055d4f9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/segment/SegmentDurationGraph.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.segment; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentDuration; - -/** - * @author peng-yongsheng - */ -public class SegmentDurationGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public SegmentDurationGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.SEGMENT_DURATION_GRAPH_ID, SegmentDuration.class) - .addNode(new SegmentDurationPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/segment/SegmentDurationPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/segment/SegmentDurationPersistenceWorker.java deleted file mode 100644 index 03299dd8491b6f6371cd7520d06267a4775b6b63..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/segment/SegmentDurationPersistenceWorker.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.segment; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.*; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ISegmentDurationPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.segment.*; - -/** - * @author peng-yongsheng - */ -public class SegmentDurationPersistenceWorker extends NonMergePersistenceWorker { - - private SegmentDurationPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.SEGMENT_DURATION_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return false; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(ISegmentDurationPersistenceDAO.class); - } - - public static class Factory extends NonMergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public SegmentDurationPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new SegmentDurationPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + SegmentDurationTable.TABLE) - @Override protected void onWork(SegmentDuration input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/segment/SegmentDurationSpanListener.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/segment/SegmentDurationSpanListener.java deleted file mode 100644 index c9e7b1371d155fcc08f68c1f3336f23071445ceb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/segment/SegmentDurationSpanListener.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.segment; - -import java.util.*; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.*; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.*; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.graph.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.*; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentDuration; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class SegmentDurationSpanListener implements FirstSpanListener, EntrySpanListener { - - private static final Logger logger = LoggerFactory.getLogger(SegmentDurationSpanListener.class); - - private final SegmentDuration segmentDuration; - private final ServiceNameCacheService serviceNameCacheService; - private Set entryOperationNameIds; - private int firstOperationNameId = 0; - - private SegmentDurationSpanListener(ModuleManager moduleManager) { - this.segmentDuration = new SegmentDuration(); - this.entryOperationNameIds = new HashSet<>(); - this.serviceNameCacheService = moduleManager.find(CacheModule.NAME).getService(ServiceNameCacheService.class); - } - - @Override public boolean containsPoint(Point point) { - return Point.First.equals(point) || Point.Entry.equals(point); - } - - @Override - public void parseFirst(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreInfo) { - long timeBucket = TimeBucketUtils.INSTANCE.getSecondTimeBucket(segmentCoreInfo.getStartTime()); - - segmentDuration.setId(segmentCoreInfo.getSegmentId()); - segmentDuration.setTraceId(segmentCoreInfo.getTraceId()); - segmentDuration.setSegmentId(segmentCoreInfo.getSegmentId()); - segmentDuration.setApplicationId(segmentCoreInfo.getApplicationId()); - segmentDuration.setDuration(segmentCoreInfo.getEndTime() - segmentCoreInfo.getStartTime()); - segmentDuration.setStartTime(segmentCoreInfo.getStartTime()); - segmentDuration.setEndTime(segmentCoreInfo.getEndTime()); - segmentDuration.setIsError(BooleanUtils.booleanToValue(segmentCoreInfo.isError())); - segmentDuration.setTimeBucket(timeBucket); - - firstOperationNameId = spanDecorator.getOperationNameId(); - } - - @Override public void parseEntry(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreInfo) { - entryOperationNameIds.add(spanDecorator.getOperationNameId()); - } - - @Override public void build() { - Graph graph = GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.SEGMENT_DURATION_GRAPH_ID, SegmentDuration.class); - - if (logger.isDebugEnabled()) { - logger.debug("segment duration listener build"); - } - - if (entryOperationNameIds.size() == 0) { - segmentDuration.getServiceName().add(serviceNameCacheService.get(firstOperationNameId).getServiceName()); - } else { - entryOperationNameIds.forEach(entryOperationNameId -> segmentDuration.getServiceName().add(serviceNameCacheService.get(entryOperationNameId).getServiceName())); - } - - graph.start(segmentDuration); - } - - public static class Factory implements SpanListenerFactory { - - @GraphComputingMetric(name = "/segment/parse/createSpanListeners/segmentDurationSpanListener") - @Override public SpanListener create(ModuleManager moduleManager) { - return new SegmentDurationSpanListener(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/heartbeat/ServiceNameAggregationWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/heartbeat/ServiceNameAggregationWorker.java deleted file mode 100644 index ed5c7d7b3fa11a687e45335c79162c272ca867b2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/heartbeat/ServiceNameAggregationWorker.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.heartbeat; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.*; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.AggregationWorker; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.table.register.*; - -/** - * @author peng-yongsheng - */ -public class ServiceNameAggregationWorker extends AggregationWorker { - - private ServiceNameAggregationWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_NAME_HEART_BEAT_AGGREGATION_WORKER_ID; - } - - public static class Factory extends AbstractLocalAsyncWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceNameAggregationWorker workerInstance(ModuleManager moduleManager) { - return new ServiceNameAggregationWorker(moduleManager); - } - - @Override public int queueSize() { - return 4096; - } - } - - @GraphComputingMetric(name = "/aggregate/onWork/" + ServiceNameTable.TABLE) - @Override protected void onWork(ServiceName message) throws WorkerException { - super.onWork(message); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/heartbeat/ServiceNameHeartBeatGraph.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/heartbeat/ServiceNameHeartBeatGraph.java deleted file mode 100644 index 68939f7fde92addb8cc18d7d2a6fe17d56dc58c8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/heartbeat/ServiceNameHeartBeatGraph.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.heartbeat; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; - -/** - * @author peng-yongsheng - */ -public class ServiceNameHeartBeatGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public ServiceNameHeartBeatGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - Graph graph = GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.SERVICE_HEART_BEAT_PERSISTENCE_GRAPH_ID, ServiceName.class); - - graph.addNode(new ServiceNameAggregationWorker.Factory(moduleManager).create(workerCreateListener)) - .addNext(new ServiceNameHeartBeatRemoteWorker.Factory(moduleManager, remoteSenderService, MetricGraphIdDefine.SERVICE_HEART_BEAT_PERSISTENCE_GRAPH_ID).create(workerCreateListener)) - .addNext(new ServiceNameHeartBeatPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/heartbeat/ServiceNameHeartBeatPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/heartbeat/ServiceNameHeartBeatPersistenceWorker.java deleted file mode 100644 index 2c2b6f18d508a8d7a61a6ff320a0eaf1c28149e1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/heartbeat/ServiceNameHeartBeatPersistenceWorker.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.heartbeat; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.*; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.IServiceNameHeartBeatPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; - -/** - * @author peng-yongsheng - */ -public class ServiceNameHeartBeatPersistenceWorker extends MergePersistenceWorker { - - private ServiceNameHeartBeatPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_NAME_HEART_BEAT_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IServiceNameHeartBeatPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceNameHeartBeatPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ServiceNameHeartBeatPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 4096; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/serviceName/heartbeat") - @Override protected void onWork(ServiceName input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/heartbeat/ServiceNameHeartBeatRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/heartbeat/ServiceNameHeartBeatRemoteWorker.java deleted file mode 100644 index 968cf17e32bd85590665fb4783e0ca40320fc761..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/heartbeat/ServiceNameHeartBeatRemoteWorker.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.heartbeat; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.*; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; - -/** - * @author peng-yongsheng - */ -public class ServiceNameHeartBeatRemoteWorker extends AbstractRemoteWorker { - - private ServiceNameHeartBeatRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_NAME_HEART_BEAT_REMOTE_WORKER_ID; - } - - @Override protected void onWork(ServiceName serviceName) { - onNext(serviceName); - } - - @Override public Selector selector() { - return Selector.HashCode; - } - - public static class Factory extends AbstractRemoteWorkerProvider { - - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public ServiceNameHeartBeatRemoteWorker workerInstance(ModuleManager moduleManager) { - return new ServiceNameHeartBeatRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/heartbeat/ServiceNameSpanListener.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/heartbeat/ServiceNameSpanListener.java deleted file mode 100644 index 261f163ece8505cf87183817b92a4790baefee9e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/heartbeat/ServiceNameSpanListener.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.heartbeat; - -import java.util.*; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.*; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.*; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.graph.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; - -/** - * @author peng-yongsheng - */ -public class ServiceNameSpanListener implements EntrySpanListener, ExitSpanListener, LocalSpanListener { - - private final List serviceNames; - - private ServiceNameSpanListener() { - this.serviceNames = new LinkedList<>(); - } - - @Override public boolean containsPoint(Point point) { - return Point.Entry.equals(point) || Point.Exit.equals(point) || Point.Local.equals(point); - } - - @Override public void parseEntry(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreInfo) { - ServiceName serviceName = new ServiceName(); - serviceName.setId(String.valueOf(spanDecorator.getOperationNameId())); - serviceName.setHeartBeatTime(segmentCoreInfo.getStartTime()); - serviceNames.add(serviceName); - - for (int i = 0; i < spanDecorator.getRefsCount(); i++) { - ReferenceDecorator referenceDecorator = spanDecorator.getRefs(i); - - ServiceName entryServiceName = new ServiceName(); - entryServiceName.setId(String.valueOf(referenceDecorator.getEntryServiceId())); - entryServiceName.setHeartBeatTime(segmentCoreInfo.getStartTime()); - serviceNames.add(entryServiceName); - - ServiceName parentServiceName = new ServiceName(); - parentServiceName.setId(String.valueOf(referenceDecorator.getParentServiceId())); - parentServiceName.setHeartBeatTime(segmentCoreInfo.getStartTime()); - serviceNames.add(parentServiceName); - } - } - - @Override public void parseExit(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreInfo) { - ServiceName serviceName = new ServiceName(); - serviceName.setId(String.valueOf(spanDecorator.getOperationNameId())); - serviceName.setHeartBeatTime(segmentCoreInfo.getStartTime()); - serviceNames.add(serviceName); - } - - @Override public void parseLocal(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreInfo) { - ServiceName serviceName = new ServiceName(); - serviceName.setId(String.valueOf(spanDecorator.getOperationNameId())); - serviceName.setHeartBeatTime(segmentCoreInfo.getStartTime()); - serviceNames.add(serviceName); - } - - @Override public void build() { - Graph graph = GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.SERVICE_HEART_BEAT_PERSISTENCE_GRAPH_ID, ServiceName.class); - serviceNames.forEach(graph::start); - } - - public static class Factory implements SpanListenerFactory { - - @GraphComputingMetric(name = "/segment/parse/createSpanListeners/serviceNameSpanListener") - @Override public SpanListener create(ModuleManager moduleManager) { - return new ServiceNameSpanListener(); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceDayMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceDayMetricPersistenceWorker.java deleted file mode 100644 index fb5323978e17b3ea7f7d4b957d2120c9bdb5546e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceDayMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceDayMetricPersistenceWorker extends MergePersistenceWorker { - - private ServiceDayMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_DAY_METRIC_PERSISTENCE_WORKER_ID; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IServiceDayMetricPersistenceDAO.class); - } - - @Override protected boolean needMergeDBData() { - return true; - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceDayMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ServiceDayMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ServiceMetricTable.TABLE + "/day") - @Override protected void onWork(ServiceMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceDayMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceDayMetricTransformNode.java deleted file mode 100644 index fcffa5ec79ad5af5eb8f3184de316100869569c7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceDayMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; - -/** - * @author peng-yongsheng - */ -public class ServiceDayMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_DAY_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(ServiceMetric serviceMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(serviceMetric.getTimeBucket()); - - ServiceMetric newServiceMetric = ServiceMetricCopy.copy(serviceMetric); - newServiceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + serviceMetric.getMetricId()); - newServiceMetric.setTimeBucket(timeBucket); - next.execute(newServiceMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceHourMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceHourMetricPersistenceWorker.java deleted file mode 100644 index 2e5f5b6bc60fab548aad1769cdf5e9026b662118..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceHourMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceHourMetricPersistenceWorker extends MergePersistenceWorker { - - private ServiceHourMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_HOUR_METRIC_PERSISTENCE_WORKER_ID; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IServiceHourMetricPersistenceDAO.class); - } - - @Override protected boolean needMergeDBData() { - return true; - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceHourMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ServiceHourMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ServiceMetricTable.TABLE + "/hour") - @Override protected void onWork(ServiceMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceHourMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceHourMetricTransformNode.java deleted file mode 100644 index 6495f43403f0e64acb5c6df26ed81cefe75940df..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceHourMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; - -/** - * @author peng-yongsheng - */ -public class ServiceHourMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_HOUR_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(ServiceMetric serviceMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(serviceMetric.getTimeBucket()); - - ServiceMetric newServiceMetric = ServiceMetricCopy.copy(serviceMetric); - newServiceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + serviceMetric.getMetricId()); - newServiceMetric.setTimeBucket(timeBucket); - next.execute(newServiceMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMetricCopy.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMetricCopy.java deleted file mode 100644 index cda3db58d88518464e44ef965544caab7ded3da3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMetricCopy.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.metric; - -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; - -/** - * @author peng-yongsheng - */ -public class ServiceMetricCopy { - - public static ServiceMetric copy(ServiceMetric serviceMetric) { - ServiceMetric newServiceMetric = new ServiceMetric(); - newServiceMetric.setId(serviceMetric.getId()); - newServiceMetric.setMetricId(serviceMetric.getMetricId()); - newServiceMetric.setSourceValue(serviceMetric.getSourceValue()); - - newServiceMetric.setApplicationId(serviceMetric.getApplicationId()); - newServiceMetric.setInstanceId(serviceMetric.getInstanceId()); - newServiceMetric.setServiceId(serviceMetric.getServiceId()); - - newServiceMetric.setTransactionCalls(serviceMetric.getTransactionCalls()); - newServiceMetric.setTransactionDurationSum(serviceMetric.getTransactionDurationSum()); - newServiceMetric.setTransactionErrorCalls(serviceMetric.getTransactionErrorCalls()); - newServiceMetric.setTransactionErrorDurationSum(serviceMetric.getTransactionErrorDurationSum()); - - newServiceMetric.setBusinessTransactionCalls(serviceMetric.getBusinessTransactionCalls()); - newServiceMetric.setBusinessTransactionDurationSum(serviceMetric.getBusinessTransactionDurationSum()); - newServiceMetric.setBusinessTransactionErrorCalls(serviceMetric.getBusinessTransactionErrorCalls()); - newServiceMetric.setBusinessTransactionErrorDurationSum(serviceMetric.getBusinessTransactionErrorDurationSum()); - - newServiceMetric.setMqTransactionCalls(serviceMetric.getMqTransactionCalls()); - newServiceMetric.setMqTransactionDurationSum(serviceMetric.getMqTransactionDurationSum()); - newServiceMetric.setMqTransactionErrorCalls(serviceMetric.getMqTransactionErrorCalls()); - newServiceMetric.setMqTransactionErrorDurationSum(serviceMetric.getMqTransactionErrorDurationSum()); - - newServiceMetric.setTimeBucket(serviceMetric.getTimeBucket()); - - return newServiceMetric; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMetricGraph.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMetricGraph.java deleted file mode 100644 index 84f62691a12b60ce2a8b3b1b882f8f4d960e6deb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMetricGraph.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.Node; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ServiceMetricGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public ServiceMetricGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - Graph graph = GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.SERVICE_METRIC_GRAPH_ID, ServiceReferenceMetric.class); - - Node remoteNode = graph.addNode(new ServiceMetricMinuteAggregationWorker.Factory(moduleManager).create(workerCreateListener)) - .addNext(new ServiceMinuteMetricRemoteWorker.Factory(moduleManager, remoteSenderService, MetricGraphIdDefine.SERVICE_METRIC_GRAPH_ID).create(workerCreateListener)); - - remoteNode.addNext(new ServiceMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ServiceHourMetricTransformNode()) - .addNext(new ServiceHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ServiceDayMetricTransformNode()) - .addNext(new ServiceDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ServiceMonthMetricTransformNode()) - .addNext(new ServiceMonthMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - link(graph); - } - - private void link(Graph graph) { - GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.SERVICE_REFERENCE_METRIC_GRAPH_ID, ServiceReferenceMetric.class) - .toFinder().findNode(MetricWorkerIdDefine.SERVICE_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID, ServiceReferenceMetric.class) - .addNext(new NodeProcessor() { - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_METRIC_GRAPH_BRIDGE_WORKER_ID; - } - - @Override - public void process(ServiceReferenceMetric serviceReferenceMetric, Next next) { - graph.start(serviceReferenceMetric); - } - }); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMetricMinuteAggregationWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMetricMinuteAggregationWorker.java deleted file mode 100644 index ad7685d04a046d2fc54797c4eb96840062e05a38..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMetricMinuteAggregationWorker.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.AggregationWorker; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ServiceMetricMinuteAggregationWorker extends AggregationWorker { - - private ServiceMetricMinuteAggregationWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_MINUTE_METRIC_AGGREGATION_WORKER_ID; - } - - @Override protected ServiceMetric transform(ServiceReferenceMetric serviceReferenceMetric) { - Integer serviceId = serviceReferenceMetric.getBehindServiceId(); - Long timeBucket = serviceReferenceMetric.getTimeBucket(); - Integer sourceValue = serviceReferenceMetric.getSourceValue(); - - String metricId = String.valueOf(serviceId) + Const.ID_SPLIT + String.valueOf(sourceValue); - String id = String.valueOf(timeBucket) + Const.ID_SPLIT + metricId; - - ServiceMetric serviceMetric = new ServiceMetric(); - serviceMetric.setId(id); - serviceMetric.setMetricId(metricId); - - serviceMetric.setApplicationId(serviceReferenceMetric.getBehindApplicationId()); - serviceMetric.setInstanceId(serviceReferenceMetric.getBehindInstanceId()); - serviceMetric.setServiceId(serviceId); - serviceMetric.setSourceValue(sourceValue); - - serviceMetric.setTransactionCalls(serviceReferenceMetric.getTransactionCalls()); - serviceMetric.setTransactionDurationSum(serviceReferenceMetric.getTransactionDurationSum()); - serviceMetric.setTransactionErrorCalls(serviceReferenceMetric.getTransactionErrorCalls()); - serviceMetric.setTransactionErrorDurationSum(serviceReferenceMetric.getTransactionErrorDurationSum()); - - serviceMetric.setBusinessTransactionCalls(serviceReferenceMetric.getBusinessTransactionCalls()); - serviceMetric.setBusinessTransactionDurationSum(serviceReferenceMetric.getBusinessTransactionDurationSum()); - serviceMetric.setBusinessTransactionErrorCalls(serviceReferenceMetric.getBusinessTransactionErrorCalls()); - serviceMetric.setBusinessTransactionErrorDurationSum(serviceReferenceMetric.getBusinessTransactionErrorDurationSum()); - - serviceMetric.setMqTransactionCalls(serviceReferenceMetric.getMqTransactionCalls()); - serviceMetric.setMqTransactionDurationSum(serviceReferenceMetric.getMqTransactionDurationSum()); - serviceMetric.setMqTransactionErrorCalls(serviceReferenceMetric.getMqTransactionErrorCalls()); - serviceMetric.setMqTransactionErrorDurationSum(serviceReferenceMetric.getMqTransactionErrorDurationSum()); - - serviceMetric.setTimeBucket(timeBucket); - - return serviceMetric; - } - - public static class Factory extends AbstractLocalAsyncWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceMetricMinuteAggregationWorker workerInstance(ModuleManager moduleManager) { - return new ServiceMetricMinuteAggregationWorker(moduleManager); - } - - @Override public int queueSize() { - return 256; - } - } - - @GraphComputingMetric(name = "/aggregate/onWork/" + ServiceMetricTable.TABLE) - @Override protected void onWork(ServiceReferenceMetric message) throws WorkerException { - super.onWork(message); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMinuteMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMinuteMetricPersistenceWorker.java deleted file mode 100644 index afb213b65e20f2c87a530927f86960210ad55a70..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMinuteMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceMinuteMetricPersistenceWorker extends MergePersistenceWorker { - - private ServiceMinuteMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_MINUTE_METRIC_PERSISTENCE_WORKER_ID; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IServiceMinuteMetricPersistenceDAO.class); - } - - @Override protected boolean needMergeDBData() { - return true; - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceMinuteMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ServiceMinuteMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ServiceMetricTable.TABLE + "/minute") - @Override protected void onWork(ServiceMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMinuteMetricRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMinuteMetricRemoteWorker.java deleted file mode 100644 index f149f5c1ba615b41e566df6696c5e51a5cf34b51..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMinuteMetricRemoteWorker.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.remote.service.Selector; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; - -/** - * @author peng-yongsheng - */ -public class ServiceMinuteMetricRemoteWorker extends AbstractRemoteWorker { - - private ServiceMinuteMetricRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_MINUTE_METRIC_REMOTE_WORKER_ID; - } - - @Override protected void onWork(ServiceMetric serviceMetric) { - onNext(serviceMetric); - } - - @Override public Selector selector() { - return Selector.HashCode; - } - - public static class Factory extends AbstractRemoteWorkerProvider { - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public ServiceMinuteMetricRemoteWorker workerInstance(ModuleManager moduleManager) { - return new ServiceMinuteMetricRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMonthMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMonthMetricPersistenceWorker.java deleted file mode 100644 index 414751f17e7125d9e80fae3dee2d7e5f95a0a2e6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMonthMetricPersistenceWorker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceMonthMetricPersistenceWorker extends MergePersistenceWorker { - - private ServiceMonthMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_MONTH_METRIC_PERSISTENCE_WORKER_ID; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IServiceMonthMetricPersistenceDAO.class); - } - - @Override protected boolean needMergeDBData() { - return true; - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceMonthMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ServiceMonthMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ServiceMetricTable.TABLE + "/month") - @Override protected void onWork(ServiceMetric input) { - super.onWork(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMonthMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMonthMetricTransformNode.java deleted file mode 100644 index 1d392878747ae8c0cc39a81eac9a148cdedd9dad..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/metric/ServiceMonthMetricTransformNode.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.metric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; - -/** - * @author peng-yongsheng - */ -public class ServiceMonthMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_MONTH_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(ServiceMetric serviceMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(serviceMetric.getTimeBucket()); - - ServiceMetric newServiceMetric = ServiceMetricCopy.copy(serviceMetric); - newServiceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + serviceMetric.getMetricId()); - newServiceMetric.setTimeBucket(timeBucket); - next.execute(newServiceMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceDayMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceDayMetricPersistenceWorker.java deleted file mode 100644 index 0b2de31467ad4d6d97a024d95e00cabdbd66e816..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceDayMetricPersistenceWorker.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceDayMetricPersistenceWorker extends MergePersistenceWorker { - - private ServiceReferenceDayMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_REFERENCE_DAY_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IServiceReferenceDayMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceReferenceDayMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ServiceReferenceDayMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ServiceReferenceMetricTable.TABLE) - @Override protected void onWork(ServiceReferenceMetric input) { - super.onWork(input); - } - - @GraphComputingMetric(name = "/persistence/flushAndSwitch/" + ServiceReferenceMetricTable.TABLE) - @Override public boolean flushAndSwitch() { - return super.flushAndSwitch(); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceDayMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceDayMetricTransformNode.java deleted file mode 100644 index 8707b9b50178afc262c99ed93c5f742a13b50fd9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceDayMetricTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceDayMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_REFERENCE_DAY_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(ServiceReferenceMetric serviceReferenceMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(serviceReferenceMetric.getTimeBucket()); - - ServiceReferenceMetric newServiceReferenceMetric = ServiceReferenceMetricCopy.copy(serviceReferenceMetric); - newServiceReferenceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + serviceReferenceMetric.getMetricId()); - newServiceReferenceMetric.setTimeBucket(timeBucket); - - next.execute(newServiceReferenceMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceHourMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceHourMetricPersistenceWorker.java deleted file mode 100644 index 2162c1dead0dfb867b976a36abe2d031be463e40..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceHourMetricPersistenceWorker.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceHourMetricPersistenceWorker extends MergePersistenceWorker { - - private ServiceReferenceHourMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_REFERENCE_HOUR_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IServiceReferenceHourMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceReferenceHourMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ServiceReferenceHourMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ServiceReferenceMetricTable.TABLE + "/hour") - @Override protected void onWork(ServiceReferenceMetric input) { - super.onWork(input); - } - - @GraphComputingMetric(name = "/persistence/flushAndSwitch/" + ServiceReferenceMetricTable.TABLE + "/hour") - @Override public boolean flushAndSwitch() { - return super.flushAndSwitch(); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceHourMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceHourMetricTransformNode.java deleted file mode 100644 index d4265cde20e8e43b8f5cd280f8bd456a53b7a0f7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceHourMetricTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceHourMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_REFERENCE_HOUR_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(ServiceReferenceMetric serviceReferenceMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(serviceReferenceMetric.getTimeBucket()); - - ServiceReferenceMetric newServiceReferenceMetric = ServiceReferenceMetricCopy.copy(serviceReferenceMetric); - newServiceReferenceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + serviceReferenceMetric.getMetricId()); - newServiceReferenceMetric.setTimeBucket(timeBucket); - - next.execute(newServiceReferenceMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMetricCopy.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMetricCopy.java deleted file mode 100644 index 825ebd1a070fe8039b5fb6d9db57e95a782412a2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMetricCopy.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.refmetric; - -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMetricCopy { - - public static ServiceReferenceMetric copy(ServiceReferenceMetric serviceReferenceMetric) { - ServiceReferenceMetric newServiceReferenceMetric = new ServiceReferenceMetric(); - newServiceReferenceMetric.setId(serviceReferenceMetric.getId()); - newServiceReferenceMetric.setMetricId(serviceReferenceMetric.getMetricId()); - newServiceReferenceMetric.setSourceValue(serviceReferenceMetric.getSourceValue()); - - newServiceReferenceMetric.setFrontApplicationId(serviceReferenceMetric.getFrontApplicationId()); - newServiceReferenceMetric.setFrontInstanceId(serviceReferenceMetric.getFrontInstanceId()); - newServiceReferenceMetric.setFrontServiceId(serviceReferenceMetric.getFrontServiceId()); - newServiceReferenceMetric.setBehindApplicationId(serviceReferenceMetric.getBehindApplicationId()); - newServiceReferenceMetric.setBehindInstanceId(serviceReferenceMetric.getBehindInstanceId()); - newServiceReferenceMetric.setBehindServiceId(serviceReferenceMetric.getBehindServiceId()); - - newServiceReferenceMetric.setTransactionCalls(serviceReferenceMetric.getTransactionCalls()); - newServiceReferenceMetric.setTransactionDurationSum(serviceReferenceMetric.getTransactionDurationSum()); - newServiceReferenceMetric.setTransactionErrorCalls(serviceReferenceMetric.getTransactionErrorCalls()); - newServiceReferenceMetric.setTransactionErrorDurationSum(serviceReferenceMetric.getTransactionErrorDurationSum()); - - newServiceReferenceMetric.setBusinessTransactionCalls(serviceReferenceMetric.getBusinessTransactionCalls()); - newServiceReferenceMetric.setBusinessTransactionDurationSum(serviceReferenceMetric.getBusinessTransactionDurationSum()); - newServiceReferenceMetric.setBusinessTransactionErrorCalls(serviceReferenceMetric.getBusinessTransactionErrorCalls()); - newServiceReferenceMetric.setBusinessTransactionErrorDurationSum(serviceReferenceMetric.getBusinessTransactionErrorDurationSum()); - - newServiceReferenceMetric.setMqTransactionCalls(serviceReferenceMetric.getMqTransactionCalls()); - newServiceReferenceMetric.setMqTransactionDurationSum(serviceReferenceMetric.getMqTransactionDurationSum()); - newServiceReferenceMetric.setMqTransactionErrorCalls(serviceReferenceMetric.getMqTransactionErrorCalls()); - newServiceReferenceMetric.setMqTransactionErrorDurationSum(serviceReferenceMetric.getMqTransactionErrorDurationSum()); - - newServiceReferenceMetric.setTimeBucket(serviceReferenceMetric.getTimeBucket()); - return newServiceReferenceMetric; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMetricGraph.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMetricGraph.java deleted file mode 100644 index 4a0f0c65775d29c7b99222f655c201547ab98905..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMetricGraph.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Node; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMetricGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public ServiceReferenceMetricGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - Node remoteNode = GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.SERVICE_REFERENCE_METRIC_GRAPH_ID, ServiceReferenceMetric.class) - .addNode(new ServiceReferenceMinuteMetricAggregationWorker.Factory(moduleManager).create(workerCreateListener)) - .addNext(new ServiceReferenceMinuteMetricRemoteWorker.Factory(moduleManager, remoteSenderService, MetricGraphIdDefine.SERVICE_REFERENCE_METRIC_GRAPH_ID).create(workerCreateListener)); - - remoteNode.addNext(new ServiceReferenceMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ServiceReferenceHourMetricTransformNode()) - .addNext(new ServiceReferenceHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ServiceReferenceDayMetricTransformNode()) - .addNext(new ServiceReferenceDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - - remoteNode.addNext(new ServiceReferenceMonthMetricTransformNode()) - .addNext(new ServiceReferenceMonthMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMetricSpanListener.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMetricSpanListener.java deleted file mode 100644 index 0e9c85489e105a505b45386e5b07cc91efb0fea8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMetricSpanListener.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.refmetric; - -import java.util.*; -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricGraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.*; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.*; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.*; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.graph.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.network.language.agent.SpanLayer; -import org.slf4j.*; - -import static java.util.Objects.nonNull; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMetricSpanListener implements EntrySpanListener, ExitSpanListener { - - private static final Logger logger = LoggerFactory.getLogger(ServiceReferenceMetricSpanListener.class); - - private final InstanceCacheService instanceCacheService; - private final ApplicationCacheService applicationCacheService; - private final List entryReferenceMetric; - private List exitReferenceMetric; - private SpanDecorator entrySpanDecorator; - private long minuteTimeBucket; - - private ServiceReferenceMetricSpanListener(ModuleManager moduleManager) { - this.entryReferenceMetric = new LinkedList<>(); - this.exitReferenceMetric = new LinkedList<>(); - this.instanceCacheService = moduleManager.find(CacheModule.NAME).getService(InstanceCacheService.class); - this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class); - } - - @Override public boolean containsPoint(Point point) { - return Point.Entry.equals(point) || Point.Exit.equals(point); - } - - @Override - public void parseEntry(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreInfo) { - this.minuteTimeBucket = segmentCoreInfo.getMinuteTimeBucket(); - - if (spanDecorator.getRefsCount() > 0) { - for (int i = 0; i < spanDecorator.getRefsCount(); i++) { - ReferenceDecorator reference = spanDecorator.getRefs(i); - ServiceReferenceMetric serviceReferenceMetric = new ServiceReferenceMetric(); - serviceReferenceMetric.setFrontServiceId(reference.getParentServiceId()); - - if (spanDecorator.getSpanLayer().equals(SpanLayer.MQ)) { - int applicationIdByPeerId = applicationCacheService.getApplicationIdByAddressId(reference.getNetworkAddressId()); - int instanceIdByPeerId = instanceCacheService.getInstanceIdByAddressId(applicationIdByPeerId, reference.getNetworkAddressId()); - serviceReferenceMetric.setFrontInstanceId(instanceIdByPeerId); - serviceReferenceMetric.setFrontApplicationId(applicationIdByPeerId); - } else { - serviceReferenceMetric.setFrontInstanceId(reference.getParentApplicationInstanceId()); - serviceReferenceMetric.setFrontApplicationId(instanceCacheService.getApplicationId(reference.getParentApplicationInstanceId())); - } - serviceReferenceMetric.setBehindServiceId(spanDecorator.getOperationNameId()); - serviceReferenceMetric.setBehindInstanceId(segmentCoreInfo.getApplicationInstanceId()); - serviceReferenceMetric.setBehindApplicationId(segmentCoreInfo.getApplicationId()); - serviceReferenceMetric.setSourceValue(MetricSource.Callee.getValue()); - calculateDuration(serviceReferenceMetric, spanDecorator); - entryReferenceMetric.add(serviceReferenceMetric); - } - } else { - ServiceReferenceMetric serviceReferenceMetric = new ServiceReferenceMetric(); - serviceReferenceMetric.setFrontServiceId(Const.NONE_SERVICE_ID); - serviceReferenceMetric.setFrontInstanceId(Const.NONE_INSTANCE_ID); - serviceReferenceMetric.setFrontApplicationId(Const.NONE_APPLICATION_ID); - serviceReferenceMetric.setBehindServiceId(spanDecorator.getOperationNameId()); - serviceReferenceMetric.setBehindInstanceId(segmentCoreInfo.getApplicationInstanceId()); - serviceReferenceMetric.setBehindApplicationId(segmentCoreInfo.getApplicationId()); - serviceReferenceMetric.setSourceValue(MetricSource.Callee.getValue()); - - calculateDuration(serviceReferenceMetric, spanDecorator); - entryReferenceMetric.add(serviceReferenceMetric); - } - this.entrySpanDecorator = spanDecorator; - } - - @Override public void parseExit(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreInfo) { - if (this.minuteTimeBucket == 0) { - this.minuteTimeBucket = segmentCoreInfo.getMinuteTimeBucket(); - } - - ServiceReferenceMetric serviceReferenceMetric = new ServiceReferenceMetric(); - - int peerId = spanDecorator.getPeerId(); - int behindApplicationId = applicationCacheService.getApplicationIdByAddressId(peerId); - int behindInstanceId = instanceCacheService.getInstanceIdByAddressId(behindApplicationId, peerId); - - serviceReferenceMetric.setFrontServiceId(Const.NONE_SERVICE_ID); - serviceReferenceMetric.setFrontInstanceId(segmentCoreInfo.getApplicationInstanceId()); - serviceReferenceMetric.setFrontApplicationId(segmentCoreInfo.getApplicationId()); - serviceReferenceMetric.setBehindServiceId(spanDecorator.getOperationNameId()); - serviceReferenceMetric.setBehindInstanceId(behindInstanceId); - serviceReferenceMetric.setBehindApplicationId(behindApplicationId); - serviceReferenceMetric.setSourceValue(MetricSource.Caller.getValue()); - calculateDuration(serviceReferenceMetric, spanDecorator); - exitReferenceMetric.add(serviceReferenceMetric); - } - - private void calculateDuration(ServiceReferenceMetric serviceReferenceMetric, SpanDecorator spanDecorator) { - long duration = spanDecorator.getEndTime() - spanDecorator.getStartTime(); - - if (spanDecorator.getIsError()) { - serviceReferenceMetric.setTransactionErrorCalls(1L); - serviceReferenceMetric.setTransactionErrorDurationSum(duration); - } - serviceReferenceMetric.setTransactionCalls(1L); - serviceReferenceMetric.setTransactionDurationSum(duration); - - if (SpanLayer.MQ.equals(spanDecorator.getSpanLayer())) { - if (spanDecorator.getIsError()) { - serviceReferenceMetric.setMqTransactionErrorCalls(1L); - serviceReferenceMetric.setMqTransactionErrorDurationSum(duration); - } - serviceReferenceMetric.setMqTransactionCalls(1L); - serviceReferenceMetric.setMqTransactionDurationSum(duration); - } else { - if (spanDecorator.getIsError()) { - serviceReferenceMetric.setBusinessTransactionErrorCalls(1L); - serviceReferenceMetric.setBusinessTransactionErrorDurationSum(duration); - } - serviceReferenceMetric.setBusinessTransactionCalls(1L); - serviceReferenceMetric.setBusinessTransactionDurationSum(duration); - } - } - - @Override public void build() { - if (logger.isDebugEnabled()) { - logger.debug("service reference listener build"); - } - - Graph graph = GraphManager.INSTANCE.findGraph(MetricGraphIdDefine.SERVICE_REFERENCE_METRIC_GRAPH_ID, ServiceReferenceMetric.class); - entryReferenceMetric.forEach(serviceReferenceMetric -> { - String metricId = serviceReferenceMetric.getFrontServiceId() + Const.ID_SPLIT + serviceReferenceMetric.getBehindServiceId() + Const.ID_SPLIT + serviceReferenceMetric.getSourceValue(); - String id = minuteTimeBucket + Const.ID_SPLIT + metricId; - - serviceReferenceMetric.setId(id); - serviceReferenceMetric.setMetricId(metricId); - serviceReferenceMetric.setTimeBucket(minuteTimeBucket); - - if (logger.isDebugEnabled()) { - logger.debug("push to service reference aggregation worker, id: {}", serviceReferenceMetric.getId()); - } - - graph.start(serviceReferenceMetric); - }); - - exitReferenceMetric.forEach(serviceReferenceMetric -> { - if (nonNull(entrySpanDecorator)) { - serviceReferenceMetric.setFrontServiceId(entrySpanDecorator.getOperationNameId()); - } else { - serviceReferenceMetric.setFrontServiceId(Const.NONE_SERVICE_ID); - } - - String metricId = serviceReferenceMetric.getFrontServiceId() + Const.ID_SPLIT + serviceReferenceMetric.getBehindServiceId() + Const.ID_SPLIT + serviceReferenceMetric.getSourceValue(); - String id = minuteTimeBucket + Const.ID_SPLIT + metricId; - serviceReferenceMetric.setId(id); - serviceReferenceMetric.setMetricId(metricId); - serviceReferenceMetric.setTimeBucket(minuteTimeBucket); - - graph.start(serviceReferenceMetric); - }); - } - - public static class Factory implements SpanListenerFactory { - - @GraphComputingMetric(name = "/segment/parse/createSpanListeners/serviceReferenceMetricSpanListener") - @Override public SpanListener create(ModuleManager moduleManager) { - return new ServiceReferenceMetricSpanListener(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMinuteMetricAggregationWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMinuteMetricAggregationWorker.java deleted file mode 100644 index 8a23417ffda8383d47c58e383ab4e781c7842398..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMinuteMetricAggregationWorker.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.AggregationWorker; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMinuteMetricAggregationWorker extends AggregationWorker { - - private ServiceReferenceMinuteMetricAggregationWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_REFERENCE_MINUTE_METRIC_AGGREGATION_WORKER_ID; - } - - public static class Factory extends AbstractLocalAsyncWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceReferenceMinuteMetricAggregationWorker workerInstance(ModuleManager moduleManager) { - return new ServiceReferenceMinuteMetricAggregationWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/aggregate/onWork/" + ServiceReferenceMetricTable.TABLE) - @Override protected void onWork(ServiceReferenceMetric message) throws WorkerException { - super.onWork(message); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMinuteMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMinuteMetricPersistenceWorker.java deleted file mode 100644 index 974fee345af3b27bbefe9ad06c18664e950a3ccf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMinuteMetricPersistenceWorker.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMinuteMetricPersistenceWorker extends MergePersistenceWorker { - - private ServiceReferenceMinuteMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_REFERENCE_MINUTE_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IServiceReferenceMinuteMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceReferenceMinuteMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ServiceReferenceMinuteMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ServiceReferenceMetricTable.TABLE + "/minute") - @Override protected void onWork(ServiceReferenceMetric input) { - super.onWork(input); - } - - @GraphComputingMetric(name = "/persistence/flushAndSwitch/" + ServiceReferenceMetricTable.TABLE + "/minute") - @Override public boolean flushAndSwitch() { - return super.flushAndSwitch(); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMinuteMetricRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMinuteMetricRemoteWorker.java deleted file mode 100644 index f92e12eda327a0bd19a711e7c8a8e74c32204f49..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMinuteMetricRemoteWorker.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.remote.service.Selector; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMinuteMetricRemoteWorker extends AbstractRemoteWorker { - - private ServiceReferenceMinuteMetricRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_REFERENCE_MINUTE_METRIC_REMOTE_WORKER_ID; - } - - @Override protected void onWork(ServiceReferenceMetric serviceReferenceMetric) { - onNext(serviceReferenceMetric); - } - - @Override public Selector selector() { - return Selector.HashCode; - } - - public static class Factory extends AbstractRemoteWorkerProvider { - - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public ServiceReferenceMinuteMetricRemoteWorker workerInstance(ModuleManager moduleManager) { - return new ServiceReferenceMinuteMetricRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMonthMetricPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMonthMetricPersistenceWorker.java deleted file mode 100644 index 4a27ccd8ee194d0291df5076ebb0f5381527be47..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMonthMetricPersistenceWorker.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.MergePersistenceWorkerProvider; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMonthMetricPersistenceWorker extends MergePersistenceWorker { - - private ServiceReferenceMonthMetricPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_REFERENCE_MONTH_METRIC_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return true; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(IServiceReferenceMonthMetricPersistenceDAO.class); - } - - public static class Factory extends MergePersistenceWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceReferenceMonthMetricPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new ServiceReferenceMonthMetricPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 1024; - } - } - - @GraphComputingMetric(name = "/persistence/onWork/" + ServiceReferenceMetricTable.TABLE + "/month") - @Override protected void onWork(ServiceReferenceMetric input) { - super.onWork(input); - } - - @GraphComputingMetric(name = "/persistence/flushAndSwitch/" + ServiceReferenceMetricTable.TABLE + "/month") - @Override public boolean flushAndSwitch() { - return super.flushAndSwitch(); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMonthMetricTransformNode.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMonthMetricTransformNode.java deleted file mode 100644 index eda5515cf3f053ef3de371acf4f1abcfbfcb137f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMonthMetricTransformNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.service.refmetric; - -import org.apache.skywalking.apm.collector.analysis.metric.define.graph.MetricWorkerIdDefine; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMonthMetricTransformNode implements NodeProcessor { - - @Override public int id() { - return MetricWorkerIdDefine.SERVICE_REFERENCE_MONTH_METRIC_TRANSFORM_NODE_ID; - } - - @Override public void process(ServiceReferenceMetric serviceReferenceMetric, Next next) { - long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(serviceReferenceMetric.getTimeBucket()); - - ServiceReferenceMetric newServiceReferenceMetric = ServiceReferenceMetricCopy.copy(serviceReferenceMetric); - newServiceReferenceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + serviceReferenceMetric.getMetricId()); - newServiceReferenceMetric.setTimeBucket(timeBucket); - - next.execute(newServiceReferenceMetric); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index aa5946400ca7fb7d7e38e0ed8db1224ddd7bafc8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.analysis.metric.provider.AnalysisMetricModuleProvider \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListenerTestCase.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListenerTestCase.java deleted file mode 100644 index 8a8ddbff688b3e53754544700fda30af30c8e6ed..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListenerTestCase.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.metric.provider.worker.global.std; - -import java.util.LinkedList; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IResponseTimeDistributionConfigService; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; -import org.junit.Assert; -import org.junit.Test; -import org.mockito.Mockito; -import org.powermock.reflect.Whitebox; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionSpanListenerTestCase { - - @Test - public void testStep() { - ModuleProvider moduleProvider = Mockito.mock(ModuleProvider.class); - LinkedList loadedProviders = new LinkedList<>(); - loadedProviders.add(moduleProvider); - - IResponseTimeDistributionConfigService service = Mockito.mock(IResponseTimeDistributionConfigService.class); - Mockito.when(service.getResponseTimeStep()).thenReturn(50); - Mockito.when(service.getCountOfResponseTimeSteps()).thenReturn(40); - Mockito.when(service.getTotalTimeOfResponseTimeSteps()).thenReturn(2050); - - ModuleDefine module = Mockito.mock(ModuleDefine.class); - Whitebox.setInternalState(module, "loadedProviders", loadedProviders); - Mockito.when(module.getService(IResponseTimeDistributionConfigService.class)).thenReturn(service); - - ModuleManager moduleManager = Mockito.mock(ModuleManager.class); - Mockito.when(moduleManager.find(ConfigurationModule.NAME)).thenReturn(module); - - ResponseTimeDistributionSpanListener listener = new ResponseTimeDistributionSpanListener(moduleManager); - - Assert.assertEquals(3, listener.getStep(200)); - Assert.assertEquals(0, listener.getStep(10)); - Assert.assertEquals(1, listener.getStep(60)); - Assert.assertEquals(40, listener.getStep(3100)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-metric/pom.xml b/apm-collector/apm-collector-analysis/analysis-metric/pom.xml deleted file mode 100644 index 1c4e57cd52e5bb4bfb15fe64a011a3b84712e777..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-metric/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - apm-collector-analysis - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - analysis-metric - pom - - metric-define - metric-provider - - \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-register/pom.xml b/apm-collector/apm-collector-analysis/analysis-register/pom.xml deleted file mode 100644 index 0f67a54a110dbcae0627afa8597ca2aa797d007d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - apm-collector-analysis - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - analysis-register - pom - - register-define - register-provider - - \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-define/pom.xml b/apm-collector/apm-collector-analysis/analysis-register/register-define/pom.xml deleted file mode 100644 index 93c01afea117ee5e9c6be12f53428baa17de57be..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-define/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - analysis-register - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - register-define - \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/AnalysisRegisterModule.java b/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/AnalysisRegisterModule.java deleted file mode 100644 index 2ad68156d8d3474e48f357e97cc32a9d5a71df31..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/AnalysisRegisterModule.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.define; - -import org.apache.skywalking.apm.collector.analysis.register.define.service.IApplicationIDService; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IInstanceIDService; -import org.apache.skywalking.apm.collector.analysis.register.define.service.INetworkAddressIDService; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IServiceNameService; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; - -/** - * @author peng-yongsheng - */ -public class AnalysisRegisterModule extends ModuleDefine { - - public static final String NAME = "analysis_register"; - - @Override public String name() { - return NAME; - } - - @Override public Class[] services() { - return new Class[] {IApplicationIDService.class, IInstanceIDService.class, IServiceNameService.class, INetworkAddressIDService.class}; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/graph/GraphIdDefine.java b/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/graph/GraphIdDefine.java deleted file mode 100644 index 1b99bcfe74b60e3fee651b990eb451fbee10ca31..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/graph/GraphIdDefine.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.define.graph; - -/** - * @author peng-yongsheng - */ -public class GraphIdDefine { - public static final int APPLICATION_REGISTER_GRAPH_ID = 200; - public static final int INSTANCE_REGISTER_GRAPH_ID = 201; - public static final int SERVICE_NAME_REGISTER_GRAPH_ID = 202; - public static final int NETWORK_ADDRESS_NAME_REGISTER_GRAPH_ID = 203; -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/graph/WorkerIdDefine.java b/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/graph/WorkerIdDefine.java deleted file mode 100644 index c8e13bf207f7d89b97dbd562d9e1a84a37164a19..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/graph/WorkerIdDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.define.graph; - -/** - * @author peng-yongsheng - */ -public class WorkerIdDefine { - public static final int APPLICATION_REGISTER_REMOTE_WORKER = 200; - public static final int APPLICATION_REGISTER_SERIAL_WORKER = 201; - public static final int INSTANCE_REGISTER_REMOTE_WORKER = 202; - public static final int INSTANCE_REGISTER_SERIAL_WORKER = 203; - public static final int SERVICE_NAME_REGISTER_REMOTE_WORKER = 204; - public static final int SERVICE_NAME_REGISTER_SERIAL_WORKER = 205; - public static final int NETWORK_ADDRESS_REGISTER_REMOTE_WORKER = 206; - public static final int NETWORK_ADDRESS_REGISTER_SERIAL_WORKER = 207; -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/service/AgentOsInfo.java b/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/service/AgentOsInfo.java deleted file mode 100644 index b16f84384c61da9df2c20c347f537882c5d46e43..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/service/AgentOsInfo.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.define.service; - -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import java.util.List; - -/** - * @author wusheng - */ -public class AgentOsInfo { - private String osName; - private String hostname; - private int processNo; - private List ipv4s; - - public AgentOsInfo() { - } - - public String getOsName() { - return osName; - } - - public void setOsName(String osName) { - this.osName = osName; - } - - public String getHostname() { - return hostname; - } - - public void setHostname(String hostname) { - this.hostname = hostname; - } - - public int getProcessNo() { - return processNo; - } - - public void setProcessNo(int processNo) { - this.processNo = processNo; - } - - public List getIpv4s() { - return ipv4s; - } - - public void setIpv4s(List ipv4s) { - this.ipv4s = ipv4s; - } - - @Override public String toString() { - JsonObject osInfoJson = new JsonObject(); - osInfoJson.addProperty("osName", this.getOsName()); - osInfoJson.addProperty("hostName", this.getHostname()); - osInfoJson.addProperty("processId", this.getProcessNo()); - - JsonArray ipv4Array = new JsonArray(); - if (this.getIpv4s() != null) { - for (String ipv4 : this.getIpv4s()) { - ipv4Array.add(ipv4); - } - } - osInfoJson.add("ipv4s", ipv4Array); - return osInfoJson.toString(); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/service/IApplicationIDService.java b/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/service/IApplicationIDService.java deleted file mode 100644 index 3e05aa3ff30fe63eeb7899f79d9bbdfab794e3b0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/service/IApplicationIDService.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.define.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface IApplicationIDService extends Service { - int getOrCreateForApplicationCode(String applicationCode); - - int getOrCreateForAddressId(int addressId, String networkAddress); -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/service/IInstanceIDService.java b/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/service/IInstanceIDService.java deleted file mode 100644 index 8959b732242da769480c6c00ced5240174a6527d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/service/IInstanceIDService.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.define.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface IInstanceIDService extends Service { - int getOrCreateByAgentUUID(int applicationId, String agentUUID, long registerTime, AgentOsInfo osInfo); - - int getOrCreateByAddressId(int applicationId, int addressId, long registerTime); -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/service/INetworkAddressIDService.java b/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/service/INetworkAddressIDService.java deleted file mode 100644 index fef1d8aa039658c708d112ae79cca46c5245c2f5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/service/INetworkAddressIDService.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.define.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface INetworkAddressIDService extends Service { - int getOrCreate(String networkAddress); - - int get(String networkAddress); - - void update(int addressId, int srcSpanLayer, int serverType); -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/service/IServiceNameService.java b/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/service/IServiceNameService.java deleted file mode 100644 index 184a397c68a8c7bb1cfe2f5370c2588c1430ef6f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/java/org/apache/skywalking/apm/collector/analysis/register/define/service/IServiceNameService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.define.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface IServiceNameService extends Service { - - int getOrCreate(int applicationId, int srcSpanType, String serviceName); - - int get(int applicationId, int srcSpanType, String serviceName); -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine deleted file mode 100644 index f43207d38162f70f2fa2c7aa72f1292d64dea316..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/pom.xml b/apm-collector/apm-collector-analysis/analysis-register/register-provider/pom.xml deleted file mode 100644 index 83d354ff5c0a68ab64dc1976ada6940efcc3e0c3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - analysis-register - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - register-provider - jar - - - - org.apache.skywalking - register-define - ${project.version} - - - org.apache.skywalking - collector-cache-define - ${project.version} - - - org.apache.skywalking - collector-storage-define - ${project.version} - - - org.apache.skywalking - analysis-worker-model - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/AnalysisRegisterModuleConfig.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/AnalysisRegisterModuleConfig.java deleted file mode 100644 index c91efd12bbc5d710d76f04a8e4305b5e3e7a6f0e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/AnalysisRegisterModuleConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author peng-yongsheng - */ -class AnalysisRegisterModuleConfig extends ModuleConfig { -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/AnalysisRegisterModuleProvider.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/AnalysisRegisterModuleProvider.java deleted file mode 100644 index e5d6a1b8ef793f31db9b704a50b8aaafe8f693ac..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/AnalysisRegisterModuleProvider.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider; - -import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule; -import org.apache.skywalking.apm.collector.analysis.register.define.service.*; -import org.apache.skywalking.apm.collector.analysis.register.provider.register.*; -import org.apache.skywalking.apm.collector.analysis.register.provider.service.*; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.analysis.worker.timer.PersistenceTimer; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.table.register.*; - -/** - * @author peng-yongsheng - */ -public class AnalysisRegisterModuleProvider extends ModuleProvider { - - public static final String NAME = "default"; - private final AnalysisRegisterModuleConfig config; - - public AnalysisRegisterModuleProvider() { - super(); - this.config = new AnalysisRegisterModuleConfig(); - } - - @Override public String name() { - return NAME; - } - - @Override public Class module() { - return AnalysisRegisterModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() throws ServiceNotProvidedException { - this.registerServiceImplementation(IApplicationIDService.class, new ApplicationIDService(getManager())); - this.registerServiceImplementation(IInstanceIDService.class, new InstanceIDService(getManager())); - this.registerServiceImplementation(IServiceNameService.class, new ServiceNameService(getManager())); - this.registerServiceImplementation(INetworkAddressIDService.class, new NetworkAddressIDService(getManager())); - } - - @Override public void start() { - WorkerCreateListener workerCreateListener = new WorkerCreateListener(); - - graphCreate(workerCreateListener); - - registerRemoteData(); - - PersistenceTimer.INSTANCE.start(getManager(), workerCreateListener.getPersistenceWorkers()); - } - - @Override public void notifyAfterCompleted() { - } - - @Override public String[] requiredModules() { - return new String[] {StorageModule.NAME, RemoteModule.NAME, CacheModule.NAME}; - } - - private void graphCreate(WorkerCreateListener workerCreateListener) { - new ApplicationRegisterGraph(getManager(), workerCreateListener).create(); - new InstanceRegisterGraph(getManager(), workerCreateListener).create(); - new ServiceNameRegisterGraph(getManager(), workerCreateListener).create(); - new NetworkAddressRegisterGraph(getManager(), workerCreateListener).create(); - } - - private void registerRemoteData() { - RemoteDataRegisterService remoteDataRegisterService = getManager().find(RemoteModule.NAME).getService(RemoteDataRegisterService.class); - remoteDataRegisterService.register(Application.class, new Application.InstanceCreator()); - remoteDataRegisterService.register(Instance.class, new Instance.InstanceCreator()); - remoteDataRegisterService.register(NetworkAddress.class, new NetworkAddress.InstanceCreator()); - remoteDataRegisterService.register(ServiceName.class, new ServiceName.InstanceCreator()); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ApplicationRegisterGraph.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ApplicationRegisterGraph.java deleted file mode 100644 index c3447eff2e7d89859c6ffef5a07979f65639d415..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ApplicationRegisterGraph.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider.register; - -import org.apache.skywalking.apm.collector.analysis.register.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.register.Application; - -/** - * @author peng-yongsheng - */ -public class ApplicationRegisterGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public ApplicationRegisterGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - GraphManager.INSTANCE.createIfAbsent(GraphIdDefine.APPLICATION_REGISTER_GRAPH_ID, Application.class) - .addNode(new ApplicationRegisterRemoteWorker.Factory(moduleManager, remoteSenderService, GraphIdDefine.APPLICATION_REGISTER_GRAPH_ID).create(workerCreateListener)) - .addNext(new ApplicationRegisterSerialWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ApplicationRegisterRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ApplicationRegisterRemoteWorker.java deleted file mode 100644 index 147166e92e404c6a7c57aba7d5dc93b7f85d705f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ApplicationRegisterRemoteWorker.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider.register; - -import org.apache.skywalking.apm.collector.analysis.register.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.*; -import org.apache.skywalking.apm.collector.storage.table.register.Application; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class ApplicationRegisterRemoteWorker extends AbstractRemoteWorker { - - private static final Logger logger = LoggerFactory.getLogger(ApplicationRegisterRemoteWorker.class); - - private ApplicationRegisterRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return WorkerIdDefine.APPLICATION_REGISTER_REMOTE_WORKER; - } - - @Override protected void onWork(Application message) { - if (logger.isDebugEnabled()) { - logger.debug("application code: {}", message.getApplicationCode()); - } - - onNext(message); - } - - @Override public Selector selector() { - return Selector.ForeverFirst; - } - - public static class Factory extends AbstractRemoteWorkerProvider { - - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public ApplicationRegisterRemoteWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationRegisterRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ApplicationRegisterSerialWorker.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ApplicationRegisterSerialWorker.java deleted file mode 100644 index 7db65e109c4c870d2e362a6300a45b7299ada930..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ApplicationRegisterSerialWorker.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider.register; - -import org.apache.skywalking.apm.collector.analysis.register.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.*; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.*; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.register.IApplicationRegisterDAO; -import org.apache.skywalking.apm.collector.storage.table.register.Application; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class ApplicationRegisterSerialWorker extends AbstractLocalAsyncWorker { - - private static final Logger logger = LoggerFactory.getLogger(ApplicationRegisterSerialWorker.class); - - private final IApplicationRegisterDAO applicationRegisterDAO; - private final ApplicationCacheService applicationCacheService; - - private ApplicationRegisterSerialWorker(ModuleManager moduleManager) { - super(moduleManager); - this.applicationRegisterDAO = getModuleManager().find(StorageModule.NAME).getService(IApplicationRegisterDAO.class); - this.applicationCacheService = getModuleManager().find(CacheModule.NAME).getService(ApplicationCacheService.class); - } - - @Override public int id() { - return WorkerIdDefine.APPLICATION_REGISTER_SERIAL_WORKER; - } - - @Override protected void onWork(Application application) { - if (logger.isDebugEnabled()) { - logger.debug("register application, application code: {}", application.getApplicationCode()); - } - - int applicationId; - - if (BooleanUtils.valueToBoolean(application.getIsAddress())) { - applicationId = applicationCacheService.getApplicationIdByAddressId(application.getAddressId()); - } else { - applicationId = applicationCacheService.getApplicationIdByCode(application.getApplicationCode()); - } - - if (applicationId == 0) { - Application newApplication; - int min = applicationRegisterDAO.getMinApplicationId(); - if (min == 0) { - Application userApplication = new Application(); - userApplication.setId(String.valueOf(Const.NONE_APPLICATION_ID)); - userApplication.setApplicationCode(Const.USER_CODE); - userApplication.setApplicationId(Const.NONE_APPLICATION_ID); - userApplication.setAddressId(Const.NONE); - userApplication.setIsAddress(BooleanUtils.FALSE); - applicationRegisterDAO.save(userApplication); - - newApplication = new Application(); - newApplication.setId("-1"); - newApplication.setApplicationId(-1); - newApplication.setApplicationCode(application.getApplicationCode()); - newApplication.setAddressId(application.getAddressId()); - newApplication.setIsAddress(application.getIsAddress()); - } else { - int max = applicationRegisterDAO.getMaxApplicationId(); - applicationId = IdAutoIncrement.INSTANCE.increment(min, max); - - newApplication = new Application(); - newApplication.setId(String.valueOf(applicationId)); - newApplication.setApplicationId(applicationId); - newApplication.setApplicationCode(application.getApplicationCode()); - newApplication.setAddressId(application.getAddressId()); - newApplication.setIsAddress(application.getIsAddress()); - } - applicationRegisterDAO.save(newApplication); - } - } - - public static class Factory extends AbstractLocalAsyncWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ApplicationRegisterSerialWorker workerInstance(ModuleManager moduleManager) { - return new ApplicationRegisterSerialWorker(moduleManager); - } - - @Override public int queueSize() { - return 256; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/IdAutoIncrement.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/IdAutoIncrement.java deleted file mode 100644 index cf1827e883bf9e18eb43e7dca5d05dea290ed901..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/IdAutoIncrement.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider.register; - -/** - * @author peng-yongsheng - */ -public enum IdAutoIncrement { - INSTANCE; - - public int increment(int min, int max) { - int id; - if (min == max) { - if (min == 0) { - id = -1; - } else { - id = 1; - } - } else if (min + max == 0) { - id = max + 1; - } else if (min + max > 0) { - id = min - 1; - } else { - id = max + 1; - } - return id; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/InstanceRegisterGraph.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/InstanceRegisterGraph.java deleted file mode 100644 index 8d05f47f8589d6453d3c2922cd24a9fbe64cfed7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/InstanceRegisterGraph.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider.register; - -import org.apache.skywalking.apm.collector.analysis.register.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.register.Instance; - -/** - * @author peng-yongsheng - */ -public class InstanceRegisterGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public InstanceRegisterGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - GraphManager.INSTANCE.createIfAbsent(GraphIdDefine.INSTANCE_REGISTER_GRAPH_ID, Instance.class) - .addNode(new InstanceRegisterRemoteWorker.Factory(moduleManager, remoteSenderService, GraphIdDefine.INSTANCE_REGISTER_GRAPH_ID).create(workerCreateListener)) - .addNext(new InstanceRegisterSerialWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/InstanceRegisterRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/InstanceRegisterRemoteWorker.java deleted file mode 100644 index 0b9da8a9032da53d8854b549538f5376343a8d1e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/InstanceRegisterRemoteWorker.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider.register; - -import org.apache.skywalking.apm.collector.analysis.register.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.*; -import org.apache.skywalking.apm.collector.storage.table.register.Instance; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class InstanceRegisterRemoteWorker extends AbstractRemoteWorker { - - private static final Logger logger = LoggerFactory.getLogger(InstanceRegisterRemoteWorker.class); - - @Override public int id() { - return WorkerIdDefine.INSTANCE_REGISTER_REMOTE_WORKER; - } - - private InstanceRegisterRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override protected void onWork(Instance instance) { - if (logger.isDebugEnabled()) { - logger.debug("application id: {}, agentUUID: {}, register time: {}", instance.getApplicationId(), instance.getAgentUUID(), instance.getRegisterTime()); - } - onNext(instance); - } - - @Override public Selector selector() { - return Selector.ForeverFirst; - } - - public static class Factory extends AbstractRemoteWorkerProvider { - - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public InstanceRegisterRemoteWorker workerInstance(ModuleManager moduleManager) { - return new InstanceRegisterRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/InstanceRegisterSerialWorker.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/InstanceRegisterSerialWorker.java deleted file mode 100644 index 8aa02f1ee620a0d177291136fe0ea9d8f26df6bd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/InstanceRegisterSerialWorker.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider.register; - -import org.apache.skywalking.apm.collector.analysis.register.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.*; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.InstanceCacheService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.*; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.register.IInstanceRegisterDAO; -import org.apache.skywalking.apm.collector.storage.table.register.Instance; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class InstanceRegisterSerialWorker extends AbstractLocalAsyncWorker { - - private static final Logger logger = LoggerFactory.getLogger(InstanceRegisterSerialWorker.class); - - private final InstanceCacheService instanceCacheService; - private final IInstanceRegisterDAO instanceRegisterDAO; - - private InstanceRegisterSerialWorker(ModuleManager moduleManager) { - super(moduleManager); - this.instanceCacheService = getModuleManager().find(CacheModule.NAME).getService(InstanceCacheService.class); - this.instanceRegisterDAO = getModuleManager().find(StorageModule.NAME).getService(IInstanceRegisterDAO.class); - } - - @Override public int id() { - return WorkerIdDefine.INSTANCE_REGISTER_SERIAL_WORKER; - } - - @Override protected void onWork(Instance instance) { - if (logger.isDebugEnabled()) { - logger.debug("register instance, application id: {}, agentUUID: {}", instance.getApplicationId(), instance.getAgentUUID()); - } - - int instanceId; - if (BooleanUtils.valueToBoolean(instance.getIsAddress())) { - instanceId = instanceCacheService.getInstanceIdByAddressId(instance.getApplicationId(), instance.getAddressId()); - } else { - instanceId = instanceCacheService.getInstanceIdByAgentUUID(instance.getApplicationId(), instance.getAgentUUID()); - } - - if (instanceId == 0) { - Instance newInstance; - - int min = instanceRegisterDAO.getMinInstanceId(); - int max = instanceRegisterDAO.getMaxInstanceId(); - if (min == 0 && max == 0) { - Instance userInstance = new Instance(); - userInstance.setId(String.valueOf(Const.NONE_INSTANCE_ID)); - userInstance.setInstanceId(Const.NONE_INSTANCE_ID); - userInstance.setApplicationId(Const.NONE_APPLICATION_ID); - userInstance.setApplicationCode(Const.USER_CODE); - userInstance.setAgentUUID(Const.USER_CODE); - userInstance.setHeartBeatTime(System.currentTimeMillis()); - userInstance.setOsInfo(Const.EMPTY_STRING); - userInstance.setRegisterTime(System.currentTimeMillis()); - userInstance.setAddressId(Const.NONE); - userInstance.setIsAddress(BooleanUtils.FALSE); - instanceRegisterDAO.save(userInstance); - - newInstance = new Instance(); - newInstance.setId("2"); - newInstance.setInstanceId(2); - newInstance.setApplicationId(instance.getApplicationId()); - newInstance.setApplicationCode(instance.getApplicationCode()); - newInstance.setAgentUUID(instance.getAgentUUID()); - newInstance.setHeartBeatTime(instance.getHeartBeatTime()); - newInstance.setOsInfo(instance.getOsInfo()); - newInstance.setRegisterTime(instance.getRegisterTime()); - newInstance.setAddressId(instance.getAddressId()); - newInstance.setIsAddress(instance.getIsAddress()); - } else { - newInstance = new Instance(); - newInstance.setId(String.valueOf(max + 1)); - newInstance.setInstanceId(max + 1); - newInstance.setApplicationId(instance.getApplicationId()); - newInstance.setApplicationCode(instance.getApplicationCode()); - newInstance.setAgentUUID(instance.getAgentUUID()); - newInstance.setHeartBeatTime(instance.getHeartBeatTime()); - newInstance.setOsInfo(instance.getOsInfo()); - newInstance.setRegisterTime(instance.getRegisterTime()); - newInstance.setAddressId(instance.getAddressId()); - newInstance.setIsAddress(instance.getIsAddress()); - } - instanceRegisterDAO.save(newInstance); - } - } - - public static class Factory extends AbstractLocalAsyncWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public InstanceRegisterSerialWorker workerInstance(ModuleManager moduleManager) { - return new InstanceRegisterSerialWorker(moduleManager); - } - - @Override public int queueSize() { - return 256; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/NetworkAddressRegisterGraph.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/NetworkAddressRegisterGraph.java deleted file mode 100644 index 85c868ade710b8efde7c2f7ef616a3b976135773..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/NetworkAddressRegisterGraph.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider.register; - -import org.apache.skywalking.apm.collector.analysis.register.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddress; - -/** - * @author peng-yongsheng - */ -public class NetworkAddressRegisterGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public NetworkAddressRegisterGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - GraphManager.INSTANCE.createIfAbsent(GraphIdDefine.NETWORK_ADDRESS_NAME_REGISTER_GRAPH_ID, NetworkAddress.class) - .addNode(new NetworkAddressRegisterRemoteWorker.Factory(moduleManager, remoteSenderService, GraphIdDefine.NETWORK_ADDRESS_NAME_REGISTER_GRAPH_ID).create(workerCreateListener)) - .addNext(new NetworkAddressRegisterSerialWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/NetworkAddressRegisterRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/NetworkAddressRegisterRemoteWorker.java deleted file mode 100644 index 69c6784dd133abc073652dc9ee47342fe923e6f5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/NetworkAddressRegisterRemoteWorker.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider.register; - -import org.apache.skywalking.apm.collector.analysis.register.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.*; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddress; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class NetworkAddressRegisterRemoteWorker extends AbstractRemoteWorker { - - private static final Logger logger = LoggerFactory.getLogger(NetworkAddressRegisterRemoteWorker.class); - - private NetworkAddressRegisterRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return WorkerIdDefine.NETWORK_ADDRESS_REGISTER_REMOTE_WORKER; - } - - @Override protected void onWork(NetworkAddress message) { - if (logger.isDebugEnabled()) { - logger.debug("network address: {}", message.getNetworkAddress()); - } - - onNext(message); - } - - @Override public Selector selector() { - return Selector.ForeverFirst; - } - - public static class Factory extends AbstractRemoteWorkerProvider { - - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public NetworkAddressRegisterRemoteWorker workerInstance(ModuleManager moduleManager) { - return new NetworkAddressRegisterRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/NetworkAddressRegisterSerialWorker.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/NetworkAddressRegisterSerialWorker.java deleted file mode 100644 index 1b1b97fc573c3ba10b630f3c6212e8023c523915..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/NetworkAddressRegisterSerialWorker.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider.register; - -import org.apache.skywalking.apm.collector.analysis.register.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.*; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.NetworkAddressCacheService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.register.INetworkAddressRegisterDAO; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddress; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class NetworkAddressRegisterSerialWorker extends AbstractLocalAsyncWorker { - - private static final Logger logger = LoggerFactory.getLogger(NetworkAddressRegisterSerialWorker.class); - - private final INetworkAddressRegisterDAO networkAddressRegisterDAO; - private final NetworkAddressCacheService networkAddressCacheService; - - private NetworkAddressRegisterSerialWorker(ModuleManager moduleManager) { - super(moduleManager); - this.networkAddressRegisterDAO = getModuleManager().find(StorageModule.NAME).getService(INetworkAddressRegisterDAO.class); - this.networkAddressCacheService = getModuleManager().find(CacheModule.NAME).getService(NetworkAddressCacheService.class); - } - - @Override public int id() { - return WorkerIdDefine.NETWORK_ADDRESS_REGISTER_SERIAL_WORKER; - } - - @Override protected void onWork(NetworkAddress networkAddress) { - if (logger.isDebugEnabled()) { - logger.debug("register network address, address: {}", networkAddress.getNetworkAddress()); - } - - if (networkAddress.getAddressId() == 0) { - int addressId = networkAddressCacheService.getAddressId(networkAddress.getNetworkAddress()); - - if (addressId == 0) { - NetworkAddress newNetworkAddress; - int min = networkAddressRegisterDAO.getMinNetworkAddressId(); - if (min == 0) { - newNetworkAddress = new NetworkAddress(); - newNetworkAddress.setId("-1"); - newNetworkAddress.setAddressId(-1); - newNetworkAddress.setSrcSpanLayer(networkAddress.getSrcSpanLayer()); - newNetworkAddress.setNetworkAddress(networkAddress.getNetworkAddress()); - } else { - int max = networkAddressRegisterDAO.getMaxNetworkAddressId(); - addressId = IdAutoIncrement.INSTANCE.increment(min, max); - - newNetworkAddress = new NetworkAddress(); - newNetworkAddress.setId(String.valueOf(addressId)); - newNetworkAddress.setAddressId(addressId); - newNetworkAddress.setSrcSpanLayer(networkAddress.getSrcSpanLayer()); - newNetworkAddress.setNetworkAddress(networkAddress.getNetworkAddress()); - } - networkAddressRegisterDAO.save(newNetworkAddress); - } - } else { - networkAddressRegisterDAO.update(networkAddress.getId(), networkAddress.getSrcSpanLayer(), networkAddress.getServerType()); - } - } - - public static class Factory extends AbstractLocalAsyncWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public NetworkAddressRegisterSerialWorker workerInstance(ModuleManager moduleManager) { - return new NetworkAddressRegisterSerialWorker(moduleManager); - } - - @Override public int queueSize() { - return 256; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ServiceNameRegisterGraph.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ServiceNameRegisterGraph.java deleted file mode 100644 index ef4d632fd3d70a3e9ba8d032bc2cbe4ecacacda6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ServiceNameRegisterGraph.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider.register; - -import org.apache.skywalking.apm.collector.analysis.register.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; - -/** - * @author peng-yongsheng - */ -public class ServiceNameRegisterGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public ServiceNameRegisterGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class); - - GraphManager.INSTANCE.createIfAbsent(GraphIdDefine.SERVICE_NAME_REGISTER_GRAPH_ID, ServiceName.class) - .addNode(new ServiceNameRegisterRemoteWorker.Factory(moduleManager, remoteSenderService, GraphIdDefine.SERVICE_NAME_REGISTER_GRAPH_ID).create(workerCreateListener)) - .addNext(new ServiceNameRegisterSerialWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ServiceNameRegisterRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ServiceNameRegisterRemoteWorker.java deleted file mode 100644 index 9d1d48123b144d2de6e47afe740490b72b0a10aa..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ServiceNameRegisterRemoteWorker.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider.register; - -import org.apache.skywalking.apm.collector.analysis.register.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.*; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; - -/** - * @author peng-yongsheng - */ -public class ServiceNameRegisterRemoteWorker extends AbstractRemoteWorker { - - private ServiceNameRegisterRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return WorkerIdDefine.SERVICE_NAME_REGISTER_REMOTE_WORKER; - } - - @Override protected void onWork(ServiceName serviceName) { - onNext(serviceName); - } - - @Override public Selector selector() { - return Selector.ForeverFirst; - } - - public static class Factory extends AbstractRemoteWorkerProvider { - - public Factory(ModuleManager moduleManager, RemoteSenderService remoteSenderService, int graphId) { - super(moduleManager, remoteSenderService, graphId); - } - - @Override public ServiceNameRegisterRemoteWorker workerInstance(ModuleManager moduleManager) { - return new ServiceNameRegisterRemoteWorker(moduleManager); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ServiceNameRegisterSerialWorker.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ServiceNameRegisterSerialWorker.java deleted file mode 100644 index c90ad7847729bc6ecd8e93263b790a5511b518c4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/ServiceNameRegisterSerialWorker.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider.register; - -import org.apache.skywalking.apm.collector.analysis.register.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.*; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.ServiceIdCacheService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.register.IServiceNameRegisterDAO; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class ServiceNameRegisterSerialWorker extends AbstractLocalAsyncWorker { - - private static final Logger logger = LoggerFactory.getLogger(ServiceNameRegisterSerialWorker.class); - - private final IServiceNameRegisterDAO serviceNameRegisterDAO; - private final ServiceIdCacheService serviceIdCacheService; - - private ServiceNameRegisterSerialWorker(ModuleManager moduleManager) { - super(moduleManager); - this.serviceNameRegisterDAO = getModuleManager().find(StorageModule.NAME).getService(IServiceNameRegisterDAO.class); - this.serviceIdCacheService = getModuleManager().find(CacheModule.NAME).getService(ServiceIdCacheService.class); - } - - @Override public int id() { - return WorkerIdDefine.SERVICE_NAME_REGISTER_SERIAL_WORKER; - } - - @Override protected void onWork(ServiceName serviceName) { - if (logger.isDebugEnabled()) { - logger.debug("register service name: {}, application id: {}", serviceName.getServiceName(), serviceName.getApplicationId()); - } - - int serviceId = serviceIdCacheService.get(serviceName.getApplicationId(), serviceName.getSrcSpanType(), serviceName.getServiceName()); - if (serviceId == 0) { - long now = System.currentTimeMillis(); - ServiceName newServiceName; - - int min = serviceNameRegisterDAO.getMinServiceId(); - if (min == 0) { - ServiceName noneServiceName = new ServiceName(); - noneServiceName.setId("1"); - noneServiceName.setApplicationId(Const.NONE_APPLICATION_ID); - noneServiceName.setServiceId(Const.NONE_SERVICE_ID); - noneServiceName.setServiceName(Const.NONE_SERVICE_NAME); - noneServiceName.setSrcSpanType(Const.SPAN_TYPE_VIRTUAL); - noneServiceName.setRegisterTime(now); - noneServiceName.setHeartBeatTime(now); - serviceNameRegisterDAO.save(noneServiceName); - - newServiceName = new ServiceName(); - newServiceName.setId("-1"); - newServiceName.setApplicationId(serviceName.getApplicationId()); - newServiceName.setServiceId(-1); - newServiceName.setSrcSpanType(serviceName.getSrcSpanType()); - newServiceName.setServiceName(serviceName.getServiceName()); - newServiceName.setRegisterTime(now); - newServiceName.setHeartBeatTime(now); - } else { - int max = serviceNameRegisterDAO.getMaxServiceId(); - serviceId = IdAutoIncrement.INSTANCE.increment(min, max); - - newServiceName = new ServiceName(); - newServiceName.setId(String.valueOf(serviceId)); - newServiceName.setApplicationId(serviceName.getApplicationId()); - newServiceName.setServiceId(serviceId); - newServiceName.setSrcSpanType(serviceName.getSrcSpanType()); - newServiceName.setServiceName(serviceName.getServiceName()); - newServiceName.setRegisterTime(now); - newServiceName.setHeartBeatTime(now); - } - serviceNameRegisterDAO.save(newServiceName); - } - } - - public static class Factory extends AbstractLocalAsyncWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public ServiceNameRegisterSerialWorker workerInstance(ModuleManager moduleManager) { - return new ServiceNameRegisterSerialWorker(moduleManager); - } - - @Override public int queueSize() { - return 256; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/ApplicationIDService.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/ApplicationIDService.java deleted file mode 100644 index 5eeb90d259c0981a82201c38f761319290941554..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/ApplicationIDService.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider.service; - -import org.apache.skywalking.apm.collector.analysis.register.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IApplicationIDService; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService; -import org.apache.skywalking.apm.collector.cache.service.NetworkAddressCacheService; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.BooleanUtils; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.register.Application; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class ApplicationIDService implements IApplicationIDService { - - private final ModuleManager moduleManager; - private ApplicationCacheService applicationCacheService; - private NetworkAddressCacheService networkAddressCacheService; - private Graph applicationRegisterGraph; - - public ApplicationIDService(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private Graph getApplicationRegisterGraph() { - if (isNull(applicationRegisterGraph)) { - this.applicationRegisterGraph = GraphManager.INSTANCE.findGraph(GraphIdDefine.APPLICATION_REGISTER_GRAPH_ID, Application.class); - } - return this.applicationRegisterGraph; - } - - private ApplicationCacheService getApplicationCacheService() { - if (isNull(applicationCacheService)) { - this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class); - } - return applicationCacheService; - } - - private NetworkAddressCacheService getNetworkAddressCacheService() { - if (isNull(networkAddressCacheService)) { - this.networkAddressCacheService = moduleManager.find(CacheModule.NAME).getService(NetworkAddressCacheService.class); - } - return networkAddressCacheService; - } - - @Override public int getOrCreateForApplicationCode(String applicationCode) { - int applicationId = getApplicationCacheService().getApplicationIdByCode(applicationCode); - - if (applicationId == 0) { - Application application = new Application(); - application.setId(applicationCode); - application.setApplicationCode(applicationCode); - application.setApplicationId(0); - application.setAddressId(Const.NONE); - application.setIsAddress(BooleanUtils.FALSE); - - getApplicationRegisterGraph().start(application); - } - return applicationId; - } - - @Override public int getOrCreateForAddressId(int addressId, String networkAddress) { - int applicationId = getApplicationCacheService().getApplicationIdByAddressId(addressId); - - if (applicationId == 0) { - Application application = new Application(); - application.setId(networkAddress); - application.setApplicationCode(networkAddress); - application.setApplicationId(0); - application.setAddressId(addressId); - application.setIsAddress(BooleanUtils.TRUE); - - getApplicationRegisterGraph().start(application); - } - return applicationId; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/InstanceIDService.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/InstanceIDService.java deleted file mode 100644 index 400a0337c3a512349e8cb005ac128fc6706c1848..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/InstanceIDService.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider.service; - -import org.apache.skywalking.apm.collector.analysis.register.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.register.define.service.AgentOsInfo; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IInstanceIDService; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService; -import org.apache.skywalking.apm.collector.cache.service.InstanceCacheService; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.BooleanUtils; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.register.Instance; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class InstanceIDService implements IInstanceIDService { - - private static final Logger logger = LoggerFactory.getLogger(InstanceIDService.class); - - private final ModuleManager moduleManager; - private InstanceCacheService instanceCacheService; - private Graph instanceRegisterGraph; - private ApplicationCacheService applicationCacheService; - - public InstanceIDService(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private InstanceCacheService getInstanceCacheService() { - if (isNull(instanceCacheService)) { - instanceCacheService = moduleManager.find(CacheModule.NAME).getService(InstanceCacheService.class); - } - return instanceCacheService; - } - - private Graph getInstanceRegisterGraph() { - if (isNull(instanceRegisterGraph)) { - this.instanceRegisterGraph = GraphManager.INSTANCE.createIfAbsent(GraphIdDefine.INSTANCE_REGISTER_GRAPH_ID, Instance.class); - } - return instanceRegisterGraph; - } - - private ApplicationCacheService getApplicationCacheService() { - if (isNull(applicationCacheService)) { - this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class); - } - return applicationCacheService; - } - - @Override public int getOrCreateByAgentUUID(int applicationId, String agentUUID, long registerTime, AgentOsInfo osInfo) { - if (logger.isDebugEnabled()) { - logger.debug("get or getOrCreate instance id by agent UUID, application id: {}, agentUUID: {}, registerTime: {}, osInfo: {}", applicationId, agentUUID, registerTime, osInfo); - } - - int instanceId = getInstanceCacheService().getInstanceIdByAgentUUID(applicationId, agentUUID); - - if (instanceId == 0) { - Instance instance = new Instance(); - instance.setId("0"); - instance.setApplicationId(applicationId); - instance.setApplicationCode(getApplicationCacheService().getApplicationById(applicationId).getApplicationCode()); - instance.setAgentUUID(agentUUID); - instance.setRegisterTime(registerTime); - instance.setHeartBeatTime(registerTime); - instance.setInstanceId(0); - instance.setOsInfo(osInfo.toString()); - instance.setIsAddress(BooleanUtils.FALSE); - instance.setAddressId(Const.NONE); - - getInstanceRegisterGraph().start(instance); - } - return instanceId; - } - - @Override public int getOrCreateByAddressId(int applicationId, int addressId, long registerTime) { - if (logger.isDebugEnabled()) { - logger.debug("get or getOrCreate instance id by address id, application id: {}, address id: {}, registerTime: {}", applicationId, addressId, registerTime); - } - - int instanceId = getInstanceCacheService().getInstanceIdByAddressId(applicationId, addressId); - - if (instanceId == 0) { - Instance instance = new Instance(); - instance.setId("0"); - instance.setApplicationId(applicationId); - instance.setApplicationCode(getApplicationCacheService().getApplicationById(applicationId).getApplicationCode()); - instance.setAgentUUID(Const.EMPTY_STRING); - instance.setRegisterTime(registerTime); - instance.setHeartBeatTime(registerTime); - instance.setInstanceId(0); - instance.setOsInfo(Const.EMPTY_STRING); - instance.setIsAddress(BooleanUtils.TRUE); - instance.setAddressId(addressId); - - getInstanceRegisterGraph().start(instance); - } - return instanceId; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/NetworkAddressIDService.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/NetworkAddressIDService.java deleted file mode 100644 index bc9856c341180ac284329fc0a702b1468e673a14..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/NetworkAddressIDService.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider.service; - -import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule; -import org.apache.skywalking.apm.collector.analysis.register.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IApplicationIDService; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IInstanceIDService; -import org.apache.skywalking.apm.collector.analysis.register.define.service.INetworkAddressIDService; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.NetworkAddressCacheService; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddress; - -import static java.util.Objects.isNull; -import static java.util.Objects.nonNull; - -/** - * @author peng-yongsheng - */ -public class NetworkAddressIDService implements INetworkAddressIDService { - - private final ModuleManager moduleManager; - private NetworkAddressCacheService networkAddressCacheService; - private IApplicationIDService applicationIDService; - private IInstanceIDService instanceIDService; - private Graph networkAddressGraph; - - public NetworkAddressIDService(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private NetworkAddressCacheService getNetworkAddressCacheService() { - if (isNull(networkAddressCacheService)) { - this.networkAddressCacheService = moduleManager.find(CacheModule.NAME).getService(NetworkAddressCacheService.class); - } - return this.networkAddressCacheService; - } - - private IApplicationIDService getApplicationIDService() { - if (isNull(applicationIDService)) { - this.applicationIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IApplicationIDService.class); - } - return this.applicationIDService; - } - - private IInstanceIDService getInstanceIDService() { - if (isNull(instanceIDService)) { - this.instanceIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IInstanceIDService.class); - } - return this.instanceIDService; - } - - private Graph getNetworkAddressGraph() { - if (isNull(networkAddressGraph)) { - this.networkAddressGraph = GraphManager.INSTANCE.findGraph(GraphIdDefine.NETWORK_ADDRESS_NAME_REGISTER_GRAPH_ID, NetworkAddress.class); - } - return this.networkAddressGraph; - } - - @Override public int getOrCreate(String networkAddress) { - int addressId = getNetworkAddressCacheService().getAddressId(networkAddress); - - if (addressId != 0) { - int applicationId = getApplicationIDService().getOrCreateForAddressId(addressId, networkAddress); - - if (applicationId != 0) { - int instanceId = getInstanceIDService().getOrCreateByAddressId(applicationId, addressId, System.currentTimeMillis()); - - if (instanceId != 0) { - return addressId; - } - } - } else { - NetworkAddress newNetworkAddress = new NetworkAddress(); - newNetworkAddress.setId(String.valueOf(Const.NONE)); - newNetworkAddress.setNetworkAddress(networkAddress); - newNetworkAddress.setSrcSpanLayer(Const.NONE); - newNetworkAddress.setServerType(Const.NONE); - newNetworkAddress.setAddressId(Const.NONE); - - getNetworkAddressGraph().start(newNetworkAddress); - } - - return 0; - } - - @Override public int get(String networkAddress) { - return getNetworkAddressCacheService().getAddressId(networkAddress); - } - - @Override public void update(int addressId, int spanLayer, int serverType) { - if (!this.compare(addressId, spanLayer, serverType)) { - NetworkAddress newNetworkAddress = new NetworkAddress(); - newNetworkAddress.setId(String.valueOf(addressId)); - newNetworkAddress.setSrcSpanLayer(spanLayer); - newNetworkAddress.setServerType(serverType); - newNetworkAddress.setAddressId(addressId); - - getNetworkAddressGraph().start(newNetworkAddress); - } - } - - private boolean compare(int addressId, int spanLayer, int serverType) { - NetworkAddress networkAddress = networkAddressCacheService.getAddress(addressId); - - if (nonNull(networkAddress)) { - return spanLayer == networkAddress.getSrcSpanLayer() && serverType == networkAddress.getServerType(); - } - return true; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/ServiceNameService.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/ServiceNameService.java deleted file mode 100644 index 67cbdc8597e615543b04d35d39fce0715e3bc680..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/ServiceNameService.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider.service; - -import org.apache.skywalking.apm.collector.analysis.register.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IServiceNameService; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.ServiceIdCacheService; -import org.apache.skywalking.apm.collector.core.graph.Graph; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class ServiceNameService implements IServiceNameService { - - private final Logger logger = LoggerFactory.getLogger(ServiceNameService.class); - - private final ModuleManager moduleManager; - private ServiceIdCacheService serviceIdCacheService; - private Graph serviceNameRegisterGraph; - - public ServiceNameService(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private ServiceIdCacheService getServiceIdCacheService() { - if (isNull(serviceIdCacheService)) { - serviceIdCacheService = moduleManager.find(CacheModule.NAME).getService(ServiceIdCacheService.class); - } - return serviceIdCacheService; - } - - private Graph getServiceNameRegisterGraph() { - if (isNull(serviceNameRegisterGraph)) { - this.serviceNameRegisterGraph = GraphManager.INSTANCE.createIfAbsent(GraphIdDefine.SERVICE_NAME_REGISTER_GRAPH_ID, ServiceName.class); - } - return serviceNameRegisterGraph; - } - - @Override public int getOrCreate(int applicationId, int srcSpanType, String serviceName) { - int serviceId = getServiceIdCacheService().get(applicationId, srcSpanType, serviceName); - - if (serviceId == 0) { - ServiceName service = new ServiceName(); - service.setId("0"); - service.setApplicationId(applicationId); - service.setServiceName(serviceName); - service.setSrcSpanType(srcSpanType); - service.setServiceId(0); - - getServiceNameRegisterGraph().start(service); - } - return serviceId; - } - - @Override public int get(int applicationId, int srcSpanType, String serviceName) { - return getServiceIdCacheService().get(applicationId, srcSpanType, serviceName); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index 7fcd99df62055a607fb7c3aac12179978da8ddb9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.analysis.register.provider.AnalysisRegisterModuleProvider \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/IdAutoIncrementTestCase.java b/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/IdAutoIncrementTestCase.java deleted file mode 100644 index ad9d0e28588b20b5c2e3a32ec7c036c7d7950283..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/IdAutoIncrementTestCase.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.register.provider.register; - -import org.junit.Assert; -import org.junit.Test; - -/** - * @author peng-yongsheng - */ -public class IdAutoIncrementTestCase { - - @Test - public void testIncrement() { - int id = IdAutoIncrement.INSTANCE.increment(0, 0); - Assert.assertEquals(-1, id); - - id = IdAutoIncrement.INSTANCE.increment(-1, -1); - Assert.assertEquals(1, id); - - id = IdAutoIncrement.INSTANCE.increment(-1, 1); - Assert.assertEquals(2, id); - - id = IdAutoIncrement.INSTANCE.increment(-1, 2); - Assert.assertEquals(-2, id); - - id = IdAutoIncrement.INSTANCE.increment(-2, 2); - Assert.assertEquals(3, id); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/pom.xml b/apm-collector/apm-collector-analysis/analysis-segment-parser/pom.xml deleted file mode 100644 index 76578f35aadcff2d9cb2c5d9610b76c790d7bc1e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - apm-collector-analysis - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - analysis-segment-parser - pom - - segment-parser-define - segment-parser-provider - - \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/pom.xml b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/pom.xml deleted file mode 100644 index 49eda5aca60efb43846ff73e8fde7f21ff0ade00..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - analysis-segment-parser - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - segment-parser-define - jar - - - - org.apache.skywalking - apm-network - ${project.version} - - - org.apache.skywalking - collector-configuration-define - ${project.version} - - - diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/AnalysisSegmentParserModule.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/AnalysisSegmentParserModule.java deleted file mode 100644 index 4cbcdb2a77928a82cae09a710b68b350cbf3b428..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/AnalysisSegmentParserModule.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.define; - -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.service.ISegmentParseService; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.service.ISegmentParserListenerRegister; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; - -/** - * @author peng-yongsheng - */ -public class AnalysisSegmentParserModule extends ModuleDefine { - - public static final String NAME = "analysis_segment_parser"; - - @Override public String name() { - return NAME; - } - - @Override public Class[] services() { - return new Class[] {ISegmentParseService.class, ISegmentParserListenerRegister.class}; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/graph/GraphIdDefine.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/graph/GraphIdDefine.java deleted file mode 100644 index 3229791b5dacf227a23402d04a7b019d0eda5384..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/graph/GraphIdDefine.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.define.graph; - -/** - * @author peng-yongsheng - */ -public class GraphIdDefine { - public static final int SEGMENT_PERSISTENCE_GRAPH_ID = 100; - public static final int SEGMENT_STANDARDIZATION_GRAPH_ID = 101; -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/graph/WorkerIdDefine.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/graph/WorkerIdDefine.java deleted file mode 100644 index 8d082fe31d032562d981c1633a41ba6576a02d30..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/graph/WorkerIdDefine.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.define.graph; - -/** - * @author peng-yongsheng - */ -public class WorkerIdDefine { - public static final int SEGMENT_PERSISTENCE_WORKER_ID = 100; - public static final int SEGMENT_STANDARDIZATION_WORKER_ID = 101; -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/service/ISegmentParseService.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/service/ISegmentParseService.java deleted file mode 100644 index 18935932e781d172d79c62de78626ca3159af743..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/service/ISegmentParseService.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.define.service; - -import org.apache.skywalking.apm.collector.core.module.Service; -import org.apache.skywalking.apm.network.language.agent.UpstreamSegment; - -/** - * @author peng-yongsheng - */ -public interface ISegmentParseService extends Service { - void parse(UpstreamSegment segment, Source source); - - enum Source { - Agent, Buffer - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/service/ISegmentParserListenerRegister.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/service/ISegmentParserListenerRegister.java deleted file mode 100644 index 16f76768951dfcacece3431d6789a1304e4fa13a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/service/ISegmentParserListenerRegister.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.define.service; - -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.SpanListenerFactory; -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface ISegmentParserListenerRegister extends Service { - void register(SpanListenerFactory spanListenerFactory); -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine deleted file mode 100644 index 8fb3ff2097d6a59b9c7e82f76728ff10706ea44b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.analysis.segment.parser.define.AnalysisSegmentParserModule \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/pom.xml b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/pom.xml deleted file mode 100644 index 348a9fd011c024b902792f7d6afaafdf90e4a883..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - analysis-segment-parser - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - segment-parser-provider - jar - - - - org.apache.skywalking - collector-configuration-define - ${project.version} - - - org.apache.skywalking - segment-parser-define - ${project.version} - - - org.apache.skywalking - register-define - ${project.version} - - - org.apache.skywalking - collector-cache-define - ${project.version} - - - org.apache.skywalking - collector-storage-define - ${project.version} - - - org.apache.skywalking - analysis-worker-model - ${project.version} - - - diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/AnalysisSegmentParserModuleConfig.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/AnalysisSegmentParserModuleConfig.java deleted file mode 100644 index 8c277177be8a8c5b33e66c6c6e3ff469f0aa4ea3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/AnalysisSegmentParserModuleConfig.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.provider; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author peng-yongsheng - */ -public class AnalysisSegmentParserModuleConfig extends ModuleConfig { - - private String bufferFilePath; - private String bufferOffsetMaxFileSize; - private String bufferSegmentMaxFileSize; - private boolean bufferFileCleanWhenRestart; - - public String getBufferFilePath() { - return bufferFilePath; - } - - public void setBufferFilePath(String bufferFilePath) { - this.bufferFilePath = bufferFilePath; - } - - public String getBufferOffsetMaxFileSize() { - return bufferOffsetMaxFileSize; - } - - public void setBufferOffsetMaxFileSize(String bufferOffsetMaxFileSize) { - this.bufferOffsetMaxFileSize = bufferOffsetMaxFileSize; - } - - public String getBufferSegmentMaxFileSize() { - return bufferSegmentMaxFileSize; - } - - public void setBufferSegmentMaxFileSize(String bufferSegmentMaxFileSize) { - this.bufferSegmentMaxFileSize = bufferSegmentMaxFileSize; - } - - public boolean isBufferFileCleanWhenRestart() { - return bufferFileCleanWhenRestart; - } - - public void setBufferFileCleanWhenRestart(boolean bufferFileCleanWhenRestart) { - this.bufferFileCleanWhenRestart = bufferFileCleanWhenRestart; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/AnalysisSegmentParserModuleProvider.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/AnalysisSegmentParserModuleProvider.java deleted file mode 100644 index 9bd8e712bece072664b1e7ebc36ff035195c35b2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/AnalysisSegmentParserModuleProvider.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.provider; - -import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.AnalysisSegmentParserModule; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.service.*; -import org.apache.skywalking.apm.collector.analysis.segment.parser.provider.buffer.*; -import org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser.*; -import org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser.standardization.SegmentStandardizationGraph; -import org.apache.skywalking.apm.collector.analysis.segment.parser.provider.service.*; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.analysis.worker.timer.PersistenceTimer; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.storage.StorageModule; - -/** - * @author peng-yongsheng - */ -public class AnalysisSegmentParserModuleProvider extends ModuleProvider { - - private static final String NAME = "default"; - private final AnalysisSegmentParserModuleConfig config; - private SegmentParserListenerManager listenerManager; - - public AnalysisSegmentParserModuleProvider() { - super(); - this.config = new AnalysisSegmentParserModuleConfig(); - } - - @Override public String name() { - return NAME; - } - - @Override public Class module() { - return AnalysisSegmentParserModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() throws ServiceNotProvidedException { - this.listenerManager = new SegmentParserListenerManager(); - this.registerServiceImplementation(ISegmentParserListenerRegister.class, new SegmentParserListenerRegister(listenerManager)); - this.registerServiceImplementation(ISegmentParseService.class, new SegmentParseService(getManager(), listenerManager)); - - BufferFileConfig.Parser parser = new BufferFileConfig.Parser(); - parser.parse(config); - } - - @Override public void start() { - WorkerCreateListener workerCreateListener = new WorkerCreateListener(); - - graphCreate(workerCreateListener); - - PersistenceTimer.INSTANCE.start(getManager(), workerCreateListener.getPersistenceWorkers()); - - SegmentBufferReader.INSTANCE.setSegmentParserListenerManager(listenerManager); - } - - @Override public void notifyAfterCompleted() { - } - - @Override public String[] requiredModules() { - return new String[] {ConfigurationModule.NAME, StorageModule.NAME, AnalysisRegisterModule.NAME, CacheModule.NAME}; - } - - private void graphCreate(WorkerCreateListener workerCreateListener) { - new SegmentPersistenceGraph(getManager(), workerCreateListener).create(); - new SegmentStandardizationGraph(getManager(), workerCreateListener).create(); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/BufferFileConfig.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/BufferFileConfig.java deleted file mode 100644 index f1f7ee613804263293eb6e58063932bd3e599e6f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/BufferFileConfig.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.provider.buffer; - -import org.apache.skywalking.apm.collector.analysis.segment.parser.provider.AnalysisSegmentParserModuleConfig; -import org.apache.skywalking.apm.collector.core.util.StringUtils; - -/** - * @author peng-yongsheng - */ -public class BufferFileConfig { - static int BUFFER_OFFSET_MAX_FILE_SIZE = 10 * 1024 * 1024; - static int BUFFER_SEGMENT_MAX_FILE_SIZE = 10 * 1024 * 1024; - static String BUFFER_PATH = "../buffer/"; - static boolean BUFFER_FILE_CLEAN_WHEN_RESTART = false; - - public static class Parser { - - public void parse(AnalysisSegmentParserModuleConfig config) { - if (StringUtils.isNotEmpty(config.getBufferFilePath())) { - BUFFER_PATH = config.getBufferFilePath(); - } - - if (StringUtils.isNotEmpty(config.getBufferOffsetMaxFileSize())) { - String sizeStr = config.getBufferOffsetMaxFileSize().toUpperCase(); - if (sizeStr.endsWith("K")) { - int size = Integer.parseInt(sizeStr.replace("K", "")); - BUFFER_OFFSET_MAX_FILE_SIZE = size * 1024; - } else if (sizeStr.endsWith("KB")) { - int size = Integer.parseInt(sizeStr.replace("KB", "")); - BUFFER_OFFSET_MAX_FILE_SIZE = size * 1024; - } else if (sizeStr.endsWith("M")) { - int size = Integer.parseInt(sizeStr.replace("M", "")); - BUFFER_OFFSET_MAX_FILE_SIZE = size * 1024 * 1024; - } else if (sizeStr.endsWith("MB")) { - int size = Integer.parseInt(sizeStr.replace("MB", "")); - BUFFER_OFFSET_MAX_FILE_SIZE = size * 1024 * 1024; - } else { - BUFFER_OFFSET_MAX_FILE_SIZE = 10 * 1024 * 1024; - } - } else { - BUFFER_OFFSET_MAX_FILE_SIZE = 10 * 1024 * 1024; - } - - if (StringUtils.isNotEmpty(config.getBufferSegmentMaxFileSize())) { - String sizeStr = config.getBufferSegmentMaxFileSize().toUpperCase(); - if (sizeStr.endsWith("K")) { - int size = Integer.parseInt(sizeStr.replace("K", "")); - BUFFER_SEGMENT_MAX_FILE_SIZE = size * 1024; - } else if (sizeStr.endsWith("KB")) { - int size = Integer.parseInt(sizeStr.replace("KB", "")); - BUFFER_SEGMENT_MAX_FILE_SIZE = size * 1024; - } else if (sizeStr.endsWith("M")) { - int size = Integer.parseInt(sizeStr.replace("M", "")); - BUFFER_SEGMENT_MAX_FILE_SIZE = size * 1024 * 1024; - } else if (sizeStr.endsWith("MB")) { - int size = Integer.parseInt(sizeStr.replace("MB", "")); - BUFFER_SEGMENT_MAX_FILE_SIZE = size * 1024 * 1024; - } else { - BUFFER_SEGMENT_MAX_FILE_SIZE = 1024 * 1024; - } - } else { - BUFFER_SEGMENT_MAX_FILE_SIZE = 1024 * 1024; - } - - BUFFER_FILE_CLEAN_WHEN_RESTART = config.isBufferFileCleanWhenRestart(); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/Offset.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/Offset.java deleted file mode 100644 index 7302690a3d70c20b968e39437e9a359f56a7bb97..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/Offset.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.provider.buffer; - -/** - * @author peng-yongsheng - */ -public class Offset { - - private static final String SPLIT_CHARACTER = ","; - private ReadOffset readOffset; - private WriteOffset writeOffset; - - public Offset() { - readOffset = new ReadOffset(); - writeOffset = new WriteOffset(); - } - - public String serialize() { - return readOffset.getReadFileName() + SPLIT_CHARACTER + String.valueOf(readOffset.getReadFileOffset()) - + SPLIT_CHARACTER + writeOffset.getWriteFileName() + SPLIT_CHARACTER + String.valueOf(writeOffset.getWriteFileOffset()); - } - - public void deserialize(String value) { - String[] values = value.split(SPLIT_CHARACTER); - if (values.length == 4) { - this.readOffset.readFileName = values[0]; - this.readOffset.readFileOffset = Long.parseLong(values[1]); - this.writeOffset.writeFileName = values[2]; - this.writeOffset.writeFileOffset = Long.parseLong(values[3]); - } - } - - public ReadOffset getReadOffset() { - return readOffset; - } - - public WriteOffset getWriteOffset() { - return writeOffset; - } - - public static class ReadOffset { - private String readFileName; - private long readFileOffset = 0; - - public String getReadFileName() { - return readFileName; - } - - public long getReadFileOffset() { - return readFileOffset; - } - - public void setReadFileName(String readFileName) { - this.readFileName = readFileName; - } - - public void setReadFileOffset(long readFileOffset) { - this.readFileOffset = readFileOffset; - } - } - - public static class WriteOffset { - private String writeFileName; - private long writeFileOffset = 0; - - public String getWriteFileName() { - return writeFileName; - } - - public long getWriteFileOffset() { - return writeFileOffset; - } - - public void setWriteFileName(String writeFileName) { - this.writeFileName = writeFileName; - } - - public void setWriteFileOffset(long writeFileOffset) { - this.writeFileOffset = writeFileOffset; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/OffsetManager.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/OffsetManager.java deleted file mode 100644 index 67c162e522a45a807fb748973a6f38fec50c4afa..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/OffsetManager.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.provider.buffer; - -import java.io.File; -import java.io.FilenameFilter; -import java.io.IOException; -import java.io.RandomAccessFile; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; -import org.apache.skywalking.apm.collector.core.util.CollectionUtils; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.FileUtils; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.util.RunnableWithExceptionProtection; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public enum OffsetManager { - INSTANCE; - - private static final Logger logger = LoggerFactory.getLogger(OffsetManager.class); - - private static final String OFFSET_FILE_PREFIX = "offset"; - private File offsetFile; - private Offset offset; - private boolean initialized = false; - private RandomAccessFile randomAccessFile = null; - private String lastOffsetRecord = Const.EMPTY_STRING; - - public synchronized void initialize() throws IOException { - if (!initialized) { - this.offset = new Offset(); - File dataPath = new File(BufferFileConfig.BUFFER_PATH); - if (dataPath.mkdirs()) { - createOffsetFile(); - } else { - File[] offsetFiles = dataPath.listFiles(new PrefixFileNameFilter()); - if (CollectionUtils.isNotEmpty(offsetFiles) && offsetFiles.length > 0) { - for (int i = 0; i < offsetFiles.length; i++) { - if (i != offsetFiles.length - 1) { - offsetFiles[i].delete(); - } else { - offsetFile = offsetFiles[i]; - } - } - } else { - createOffsetFile(); - } - } - String offsetRecord = FileUtils.INSTANCE.readLastLine(offsetFile); - offset.deserialize(offsetRecord); - initialized = true; - - Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate( - new RunnableWithExceptionProtection(this::flush, - t -> logger.error("flush offset file in background failure.", t) - ), 10, 3, TimeUnit.SECONDS); - } - } - - private void createOffsetFile() throws IOException { - String timeBucket = String.valueOf(TimeBucketUtils.INSTANCE.getSecondTimeBucket(System.currentTimeMillis())); - String offsetFileName = OFFSET_FILE_PREFIX + "_" + timeBucket + "." + Const.FILE_SUFFIX; - offsetFile = new File(BufferFileConfig.BUFFER_PATH + offsetFileName); - this.offset.getWriteOffset().setWriteFileName(Const.EMPTY_STRING); - this.offset.getWriteOffset().setWriteFileOffset(0); - this.offset.getReadOffset().setReadFileName(Const.EMPTY_STRING); - this.offset.getReadOffset().setReadFileOffset(0); - this.flush(); - } - - public void flush() { - String offsetRecord = offset.serialize(); - if (!lastOffsetRecord.equals(offsetRecord)) { - if (offsetFile.length() >= BufferFileConfig.BUFFER_OFFSET_MAX_FILE_SIZE) { - nextFile(); - } - FileUtils.INSTANCE.writeAppendToLast(offsetFile, randomAccessFile, offsetRecord); - lastOffsetRecord = offsetRecord; - } - } - - private void nextFile() { - String timeBucket = String.valueOf(TimeBucketUtils.INSTANCE.getSecondTimeBucket(System.currentTimeMillis())); - String offsetFileName = OFFSET_FILE_PREFIX + "_" + timeBucket + "." + Const.FILE_SUFFIX; - File newOffsetFile = new File(BufferFileConfig.BUFFER_PATH + offsetFileName); - offsetFile.delete(); - offsetFile = newOffsetFile; - this.flush(); - } - - public String getReadFileName() { - return offset.getReadOffset().getReadFileName(); - } - - public long getReadFileOffset() { - return offset.getReadOffset().getReadFileOffset(); - } - - public void setReadOffset(long readFileOffset) { - offset.getReadOffset().setReadFileOffset(readFileOffset); - } - - public void setReadOffset(String readFileName, long readFileOffset) { - offset.getReadOffset().setReadFileName(readFileName); - offset.getReadOffset().setReadFileOffset(readFileOffset); - } - - public String getWriteFileName() { - return offset.getWriteOffset().getWriteFileName(); - } - - public long getWriteFileOffset() { - return offset.getWriteOffset().getWriteFileOffset(); - } - - public void setWriteOffset(String writeFileName, long writeFileOffset) { - offset.getWriteOffset().setWriteFileName(writeFileName); - offset.getWriteOffset().setWriteFileOffset(writeFileOffset); - } - - public void setWriteOffset(long writeFileOffset) { - offset.getWriteOffset().setWriteFileOffset(writeFileOffset); - } - - class PrefixFileNameFilter implements FilenameFilter { - @Override public boolean accept(File dir, String name) { - return name.startsWith(OFFSET_FILE_PREFIX); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/SegmentBufferManager.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/SegmentBufferManager.java deleted file mode 100644 index 5f7e5460a7e114f5812b5dbcc29344acd649e1c7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/SegmentBufferManager.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.provider.buffer; - -import java.io.*; -import java.nio.channels.FileLock; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.*; -import org.apache.skywalking.apm.network.language.agent.UpstreamSegment; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public enum SegmentBufferManager { - INSTANCE; - - private static final Logger logger = LoggerFactory.getLogger(SegmentBufferManager.class); - - public static final String DATA_FILE_PREFIX = "data"; - private FileOutputStream outputStream; - - public synchronized void initialize(ModuleManager moduleManager) { - logger.info("segment buffer initialize"); - try { - OffsetManager.INSTANCE.initialize(); - if (new File(BufferFileConfig.BUFFER_PATH).mkdirs()) { - tryLock(); - newDataFile(); - } else if (BufferFileConfig.BUFFER_FILE_CLEAN_WHEN_RESTART) { - deleteFiles(); - tryLock(); - newDataFile(); - } else { - tryLock(); - String writeFileName = OffsetManager.INSTANCE.getWriteFileName(); - if (StringUtils.isNotEmpty(writeFileName)) { - File dataFile = new File(BufferFileConfig.BUFFER_PATH + writeFileName); - if (dataFile.exists()) { - outputStream = new FileOutputStream(new File(BufferFileConfig.BUFFER_PATH + writeFileName), true); - } else { - newDataFile(); - } - } else { - newDataFile(); - } - } - SegmentBufferReader.INSTANCE.initialize(moduleManager); - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - } - - public synchronized void writeBuffer(UpstreamSegment segment) { - try { - segment.writeDelimitedTo(outputStream); - long position = outputStream.getChannel().position(); - if (position > BufferFileConfig.BUFFER_SEGMENT_MAX_FILE_SIZE) { - newDataFile(); - } else { - OffsetManager.INSTANCE.setWriteOffset(position); - } - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - } - - private void tryLock() { - logger.info("try to lock buffer directory."); - FileLock lock = null; - - try { - lock = new FileOutputStream(BufferFileConfig.BUFFER_PATH + "lock").getChannel().tryLock(); - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - - if (lock == null) { - throw new RuntimeException("The buffer directory is reading or writing by another thread."); - } - } - - private void newDataFile() throws IOException { - if (logger.isDebugEnabled()) { - logger.debug("getOrCreate new segment buffer file"); - } - - String timeBucket = String.valueOf(TimeBucketUtils.INSTANCE.getSecondTimeBucket(System.currentTimeMillis())); - String writeFileName = DATA_FILE_PREFIX + "_" + timeBucket + "." + Const.FILE_SUFFIX; - File dataFile = new File(BufferFileConfig.BUFFER_PATH + writeFileName); - boolean created = dataFile.createNewFile(); - if (!created) { - logger.info("The file named {} already exists.", writeFileName); - } - - OffsetManager.INSTANCE.setWriteOffset(writeFileName, 0); - try { - if (outputStream != null) { - outputStream.close(); - } - outputStream = new FileOutputStream(dataFile); - outputStream.getChannel().position(0); - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - } - - private void deleteFiles() { - File bufferDirectory = new File(BufferFileConfig.BUFFER_PATH); - boolean delete = bufferDirectory.delete(); - if (delete) { - logger.info("Buffer directory is successfully deleted"); - } else { - logger.info("Buffer directory is not deleted"); - } - } - - public synchronized void flush() { - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/SegmentBufferReader.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/SegmentBufferReader.java deleted file mode 100644 index a94be0c7d6d84fe9bcca200837588310c159de0c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/buffer/SegmentBufferReader.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.provider.buffer; - -import com.google.protobuf.CodedOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FilenameFilter; -import java.io.IOException; -import java.io.InputStream; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.service.ISegmentParseService; -import org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser.SegmentParse; -import org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser.SegmentParserListenerManager; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.CollectionUtils; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.StringUtils; -import org.apache.skywalking.apm.network.language.agent.UpstreamSegment; -import org.apache.skywalking.apm.util.RunnableWithExceptionProtection; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public enum SegmentBufferReader { - INSTANCE; - - private static final Logger logger = LoggerFactory.getLogger(SegmentBufferReader.class); - private InputStream inputStream; - private ModuleManager moduleManager; - private SegmentParserListenerManager listenerManager; - - public void initialize(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate( - new RunnableWithExceptionProtection(this::preRead, - t -> logger.error("Segment buffer pre read failure.", t)), 3, 3, TimeUnit.SECONDS); - } - - public void setSegmentParserListenerManager(SegmentParserListenerManager listenerManager) { - this.listenerManager = listenerManager; - } - - private void preRead() { - String readFileName = OffsetManager.INSTANCE.getReadFileName(); - if (StringUtils.isNotEmpty(readFileName)) { - File readFile = new File(BufferFileConfig.BUFFER_PATH + readFileName); - if (readFile.exists()) { - deleteTheDataFilesBeforeReadFile(readFileName); - long readFileOffset = OffsetManager.INSTANCE.getReadFileOffset(); - read(readFile, readFileOffset); - readEarliestCreateDataFile(); - } else { - deleteTheDataFilesBeforeReadFile(readFileName); - readEarliestCreateDataFile(); - } - } else { - readEarliestCreateDataFile(); - } - } - - private void deleteTheDataFilesBeforeReadFile(String readFileName) { - File[] dataFiles = new File(BufferFileConfig.BUFFER_PATH).listFiles(new PrefixFileNameFilter()); - - long readFileCreateTime = getFileCreateTime(readFileName); - for (File dataFile : dataFiles) { - long fileCreateTime = getFileCreateTime(dataFile.getName()); - if (fileCreateTime < readFileCreateTime) { - dataFile.delete(); - } else if (fileCreateTime == readFileCreateTime) { - break; - } - } - } - - private long getFileCreateTime(String fileName) { - fileName = fileName.replace(SegmentBufferManager.DATA_FILE_PREFIX + "_", Const.EMPTY_STRING); - fileName = fileName.replace("." + Const.FILE_SUFFIX, Const.EMPTY_STRING); - return Long.valueOf(fileName); - } - - private void readEarliestCreateDataFile() { - String readFileName = OffsetManager.INSTANCE.getReadFileName(); - File[] dataFiles = new File(BufferFileConfig.BUFFER_PATH).listFiles(new PrefixFileNameFilter()); - - if (CollectionUtils.isNotEmpty(dataFiles)) { - if (dataFiles[0].getName().equals(readFileName)) { - return; - } - } - - for (File dataFile : dataFiles) { - if (logger.isDebugEnabled()) { - logger.debug("Reading segment buffer data file, file name: {}", dataFile.getAbsolutePath()); - } - - OffsetManager.INSTANCE.setReadOffset(dataFile.getName(), 0); - if (!read(dataFile, 0)) { - break; - } - } - } - - private boolean read(File readFile, long readFileOffset) { - try { - inputStream = new FileInputStream(readFile); - inputStream.skip(readFileOffset); - - String writeFileName = OffsetManager.INSTANCE.getWriteFileName(); - long endPoint = readFile.length(); - if (writeFileName.equals(readFile.getName())) { - endPoint = OffsetManager.INSTANCE.getWriteFileOffset(); - } - - while (readFile.length() > readFileOffset && readFileOffset < endPoint) { - UpstreamSegment upstreamSegment = UpstreamSegment.parser().parseDelimitedFrom(inputStream); - SegmentParse parse = new SegmentParse(moduleManager, listenerManager); - if (!parse.parse(upstreamSegment, ISegmentParseService.Source.Buffer)) { - return false; - } - - final int serialized = upstreamSegment.getSerializedSize(); - readFileOffset = readFileOffset + CodedOutputStream.computeUInt32SizeNoTag(serialized) + serialized; - - if (logger.isDebugEnabled()) { - logger.debug("read segment buffer from file: {}, offset: {}, file length: {}", readFile.getName(), readFileOffset, readFile.length()); - } - - OffsetManager.INSTANCE.setReadOffset(readFileOffset); - } - - inputStream.close(); - if (!writeFileName.equals(readFile.getName())) { - readFile.delete(); - } - } catch (IOException e) { - logger.error(e.getMessage(), e); - return false; - } - return true; - } - - class PrefixFileNameFilter implements FilenameFilter { - @Override public boolean accept(File dir, String name) { - return name.startsWith(SegmentBufferManager.DATA_FILE_PREFIX); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/SegmentPersistenceGraph.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/SegmentPersistenceGraph.java deleted file mode 100644 index b42a551042f7d75099ab8a673c90deae64ba3ef4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/SegmentPersistenceGraph.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser; - -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.table.segment.Segment; - -/** - * @author peng-yongsheng - */ -public class SegmentPersistenceGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public SegmentPersistenceGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - GraphManager.INSTANCE.createIfAbsent(GraphIdDefine.SEGMENT_PERSISTENCE_GRAPH_ID, Segment.class) - .addNode(new SegmentPersistenceWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/SegmentPersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/SegmentPersistenceWorker.java deleted file mode 100644 index f811a34f9297bcf9713aa2b05acd4687bed17e99..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/SegmentPersistenceWorker.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser; - -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ISegmentPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.segment.Segment; - -/** - * @author peng-yongsheng - */ -public class SegmentPersistenceWorker extends NonMergePersistenceWorker { - - private SegmentPersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public int id() { - return WorkerIdDefine.SEGMENT_PERSISTENCE_WORKER_ID; - } - - @Override protected boolean needMergeDBData() { - return false; - } - - @SuppressWarnings("unchecked") - @Override protected IPersistenceDAO persistenceDAO() { - return getModuleManager().find(StorageModule.NAME).getService(ISegmentPersistenceDAO.class); - } - - public static class Factory extends NonMergePersistenceWorkerProvider { - Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public SegmentPersistenceWorker workerInstance(ModuleManager moduleManager) { - return new SegmentPersistenceWorker(moduleManager); - } - - @Override - public int queueSize() { - return 2048; - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/ReferenceIdExchanger.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/ReferenceIdExchanger.java deleted file mode 100644 index 15f2653fa7654ca7527b94302918b5e7b0cab18c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/ReferenceIdExchanger.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser.standardization; - -import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule; -import org.apache.skywalking.apm.collector.analysis.register.define.service.INetworkAddressIDService; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IServiceNameService; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.ReferenceDecorator; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.InstanceCacheService; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.StringUtils; -import org.apache.skywalking.apm.network.language.agent.SpanType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class ReferenceIdExchanger implements IdExchanger { - - private static final Logger logger = LoggerFactory.getLogger(ReferenceIdExchanger.class); - - private static ReferenceIdExchanger EXCHANGER; - private final IServiceNameService serviceNameService; - private final InstanceCacheService instanceCacheService; - private final INetworkAddressIDService networkAddressIDService; - - public static ReferenceIdExchanger getInstance(ModuleManager moduleManager) { - if (EXCHANGER == null) { - EXCHANGER = new ReferenceIdExchanger(moduleManager); - } - return EXCHANGER; - } - - private ReferenceIdExchanger(ModuleManager moduleManager) { - this.serviceNameService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IServiceNameService.class); - this.networkAddressIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(INetworkAddressIDService.class); - this.instanceCacheService = moduleManager.find(CacheModule.NAME).getService(InstanceCacheService.class); - } - - @GraphComputingMetric(name = "/segment/parse/exchange/referenceIdExchanger") - @Override public boolean exchange(ReferenceDecorator standardBuilder, int applicationId) { - if (standardBuilder.getEntryServiceId() == 0) { - String entryServiceName = StringUtils.isNotEmpty(standardBuilder.getEntryServiceName()) ? standardBuilder.getEntryServiceName() : Const.DOMAIN_OPERATION_NAME; - int entryServiceId = serviceNameService.getOrCreate(instanceCacheService.getApplicationId(standardBuilder.getEntryApplicationInstanceId()), SpanType.Entry_VALUE, entryServiceName); - - if (entryServiceId == 0) { - if (logger.isDebugEnabled()) { - int entryApplicationId = instanceCacheService.getApplicationId(standardBuilder.getEntryApplicationInstanceId()); - logger.debug("entry service name: {} from application id: {} exchange failed", entryServiceName, entryApplicationId); - } - return false; - } else { - standardBuilder.toBuilder(); - standardBuilder.setEntryServiceId(entryServiceId); - standardBuilder.setEntryServiceName(Const.EMPTY_STRING); - } - } - - if (standardBuilder.getParentServiceId() == 0) { - String parentServiceName = StringUtils.isNotEmpty(standardBuilder.getParentServiceName()) ? standardBuilder.getParentServiceName() : Const.DOMAIN_OPERATION_NAME; - int parentServiceId = serviceNameService.getOrCreate(instanceCacheService.getApplicationId(standardBuilder.getParentApplicationInstanceId()), SpanType.Entry_VALUE, parentServiceName); - - if (parentServiceId == 0) { - if (logger.isDebugEnabled()) { - int parentApplicationId = instanceCacheService.getApplicationId(standardBuilder.getParentApplicationInstanceId()); - logger.debug("parent service name: {} from application id: {} exchange failed", parentServiceName, parentApplicationId); - } - return false; - } else { - standardBuilder.toBuilder(); - standardBuilder.setParentServiceId(parentServiceId); - standardBuilder.setParentServiceName(Const.EMPTY_STRING); - } - } - - if (standardBuilder.getNetworkAddressId() == 0 && StringUtils.isNotEmpty(standardBuilder.getNetworkAddress())) { - int networkAddressId = networkAddressIDService.getOrCreate(standardBuilder.getNetworkAddress()); - - if (networkAddressId == 0) { - if (logger.isDebugEnabled()) { - logger.debug("network address: {} from application id: {} exchange failed", standardBuilder.getNetworkAddress(), applicationId); - } - return false; - } else { - standardBuilder.toBuilder(); - standardBuilder.setNetworkAddressId(networkAddressId); - standardBuilder.setNetworkAddress(Const.EMPTY_STRING); - } - } - return true; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/SegmentStandardizationGraph.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/SegmentStandardizationGraph.java deleted file mode 100644 index c8a1191332129742a47d6eaf669e72437a909906..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/SegmentStandardizationGraph.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser.standardization; - -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerCreateListener; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; - -/** - * @author peng-yongsheng - */ -public class SegmentStandardizationGraph { - - private final ModuleManager moduleManager; - private final WorkerCreateListener workerCreateListener; - - public SegmentStandardizationGraph(ModuleManager moduleManager, WorkerCreateListener workerCreateListener) { - this.moduleManager = moduleManager; - this.workerCreateListener = workerCreateListener; - } - - public void create() { - GraphManager.INSTANCE.createIfAbsent(GraphIdDefine.SEGMENT_STANDARDIZATION_GRAPH_ID, SegmentStandardization.class) - .addNode(new SegmentStandardizationWorker.Factory(moduleManager).create(workerCreateListener)); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/SegmentStandardizationWorker.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/SegmentStandardizationWorker.java deleted file mode 100644 index 67b6d086a06e26dcf32dbdf0f6275fd89783460e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/SegmentStandardizationWorker.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser.standardization; - -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.graph.WorkerIdDefine; -import org.apache.skywalking.apm.collector.analysis.segment.parser.provider.buffer.SegmentBufferManager; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorker; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.util.RunnableWithExceptionProtection; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class SegmentStandardizationWorker extends AbstractLocalAsyncWorker { - - private static final Logger logger = LoggerFactory.getLogger(SegmentStandardizationWorker.class); - - private SegmentStandardizationWorker(ModuleManager moduleManager) { - super(moduleManager); - SegmentBufferManager.INSTANCE.initialize(moduleManager); - } - - @Override public int id() { - return WorkerIdDefine.SEGMENT_STANDARDIZATION_WORKER_ID; - } - - @Override protected void onWork(SegmentStandardization segmentStandardization) throws WorkerException { - SegmentBufferManager.INSTANCE.writeBuffer(segmentStandardization.getUpstreamSegment()); - } - - public final void flushAndSwitch() { - SegmentBufferManager.INSTANCE.flush(); - } - - public static class Factory extends AbstractLocalAsyncWorkerProvider { - - public Factory(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override public SegmentStandardizationWorker workerInstance(ModuleManager moduleManager) { - SegmentStandardizationWorker standardizationWorker = new SegmentStandardizationWorker(moduleManager); - startTimer(standardizationWorker); - return standardizationWorker; - } - - @Override public int queueSize() { - return 1024; - } - - private void startTimer(SegmentStandardizationWorker standardizationWorker) { - Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate( - new RunnableWithExceptionProtection(standardizationWorker::flushAndSwitch, - t -> logger.error("Segment standardization failure.", t)), 10, 3, TimeUnit.SECONDS); - } - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/service/SegmentParseService.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/service/SegmentParseService.java deleted file mode 100644 index aaea24c4c1c138a0ac36210470d3983355f828ea..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/service/SegmentParseService.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.provider.service; - -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.service.ISegmentParseService; -import org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser.SegmentParse; -import org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser.SegmentParserListenerManager; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.network.language.agent.UpstreamSegment; - -/** - * @author peng-yongsheng - */ -public class SegmentParseService implements ISegmentParseService { - - private final ModuleManager moduleManager; - private final SegmentParserListenerManager listenerManager; - - public SegmentParseService(ModuleManager moduleManager, SegmentParserListenerManager listenerManager) { - this.moduleManager = moduleManager; - this.listenerManager = listenerManager; - } - - @Override public void parse(UpstreamSegment segment, Source source) { - SegmentParse segmentParse = new SegmentParse(moduleManager, listenerManager); - segmentParse.parse(segment, source); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/service/SegmentParserListenerRegister.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/service/SegmentParserListenerRegister.java deleted file mode 100644 index cd65c35b918eaf939bcf1c7692aab13361ce209f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/service/SegmentParserListenerRegister.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.provider.service; - -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.SpanListenerFactory; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.service.ISegmentParserListenerRegister; -import org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser.SegmentParserListenerManager; - -/** - * @author peng-yongsheng - */ -public class SegmentParserListenerRegister implements ISegmentParserListenerRegister { - - private final SegmentParserListenerManager listenerManager; - - public SegmentParserListenerRegister(SegmentParserListenerManager listenerManager) { - this.listenerManager = listenerManager; - } - - @Override public void register(SpanListenerFactory spanListenerFactory) { - this.listenerManager.add(spanListenerFactory); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index f2e4fa1835542bc6bc4eabb6bbb75244732c6821..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.analysis.segment.parser.provider.AnalysisSegmentParserModuleProvider \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/service/SegmentBase64Printer.java b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/service/SegmentBase64Printer.java deleted file mode 100644 index 5f85a462d5831e3c1c06e96db37d5981765f441d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/service/SegmentBase64Printer.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.segment.parser.provider.service; - -import com.google.protobuf.InvalidProtocolBufferException; -import java.util.*; -import org.apache.skywalking.apm.network.language.agent.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class SegmentBase64Printer { - - private static final Logger LOGGER = LoggerFactory.getLogger(SegmentBase64Printer.class); - - public static void main(String[] args) throws InvalidProtocolBufferException { - if (args.length == 0) { - return; - } - - byte[] binarySegment = Base64.getDecoder().decode(args[0]); - TraceSegmentObject segmentObject = TraceSegmentObject.parseFrom(binarySegment); - - UniqueId segmentId = segmentObject.getTraceSegmentId(); - StringBuilder segmentIdBuilder = new StringBuilder(); - for (int i = 0; i < segmentId.getIdPartsList().size(); i++) { - if (i == 0) { - segmentIdBuilder.append(segmentId.getIdPartsList().get(i)); - } else { - segmentIdBuilder.append(".").append(segmentId.getIdPartsList().get(i)); - } - } - LOGGER.info("SegmentId: {}", segmentIdBuilder.toString()); - LOGGER.info("ApplicationId: {}", segmentObject.getApplicationId()); - LOGGER.info("ApplicationInstanceId: {}", segmentObject.getApplicationInstanceId()); - List spansList = segmentObject.getSpansList(); - LOGGER.info("Spans:"); - spansList.forEach(span -> { - LOGGER.info(" Span:"); - LOGGER.info(" SpanId: {}", span.getSpanId()); - LOGGER.info(" ParentSpanId: {}", span.getParentSpanId()); - LOGGER.info(" SpanLayer: {}", span.getSpanLayer()); - LOGGER.info(" SpanType: {}", span.getSpanType()); - LOGGER.info(" StartTime: {}", span.getStartTime()); - LOGGER.info(" EndTime: {}", span.getEndTime()); - LOGGER.info(" ComponentId: {}", span.getComponentId()); - LOGGER.info(" Component: {}", span.getComponent()); - LOGGER.info(" OperationNameId: {}", span.getOperationNameId()); - LOGGER.info(" OperationName: {}", span.getOperationName()); - LOGGER.info(" PeerId: {}", span.getPeerId()); - LOGGER.info(" Peer: {}", span.getPeer()); - LOGGER.info(" IsError: {}", span.getIsError()); - - LOGGER.info(" reference:"); - span.getRefsList().forEach(reference -> { - LOGGER.info(" EntryApplicationInstanceId: {}", reference.getEntryApplicationInstanceId()); - LOGGER.info(" EntryServiceId: {}", reference.getEntryServiceId()); - LOGGER.info(" EntryServiceName: {}", reference.getEntryServiceName()); - LOGGER.info(" ParentTraceSegmentId: {}", reference.getParentTraceSegmentId()); - LOGGER.info(" ParentSpanId: {}", reference.getParentSpanId()); - LOGGER.info(" ParentApplicationInstanceId: {}", reference.getParentApplicationInstanceId()); - LOGGER.info(" ParentServiceId: {}", reference.getParentServiceId()); - LOGGER.info(" ParentServiceName: {}", reference.getParentServiceName()); - LOGGER.info(" NetworkAddressId: {}", reference.getNetworkAddressId()); - LOGGER.info(" NetworkAddress: {}", reference.getNetworkAddress()); - }); - }); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/test/resources/log4j2.xml b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/test/resources/log4j2.xml deleted file mode 100644 index 6697ebf27225d592684af50e65d407704b3024ac..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/test/resources/log4j2.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/pom.xml b/apm-collector/apm-collector-analysis/analysis-worker-model/pom.xml deleted file mode 100644 index 35f6f9e71e5a8ced7bff915b35a4b1602a576633..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - apm-collector-analysis - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - analysis-worker-model - jar - - - - org.apache.skywalking - collector-storage-define - ${project.version} - - - org.apache.skywalking - apm-datacarrier - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractLocalAsyncWorker.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractLocalAsyncWorker.java deleted file mode 100644 index d85ac9f5dcafce7173c3889c37cd0f622eda2cc8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractLocalAsyncWorker.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.base; - -import org.apache.skywalking.apm.collector.core.data.QueueData; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; - -/** - * The AbstractLocalAsyncWorker implementations represent workers, - * which receive local asynchronous message. - * - * @author peng-yongsheng - * @since v3.0-2017 - */ -public abstract class AbstractLocalAsyncWorker extends AbstractWorker { - - public AbstractLocalAsyncWorker(ModuleManager moduleManager) { - super(moduleManager); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractLocalAsyncWorkerProvider.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractLocalAsyncWorkerProvider.java deleted file mode 100644 index 3a62831a87f9d8e6b105fc719b70ebb802db2e40..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractLocalAsyncWorkerProvider.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.base; - -import org.apache.skywalking.apm.collector.core.data.QueueData; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.commons.datacarrier.DataCarrier; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractLocalAsyncWorkerProvider> extends AbstractWorkerProvider { - - public abstract int queueSize(); - - public AbstractLocalAsyncWorkerProvider(ModuleManager moduleManager) { - super(moduleManager); - } - - @Override - public final WorkerRef create(WorkerCreateListener workerCreateListener) { - WORKER_TYPE localAsyncWorker = workerInstance(getModuleManager()); - workerCreateListener.addWorker(localAsyncWorker); - - LocalAsyncWorkerRef localAsyncWorkerRef = new LocalAsyncWorkerRef<>(localAsyncWorker); - DataCarrier dataCarrier = new DataCarrier<>(1, 10000); - localAsyncWorkerRef.setQueueEventHandler(dataCarrier); - dataCarrier.consume(localAsyncWorkerRef, 1); - return localAsyncWorkerRef; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractRemoteWorker.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractRemoteWorker.java deleted file mode 100644 index 42769c4646a501f54178fa1424557747b393655f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractRemoteWorker.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.base; - -import org.apache.skywalking.apm.collector.core.data.RemoteData; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.Selector; - -/** - * The AbstractRemoteWorker implementations represent workers, - * which receive remote messages. - *

- * Usually, the implementations are doing persistent, or aggregate works. - * - * @author peng-yongsheng - * @since v3.0-2017 - */ -public abstract class AbstractRemoteWorker extends AbstractWorker { - - public AbstractRemoteWorker(ModuleManager moduleManager) { - super(moduleManager); - } - - public abstract Selector selector(); -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractRemoteWorkerProvider.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractRemoteWorkerProvider.java deleted file mode 100644 index e007524d9e37cefebebcdfe7ea22c04ff567e4bd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractRemoteWorkerProvider.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.base; - -import org.apache.skywalking.apm.collector.core.data.RemoteData; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; - -/** - * The AbstractRemoteWorkerProvider implementations represent providers, - * which create instance of cluster workers whose implemented {@link AbstractRemoteWorker}. - *

- * - * @author peng-yongsheng - * @since v3.0-2017 - */ -public abstract class AbstractRemoteWorkerProvider> extends AbstractWorkerProvider { - - private final RemoteSenderService remoteSenderService; - private final int graphId; - - public AbstractRemoteWorkerProvider(ModuleManager moduleManager, RemoteSenderService remoteSenderService, - int graphId) { - super(moduleManager); - this.remoteSenderService = remoteSenderService; - this.graphId = graphId; - } - - /** - * Create the worker instance into akka system, the akka system will control the cluster worker life cycle. - * - * @return The created worker reference. See {@link RemoteWorkerRef} worker instance, when the worker provider not - * find then Throw this Exception. - */ - @Override final public RemoteWorkerRef create(WorkerCreateListener workerCreateListener) { - WORKER_TYPE remoteWorker = workerInstance(getModuleManager()); - workerCreateListener.addWorker(remoteWorker); - return new RemoteWorkerRef<>(remoteWorker, remoteSenderService, graphId); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractWorker.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractWorker.java deleted file mode 100644 index 1c0d9a079a2daf20c7788b709f988bd057ed2a23..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractWorker.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.base; - -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractWorker implements NodeProcessor { - - private static final Logger logger = LoggerFactory.getLogger(AbstractWorker.class); - - private final ModuleManager moduleManager; - - AbstractWorker(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - public final ModuleManager getModuleManager() { - return moduleManager; - } - - private Next next; - - /** - * The data process logic in this method. - * - * @param message Cast the message object to a expect subclass. - * @throws WorkerException Don't handle the exception, throw it. - */ - protected abstract void onWork(INPUT message) throws WorkerException; - - @Override public final void process(INPUT input, Next next) { - this.next = next; - try { - onWork(input); - } catch (WorkerException e) { - logger.error(e.getMessage(), e); - } - } - - protected final void onNext(OUTPUT message) { - next.execute(message); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractWorkerProvider.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractWorkerProvider.java deleted file mode 100644 index b312af53285ba4c5955d93643dd635b0e5549334..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/AbstractWorkerProvider.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.base; - -import org.apache.skywalking.apm.collector.core.module.ModuleManager; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractWorkerProvider> implements Provider { - - private final ModuleManager moduleManager; - - AbstractWorkerProvider(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - public final ModuleManager getModuleManager() { - return moduleManager; - } - - public abstract WORKER_TYPE workerInstance(ModuleManager moduleManager); -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/LocalAsyncWorkerRef.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/LocalAsyncWorkerRef.java deleted file mode 100644 index 7dcc19d2caa9ff0e9f554f54cdcc608834dfad96..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/LocalAsyncWorkerRef.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.base; - -import java.util.*; -import org.apache.skywalking.apm.collector.core.annotations.trace.BatchParameter; -import org.apache.skywalking.apm.collector.core.data.QueueData; -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.queue.EndOfBatchContext; -import org.apache.skywalking.apm.commons.datacarrier.DataCarrier; -import org.apache.skywalking.apm.commons.datacarrier.consumer.IConsumer; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class LocalAsyncWorkerRef extends WorkerRef implements IConsumer { - - private static final Logger logger = LoggerFactory.getLogger(LocalAsyncWorkerRef.class); - - private DataCarrier dataCarrier; - - LocalAsyncWorkerRef(NodeProcessor destinationHandler) { - super(destinationHandler); - } - - void setQueueEventHandler(DataCarrier dataCarrier) { - this.dataCarrier = dataCarrier; - } - - @Override - public void consume(@BatchParameter List data) { - Iterator inputIterator = data.iterator(); - - int i = 0; - while (inputIterator.hasNext()) { - INPUT input = inputIterator.next(); - i++; - if (i == data.size()) { - input.getEndOfBatchContext().setEndOfBatch(true); - } - out(input); - } - } - - @Override public void init() { - } - - @Override public void onError(List data, Throwable t) { - logger.error(t.getMessage(), t); - } - - @Override public void onExit() { - } - - @Override protected void in(INPUT input) { - input.setEndOfBatchContext(new EndOfBatchContext(false)); - dataCarrier.produce(input); - } - - @Override protected void out(INPUT input) { - super.out(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/Provider.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/Provider.java deleted file mode 100644 index 179729782a22df94dfb7dbe4a60c2a136f7e6e81..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/Provider.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.base; - -/** - * @author peng-yongsheng - */ -public interface Provider { - - WorkerRef create(WorkerCreateListener workerCreateListener) throws ProviderNotFoundException; -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/ProviderNotFoundException.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/ProviderNotFoundException.java deleted file mode 100644 index 44a6dc3dbb2af3094c4b79c343bb16e77c5a7e33..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/ProviderNotFoundException.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.base; - -public class ProviderNotFoundException extends Exception { - public ProviderNotFoundException(String message) { - super(message); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/RemoteWorkerRef.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/RemoteWorkerRef.java deleted file mode 100644 index 78410c4b72b698a93bf723d235f2eaf3536f9b14..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/RemoteWorkerRef.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.base; - -import org.apache.skywalking.apm.collector.core.data.RemoteData; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class RemoteWorkerRef extends WorkerRef { - - private static final Logger logger = LoggerFactory.getLogger(RemoteWorkerRef.class); - - private final AbstractRemoteWorker remoteWorker; - private final RemoteSenderService remoteSenderService; - private final int graphId; - - RemoteWorkerRef(AbstractRemoteWorker remoteWorker, RemoteSenderService remoteSenderService, - int graphId) { - super(remoteWorker); - this.remoteWorker = remoteWorker; - this.remoteSenderService = remoteSenderService; - this.graphId = graphId; - } - - @Override protected void in(INPUT message) { - try { - RemoteSenderService.Mode mode = remoteSenderService.send(this.graphId, this.remoteWorker.id(), message, this.remoteWorker.selector()); - if (mode.equals(RemoteSenderService.Mode.Local)) { - out(message); - } - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - } - - @Override protected void out(INPUT input) { - super.out(input); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/WorkerCreateListener.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/WorkerCreateListener.java deleted file mode 100644 index 87cf41289a251124d538c72f22a02ae550b94616..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/WorkerCreateListener.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.base; - -import java.util.*; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorker; - -/** - * @author peng-yongsheng - */ -public class WorkerCreateListener { - - private final List persistenceWorkers; - - public WorkerCreateListener() { - this.persistenceWorkers = new LinkedList<>(); - } - - void addWorker(AbstractWorker worker) { - if (worker instanceof PersistenceWorker) { - persistenceWorkers.add((PersistenceWorker)worker); - } - } - - public List getPersistenceWorkers() { - return persistenceWorkers; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/WorkerException.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/WorkerException.java deleted file mode 100644 index 126c0a0fde8832226cd555b3519b2fa494928642..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/WorkerException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.base; - -import org.apache.skywalking.apm.collector.core.CollectorException; - -/** - * Defines a general exception a worker can throw when it - * encounters difficulty. - * - * @author peng-yongsheng - * @since v3.1-2017 - */ -public class WorkerException extends CollectorException { - - public WorkerException(String message) { - super(message); - } - - public WorkerException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/WorkerRef.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/WorkerRef.java deleted file mode 100644 index 3dbb71d27a80b099f119e6881454688af70ced77..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/base/WorkerRef.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.base; - -import org.apache.skywalking.apm.collector.core.graph.NodeProcessor; -import org.apache.skywalking.apm.collector.core.graph.WayToNode; - -/** - * @author peng-yongsheng - */ -abstract class WorkerRef extends WayToNode { - WorkerRef(NodeProcessor destinationHandler) { - super(destinationHandler); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/AggregationWorker.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/AggregationWorker.java deleted file mode 100644 index 8639b78f33e9335d69527b3e3dbe2e9d7fa9b7a9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/AggregationWorker.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.impl; - -import org.apache.skywalking.apm.collector.analysis.worker.model.base.*; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.data.MergeDataCache; -import org.apache.skywalking.apm.collector.core.data.StreamData; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public abstract class AggregationWorker extends AbstractLocalAsyncWorker { - - private static final Logger logger = LoggerFactory.getLogger(AggregationWorker.class); - - private final MergeDataCache mergeDataCache; - private int messageNum; - - public AggregationWorker(ModuleManager moduleManager) { - super(moduleManager); - this.mergeDataCache = new MergeDataCache<>(); - } - - @SuppressWarnings("unchecked") - protected OUTPUT transform(INPUT message) { - return (OUTPUT)message; - } - - @Override protected void onWork(INPUT message) throws WorkerException { - OUTPUT output = transform(message); - - messageNum++; - aggregate(output); - - if (messageNum >= 1000 || message.getEndOfBatchContext().isEndOfBatch()) { - sendToNext(); - messageNum = 0; - } - } - - private void sendToNext() throws WorkerException { - mergeDataCache.switchPointer(); - while (mergeDataCache.getLast().isWriting()) { - try { - Thread.sleep(10); - } catch (InterruptedException e) { - throw new WorkerException(e.getMessage(), e); - } - } - - mergeDataCache.getLast().collection().forEach((String id, OUTPUT data) -> { - if (logger.isDebugEnabled()) { - logger.debug(data.toString()); - } - - onNext(data); - }); - mergeDataCache.finishReadingLast(); - } - - private void aggregate(OUTPUT message) { - mergeDataCache.writing(); - if (mergeDataCache.containsKey(message.getId())) { - mergeDataCache.get(message.getId()).mergeAndFormulaCalculateData(message); - } else { - message.calculateFormula(); - mergeDataCache.put(message.getId(), message); - } - mergeDataCache.finishWriting(); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/MergePersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/MergePersistenceWorker.java deleted file mode 100644 index ae4a14ebca390f351a8693714a1b51632bd34251..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/MergePersistenceWorker.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.impl; - -import java.util.*; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.data.*; -import org.apache.skywalking.apm.collector.core.cache.Window; -import org.apache.skywalking.apm.collector.core.data.StreamData; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.slf4j.*; - -import static java.util.Objects.nonNull; - -/** - * @author peng-yongsheng - */ -public abstract class MergePersistenceWorker extends PersistenceWorker> { - - private static final Logger logger = LoggerFactory.getLogger(MergePersistenceWorker.class); - - private final MergeDataCache mergeDataCache; - - public MergePersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - this.mergeDataCache = new MergeDataCache<>(); - } - - @Override protected Window> getCache() { - return mergeDataCache; - } - - @Override protected List prepareBatch(MergeDataCollection collection) { - List batchCollection = new LinkedList<>(); - collection.collection().forEach((id, data) -> { - if (needMergeDBData()) { - INPUT_AND_OUTPUT dbData = persistenceDAO().get(id); - if (nonNull(dbData)) { - dbData.mergeAndFormulaCalculateData(data); - try { - batchCollection.add(persistenceDAO().prepareBatchUpdate(dbData)); - onNext(dbData); - } catch (Throwable t) { - logger.error(t.getMessage(), t); - } - } else { - try { - batchCollection.add(persistenceDAO().prepareBatchInsert(data)); - onNext(data); - } catch (Throwable t) { - logger.error(t.getMessage(), t); - } - } - } else { - try { - batchCollection.add(persistenceDAO().prepareBatchInsert(data)); - onNext(data); - } catch (Throwable t) { - logger.error(t.getMessage(), t); - } - } - }); - - return batchCollection; - } - - @Override protected void cacheData(INPUT_AND_OUTPUT input) { - mergeDataCache.writing(); - if (mergeDataCache.containsKey(input.getId())) { - mergeDataCache.get(input.getId()).mergeAndFormulaCalculateData(input); - } else { - input.calculateFormula(); - mergeDataCache.put(input.getId(), input); - } - - mergeDataCache.finishWriting(); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/MergePersistenceWorkerProvider.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/MergePersistenceWorkerProvider.java deleted file mode 100644 index ca69bdac3ce92ff6a3ebc4687df19a1df540a7ad..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/MergePersistenceWorkerProvider.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.impl; - -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider; -import org.apache.skywalking.apm.collector.core.data.StreamData; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; - -/** - * @author peng-yongsheng - */ -public abstract class MergePersistenceWorkerProvider> extends AbstractLocalAsyncWorkerProvider { - - public MergePersistenceWorkerProvider(ModuleManager moduleManager) { - super(moduleManager); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/NonMergePersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/NonMergePersistenceWorker.java deleted file mode 100644 index 767e092778c946e2ba60ffa00bf57cadd29aca32..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/NonMergePersistenceWorker.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.impl; - -import java.util.*; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.data.*; -import org.apache.skywalking.apm.collector.core.cache.Window; -import org.apache.skywalking.apm.collector.core.data.StreamData; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public abstract class NonMergePersistenceWorker extends PersistenceWorker> { - - private static final Logger logger = LoggerFactory.getLogger(NonMergePersistenceWorker.class); - - private final NonMergeDataCache mergeDataCache; - - public NonMergePersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - this.mergeDataCache = new NonMergeDataCache<>(); - } - - @Override protected Window> getCache() { - return mergeDataCache; - } - - @Override protected void cacheData(INPUT_AND_OUTPUT input) { - mergeDataCache.writing(); - mergeDataCache.add(input); - mergeDataCache.finishWriting(); - } - - @Override protected List prepareBatch(NonMergeDataCollection collection) { - List insertBatchCollection = new ArrayList<>(collection.collection().size()); - collection.collection().forEach(data -> { - try { - insertBatchCollection.add(persistenceDAO().prepareBatchInsert(data)); - onNext(data); - } catch (Throwable t) { - logger.error(t.getMessage(), t); - } - }); - return insertBatchCollection; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/NonMergePersistenceWorkerProvider.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/NonMergePersistenceWorkerProvider.java deleted file mode 100644 index 255782d5f06748927d3b8888468207aaf64abb69..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/NonMergePersistenceWorkerProvider.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.impl; - -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorkerProvider; -import org.apache.skywalking.apm.collector.core.data.StreamData; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; - -/** - * @author peng-yongsheng - */ -public abstract class NonMergePersistenceWorkerProvider> extends AbstractLocalAsyncWorkerProvider { - - public NonMergePersistenceWorkerProvider(ModuleManager moduleManager) { - super(moduleManager); - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/PersistenceWorker.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/PersistenceWorker.java deleted file mode 100644 index f06efa9480ae1f88eb82d9e06517efc2aba779a9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/PersistenceWorker.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.impl; - -import java.util.*; -import org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractLocalAsyncWorker; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IWorkerCacheSizeConfig; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.cache.Collection; -import org.apache.skywalking.apm.collector.core.cache.*; -import org.apache.skywalking.apm.collector.core.data.StreamData; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public abstract class PersistenceWorker extends AbstractLocalAsyncWorker { - - private static final Logger logger = LoggerFactory.getLogger(PersistenceWorker.class); - - private final IBatchDAO batchDAO; - private final int blockBatchPersistenceSize; - - PersistenceWorker(ModuleManager moduleManager) { - super(moduleManager); - this.batchDAO = moduleManager.find(StorageModule.NAME).getService(IBatchDAO.class); - this.blockBatchPersistenceSize = moduleManager.find(ConfigurationModule.NAME).getService(IWorkerCacheSizeConfig.class).cacheSize(); - } - - public boolean flushAndSwitch() { - boolean isSwitch; - try { - if (isSwitch = getCache().trySwitchPointer()) { - getCache().switchPointer(); - } - } finally { - getCache().trySwitchPointerFinally(); - } - return isSwitch; - } - - @Override protected void onWork(INPUT_AND_OUTPUT input) { - if (getCache().currentCollectionSize() >= blockBatchPersistenceSize) { - try { - if (getCache().trySwitchPointer()) { - getCache().switchPointer(); - - List collection = buildBatchCollection(); - batchDAO.batchPersistence(collection); - } - } finally { - getCache().trySwitchPointerFinally(); - } - } - cacheData(input); - } - - @GraphComputingMetric(name = "/persistence/buildBatchCollection/") - public final List buildBatchCollection() { - List batchCollection = new LinkedList<>(); - try { - while (getCache().getLast().isWriting()) { - try { - Thread.sleep(10); - } catch (InterruptedException e) { - logger.warn("thread wake up"); - } - } - - if (getCache().getLast().collection() != null) { - batchCollection = prepareBatch(getCache().getLast()); - } - } finally { - getCache().finishReadingLast(); - } - return batchCollection; - } - - protected abstract List prepareBatch(COLLECTION collection); - - protected abstract Window getCache(); - - protected abstract IPersistenceDAO persistenceDAO(); - - protected abstract boolean needMergeDBData(); - - protected abstract void cacheData(INPUT_AND_OUTPUT input); -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/data/DataCache.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/data/DataCache.java deleted file mode 100644 index 3e34b1da5017bbe24672f7a75f70c7ae20b3a590..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/data/DataCache.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.impl.data; - -/** - * @author peng-yongsheng - */ -public interface DataCache { - - void writing(); - - void finishWriting(); -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/data/MergeDataCache.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/data/MergeDataCache.java deleted file mode 100644 index 56ce56b15a6b0be88631c0cdc4ebadeacebe6b43..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/data/MergeDataCache.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.impl.data; - -import org.apache.skywalking.apm.collector.core.cache.Window; -import org.apache.skywalking.apm.collector.core.data.StreamData; - -/** - * @author peng-yongsheng - */ -public class MergeDataCache extends Window> implements DataCache { - - private MergeDataCollection lockedMergeDataCollection; - - @Override public MergeDataCollection collectionInstance() { - return new MergeDataCollection<>(); - } - - public boolean containsKey(String id) { - return lockedMergeDataCollection.containsKey(id); - } - - public StreamData get(String id) { - return lockedMergeDataCollection.get(id); - } - - public void put(String id, STREAM_DATA data) { - lockedMergeDataCollection.put(id, data); - } - - @Override public void writing() { - lockedMergeDataCollection = getCurrentAndWriting(); - } - - @Override public void finishWriting() { - lockedMergeDataCollection.finishWriting(); - lockedMergeDataCollection = null; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/data/MergeDataCollection.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/data/MergeDataCollection.java deleted file mode 100644 index a7e014a43bd652b3e3c38aa5338e20e16c276805..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/data/MergeDataCollection.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.impl.data; - -import java.util.*; -import org.apache.skywalking.apm.collector.core.cache.Collection; -import org.apache.skywalking.apm.collector.core.data.StreamData; - -/** - * @author peng-yongsheng - */ -public class MergeDataCollection implements Collection> { - private Map data; - private volatile boolean writing; - private volatile boolean reading; - - MergeDataCollection() { - this.data = new LinkedHashMap<>(); - this.writing = false; - this.reading = false; - } - - public void finishWriting() { - writing = false; - } - - @Override public void writing() { - writing = true; - } - - @Override public boolean isWriting() { - return writing; - } - - @Override public void finishReading() { - reading = false; - } - - @Override public void reading() { - reading = true; - } - - @Override public boolean isReading() { - return reading; - } - - boolean containsKey(String key) { - return data.containsKey(key); - } - - void put(String key, STREAM_DATA value) { - data.put(key, value); - } - - public STREAM_DATA get(String key) { - return data.get(key); - } - - @Override public int size() { - return data.size(); - } - - @Override public void clear() { - data.clear(); - } - - public Map collection() { - return data; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/data/NonMergeDataCache.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/data/NonMergeDataCache.java deleted file mode 100644 index 266efc7f081afe1bf6440ed331a1b316334decbc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/data/NonMergeDataCache.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.impl.data; - -import org.apache.skywalking.apm.collector.core.cache.Window; -import org.apache.skywalking.apm.collector.core.data.StreamData; - -/** - * @author peng-yongsheng - */ -public class NonMergeDataCache extends Window> implements DataCache { - - private NonMergeDataCollection lockedMergeDataCollection; - - @Override public NonMergeDataCollection collectionInstance() { - return new NonMergeDataCollection<>(); - } - - public void add(STREAM_DATA data) { - lockedMergeDataCollection.add(data); - } - - @Override public void writing() { - lockedMergeDataCollection = getCurrentAndWriting(); - } - - @Override public void finishWriting() { - lockedMergeDataCollection.finishWriting(); - lockedMergeDataCollection = null; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/data/NonMergeDataCollection.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/data/NonMergeDataCollection.java deleted file mode 100644 index 39534c5a5f4f2609019ab1f116856f225b2fcccb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/model/impl/data/NonMergeDataCollection.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.model.impl.data; - -import java.util.*; -import org.apache.skywalking.apm.collector.core.cache.Collection; -import org.apache.skywalking.apm.collector.core.data.StreamData; - -/** - * @author peng-yongsheng - */ -public class NonMergeDataCollection implements Collection> { - - private final List data; - private volatile boolean writing; - private volatile boolean reading; - - NonMergeDataCollection() { - this.data = new LinkedList<>(); - this.writing = false; - this.reading = false; - } - - public void finishWriting() { - writing = false; - } - - @Override public void writing() { - writing = true; - } - - @Override public boolean isWriting() { - return writing; - } - - @Override public void finishReading() { - reading = false; - } - - @Override public void reading() { - reading = true; - } - - @Override public boolean isReading() { - return reading; - } - - void add(STREAM_DATA value) { - data.add(value); - } - - @Override public int size() { - return data.size(); - } - - @Override public void clear() { - data.clear(); - } - - public List collection() { - return data; - } -} diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/timer/PersistenceTimer.java b/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/timer/PersistenceTimer.java deleted file mode 100644 index e37deb6cbcb379c88573613fdc08b059c5150adc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/src/main/java/org/apache/skywalking/apm/collector/analysis/worker/timer/PersistenceTimer.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.analysis.worker.timer; - -import java.util.*; -import java.util.concurrent.*; -import org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorker; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IBatchDAO; -import org.apache.skywalking.apm.util.RunnableWithExceptionProtection; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public enum PersistenceTimer { - INSTANCE; - - private static final Logger logger = LoggerFactory.getLogger(PersistenceTimer.class); - - private Boolean isStarted = false; - private List persistenceWorkers = new LinkedList<>(); - private final Boolean debug; - - PersistenceTimer() { - this.debug = System.getProperty("debug") != null; - } - - public void start(ModuleManager moduleManager, List persistenceWorkers) { - logger.info("persistence timer start"); - this.persistenceWorkers.addAll(persistenceWorkers); - //TODO timer value config -// final long timeInterval = EsConfig.Es.Persistence.Timer.VALUE * 1000; - final long timeInterval = 3; - IBatchDAO batchDAO = moduleManager.find(StorageModule.NAME).getService(IBatchDAO.class); - - if (!isStarted) { - Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate( - new RunnableWithExceptionProtection(() -> extractDataAndSave(batchDAO, this.persistenceWorkers), - t -> logger.error("Extract data and save failure.", t)), 1, timeInterval, TimeUnit.SECONDS); - - this.isStarted = true; - } - } - - @SuppressWarnings("unchecked") - private void extractDataAndSave(IBatchDAO batchDAO, List persistenceWorkers) { - if (logger.isDebugEnabled()) { - logger.debug("Extract data and save"); - } - - long startTime = System.currentTimeMillis(); - try { - List batchAllCollection = new LinkedList(); - persistenceWorkers.forEach((PersistenceWorker worker) -> { - if (logger.isDebugEnabled()) { - logger.debug("extract {} worker data and save", worker.getClass().getName()); - } - - if (worker.flushAndSwitch()) { - List batchCollection = worker.buildBatchCollection(); - - if (logger.isDebugEnabled()) { - logger.debug("extract {} worker data size: {}", worker.getClass().getName(), batchCollection.size()); - } - batchAllCollection.addAll(batchCollection); - } - }); - - if (debug) { - logger.info("build batch persistence duration: {} ms", System.currentTimeMillis() - startTime); - } - batchDAO.batchPersistence(batchAllCollection); - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } finally { - if (logger.isDebugEnabled()) { - logger.debug("persistence data save finish"); - } - } - - if (debug) { - logger.info("batch persistence duration: {} ms", System.currentTimeMillis() - startTime); - } - } -} diff --git a/apm-collector/apm-collector-analysis/pom.xml b/apm-collector/apm-collector-analysis/pom.xml deleted file mode 100644 index 9605c20eb38d38c7f16d914e22a238e8b73f3a3f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-analysis/pom.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - apm-collector - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - apm-collector-analysis - pom - - analysis-segment-parser - analysis-alarm - analysis-baseline - analysis-worker-model - analysis-metric - analysis-register - analysis-jvm - - - - - org.apache.skywalking - apm-collector-core - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-boot/pom.xml b/apm-collector/apm-collector-boot/pom.xml deleted file mode 100644 index 38ae9ea1ba1eb51c924a6830a062af9e9afcabb6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-boot/pom.xml +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - apm-collector - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - apm-collector-boot - jar - - - skywalking/skywalking-collector - ${version} - - - - - org.yaml - snakeyaml - - - org.apache.skywalking - apm-collector-core - ${project.version} - - - - org.apache.skywalking - collector-cluster-redis-provider - ${project.version} - - - org.apache.skywalking - collector-cluster-standalone-provider - ${project.version} - - - org.apache.skywalking - collector-cluster-zookeeper-provider - ${project.version} - - - - - org.apache.skywalking - collector-grpc-manager-provider - ${project.version} - - - - - org.apache.skywalking - collector-jetty-manager-provider - ${project.version} - - - - - org.apache.skywalking - collector-naming-jetty-provider - ${project.version} - - - - - org.apache.skywalking - agent-grpc-provider - ${project.version} - - - - - org.apache.skywalking - agent-jetty-provider - ${project.version} - - - - - org.apache.skywalking - segment-parser-provider - ${project.version} - - - org.apache.skywalking - register-provider - ${project.version} - - - org.apache.skywalking - jvm-provider - ${project.version} - - - org.apache.skywalking - metric-provider - ${project.version} - - - org.apache.skywalking - alarm-provider - ${project.version} - - - org.apache.skywalking - baseline-computing-provider - ${project.version} - - - - - org.apache.skywalking - collector-ui-jetty-provider - ${project.version} - - - - - org.apache.skywalking - collector-storage-es-provider - ${project.version} - - - org.apache.skywalking - collector-storage-h2-provider - ${project.version} - - - org.apache.skywalking - collector-storage-shardingjdbc-provider - ${project.version} - - - - - org.apache.skywalking - collector-remote-grpc-provider - ${project.version} - - - - - org.apache.skywalking - collector-cache-guava-provider - ${project.version} - - - org.apache.skywalking - collector-cache-caffeine-provider - ${project.version} - - - - - org.apache.skywalking - collector-configuration-provider - ${project.version} - - - - - org.apache.skywalking - alarm-provider - ${project.version} - - - - - org.apache.skywalking - receiver-zipkin-provider - ${project.version} - - - - - org.apache.skywalking - apm-collector-instrument - ${project.version} - provided - - - - - skywalking-collector - - - maven-compiler-plugin - - ${compiler.version} - ${compiler.version} - ${project.build.sourceEncoding} - - - - maven-jar-plugin - - - application.yml - log4j2.xml - component-libraries.yml - - - - - maven-assembly-plugin - - - assembly - package - - single - - - - src/main/assembly/assembly.xml - - - - - - - - diff --git a/apm-collector/apm-collector-boot/src/main/assembly/assembly.xml b/apm-collector/apm-collector-boot/src/main/assembly/assembly.xml deleted file mode 100644 index 0f234cd79633ec159cd4f2c1eef28e537aa574a9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-boot/src/main/assembly/assembly.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - assembly - - dir - - - - /libs - runtime - - - - - src/main/assembly - /config - - log4j2.xml - - - - src/main/resources - - application.yml - log4j2.xml - component-libraries.yml - - /config - - - ${project.basedir}/../apm-collector-instrument/target - - collector-instrument-agent.jar - - /agent - - - diff --git a/apm-collector/apm-collector-boot/src/main/assembly/log4j2.xml b/apm-collector/apm-collector-boot/src/main/assembly/log4j2.xml deleted file mode 100644 index bc1d36d499bda9e30226c269d9b8db8bb1bebc64..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-boot/src/main/assembly/log4j2.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - ${sys:collector.logDir} - - - - - %d - %c -%-4r [%t] %-5p %x - %m%n - - - - - - - - - - - - - - - - - - diff --git a/apm-collector/apm-collector-boot/src/main/java/org/apache/skywalking/apm/collector/boot/CollectorBootStartUp.java b/apm-collector/apm-collector-boot/src/main/java/org/apache/skywalking/apm/collector/boot/CollectorBootStartUp.java deleted file mode 100644 index 83f3b6972e352804a97cfa9b89770e471ac5510b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-boot/src/main/java/org/apache/skywalking/apm/collector/boot/CollectorBootStartUp.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.boot; - -import org.apache.skywalking.apm.collector.boot.config.ApplicationConfigLoader; -import org.apache.skywalking.apm.collector.boot.config.ConfigFileNotFoundException; -import org.apache.skywalking.apm.collector.core.module.ApplicationConfiguration; -import org.apache.skywalking.apm.collector.core.module.ModuleConfigException; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.module.ModuleNotFoundException; -import org.apache.skywalking.apm.collector.core.module.ModuleStartException; -import org.apache.skywalking.apm.collector.core.module.ProviderNotFoundException; -import org.apache.skywalking.apm.collector.core.module.ServiceNotProvidedException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class CollectorBootStartUp { - - public static void main(String[] args) { - final Logger logger = LoggerFactory.getLogger(CollectorBootStartUp.class); - - ApplicationConfigLoader configLoader = new ApplicationConfigLoader(); - ModuleManager manager = new ModuleManager(); - try { - ApplicationConfiguration applicationConfiguration = configLoader.load(); - manager.init(applicationConfiguration); - } catch (ConfigFileNotFoundException | ModuleNotFoundException | ProviderNotFoundException | ServiceNotProvidedException | ModuleConfigException | ModuleStartException e) { - logger.error(e.getMessage(), e); - System.exit(1); - } - } -} diff --git a/apm-collector/apm-collector-boot/src/main/java/org/apache/skywalking/apm/collector/boot/config/ApplicationConfigLoader.java b/apm-collector/apm-collector-boot/src/main/java/org/apache/skywalking/apm/collector/boot/config/ApplicationConfigLoader.java deleted file mode 100644 index 9f568d19d989242eb2a361fd9a28b7de79d9323c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-boot/src/main/java/org/apache/skywalking/apm/collector/boot/config/ApplicationConfigLoader.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.boot.config; - -import java.io.FileNotFoundException; -import java.io.Reader; -import java.util.Map; -import java.util.Properties; -import org.apache.skywalking.apm.collector.core.module.ApplicationConfiguration; -import org.apache.skywalking.apm.collector.core.util.CollectionUtils; -import org.apache.skywalking.apm.collector.core.util.ResourceUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.yaml.snakeyaml.Yaml; - -/** - * Initialize collector settings with following sources. - * Use application.yml as primary setting, - * and fix missing setting by default settings in application-default.yml. - * - * At last, override setting by system.properties and system.envs if the key matches moduleName.provideName.settingKey. - * - * @author peng-yongsheng, wusheng - */ -public class ApplicationConfigLoader implements ConfigLoader { - - private static final Logger logger = LoggerFactory.getLogger(ApplicationConfigLoader.class); - - private final Yaml yaml = new Yaml(); - - @Override public ApplicationConfiguration load() throws ConfigFileNotFoundException { - ApplicationConfiguration configuration = new ApplicationConfiguration(); - this.loadConfig(configuration); - this.loadDefaultConfig(configuration); - this.overrideConfigBySystemEnv(configuration); - return configuration; - } - - @SuppressWarnings("unchecked") - private void loadConfig(ApplicationConfiguration configuration) throws ConfigFileNotFoundException { - try { - Reader applicationReader = ResourceUtils.read("application.yml"); - Map>> moduleConfig = yaml.loadAs(applicationReader, Map.class); - if (CollectionUtils.isNotEmpty(moduleConfig)) { - moduleConfig.forEach((moduleName, providerConfig) -> { - if (providerConfig.size() > 0) { - logger.info("Get a module define from application.yml, module name: {}", moduleName); - ApplicationConfiguration.ModuleConfiguration moduleConfiguration = configuration.addModule(moduleName); - providerConfig.forEach((name, propertiesConfig) -> { - logger.info("Get a provider define belong to {} module, provider name: {}", moduleName, name); - Properties properties = new Properties(); - if (propertiesConfig != null) { - propertiesConfig.forEach((key, value) -> { - properties.put(key, value); - logger.info("The property with key: {}, value: {}, in {} provider", key, value, name); - }); - } - moduleConfiguration.addProviderConfiguration(name, properties); - }); - } else { - logger.warn("Get a module define from application.yml, but no provider define, use default, module name: {}", moduleName); - } - }); - } - } catch (FileNotFoundException e) { - throw new ConfigFileNotFoundException(e.getMessage(), e); - } - } - - @SuppressWarnings("unchecked") - private void loadDefaultConfig(ApplicationConfiguration configuration) throws ConfigFileNotFoundException { - try { - Reader applicationReader = ResourceUtils.read("application-default.yml"); - Map>> moduleConfig = yaml.loadAs(applicationReader, Map.class); - if (CollectionUtils.isNotEmpty(moduleConfig)) { - moduleConfig.forEach((moduleName, providerConfig) -> { - if (!configuration.has(moduleName)) { - logger.warn("The {} module did't define in application.yml, use default", moduleName); - ApplicationConfiguration.ModuleConfiguration moduleConfiguration = configuration.addModule(moduleName); - providerConfig.forEach((name, propertiesConfig) -> { - Properties properties = new Properties(); - if (propertiesConfig != null) { - propertiesConfig.forEach(properties::put); - } - moduleConfiguration.addProviderConfiguration(name, properties); - }); - } - }); - } - } catch (FileNotFoundException e) { - throw new ConfigFileNotFoundException(e.getMessage(), e); - } - } - - private void overrideConfigBySystemEnv(ApplicationConfiguration configuration) { - for (Map.Entry prop : System.getProperties().entrySet()) { - overrideModuleSettings(configuration, prop.getKey().toString(), prop.getValue().toString()); - } - } - - private void overrideModuleSettings(ApplicationConfiguration configuration, String key, String value) { - int moduleAndConfigSeparator = key.indexOf('.'); - if (moduleAndConfigSeparator <= 0) { - return; - } - String moduleName = key.substring(0, moduleAndConfigSeparator); - String providerSettingSubKey = key.substring(moduleAndConfigSeparator + 1); - ApplicationConfiguration.ModuleConfiguration moduleConfiguration = configuration.getModuleConfiguration(moduleName); - if (moduleConfiguration == null) { - return; - } - int providerAndConfigSeparator = providerSettingSubKey.indexOf('.'); - if (providerAndConfigSeparator <= 0) { - return; - } - String providerName = providerSettingSubKey.substring(0, providerAndConfigSeparator); - String settingKey = providerSettingSubKey.substring(providerAndConfigSeparator + 1); - if (!moduleConfiguration.has(providerName)) { - return; - } - Properties providerSettings = moduleConfiguration.getProviderConfiguration(providerName); - if (!providerSettings.containsKey(settingKey)) { - return; - } - Object originValue = providerSettings.get(settingKey); - Class type = originValue.getClass(); - if (type.equals(int.class) || type.equals(Integer.class)) - providerSettings.put(settingKey, Integer.valueOf(value)); - else if (type.equals(String.class)) - providerSettings.put(settingKey, value); - else if (type.equals(long.class) || type.equals(Long.class)) - providerSettings.put(settingKey, Long.valueOf(value)); - else if (type.equals(boolean.class) || type.equals(Boolean.class)) { - providerSettings.put(settingKey, Boolean.valueOf(value)); - } else { - return; - } - - logger.info("The setting has been override by key: {}, value: {}, in {} provider of {} module through {}", - settingKey, value, providerName, moduleName, "System.properties"); - } -} diff --git a/apm-collector/apm-collector-boot/src/main/java/org/apache/skywalking/apm/collector/boot/config/ConfigFileNotFoundException.java b/apm-collector/apm-collector-boot/src/main/java/org/apache/skywalking/apm/collector/boot/config/ConfigFileNotFoundException.java deleted file mode 100644 index f0f741bb99a6fe0280579f2895330b7a2b9dfa97..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-boot/src/main/java/org/apache/skywalking/apm/collector/boot/config/ConfigFileNotFoundException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.boot.config; - -import org.apache.skywalking.apm.collector.core.CollectorException; - -/** - * @author peng-yongsheng - */ -public class ConfigFileNotFoundException extends CollectorException { - - public ConfigFileNotFoundException(String message) { - super(message); - } - - public ConfigFileNotFoundException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-boot/src/main/java/org/apache/skywalking/apm/collector/boot/config/ConfigLoader.java b/apm-collector/apm-collector-boot/src/main/java/org/apache/skywalking/apm/collector/boot/config/ConfigLoader.java deleted file mode 100644 index d3449ffef0848e04508db3df91da244389e33ff1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-boot/src/main/java/org/apache/skywalking/apm/collector/boot/config/ConfigLoader.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.boot.config; - -/** - * @author peng-yongsheng - */ -public interface ConfigLoader { - T load() throws ConfigFileNotFoundException; -} diff --git a/apm-collector/apm-collector-boot/src/main/resources/application.yml b/apm-collector/apm-collector-boot/src/main/resources/application.yml deleted file mode 100644 index 047cf9301ea1ddba7fa02f42d1c88b080d46cf47..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-boot/src/main/resources/application.yml +++ /dev/null @@ -1,114 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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. - -#cluster: -# zookeeper: -# hostPort: localhost:2181 -# sessionTimeout: 100000 -naming: - jetty: - #OS real network IP(binding required), for agent to find collector cluster - host: localhost - port: 10800 - contextPath: / -cache: -# guava: - caffeine: -remote: - gRPC: - # OS real network IP(binding required), for collector nodes communicate with each other in cluster. collectorN --(gRPC) --> collectorM - host: localhost - port: 11800 -agent_gRPC: - gRPC: - #OS real network IP(binding required), for agent to uplink data(trace/metrics) to collector. agent--(gRPC)--> collector - host: localhost - port: 11800 - # Set these two setting to open ssl - #sslCertChainFile: $path - #sslPrivateKeyFile: $path - - # Set your own token to active auth - #authentication: xxxxxx -agent_jetty: - jetty: - # OS real network IP(binding required), for agent to uplink data(trace/metrics) to collector through HTTP. agent--(HTTP)--> collector - # SkyWalking native Java/.Net/node.js agents don't use this. - # Open this for other implementor. - host: localhost - port: 12800 - contextPath: / -analysis_register: - default: -analysis_jvm: - default: -analysis_segment_parser: - default: - bufferFilePath: ../buffer/ - bufferOffsetMaxFileSize: 10M - bufferSegmentMaxFileSize: 500M - bufferFileCleanWhenRestart: true -ui: - jetty: - # Stay in `localhost` if UI starts up in default mode. - # Change it to OS real network IP(binding required), if deploy collector in different machine. - host: localhost - port: 12800 - contextPath: / -storage: - elasticsearch: - clusterName: CollectorDBCluster - clusterTransportSniffer: true - clusterNodes: localhost:9300 - indexShardsNumber: 2 - indexReplicasNumber: 0 - highPerformanceMode: true - # Batch process setting, refer to https://www.elastic.co/guide/en/elasticsearch/client/java-api/5.5/java-docs-bulk-processor.html - bulkActions: 2000 # Execute the bulk every 2000 requests - bulkSize: 20 # flush the bulk every 20mb - flushInterval: 10 # flush the bulk every 10 seconds whatever the number of requests - concurrentRequests: 2 # the number of concurrent requests - # Set a timeout on metric data. After the timeout has expired, the metric data will automatically be deleted. - traceDataTTL: 90 # Unit is minute - minuteMetricDataTTL: 90 # Unit is minute - hourMetricDataTTL: 36 # Unit is hour - dayMetricDataTTL: 45 # Unit is day - monthMetricDataTTL: 18 # Unit is month -#storage: -# h2: -# url: jdbc:h2:~/memorydb -# userName: sa -configuration: - default: - #namespace: xxxxx - # alarm threshold - applicationApdexThreshold: 2000 - serviceErrorRateThreshold: 10.00 - serviceAverageResponseTimeThreshold: 2000 - instanceErrorRateThreshold: 10.00 - instanceAverageResponseTimeThreshold: 2000 - applicationErrorRateThreshold: 10.00 - applicationAverageResponseTimeThreshold: 2000 - # thermodynamic - thermodynamicResponseTimeStep: 50 - thermodynamicCountOfResponseTimeSteps: 40 - # max collection's size of worker cache collection, setting it smaller when collector OutOfMemory crashed. - workerCacheMaxSize: 10000 -#receiver_zipkin: -# default: -# host: localhost -# port: 9411 -# contextPath: / diff --git a/apm-collector/apm-collector-boot/src/main/resources/component-libraries.yml b/apm-collector/apm-collector-boot/src/main/resources/component-libraries.yml deleted file mode 100644 index 141918f98850df808517a1ab58c0c85025396c63..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-boot/src/main/resources/component-libraries.yml +++ /dev/null @@ -1,257 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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. - -# Define all component libraries' names and IDs, used in monitored application. -# This is a bothway mapping, agent or SDK could use the value(ID) to represent the component name in uplink data. -# -# ###### -# id -# ###### -# We highly recommend DO NOT change the IDs in these file, just append new one, and make sure the ID unique. -# Any replacement will cause visualization and aggregation error. -# -# All IDs in this files are reserved, even some IDs removed by some reasons, those IDs will be abandoned. -# -# ###### -# languages -# ###### -# Languages declare which languages are using this component. Multi languages should be separated by `,` - -Tomcat: - id: 1 - languages: Java -HttpClient: - id: 2 - languages: Java,C#,Node.js -Dubbo: - id: 3 - languages: Java -H2: - id: 4 - languages: Java -Mysql: - id: 5 - languages: Java,C#,Node.js -ORACLE: - id: 6 - languages: Java -Redis: - id: 7 - languages: Java,C#,Node.js -Motan: - id: 8 - languages: Java -MongoDB: - id: 9 - languages: Java,C#,Node.js -Resin: - id: 10 - languages: Java -Feign: - id: 11 - languages: Java -OKHttp: - id: 12 - languages: Java -SpringRestTemplate: - id: 13 - languages: Java -SpringMVC: - id: 14 - languages: Java -Struts2: - id: 15 - languages: Java -NutzMVC: - id: 16 - languages: Java -NutzHttp: - id: 17 - languages: Java -JettyClient: - id: 18 - languages: Java -JettyServer: - id: 19 - languages: Java -Memcached: - id: 20 - languages: Java -ShardingJDBC: - id: 21 - languages: Java -PostgreSQL: - id: 22 - languages: Java,C#,Node.js -GRPC: - id: 23 - languages: Java -ElasticJob: - id: 24 - languages: Java -RocketMQ: - id: 25 - languages: Java -httpasyncclient: - id: 26 - languages: Java -Kafka: - id: 27 - languages: Java -ServiceComb: - id: 28 - languages: Java -Hystrix: - id: 29 - languages: Java -Jedis: - id: 30 - languages: Java -SQLite: - id: 31 - languages: Java,C# -h2-jdbc-driver: - id: 32 - languages: Java -mysql-connector-java: - id: 33 - languages: Java -Spymemcached: - id: 35 - languages: Java -Xmemcached: - id: 36 - languages: Java -postgresql-jdbc-driver: - id: 37 - languages: Java -rocketMQ-producer: - id: 38 - languages: Java -rocketMQ-consumer: - id: 39 - languages: Java -kafka-producer: - id: 40 - languages: Java -kafka-consumer: - id: 41 - languages: Java -mongodb-driver: - id: 42 - languages: Java -SOFARPC: - id: 43 - languages: Java -ActiveMQ: - id: 44 - languages: Java -activemq-producer: - id: 45 - languages: Java -activemq-consumer: - id: 46 - languages: Java -# .NET/.NET Core components -# [3000, 4000) for C#/.NET only -AspNetCore: - id: 3001 - languages: C# -EntityFrameworkCore: - id: 3002 - languages: C# -SqlClient: - id: 3003 - languages: C# -CAP: - id: 3004 - languages: C# -StackExchange.Redis: - id: 3005 - languages: C# -SqlServer: - id: 3006 - languages: C# -Npgsql: - id: 3007 - languages: C# -MySqlConnector: - id: 3008 - languages: C# -EntityFrameworkCore.InMemory: - id: 3009 - languages: C# -EntityFrameworkCore.SqlServer: - id: 3010 - languages: C# -EntityFrameworkCore.Sqlite: - id: 3011 - languages: C# -Pomelo.EntityFrameworkCore.MySql: - id: 3012 - languages: C# -Npgsql.EntityFrameworkCore.PostgreSQL: - id: 3013 - languages: C# -InMemoryDatabase: - id: 3014 - languages: C# -AspNet: - id: 3015 - languages: C# - -# NoeJS components -# [4000, 5000) for Node.js agent -HttpServer: - id: 4001 - languages: Node.js -express: - id: 4002 - languages: Node.js -Egg: - id: 4003 - languages: Node.js -Koa: - id: 4004 - languages: Node.js - -# Component Server mapping defines the server display names of some components -# e.g. -# Jedis is a client library in Java for Redis server -Component-Server-Mappings: - mongodb-driver: MongoDB - rocketMQ-producer: RocketMQ - rocketMQ-consumer: RocketMQ - kafka-producer: Kafka - kafka-consumer: Kafka - activemq-producer: ActiveMQ - activemq-consumer: ActiveMQ - postgresql-jdbc-driver: PostgreSQL - Xmemcached: Memcached - Spymemcached: Memcached - h2-jdbc-driver: H2 - mysql-connector-java: Mysql - Jedis: Redis - StackExchange.Redis: Redis - SqlClient: SqlServer - Npgsql: PostgreSQL - MySqlConnector: Mysql - EntityFrameworkCore.InMemory: InMemoryDatabase - EntityFrameworkCore.SqlServer: SqlServer - EntityFrameworkCore.Sqlite: SQLite - Pomelo.EntityFrameworkCore.MySql: Mysql - Npgsql.EntityFrameworkCore.PostgreSQL: PostgreSQL - diff --git a/apm-collector/apm-collector-boot/src/main/resources/log4j2.xml b/apm-collector/apm-collector-boot/src/main/resources/log4j2.xml deleted file mode 100644 index 6697ebf27225d592684af50e65d407704b3024ac..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-boot/src/main/resources/log4j2.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/apm-collector/apm-collector-boot/src/test/java/org/apache/skywalking/apm/collector/boot/ComponentLibraryCatalogFileTest.java b/apm-collector/apm-collector-boot/src/test/java/org/apache/skywalking/apm/collector/boot/ComponentLibraryCatalogFileTest.java deleted file mode 100644 index 59985655522bf6e5233481749a6b7db0223fca50..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-boot/src/test/java/org/apache/skywalking/apm/collector/boot/ComponentLibraryCatalogFileTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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. - * - */ - -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.boot; - -import org.apache.skywalking.apm.collector.configuration.service.ComponentLibraryCatalogService; -import org.junit.Assert; -import org.junit.Test; - -/** - * @author wusheng - */ -public class ComponentLibraryCatalogFileTest { - @Test - public void testInitAndSettings() { - ComponentLibraryCatalogService service = new ComponentLibraryCatalogService(); - Assert.assertEquals(1, service.getComponentId("Tomcat")); - Assert.assertEquals(7, service.getServerIdBasedOnComponent(30)); - Assert.assertEquals(21, service.getServerIdBasedOnComponent(21)); - Assert.assertEquals("Jedis", service.getServerName(30)); - } -} diff --git a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/pom.xml b/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/pom.xml deleted file mode 100644 index f8684b8deb7046318d96c085a756ee18aa83f90f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - apm-collector-cache - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-cache-caffeine-provider - jar - - - - org.apache.skywalking - collector-cache-define - ${project.version} - - - com.github.ben-manes.caffeine - caffeine - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/CacheModuleCaffeineConfig.java b/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/CacheModuleCaffeineConfig.java deleted file mode 100644 index 914c59cf41d475bff53ec57e18aa3feba127305d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/CacheModuleCaffeineConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.caffeine; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author peng-yongsheng - */ -class CacheModuleCaffeineConfig extends ModuleConfig { -} diff --git a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/CacheModuleCaffeineProvider.java b/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/CacheModuleCaffeineProvider.java deleted file mode 100644 index 8e8aa6849698e12084691523727b949074ad3a3e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/CacheModuleCaffeineProvider.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.caffeine; - -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.caffeine.service.ApplicationCacheCaffeineService; -import org.apache.skywalking.apm.collector.cache.caffeine.service.InstanceCacheCaffeineService; -import org.apache.skywalking.apm.collector.cache.caffeine.service.NetworkAddressCacheCaffeineService; -import org.apache.skywalking.apm.collector.cache.caffeine.service.ServiceIdCacheCaffeineService; -import org.apache.skywalking.apm.collector.cache.caffeine.service.ServiceNameCacheCaffeineService; -import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService; -import org.apache.skywalking.apm.collector.cache.service.InstanceCacheService; -import org.apache.skywalking.apm.collector.cache.service.NetworkAddressCacheService; -import org.apache.skywalking.apm.collector.cache.service.ServiceIdCacheService; -import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; -import org.apache.skywalking.apm.collector.storage.StorageModule; - -/** - * @author peng-yongsheng - */ -public class CacheModuleCaffeineProvider extends ModuleProvider { - - private final CacheModuleCaffeineConfig config; - - public CacheModuleCaffeineProvider() { - super(); - this.config = new CacheModuleCaffeineConfig(); - } - - @Override public String name() { - return "caffeine"; - } - - @Override public Class module() { - return CacheModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() throws ServiceNotProvidedException { - this.registerServiceImplementation(ApplicationCacheService.class, new ApplicationCacheCaffeineService(getManager())); - this.registerServiceImplementation(InstanceCacheService.class, new InstanceCacheCaffeineService(getManager())); - this.registerServiceImplementation(ServiceIdCacheService.class, new ServiceIdCacheCaffeineService(getManager())); - this.registerServiceImplementation(ServiceNameCacheService.class, new ServiceNameCacheCaffeineService(getManager())); - this.registerServiceImplementation(NetworkAddressCacheService.class, new NetworkAddressCacheCaffeineService(getManager())); - } - - @Override public void start() { - } - - @Override public void notifyAfterCompleted() { - } - - @Override public String[] requiredModules() { - return new String[] {StorageModule.NAME}; - } -} diff --git a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/service/ApplicationCacheCaffeineService.java b/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/service/ApplicationCacheCaffeineService.java deleted file mode 100644 index 18f39d65237c8031a123d395f1b3d7eed5a7ad32..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/service/ApplicationCacheCaffeineService.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.caffeine.service; - -import com.github.benmanes.caffeine.cache.Cache; -import com.github.benmanes.caffeine.cache.Caffeine; -import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.cache.IApplicationCacheDAO; -import org.apache.skywalking.apm.collector.storage.table.register.Application; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.concurrent.TimeUnit; - -import static java.util.Objects.isNull; -import static java.util.Objects.nonNull; - -/** - * @author peng-yongsheng - */ -public class ApplicationCacheCaffeineService implements ApplicationCacheService { - - private final Logger logger = LoggerFactory.getLogger(ApplicationCacheCaffeineService.class); - - private final Cache codeCache = Caffeine.newBuilder().expireAfterWrite(10, TimeUnit.SECONDS).initialCapacity(100).maximumSize(1000).build(); - - private final ModuleManager moduleManager; - private IApplicationCacheDAO applicationCacheDAO; - - public ApplicationCacheCaffeineService(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private IApplicationCacheDAO getApplicationCacheDAO() { - if (isNull(applicationCacheDAO)) { - this.applicationCacheDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationCacheDAO.class); - } - return this.applicationCacheDAO; - } - - @Override public int getApplicationIdByCode(String applicationCode) { - int applicationId = 0; - try { - Integer value = codeCache.get(applicationCode, key -> getApplicationCacheDAO().getApplicationIdByCode(key)); - applicationId = value == null ? 0 : value; - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - if (applicationId == 0) { - applicationId = getApplicationCacheDAO().getApplicationIdByCode(applicationCode); - if (applicationId != 0) { - codeCache.put(applicationCode, applicationId); - } - } - return applicationId; - } - - private final Cache applicationCache = Caffeine.newBuilder().expireAfterWrite(10, TimeUnit.SECONDS).initialCapacity(100).maximumSize(1000).build(); - - @Override public Application getApplicationById(int applicationId) { - Application application = null; - try { - application = applicationCache.get(applicationId, key -> getApplicationCacheDAO().getApplication(key)); - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - if (isNull(application)) { - application = getApplicationCacheDAO().getApplication(applicationId); - if (nonNull(application)) { - applicationCache.put(applicationId, application); - } - } - return application; - } - - private final Cache addressIdCache = Caffeine.newBuilder().expireAfterWrite(10, TimeUnit.SECONDS).initialCapacity(100).maximumSize(1000).build(); - - @Override public int getApplicationIdByAddressId(int addressId) { - int applicationId = 0; - try { - Integer value = addressIdCache.get(addressId, key -> getApplicationCacheDAO().getApplicationIdByAddressId(key)); - applicationId = value == null ? 0 : value; - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - if (applicationId == 0) { - applicationId = getApplicationCacheDAO().getApplicationIdByAddressId(addressId); - if (applicationId != 0) { - addressIdCache.put(addressId, applicationId); - } - } - return applicationId; - } -} diff --git a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/service/InstanceCacheCaffeineService.java b/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/service/InstanceCacheCaffeineService.java deleted file mode 100644 index 0177aefd3ee8907b8d2b8d4709942ac71b834f6f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/service/InstanceCacheCaffeineService.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.caffeine.service; - -import com.github.benmanes.caffeine.cache.Cache; -import com.github.benmanes.caffeine.cache.Caffeine; -import org.apache.skywalking.apm.collector.cache.service.InstanceCacheService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.cache.IInstanceCacheDAO; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.concurrent.TimeUnit; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class InstanceCacheCaffeineService implements InstanceCacheService { - - private final Logger logger = LoggerFactory.getLogger(InstanceCacheCaffeineService.class); - - private final Cache applicationIdCache = Caffeine.newBuilder().expireAfterWrite(10, TimeUnit.SECONDS).initialCapacity(100).maximumSize(5000).build(); - - private final Cache agentUUIDCache = Caffeine.newBuilder().expireAfterWrite(10, TimeUnit.SECONDS).initialCapacity(100).maximumSize(5000).build(); - - private final Cache addressIdCache = Caffeine.newBuilder().expireAfterWrite(10, TimeUnit.SECONDS).initialCapacity(100).maximumSize(5000).build(); - - private final ModuleManager moduleManager; - private IInstanceCacheDAO instanceCacheDAO; - - public InstanceCacheCaffeineService(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private IInstanceCacheDAO getInstanceCacheDAO() { - if (isNull(instanceCacheDAO)) { - this.instanceCacheDAO = moduleManager.find(StorageModule.NAME).getService(IInstanceCacheDAO.class); - } - return this.instanceCacheDAO; - } - - @Override public int getApplicationId(int instanceId) { - int applicationId = 0; - try { - Integer value = applicationIdCache.get(instanceId, key -> getInstanceCacheDAO().getApplicationId(key)); - applicationId = value == null ? 0 : value; - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - if (applicationId == 0) { - applicationId = getInstanceCacheDAO().getApplicationId(instanceId); - if (applicationId != 0) { - applicationIdCache.put(instanceId, applicationId); - } - } - return applicationId; - } - - @Override public int getInstanceIdByAgentUUID(int applicationId, String agentUUID) { - String cacheKey = applicationId + Const.ID_SPLIT + agentUUID; - - int instanceId = 0; - try { - Integer value = agentUUIDCache.get(cacheKey, key -> getInstanceCacheDAO().getInstanceIdByAgentUUID(applicationId, agentUUID)); - instanceId = value == null ? 0 : value; - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - if (instanceId == 0) { - instanceId = getInstanceCacheDAO().getInstanceIdByAgentUUID(applicationId, agentUUID); - if (applicationId != 0) { - agentUUIDCache.put(cacheKey, instanceId); - } - } - return instanceId; - } - - @Override public int getInstanceIdByAddressId(int applicationId, int addressId) { - String cacheKey = applicationId + Const.ID_SPLIT + addressId; - - int instanceId = 0; - try { - Integer value = addressIdCache.get(cacheKey, key -> getInstanceCacheDAO().getInstanceIdByAddressId(applicationId, addressId)); - instanceId = value == null ? 0 : value; - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - if (instanceId == 0) { - instanceId = getInstanceCacheDAO().getInstanceIdByAddressId(applicationId, addressId); - if (applicationId != 0) { - addressIdCache.put(cacheKey, instanceId); - } - } - return instanceId; - } -} diff --git a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/service/NetworkAddressCacheCaffeineService.java b/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/service/NetworkAddressCacheCaffeineService.java deleted file mode 100644 index 6b699988be9f9f3d7b89351add20a1383250005a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/service/NetworkAddressCacheCaffeineService.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.caffeine.service; - -import com.github.benmanes.caffeine.cache.Cache; -import com.github.benmanes.caffeine.cache.Caffeine; -import org.apache.skywalking.apm.collector.cache.service.NetworkAddressCacheService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.StringUtils; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.cache.INetworkAddressCacheDAO; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddress; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.concurrent.TimeUnit; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class NetworkAddressCacheCaffeineService implements NetworkAddressCacheService { - - private final Logger logger = LoggerFactory.getLogger(NetworkAddressCacheCaffeineService.class); - - private final Cache addressCache = Caffeine.newBuilder().expireAfterWrite(10, TimeUnit.SECONDS).initialCapacity(1000).maximumSize(5000).build(); - - private final ModuleManager moduleManager; - private INetworkAddressCacheDAO networkAddressCacheDAO; - - public NetworkAddressCacheCaffeineService(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private INetworkAddressCacheDAO getNetworkAddressCacheDAO() { - if (isNull(networkAddressCacheDAO)) { - this.networkAddressCacheDAO = moduleManager.find(StorageModule.NAME).getService(INetworkAddressCacheDAO.class); - } - return this.networkAddressCacheDAO; - } - - public int getAddressId(String networkAddress) { - int addressId = 0; - try { - Integer value = addressCache.get(networkAddress, key -> getNetworkAddressCacheDAO().getAddressId(key)); - addressId = value == null ? 0 : value; - - if (addressId == 0) { - addressId = getNetworkAddressCacheDAO().getAddressId(networkAddress); - if (addressId != 0) { - addressCache.put(networkAddress, addressId); - } - } - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - return addressId; - } - - private final Cache idCache = Caffeine.newBuilder().expireAfterWrite(10, TimeUnit.SECONDS).initialCapacity(1000).maximumSize(5000).build(); - - public NetworkAddress getAddress(int addressId) { - NetworkAddress networkAddress = null; - try { - networkAddress = idCache.get(addressId, key -> getNetworkAddressCacheDAO().getAddressById(key)); - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - if (isNull(networkAddress)) { - networkAddress = getNetworkAddressCacheDAO().getAddressById(addressId); - if (StringUtils.isNotEmpty(networkAddress)) { - idCache.put(addressId, networkAddress); - } - } - return networkAddress; - } -} diff --git a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/service/ServiceIdCacheCaffeineService.java b/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/service/ServiceIdCacheCaffeineService.java deleted file mode 100644 index 54a2167789f9979277f844c3fa1a32dd45223d51..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/service/ServiceIdCacheCaffeineService.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.caffeine.service; - -import com.github.benmanes.caffeine.cache.Cache; -import com.github.benmanes.caffeine.cache.Caffeine; -import org.apache.skywalking.apm.collector.cache.service.ServiceIdCacheService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.cache.IServiceNameCacheDAO; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.concurrent.TimeUnit; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class ServiceIdCacheCaffeineService implements ServiceIdCacheService { - - private final Logger logger = LoggerFactory.getLogger(ServiceIdCacheCaffeineService.class); - - private final Cache serviceIdCache = Caffeine.newBuilder().expireAfterWrite(10, TimeUnit.SECONDS).initialCapacity(1000).maximumSize(10000).build(); - - private final ModuleManager moduleManager; - private IServiceNameCacheDAO serviceNameCacheDAO; - - public ServiceIdCacheCaffeineService(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private IServiceNameCacheDAO getServiceNameCacheDAO() { - if (isNull(serviceNameCacheDAO)) { - this.serviceNameCacheDAO = moduleManager.find(StorageModule.NAME).getService(IServiceNameCacheDAO.class); - } - return this.serviceNameCacheDAO; - } - - @Override public int get(int applicationId, int srcSpanType, String serviceName) { - int serviceId = 0; - String id = applicationId + Const.ID_SPLIT + srcSpanType + Const.ID_SPLIT + serviceName; - try { - Integer value = serviceIdCache.get(id, key -> getServiceNameCacheDAO().getServiceId(applicationId, srcSpanType, serviceName)); - serviceId = value == null ? 0 : value; - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - if (serviceId == 0) { - serviceId = getServiceNameCacheDAO().getServiceId(applicationId, srcSpanType, serviceName); - if (serviceId != 0) { - serviceIdCache.put(id, serviceId); - } - } - return serviceId; - } -} diff --git a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/service/ServiceNameCacheCaffeineService.java b/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/service/ServiceNameCacheCaffeineService.java deleted file mode 100644 index ff2341f9aaffc2fe51bbc8851a3bc626db4a347a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/java/org/apache/skywalking/apm/collector/cache/caffeine/service/ServiceNameCacheCaffeineService.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.caffeine.service; - -import com.github.benmanes.caffeine.cache.Cache; -import com.github.benmanes.caffeine.cache.Caffeine; -import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.cache.IServiceNameCacheDAO; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.concurrent.TimeUnit; - -import static java.util.Objects.isNull; -import static java.util.Objects.nonNull; - -/** - * @author peng-yongsheng - */ -public class ServiceNameCacheCaffeineService implements ServiceNameCacheService { - - private final Logger logger = LoggerFactory.getLogger(ServiceNameCacheCaffeineService.class); - - private final Cache serviceCache = Caffeine.newBuilder().expireAfterWrite(10, TimeUnit.SECONDS).initialCapacity(100).maximumSize(10000).build(); - - private final ModuleManager moduleManager; - private IServiceNameCacheDAO serviceNameCacheDAO; - - public ServiceNameCacheCaffeineService(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private IServiceNameCacheDAO getServiceNameCacheDAO() { - if (isNull(serviceNameCacheDAO)) { - this.serviceNameCacheDAO = moduleManager.find(StorageModule.NAME).getService(IServiceNameCacheDAO.class); - } - return this.serviceNameCacheDAO; - } - - public ServiceName get(int serviceId) { - ServiceName serviceName = null; - try { - serviceName = serviceCache.get(serviceId, key -> getServiceNameCacheDAO().get(key)); - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - if (isNull(serviceName)) { - serviceName = getServiceNameCacheDAO().get(serviceId); - if (nonNull(serviceName)) { - serviceCache.put(serviceId, serviceName); - } - } - - return serviceName; - } -} diff --git a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index 053f7746deb5292962b06cf02f70318875169f8b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.cache.caffeine.CacheModuleCaffeineProvider diff --git a/apm-collector/apm-collector-cache/collector-cache-define/pom.xml b/apm-collector/apm-collector-cache/collector-cache-define/pom.xml deleted file mode 100644 index fb9600c2da189e0f0f9824be543af587b1ec780d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-define/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - apm-collector-cache - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-cache-define - jar - \ No newline at end of file diff --git a/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/CacheModule.java b/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/CacheModule.java deleted file mode 100644 index 1f0e591749a60d182caafb2c14615d9c20a7f7e1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/CacheModule.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache; - -import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService; -import org.apache.skywalking.apm.collector.cache.service.InstanceCacheService; -import org.apache.skywalking.apm.collector.cache.service.NetworkAddressCacheService; -import org.apache.skywalking.apm.collector.cache.service.ServiceIdCacheService; -import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; - -/** - * @author peng-yongsheng - */ -public class CacheModule extends ModuleDefine { - - public static final String NAME = "cache"; - - @Override public String name() { - return NAME; - } - - @Override public Class[] services() { - return new Class[] {ApplicationCacheService.class, InstanceCacheService.class, ServiceIdCacheService.class, ServiceNameCacheService.class, NetworkAddressCacheService.class}; - } -} diff --git a/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/ApplicationCacheService.java b/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/ApplicationCacheService.java deleted file mode 100644 index f576b28308c0a394b743d790bec230520199ab9a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/ApplicationCacheService.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.service; - -import org.apache.skywalking.apm.collector.core.module.Service; -import org.apache.skywalking.apm.collector.storage.table.register.Application; - -/** - * @author peng-yongsheng - */ -public interface ApplicationCacheService extends Service { - int getApplicationIdByCode(String applicationCode); - - Application getApplicationById(int applicationId); - - int getApplicationIdByAddressId(int addressId); -} diff --git a/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/InstanceCacheService.java b/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/InstanceCacheService.java deleted file mode 100644 index 646ea31750f96b789e8c5f8d19c052bb802800ab..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/InstanceCacheService.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface InstanceCacheService extends Service { - int getApplicationId(int instanceId); - - int getInstanceIdByAgentUUID(int applicationId, String agentUUID); - - int getInstanceIdByAddressId(int applicationId, int addressId); -} diff --git a/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/NetworkAddressCacheService.java b/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/NetworkAddressCacheService.java deleted file mode 100644 index a5d17af80f3b95557d2d8e70c3652e83d75b6d80..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/NetworkAddressCacheService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.service; - -import org.apache.skywalking.apm.collector.core.module.Service; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddress; - -/** - * @author peng-yongsheng - */ -public interface NetworkAddressCacheService extends Service { - int getAddressId(String networkAddress); - - NetworkAddress getAddress(int addressId); -} diff --git a/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/ServiceIdCacheService.java b/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/ServiceIdCacheService.java deleted file mode 100644 index 7aef5102c9a9a74b09ec4eaf8df78e7194cd695a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/ServiceIdCacheService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface ServiceIdCacheService extends Service { - int get(int applicationId, int srcSpanType, String serviceName); -} diff --git a/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/ServiceNameCacheService.java b/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/ServiceNameCacheService.java deleted file mode 100644 index 298a5a65955dc6981cf26d768703848904aaf3e8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-define/src/main/java/org/apache/skywalking/apm/collector/cache/service/ServiceNameCacheService.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.service; - -import org.apache.skywalking.apm.collector.core.module.Service; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; - -/** - * @author peng-yongsheng - */ -public interface ServiceNameCacheService extends Service { - ServiceName get(int serviceId); -} diff --git a/apm-collector/apm-collector-cache/collector-cache-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-cache/collector-cache-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine deleted file mode 100644 index e8c3c34fc357eb814d3b594f6f793236bff37e75..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.cache.CacheModule diff --git a/apm-collector/apm-collector-cache/collector-cache-guava-provider/pom.xml b/apm-collector/apm-collector-cache/collector-cache-guava-provider/pom.xml deleted file mode 100644 index 63630d0d27de13ad6c0573f1b18c31f33149a126..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-guava-provider/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - apm-collector-cache - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-cache-guava-provider - jar - - - - org.apache.skywalking - collector-cache-define - ${project.version} - - - com.google.guava - guava - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/CacheModuleGuavaConfig.java b/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/CacheModuleGuavaConfig.java deleted file mode 100644 index 5440276725f0e354b11bb3bf235650a47d74d2d6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/CacheModuleGuavaConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.guava; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author peng-yongsheng - */ -class CacheModuleGuavaConfig extends ModuleConfig { -} diff --git a/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/CacheModuleGuavaProvider.java b/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/CacheModuleGuavaProvider.java deleted file mode 100644 index 696d4a2dfe4ba372d342a639c7ee2015a236e878..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/CacheModuleGuavaProvider.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.guava; - -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.guava.service.ApplicationCacheGuavaService; -import org.apache.skywalking.apm.collector.cache.guava.service.InstanceCacheGuavaService; -import org.apache.skywalking.apm.collector.cache.guava.service.NetworkAddressCacheGuavaService; -import org.apache.skywalking.apm.collector.cache.guava.service.ServiceIdCacheGuavaService; -import org.apache.skywalking.apm.collector.cache.guava.service.ServiceNameCacheGuavaService; -import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService; -import org.apache.skywalking.apm.collector.cache.service.InstanceCacheService; -import org.apache.skywalking.apm.collector.cache.service.NetworkAddressCacheService; -import org.apache.skywalking.apm.collector.cache.service.ServiceIdCacheService; -import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; -import org.apache.skywalking.apm.collector.core.module.ModuleProvider; -import org.apache.skywalking.apm.collector.core.module.ServiceNotProvidedException; -import org.apache.skywalking.apm.collector.storage.StorageModule; - -/** - * @author peng-yongsheng - */ -public class CacheModuleGuavaProvider extends ModuleProvider { - - private final CacheModuleGuavaConfig config; - - public CacheModuleGuavaProvider() { - super(); - this.config = new CacheModuleGuavaConfig(); - } - - @Override public String name() { - return "guava"; - } - - @Override public Class module() { - return CacheModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() throws ServiceNotProvidedException { - this.registerServiceImplementation(ApplicationCacheService.class, new ApplicationCacheGuavaService(getManager())); - this.registerServiceImplementation(InstanceCacheService.class, new InstanceCacheGuavaService(getManager())); - this.registerServiceImplementation(ServiceIdCacheService.class, new ServiceIdCacheGuavaService(getManager())); - this.registerServiceImplementation(ServiceNameCacheService.class, new ServiceNameCacheGuavaService(getManager())); - this.registerServiceImplementation(NetworkAddressCacheService.class, new NetworkAddressCacheGuavaService(getManager())); - } - - @Override public void start() { - } - - @Override public void notifyAfterCompleted() { - } - - @Override public String[] requiredModules() { - return new String[] {StorageModule.NAME}; - } -} diff --git a/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/ApplicationCacheGuavaService.java b/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/ApplicationCacheGuavaService.java deleted file mode 100644 index 0de697b79467cee675b7ccefd0f589760af869db..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/ApplicationCacheGuavaService.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.guava.service; - -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; -import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.cache.IApplicationCacheDAO; -import org.apache.skywalking.apm.collector.storage.table.register.Application; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static java.util.Objects.isNull; -import static java.util.Objects.nonNull; - -/** - * @author peng-yongsheng - */ -public class ApplicationCacheGuavaService implements ApplicationCacheService { - - private final Logger logger = LoggerFactory.getLogger(ApplicationCacheGuavaService.class); - - private final Cache codeCache = CacheBuilder.newBuilder().initialCapacity(100).maximumSize(1000).build(); - - private final ModuleManager moduleManager; - private IApplicationCacheDAO applicationCacheDAO; - - public ApplicationCacheGuavaService(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private IApplicationCacheDAO getApplicationCacheDAO() { - if (isNull(applicationCacheDAO)) { - this.applicationCacheDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationCacheDAO.class); - } - return this.applicationCacheDAO; - } - - @Override public int getApplicationIdByCode(String applicationCode) { - int applicationId = 0; - try { - applicationId = codeCache.get(applicationCode, () -> getApplicationCacheDAO().getApplicationIdByCode(applicationCode)); - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - if (applicationId == 0) { - applicationId = getApplicationCacheDAO().getApplicationIdByCode(applicationCode); - if (applicationId != 0) { - codeCache.put(applicationCode, applicationId); - } - } - return applicationId; - } - - private final Cache applicationCache = CacheBuilder.newBuilder().maximumSize(1000).build(); - - @Override public Application getApplicationById(int applicationId) { - Application application = null; - try { - application = applicationCache.get(applicationId, () -> getApplicationCacheDAO().getApplication(applicationId)); - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - if (isNull(application)) { - application = getApplicationCacheDAO().getApplication(applicationId); - if (nonNull(application)) { - applicationCache.put(applicationId, application); - } - } - return application; - } - - private final Cache addressIdCache = CacheBuilder.newBuilder().maximumSize(1000).build(); - - @Override public int getApplicationIdByAddressId(int addressId) { - int applicationId = 0; - try { - applicationId = addressIdCache.get(addressId, () -> getApplicationCacheDAO().getApplicationIdByAddressId(addressId)); - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - if (applicationId == 0) { - applicationId = getApplicationCacheDAO().getApplicationIdByAddressId(addressId); - if (applicationId != 0) { - addressIdCache.put(addressId, applicationId); - } - } - return applicationId; - } -} diff --git a/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/InstanceCacheGuavaService.java b/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/InstanceCacheGuavaService.java deleted file mode 100644 index 8d87a4a4a36f02fc3d627634bd943775c71fea36..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/InstanceCacheGuavaService.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.guava.service; - -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; -import org.apache.skywalking.apm.collector.cache.service.InstanceCacheService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.cache.IInstanceCacheDAO; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class InstanceCacheGuavaService implements InstanceCacheService { - - private final Logger logger = LoggerFactory.getLogger(InstanceCacheGuavaService.class); - - private final Cache applicationIdCache = CacheBuilder.newBuilder().initialCapacity(100).maximumSize(5000).build(); - - private final Cache agentUUIDCache = CacheBuilder.newBuilder().initialCapacity(100).maximumSize(5000).build(); - - private final Cache addressIdCache = CacheBuilder.newBuilder().initialCapacity(100).maximumSize(5000).build(); - - private final ModuleManager moduleManager; - private IInstanceCacheDAO instanceCacheDAO; - - public InstanceCacheGuavaService(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private IInstanceCacheDAO getInstanceCacheDAO() { - if (isNull(instanceCacheDAO)) { - this.instanceCacheDAO = moduleManager.find(StorageModule.NAME).getService(IInstanceCacheDAO.class); - } - return this.instanceCacheDAO; - } - - @Override public int getApplicationId(int instanceId) { - int applicationId = 0; - try { - applicationId = applicationIdCache.get(instanceId, () -> getInstanceCacheDAO().getApplicationId(instanceId)); - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - if (applicationId == 0) { - applicationId = getInstanceCacheDAO().getApplicationId(instanceId); - if (applicationId != 0) { - applicationIdCache.put(instanceId, applicationId); - } - } - return applicationId; - } - - @Override public int getInstanceIdByAgentUUID(int applicationId, String agentUUID) { - String key = applicationId + Const.ID_SPLIT + agentUUID; - - int instanceId = 0; - try { - instanceId = agentUUIDCache.get(key, () -> getInstanceCacheDAO().getInstanceIdByAgentUUID(applicationId, agentUUID)); - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - if (instanceId == 0) { - instanceId = getInstanceCacheDAO().getInstanceIdByAgentUUID(applicationId, agentUUID); - if (applicationId != 0) { - agentUUIDCache.put(key, instanceId); - } - } - return instanceId; - } - - @Override public int getInstanceIdByAddressId(int applicationId, int addressId) { - String key = applicationId + Const.ID_SPLIT + addressId; - - int instanceId = 0; - try { - instanceId = addressIdCache.get(key, () -> getInstanceCacheDAO().getInstanceIdByAddressId(applicationId, addressId)); - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - if (instanceId == 0) { - instanceId = getInstanceCacheDAO().getInstanceIdByAddressId(applicationId, addressId); - if (applicationId != 0) { - addressIdCache.put(key, instanceId); - } - } - return instanceId; - } -} diff --git a/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/NetworkAddressCacheGuavaService.java b/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/NetworkAddressCacheGuavaService.java deleted file mode 100644 index 3fe79d718de4294b664e1320a034c28f2263cd71..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/NetworkAddressCacheGuavaService.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.guava.service; - -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; -import org.apache.skywalking.apm.collector.cache.service.NetworkAddressCacheService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.StringUtils; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.cache.INetworkAddressCacheDAO; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddress; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class NetworkAddressCacheGuavaService implements NetworkAddressCacheService { - - private final Logger logger = LoggerFactory.getLogger(NetworkAddressCacheGuavaService.class); - - private final Cache addressCache = CacheBuilder.newBuilder().initialCapacity(1000).maximumSize(5000).build(); - - private final ModuleManager moduleManager; - private INetworkAddressCacheDAO networkAddressCacheDAO; - - public NetworkAddressCacheGuavaService(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private INetworkAddressCacheDAO getNetworkAddressCacheDAO() { - if (isNull(networkAddressCacheDAO)) { - this.networkAddressCacheDAO = moduleManager.find(StorageModule.NAME).getService(INetworkAddressCacheDAO.class); - } - return this.networkAddressCacheDAO; - } - - public int getAddressId(String networkAddress) { - int addressId = 0; - try { - addressId = addressCache.get(networkAddress, () -> getNetworkAddressCacheDAO().getAddressId(networkAddress)); - - if (addressId == 0) { - addressId = getNetworkAddressCacheDAO().getAddressId(networkAddress); - if (addressId != 0) { - addressCache.put(networkAddress, addressId); - } - } - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - return addressId; - } - - private final Cache idCache = CacheBuilder.newBuilder().initialCapacity(1000).maximumSize(5000).build(); - - public NetworkAddress getAddress(int addressId) { - NetworkAddress networkAddress = null; - try { - networkAddress = idCache.get(addressId, () -> getNetworkAddressCacheDAO().getAddressById(addressId)); - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - if (isNull(networkAddress)) { - networkAddress = getNetworkAddressCacheDAO().getAddressById(addressId); - if (StringUtils.isNotEmpty(networkAddress)) { - idCache.put(addressId, networkAddress); - } - } - return networkAddress; - } -} diff --git a/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/ServiceIdCacheGuavaService.java b/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/ServiceIdCacheGuavaService.java deleted file mode 100644 index 95226c2bf795d452e7b813a32ab37a7f8f43f085..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/ServiceIdCacheGuavaService.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.guava.service; - -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; -import org.apache.skywalking.apm.collector.cache.service.ServiceIdCacheService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.cache.IServiceNameCacheDAO; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class ServiceIdCacheGuavaService implements ServiceIdCacheService { - - private final Logger logger = LoggerFactory.getLogger(ServiceIdCacheGuavaService.class); - - private final Cache serviceIdCache = CacheBuilder.newBuilder().maximumSize(1000000).build(); - - private final ModuleManager moduleManager; - private IServiceNameCacheDAO serviceNameCacheDAO; - - public ServiceIdCacheGuavaService(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private IServiceNameCacheDAO getServiceNameCacheDAO() { - if (isNull(serviceNameCacheDAO)) { - this.serviceNameCacheDAO = moduleManager.find(StorageModule.NAME).getService(IServiceNameCacheDAO.class); - } - return this.serviceNameCacheDAO; - } - - @Override public int get(int applicationId, int srcSpanType, String serviceName) { - int serviceId = 0; - String id = applicationId + Const.ID_SPLIT + srcSpanType + Const.ID_SPLIT + serviceName; - try { - serviceId = serviceIdCache.get(id, () -> getServiceNameCacheDAO().getServiceId(applicationId, srcSpanType, serviceName)); - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - if (serviceId == 0) { - serviceId = getServiceNameCacheDAO().getServiceId(applicationId, srcSpanType, serviceName); - if (serviceId != 0) { - serviceIdCache.put(id, serviceId); - } - } - return serviceId; - } -} diff --git a/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/ServiceNameCacheGuavaService.java b/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/ServiceNameCacheGuavaService.java deleted file mode 100644 index 37deb09ea52ac3b4a14e8806ebdeafeb2a6c70e2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/java/org/apache/skywalking/apm/collector/cache/guava/service/ServiceNameCacheGuavaService.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cache.guava.service; - -import com.google.common.cache.*; -import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.cache.IServiceNameCacheDAO; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; -import org.slf4j.*; - -import static java.util.Objects.*; - -/** - * @author peng-yongsheng - */ -public class ServiceNameCacheGuavaService implements ServiceNameCacheService { - - private final Logger logger = LoggerFactory.getLogger(ServiceNameCacheGuavaService.class); - - private final Cache serviceCache = CacheBuilder.newBuilder().maximumSize(1000000).build(); - - private final ModuleManager moduleManager; - private IServiceNameCacheDAO serviceNameCacheDAO; - - public ServiceNameCacheGuavaService(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private IServiceNameCacheDAO getServiceNameCacheDAO() { - if (isNull(serviceNameCacheDAO)) { - this.serviceNameCacheDAO = moduleManager.find(StorageModule.NAME).getService(IServiceNameCacheDAO.class); - } - return this.serviceNameCacheDAO; - } - - public ServiceName get(int serviceId) { - ServiceName serviceName = null; - try { - serviceName = serviceCache.get(serviceId, () -> getServiceNameCacheDAO().get(serviceId)); - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - - if (isNull(serviceName)) { - serviceName = getServiceNameCacheDAO().get(serviceId); - if (nonNull(serviceName)) { - serviceCache.put(serviceId, serviceName); - } else { - logger.warn("Service id {} is not in cache and persistent storage.", serviceId); - } - } - - return serviceName; - } -} diff --git a/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index b7b1ba9c800a12638d2beff923d8e9dcf91310eb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/collector-cache-guava-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.cache.guava.CacheModuleGuavaProvider \ No newline at end of file diff --git a/apm-collector/apm-collector-cache/pom.xml b/apm-collector/apm-collector-cache/pom.xml deleted file mode 100644 index c77f564534153a2473263c9adae859092ff9883d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cache/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - apm-collector - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - apm-collector-cache - pom - - collector-cache-define - collector-cache-guava-provider - collector-cache-caffeine-provider - - - - - org.apache.skywalking - apm-collector-core - ${project.version} - - - org.apache.skywalking - collector-storage-define - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-cluster/collector-cluster-define/pom.xml b/apm-collector/apm-collector-cluster/collector-cluster-define/pom.xml deleted file mode 100644 index 56c584a1aa385b61cf88f1befd8106564d9f17b6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-define/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - apm-collector-cluster - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-cluster-define - jar - diff --git a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/ClusterException.java b/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/ClusterException.java deleted file mode 100644 index 4fbe93dcb2c0ea3b76f6738c6a9d6ec40eba122f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/ClusterException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster; - -import org.apache.skywalking.apm.collector.core.CollectorException; - -/** - * @author peng-yongsheng - */ -public abstract class ClusterException extends CollectorException { - - public ClusterException(String message) { - super(message); - } - - public ClusterException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/ClusterModule.java b/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/ClusterModule.java deleted file mode 100644 index 74cd5f40925ed01e15b21c138bf437a5d93bfcac..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/ClusterModule.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster; - -import org.apache.skywalking.apm.collector.cluster.service.ModuleRegisterService; -import org.apache.skywalking.apm.collector.core.module.Service; -import org.apache.skywalking.apm.collector.cluster.service.ModuleListenerService; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; - -/** - * @author peng-yongsheng - */ -public class ClusterModule extends ModuleDefine { - - public static final String NAME = "cluster"; - - @Override public String name() { - return NAME; - } - - @Override public Class[] services() { - return new Class[] {ModuleListenerService.class, ModuleRegisterService.class}; - } -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/ClusterModuleListener.java b/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/ClusterModuleListener.java deleted file mode 100644 index 7690d084a6e246d441126d92726d794f92f98288..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/ClusterModuleListener.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster; - -import java.util.HashSet; -import java.util.Set; - -/** - * @author peng-yongsheng - */ -public abstract class ClusterModuleListener { - - private Set addresses; - - public ClusterModuleListener() { - addresses = new HashSet<>(); - } - - public abstract String path(); - - public final void addAddress(String address) { - addresses.add(address); - } - - public final void removeAddress(String address) { - addresses.remove(address); - } - - public final Set getAddresses() { - return addresses; - } - - public abstract void serverJoinNotify(String serverAddress); - - public abstract void serverQuitNotify(String serverAddress); -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/ClusterNodeExistException.java b/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/ClusterNodeExistException.java deleted file mode 100644 index e11eefe544031de6eeb14237e8070e76d76aeaea..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/ClusterNodeExistException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster; - -/** - * @author peng-yongsheng - */ -public class ClusterNodeExistException extends ClusterException { - - public ClusterNodeExistException(String message) { - super(message); - } - - public ClusterNodeExistException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/DataMonitor.java b/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/DataMonitor.java deleted file mode 100644 index 35c30f6dab5d51bd20cfcc2254b2abcb1b4700eb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/DataMonitor.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster; - -import org.apache.skywalking.apm.collector.client.ClientException; -import org.apache.skywalking.apm.collector.client.Client; - -/** - * @author peng-yongsheng - */ -public interface DataMonitor { - void setClient(Client client); - - void addListener(ClusterModuleListener listener) throws ClientException; - - void register(String path, ModuleRegistration registration) throws ClientException; - - ClusterModuleListener getListener(String path); - - void createPath(String path) throws ClientException; - - void setData(String path, String value) throws ClientException; - - String getBaseCatalog(); -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/ModuleRegistration.java b/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/ModuleRegistration.java deleted file mode 100644 index 84fb557a95d939c3f4dd13e8ab87ad65f792b8de..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/ModuleRegistration.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster; - -/** - * @author peng-yongsheng - */ -public abstract class ModuleRegistration { - - public abstract Value buildValue(); - - public static class Value { - private final String host; - private final int port; - private final String contextPath; - - public Value(String host, int port, String contextPath) { - this.host = host; - this.port = port; - this.contextPath = contextPath; - } - - public String getHost() { - return host; - } - - public int getPort() { - return port; - } - - public String getHostPort() { - return host + ":" + port; - } - - public String getContextPath() { - return contextPath; - } - } -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/service/ModuleListenerService.java b/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/service/ModuleListenerService.java deleted file mode 100644 index 8c817efb4cc984df3f385fe50aa09b1d6a236fcf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/service/ModuleListenerService.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster.service; - -import org.apache.skywalking.apm.collector.cluster.ClusterModuleListener; -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface ModuleListenerService extends Service { - void addListener(ClusterModuleListener listener); -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/service/ModuleRegisterService.java b/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/service/ModuleRegisterService.java deleted file mode 100644 index c903e5654339e07e5c0c203ae1082f9636d0b854..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/java/org/apache/skywalking/apm/collector/cluster/service/ModuleRegisterService.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster.service; - -import org.apache.skywalking.apm.collector.core.module.Service; -import org.apache.skywalking.apm.collector.cluster.ModuleRegistration; - -/** - * @author peng-yongsheng - */ -public interface ModuleRegisterService extends Service { - void register(String moduleName, String providerName, ModuleRegistration registration); -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/pom.xml b/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/pom.xml deleted file mode 100644 index ea3a35b6db816c3dbfc759c9f9f40d4d1a24b7dd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - apm-collector-cluster - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-cluster-redis-provider - jar - - - - org.apache.skywalking - collector-cluster-define - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/redis/ClusterModuleRedisConfig.java b/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/redis/ClusterModuleRedisConfig.java deleted file mode 100644 index 8f46e66b23a02f8df5e5d774aae2bdb52465a6fe..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/redis/ClusterModuleRedisConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster.redis; - -import org.apache.skywalking.apm.collector.client.redis.RedisClientConfig; - -/** - * @author peng-yongsheng - */ -class ClusterModuleRedisConfig extends RedisClientConfig { -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/redis/ClusterModuleRedisProvider.java b/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/redis/ClusterModuleRedisProvider.java deleted file mode 100644 index fc694de17b7e40c20490870ac1297a39c9cb3428..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/redis/ClusterModuleRedisProvider.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster.redis; - -import org.apache.skywalking.apm.collector.cluster.ClusterModule; -import org.apache.skywalking.apm.collector.cluster.redis.service.RedisModuleRegisterService; -import org.apache.skywalking.apm.collector.cluster.service.ModuleRegisterService; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; - -/** - * @author peng-yongsheng - */ -public class ClusterModuleRedisProvider extends ModuleProvider { - - private final ClusterModuleRedisConfig config; - - public ClusterModuleRedisProvider() { - super(); - this.config = new ClusterModuleRedisConfig(); - } - - @Override public String name() { - return "redis"; - } - - @Override public Class module() { - return ClusterModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() throws ServiceNotProvidedException { - this.registerServiceImplementation(ModuleRegisterService.class, new RedisModuleRegisterService()); - } - - @Override public void start() { - } - - @Override public void notifyAfterCompleted() { - } - - @Override public String[] requiredModules() { - return new String[0]; - } -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/redis/service/RedisModuleRegisterService.java b/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/redis/service/RedisModuleRegisterService.java deleted file mode 100644 index 644b9dc5a3217e2bab5820b0ec9e3aff3046d39c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/redis/service/RedisModuleRegisterService.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster.redis.service; - -import org.apache.skywalking.apm.collector.cluster.service.ModuleRegisterService; -import org.apache.skywalking.apm.collector.cluster.ModuleRegistration; - -/** - * @author peng-yongsheng - */ -public class RedisModuleRegisterService implements ModuleRegisterService { - - @Override public void register(String moduleName, String providerName, ModuleRegistration registration) { - - } -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index 4d1ad515d12c62e2355b2e64f4b2ff8a7597535d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.cluster.redis.ClusterModuleRedisProvider diff --git a/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/pom.xml b/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/pom.xml deleted file mode 100644 index 6b1ad1e21759ddb3dc0f4e1b7a702a206b971cc9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - apm-collector-cluster - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-cluster-standalone-provider - jar - - - - org.apache.skywalking - collector-cluster-define - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/standalone/ClusterModuleStandaloneConfig.java b/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/standalone/ClusterModuleStandaloneConfig.java deleted file mode 100644 index 103e26f3e8c1b5e70db7f29f40ecd0f6a080f09c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/standalone/ClusterModuleStandaloneConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster.standalone; - -import org.apache.skywalking.apm.collector.client.h2.H2ClientConfig; - -/** - * @author peng-yongsheng - */ -class ClusterModuleStandaloneConfig extends H2ClientConfig { -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/standalone/ClusterModuleStandaloneProvider.java b/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/standalone/ClusterModuleStandaloneProvider.java deleted file mode 100644 index d6bb126a4f9e9a3fc4a021b18d3a64d573c13143..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/standalone/ClusterModuleStandaloneProvider.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster.standalone; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.cluster.ClusterModule; -import org.apache.skywalking.apm.collector.cluster.service.ModuleListenerService; -import org.apache.skywalking.apm.collector.cluster.service.ModuleRegisterService; -import org.apache.skywalking.apm.collector.cluster.standalone.service.StandaloneModuleListenerService; -import org.apache.skywalking.apm.collector.cluster.standalone.service.StandaloneModuleRegisterService; -import org.apache.skywalking.apm.collector.core.CollectorException; -import org.apache.skywalking.apm.collector.core.UnexpectedException; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; -import org.apache.skywalking.apm.collector.core.module.ModuleProvider; -import org.apache.skywalking.apm.collector.core.module.ServiceNotProvidedException; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class ClusterModuleStandaloneProvider extends ModuleProvider { - - private static final Logger logger = LoggerFactory.getLogger(ClusterModuleStandaloneProvider.class); - - private final ClusterModuleStandaloneConfig config; - private H2Client h2Client; - private ClusterStandaloneDataMonitor dataMonitor; - - public ClusterModuleStandaloneProvider() { - super(); - this.config = new ClusterModuleStandaloneConfig(); - } - - @Override public String name() { - return "standalone"; - } - - @Override public Class module() { - return ClusterModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() throws ServiceNotProvidedException { - this.dataMonitor = new ClusterStandaloneDataMonitor(); - h2Client = new H2Client(config.getUrl(), config.getUserName(), Const.EMPTY_STRING); - this.dataMonitor.setClient(h2Client); - - this.registerServiceImplementation(ModuleListenerService.class, new StandaloneModuleListenerService(dataMonitor)); - this.registerServiceImplementation(ModuleRegisterService.class, new StandaloneModuleRegisterService(dataMonitor)); - } - - @Override public void start() { - try { - h2Client.initialize(); - } catch (H2ClientException e) { - logger.error(e.getMessage(), e); - } - } - - @Override public void notifyAfterCompleted() { - try { - dataMonitor.start(); - } catch (CollectorException e) { - throw new UnexpectedException(e.getMessage()); - } - } - - @Override public String[] requiredModules() { - return new String[0]; - } -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/standalone/ClusterStandaloneDataMonitor.java b/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/standalone/ClusterStandaloneDataMonitor.java deleted file mode 100644 index ef12feae0085dd10f3b046028427fcb65202f93a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/standalone/ClusterStandaloneDataMonitor.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster.standalone; - -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.Client; -import org.apache.skywalking.apm.collector.client.ClientException; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.cluster.ClusterModuleListener; -import org.apache.skywalking.apm.collector.cluster.DataMonitor; -import org.apache.skywalking.apm.collector.cluster.ModuleRegistration; -import org.apache.skywalking.apm.collector.core.CollectorException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class ClusterStandaloneDataMonitor implements DataMonitor { - - private static final Logger logger = LoggerFactory.getLogger(ClusterStandaloneDataMonitor.class); - - private H2Client client; - - private Map listeners; - private Map registrations; - - ClusterStandaloneDataMonitor() { - listeners = new LinkedHashMap<>(); - registrations = new LinkedHashMap<>(); - } - - @Override public void setClient(Client client) { - this.client = (H2Client)client; - } - - @Override - public void addListener(ClusterModuleListener listener) { - String path = getBaseCatalog() + listener.path(); - logger.info("listener path: {}", path); - listeners.put(path, listener); - } - - @Override public ClusterModuleListener getListener(String path) { - path = getBaseCatalog() + path; - return listeners.get(path); - } - - @Override public void register(String path, ModuleRegistration registration) { - registrations.put(getBaseCatalog() + path, registration); - } - - @Override public void createPath(String path) throws ClientException { - - } - - @Override public void setData(String path, String value) throws ClientException { - if (listeners.containsKey(path)) { - listeners.get(path).addAddress(value); - listeners.get(path).serverJoinNotify(value); - } - } - - @Override public String getBaseCatalog() { - return "/skywalking"; - } - - public void start() throws CollectorException { - Iterator> entryIterator = registrations.entrySet().iterator(); - while (entryIterator.hasNext()) { - Map.Entry next = entryIterator.next(); - ModuleRegistration.Value value = next.getValue().buildValue(); - String contextPath = value.getContextPath() == null ? "" : value.getContextPath(); - setData(next.getKey(), value.getHostPort() + contextPath); - } - } -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/standalone/service/StandaloneModuleListenerService.java b/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/standalone/service/StandaloneModuleListenerService.java deleted file mode 100644 index f97268a23320d065a04d9ccd5823d04b66a8ef3a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/standalone/service/StandaloneModuleListenerService.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster.standalone.service; - -import org.apache.skywalking.apm.collector.cluster.ClusterModuleListener; -import org.apache.skywalking.apm.collector.cluster.service.ModuleListenerService; -import org.apache.skywalking.apm.collector.cluster.standalone.ClusterStandaloneDataMonitor; - -/** - * @author peng-yongsheng - */ -public class StandaloneModuleListenerService implements ModuleListenerService { - - private final ClusterStandaloneDataMonitor dataMonitor; - - public StandaloneModuleListenerService(ClusterStandaloneDataMonitor dataMonitor) { - this.dataMonitor = dataMonitor; - } - - @Override public void addListener(ClusterModuleListener listener) { - dataMonitor.addListener(listener); - } -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/standalone/service/StandaloneModuleRegisterService.java b/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/standalone/service/StandaloneModuleRegisterService.java deleted file mode 100644 index 2d2636643967c62e66b32424334de4072695e347..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/standalone/service/StandaloneModuleRegisterService.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster.standalone.service; - -import org.apache.skywalking.apm.collector.cluster.service.ModuleRegisterService; -import org.apache.skywalking.apm.collector.cluster.ModuleRegistration; -import org.apache.skywalking.apm.collector.cluster.standalone.ClusterStandaloneDataMonitor; - -/** - * @author peng-yongsheng - */ -public class StandaloneModuleRegisterService implements ModuleRegisterService { - - private final ClusterStandaloneDataMonitor dataMonitor; - - public StandaloneModuleRegisterService(ClusterStandaloneDataMonitor dataMonitor) { - this.dataMonitor = dataMonitor; - } - - @Override public void register(String moduleName, String providerName, ModuleRegistration registration) { - String path = "/" + moduleName + "/" + providerName; - dataMonitor.register(path, registration); - } -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index a1efacc44cf5ebd29b6993ae0958d87d75419acf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.cluster.standalone.ClusterModuleStandaloneProvider diff --git a/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/pom.xml b/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/pom.xml deleted file mode 100644 index 27bba6c189679d35359e3ed114f3dc06869e54e9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - apm-collector-cluster - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-cluster-zookeeper-provider - jar - - - - org.apache.skywalking - collector-cluster-define - ${project.version} - - - org.apache.skywalking - collector-configuration-define - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/ClusterModuleZKConfig.java b/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/ClusterModuleZKConfig.java deleted file mode 100644 index 800aef02409c32820d14272243b1c61712a0ff96..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/ClusterModuleZKConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster.zookeeper; - -import org.apache.skywalking.apm.collector.client.zookeeper.ZookeeperClientConfig; - -/** - * @author peng-yongsheng - */ -class ClusterModuleZKConfig extends ZookeeperClientConfig { -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/ClusterModuleZookeeperProvider.java b/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/ClusterModuleZookeeperProvider.java deleted file mode 100644 index 712bb0a0d9b4ba713a9e3265d8f039dec38bac48..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/ClusterModuleZookeeperProvider.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster.zookeeper; - -import org.apache.skywalking.apm.collector.client.zookeeper.ZookeeperClient; -import org.apache.skywalking.apm.collector.client.zookeeper.ZookeeperClientException; -import org.apache.skywalking.apm.collector.cluster.ClusterModule; -import org.apache.skywalking.apm.collector.cluster.service.ModuleListenerService; -import org.apache.skywalking.apm.collector.cluster.service.ModuleRegisterService; -import org.apache.skywalking.apm.collector.cluster.zookeeper.service.ZookeeperModuleListenerService; -import org.apache.skywalking.apm.collector.cluster.zookeeper.service.ZookeeperModuleRegisterService; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.ICollectorConfig; -import org.apache.skywalking.apm.collector.core.CollectorException; -import org.apache.skywalking.apm.collector.core.UnexpectedException; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; -import org.apache.skywalking.apm.collector.core.module.ModuleProvider; -import org.apache.skywalking.apm.collector.core.module.ServiceNotProvidedException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class ClusterModuleZookeeperProvider extends ModuleProvider { - - private final Logger logger = LoggerFactory.getLogger(ClusterModuleZookeeperProvider.class); - - private final ClusterModuleZKConfig config; - private ZookeeperClient zookeeperClient; - private ClusterZKDataMonitor dataMonitor; - - public ClusterModuleZookeeperProvider() { - super(); - this.config = new ClusterModuleZKConfig(); - } - - @Override public String name() { - return "zookeeper"; - } - - @Override public Class module() { - return ClusterModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() throws ServiceNotProvidedException { - dataMonitor = new ClusterZKDataMonitor(); - zookeeperClient = new ZookeeperClient(config.getHostPort(), config.getSessionTimeout(), dataMonitor); - dataMonitor.setClient(zookeeperClient); - - this.registerServiceImplementation(ModuleListenerService.class, new ZookeeperModuleListenerService(dataMonitor)); - this.registerServiceImplementation(ModuleRegisterService.class, new ZookeeperModuleRegisterService(dataMonitor)); - } - - @Override public void start() { - dataMonitor.setNamespace(getManager().find(ConfigurationModule.NAME).getService(ICollectorConfig.class).getNamespace()); - try { - zookeeperClient.initialize(); - } catch (ZookeeperClientException e) { - logger.error(e.getMessage(), e); - } - } - - @Override public void notifyAfterCompleted() { - try { - dataMonitor.start(); - } catch (CollectorException e) { - throw new UnexpectedException(e.getMessage()); - } - } - - @Override public String[] requiredModules() { - return new String[] {ConfigurationModule.NAME}; - } - -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/ClusterZKDataMonitor.java b/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/ClusterZKDataMonitor.java deleted file mode 100644 index 4def6a81b79c16e08a2d6e40483edc2382b9e787..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/ClusterZKDataMonitor.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster.zookeeper; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import org.apache.skywalking.apm.collector.client.Client; -import org.apache.skywalking.apm.collector.client.ClientException; -import org.apache.skywalking.apm.collector.client.zookeeper.ZookeeperClient; -import org.apache.skywalking.apm.collector.client.zookeeper.ZookeeperClientException; -import org.apache.skywalking.apm.collector.cluster.ClusterModuleListener; -import org.apache.skywalking.apm.collector.cluster.ClusterNodeExistException; -import org.apache.skywalking.apm.collector.cluster.DataMonitor; -import org.apache.skywalking.apm.collector.cluster.ModuleRegistration; -import org.apache.skywalking.apm.collector.core.CollectorException; -import org.apache.skywalking.apm.collector.core.util.CollectionUtils; -import org.apache.skywalking.apm.util.StringUtil; -import org.apache.zookeeper.CreateMode; -import org.apache.zookeeper.WatchedEvent; -import org.apache.zookeeper.Watcher; -import org.apache.zookeeper.ZooDefs; -import org.apache.zookeeper.data.Stat; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class ClusterZKDataMonitor implements DataMonitor, Watcher { - - private final Logger logger = LoggerFactory.getLogger(ClusterZKDataMonitor.class); - - private ZookeeperClient client; - - private Map listeners; - private Map registrations; - private String namespace; - - public ClusterZKDataMonitor() { - listeners = new LinkedHashMap<>(); - registrations = new LinkedHashMap<>(); - } - - @Override public synchronized void process(WatchedEvent event) { - logger.info("changed path {}, event type: {}", event.getPath(), event.getType().name()); - if (listeners.containsKey(event.getPath())) { - List paths; - try { - paths = client.getChildren(event.getPath(), true); - ClusterModuleListener listener = listeners.get(event.getPath()); - Set remoteNodes = new HashSet<>(); - Set notifiedNodes = listener.getAddresses(); - if (CollectionUtils.isNotEmpty(paths)) { - for (String serverPath : paths) { - Stat stat = new Stat(); - byte[] data = client.getData(event.getPath() + "/" + serverPath, true, stat); - String dataStr = new String(data); - String addressValue = serverPath + dataStr; - remoteNodes.add(addressValue); - if (!notifiedNodes.contains(addressValue)) { - logger.info("path children has been created, path: {}, data: {}", event.getPath() + "/" + serverPath, dataStr); - listener.addAddress(addressValue); - listener.serverJoinNotify(addressValue); - } - } - } - - String[] notifiedNodeArray = notifiedNodes.toArray(new String[notifiedNodes.size()]); - for (int i = notifiedNodeArray.length - 1; i >= 0; i--) { - String address = notifiedNodeArray[i]; - if (remoteNodes.isEmpty() || !remoteNodes.contains(address)) { - logger.info("path children has been remove, path and data: {}", event.getPath() + "/" + address); - listener.removeAddress(address); - listener.serverQuitNotify(address); - } - } - } catch (ZookeeperClientException e) { - logger.error(e.getMessage(), e); - } - } - } - - @Override public void setClient(Client client) { - this.client = (ZookeeperClient)client; - } - - public void start() throws CollectorException { - Iterator> entryIterator = registrations.entrySet().iterator(); - while (entryIterator.hasNext()) { - Map.Entry next = entryIterator.next(); - createPath(next.getKey()); - - ModuleRegistration.Value value = next.getValue().buildValue(); - String contextPath = value.getContextPath() == null ? "" : value.getContextPath(); - - client.getChildren(next.getKey(), true); - String serverPath = next.getKey() + "/" + value.getHostPort(); - - Stat stat = client.exists(serverPath, false); - if (stat != null) { - client.delete(serverPath, stat.getVersion()); - } - stat = client.exists(serverPath, false); - if (stat == null) { - setData(serverPath, contextPath); - } else { - client.delete(serverPath, stat.getVersion()); - throw new ClusterNodeExistException("current address: " + value.getHostPort() + " has been registered, check the host and port configuration or wait a moment."); - } - } - } - - @Override public void addListener(ClusterModuleListener listener) { - String path = getBaseCatalog() + listener.path(); - logger.info("listener path: {}", path); - listeners.put(path, listener); - } - - @Override public void register(String path, ModuleRegistration registration) { - registrations.put(getBaseCatalog() + path, registration); - } - - @Override public ClusterModuleListener getListener(String path) { - path = getBaseCatalog() + path; - return listeners.get(path); - } - - @Override public void createPath(String path) throws ClientException { - String[] paths = path.replaceFirst("/", "").split("/"); - - StringBuilder pathBuilder = new StringBuilder(); - for (String subPath : paths) { - pathBuilder.append("/").append(subPath); - if (client.exists(pathBuilder.toString(), false) == null) { - client.create(pathBuilder.toString(), null, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); - } - } - } - - @Override public void setData(String path, String value) throws ClientException { - if (client.exists(path, false) == null) { - client.create(path, value.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL); - } else { - client.setData(path, value.getBytes(), -1); - } - } - - @Override public String getBaseCatalog() { - if (StringUtil.isEmpty(namespace)) { - return "/skywalking"; - } else { - return "/" + namespace + "/skywalking"; - } - } - - void setNamespace(String namespace) { - this.namespace = namespace; - } -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/service/ZookeeperModuleListenerService.java b/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/service/ZookeeperModuleListenerService.java deleted file mode 100644 index 872864ea2a158c4f91b97de01b438524adc66540..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/service/ZookeeperModuleListenerService.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster.zookeeper.service; - -import org.apache.skywalking.apm.collector.cluster.ClusterModuleListener; -import org.apache.skywalking.apm.collector.cluster.zookeeper.ClusterZKDataMonitor; -import org.apache.skywalking.apm.collector.cluster.service.ModuleListenerService; - -/** - * @author peng-yongsheng - */ -public class ZookeeperModuleListenerService implements ModuleListenerService { - - private final ClusterZKDataMonitor dataMonitor; - - public ZookeeperModuleListenerService(ClusterZKDataMonitor dataMonitor) { - this.dataMonitor = dataMonitor; - } - - @Override public void addListener(ClusterModuleListener listener) { - dataMonitor.addListener(listener); - } -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/service/ZookeeperModuleRegisterService.java b/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/service/ZookeeperModuleRegisterService.java deleted file mode 100644 index d0c62309833426aec722eed4fc6584f3940d554f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/java/org/apache/skywalking/apm/collector/cluster/zookeeper/service/ZookeeperModuleRegisterService.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.cluster.zookeeper.service; - -import org.apache.skywalking.apm.collector.cluster.service.ModuleRegisterService; -import org.apache.skywalking.apm.collector.cluster.zookeeper.ClusterZKDataMonitor; -import org.apache.skywalking.apm.collector.cluster.ModuleRegistration; - -/** - * @author peng-yongsheng - */ -public class ZookeeperModuleRegisterService implements ModuleRegisterService { - - private final ClusterZKDataMonitor dataMonitor; - - public ZookeeperModuleRegisterService(ClusterZKDataMonitor dataMonitor) { - this.dataMonitor = dataMonitor; - } - - @Override public void register(String moduleName, String providerName, ModuleRegistration registration) { - String path = "/" + moduleName + "/" + providerName; - dataMonitor.register(path, registration); - } -} diff --git a/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index cafa032bd2dfe20e13dce9b7069432aba4e67e9b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.cluster.zookeeper.ClusterModuleZookeeperProvider diff --git a/apm-collector/apm-collector-cluster/pom.xml b/apm-collector/apm-collector-cluster/pom.xml deleted file mode 100644 index 451bda2aa5a3eb17182e831770d7f93334fba94a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-cluster/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - apm-collector - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - apm-collector-cluster - pom - - collector-cluster-define - collector-cluster-zookeeper-provider - collector-cluster-redis-provider - collector-cluster-standalone-provider - - - - - org.apache.skywalking - apm-collector-core - ${project.version} - - - org.apache.skywalking - client-component - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-component/client-component/pom.xml b/apm-collector/apm-collector-component/client-component/pom.xml deleted file mode 100644 index 38b21b263b19e779ad9a0e554e8992f76e1ecebc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/pom.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - apm-collector-component - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - client-component - jar - - - - com.h2database - h2 - - - redis.clients - jedis - - - org.elasticsearch.client - transport - - - snakeyaml - org.yaml - - - netty-common - io.netty - - - netty-transport - io.netty - - - netty-codec - io.netty - - - netty-codec-http - io.netty - - - netty-buffer - io.netty - - - netty-handler - io.netty - - - netty-resolver - io.netty - - - - - org.apache.zookeeper - zookeeper - - - slf4j-api - org.slf4j - - - slf4j-log4j12 - org.slf4j - - - - - org.apache.skywalking - apm-network - ${project.version} - - - guava - com.google.guava - - - - - io.shardingjdbc - sharding-jdbc-core - - - commons-dbcp - commons-dbcp - - - diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/Client.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/Client.java deleted file mode 100644 index 70a2cd37423ab60f74898c783164e760bc7b68bc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/Client.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client; - -/** - * @author peng-yongsheng - */ -public interface Client { - void initialize() throws ClientException; - - void shutdown(); -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/ClientException.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/ClientException.java deleted file mode 100644 index 0cdcba6d83cc14bc3cc2869a230350f1c7e2da04..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/ClientException.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client; - -import org.apache.skywalking.apm.collector.core.CollectorException; - -/** - * @author peng-yongsheng - */ -public abstract class ClientException extends CollectorException { - public ClientException(String message) { - super(message); - } - - public ClientException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/NameSpace.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/NameSpace.java deleted file mode 100644 index 653af5e02c87b3804613f3f970dc82968b99dee5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/NameSpace.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client; - -import org.apache.skywalking.apm.collector.core.util.Const; - -/** - * @author peng-yongsheng - */ -public class NameSpace { - - private String nameSpace = Const.EMPTY_STRING; - - public String getNameSpace() { - return nameSpace; - } - - public void setNameSpace(String nameSpace) { - this.nameSpace = nameSpace; - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/elasticsearch/ElasticSearchClient.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/elasticsearch/ElasticSearchClient.java deleted file mode 100644 index 20a982cbfa92017d574b2418f9e3653c41dbbd07..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/elasticsearch/ElasticSearchClient.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.elasticsearch; - -import java.net.*; -import java.util.*; -import java.util.function.Consumer; -import org.apache.skywalking.apm.collector.client.*; -import org.apache.skywalking.apm.collector.core.data.CommonTable; -import org.apache.skywalking.apm.collector.core.util.*; -import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; -import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse; -import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse; -import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsResponse; -import org.elasticsearch.action.bulk.BulkRequestBuilder; -import org.elasticsearch.action.get.*; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.client.IndicesAdminClient; -import org.elasticsearch.common.Nullable; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.transport.InetSocketTransportAddress; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.index.query.QueryBuilder; -import org.elasticsearch.index.reindex.*; -import org.elasticsearch.transport.client.PreBuiltTransportClient; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class ElasticSearchClient implements Client { - - private static final Logger logger = LoggerFactory.getLogger(ElasticSearchClient.class); - - private org.elasticsearch.client.Client client; - - private final String clusterName; - - private final boolean clusterTransportSniffer; - - private final String clusterNodes; - - private final NameSpace namespace; - - public ElasticSearchClient(String clusterName, boolean clusterTransportSniffer, - String clusterNodes) { - this.clusterName = clusterName; - this.clusterTransportSniffer = clusterTransportSniffer; - this.clusterNodes = clusterNodes; - this.namespace = new NameSpace(); - } - - public ElasticSearchClient(String clusterName, boolean clusterTransportSniffer, - String clusterNodes, NameSpace namespace) { - this.clusterName = clusterName; - this.clusterTransportSniffer = clusterTransportSniffer; - this.clusterNodes = clusterNodes; - this.namespace = namespace; - } - - @Override - public void initialize() throws ClientException { - Settings settings = Settings.builder() - .put("cluster.name", clusterName) - .put("client.transport.sniff", clusterTransportSniffer) - .build(); - - client = new PreBuiltTransportClient(settings); - - List pairsList = parseClusterNodes(clusterNodes); - for (AddressPairs pairs : pairsList) { - try { - ((PreBuiltTransportClient)client).addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(pairs.host), pairs.port)); - } catch (UnknownHostException e) { - throw new ElasticSearchClientException(e.getMessage(), e); - } - } - } - - @Override - public void shutdown() { - - } - - private List parseClusterNodes(String nodes) { - List pairsList = new LinkedList<>(); - logger.info("elasticsearch cluster nodes: {}", nodes); - String[] nodesSplit = nodes.split(","); - for (String node : nodesSplit) { - String host = node.split(":")[0]; - String port = node.split(":")[1]; - pairsList.add(new AddressPairs(host, Integer.valueOf(port))); - } - - return pairsList; - } - - class AddressPairs { - private String host; - private Integer port; - - AddressPairs(String host, Integer port) { - this.host = host; - this.port = port; - } - } - - public boolean createIndex(String indexName, String indexType, Settings settings, XContentBuilder mappingBuilder) { - IndicesAdminClient adminClient = client.admin().indices(); - indexName = formatIndexName(indexName); - CreateIndexResponse response = adminClient.prepareCreate(indexName).setSettings(settings).addMapping(indexType, mappingBuilder).get(); - logger.info("create {} index with type of {} finished, isAcknowledged: {}", indexName, indexType, response.isAcknowledged()); - return response.isShardsAcked(); - } - - public boolean deleteIndex(String indexName) { - indexName = formatIndexName(indexName); - IndicesAdminClient adminClient = client.admin().indices(); - DeleteIndexResponse response = adminClient.prepareDelete(indexName).get(); - logger.info("delete {} index finished, isAcknowledged: {}", indexName, response.isAcknowledged()); - return response.isAcknowledged(); - } - - public boolean isExistsIndex(String indexName) { - indexName = formatIndexName(indexName); - IndicesAdminClient adminClient = client.admin().indices(); - IndicesExistsResponse response = adminClient.prepareExists(indexName).get(); - return response.isExists(); - } - - public SearchRequestBuilder prepareSearch(String indexName) { - indexName = formatIndexName(indexName); - return client.prepareSearch(indexName); - } - - public IndexRequestBuilder prepareIndex(String indexName, String id) { - indexName = formatIndexName(indexName); - return client.prepareIndex(indexName, CommonTable.TABLE_TYPE, id); - } - - public GetFieldMappingsResponse.FieldMappingMetaData prepareGetMappings(String indexName, String fieldName) { - indexName = formatIndexName(indexName); - GetFieldMappingsResponse response = client.admin().indices().prepareGetFieldMappings(indexName).setFields(fieldName).get(); - return response.fieldMappings(indexName, CommonTable.TABLE_TYPE, fieldName); - } - - public UpdateRequestBuilder prepareUpdate(String indexName, String id) { - indexName = formatIndexName(indexName); - return client.prepareUpdate(indexName, CommonTable.TABLE_TYPE, id); - } - - public GetRequestBuilder prepareGet(String indexName, String id) { - indexName = formatIndexName(indexName); - return client.prepareGet(indexName, CommonTable.TABLE_TYPE, id); - } - - public DeleteByQueryRequestBuilder prepareDelete(QueryBuilder queryBuilder, String indexName) { - indexName = formatIndexName(indexName); - return DeleteByQueryAction.INSTANCE.newRequestBuilder(client).filter(queryBuilder).source(indexName); - } - - public MultiGetRequestBuilder prepareMultiGet(List rows, MultiGetRowHandler rowHandler) { - MultiGetRequestBuilder prepareMultiGet = client.prepareMultiGet(); - rowHandler.setPrepareMultiGet(prepareMultiGet); - rowHandler.setNamespace(namespace.getNameSpace()); - - rows.forEach(rowHandler::accept); - - return rowHandler.getPrepareMultiGet(); - } - - public abstract static class MultiGetRowHandler implements Consumer { - private MultiGetRequestBuilder prepareMultiGet; - private String namespace; - - void setPrepareMultiGet(MultiGetRequestBuilder prepareMultiGet) { - this.prepareMultiGet = prepareMultiGet; - } - - void setNamespace(String namespace) { - this.namespace = namespace; - } - - public void add(String indexName, @Nullable String type, String id) { - indexName = formatIndexName(namespace, indexName); - prepareMultiGet = prepareMultiGet.add(indexName, type, id); - } - - private MultiGetRequestBuilder getPrepareMultiGet() { - return prepareMultiGet; - } - } - - public BulkRequestBuilder prepareBulk() { - return client.prepareBulk(); - } - - private String formatIndexName(String indexName) { - return formatIndexName(this.namespace.getNameSpace(), indexName); - } - - private static String formatIndexName(String namespace, String indexName) { - if (StringUtils.isNotEmpty(namespace)) { - return namespace + Const.ID_SPLIT + indexName; - } - return indexName; - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/elasticsearch/ElasticSearchClientConfig.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/elasticsearch/ElasticSearchClientConfig.java deleted file mode 100644 index 6bb15e1c24a90b2b6be27603c5d8fd147cfcaf15..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/elasticsearch/ElasticSearchClientConfig.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.elasticsearch; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author peng-yongsheng - */ -public abstract class ElasticSearchClientConfig extends ModuleConfig { - - private String clusterName; - private boolean clusterTransportSniffer; - private String clusterNodes; - private String namespace; - - public String getClusterName() { - return clusterName; - } - - public void setClusterName(String clusterName) { - this.clusterName = clusterName; - } - - public boolean getClusterTransportSniffer() { - return clusterTransportSniffer; - } - - public void setClusterTransportSniffer(boolean clusterTransportSniffer) { - this.clusterTransportSniffer = clusterTransportSniffer; - } - - public String getClusterNodes() { - return clusterNodes; - } - - public void setClusterNodes(String clusterNodes) { - this.clusterNodes = clusterNodes; - } - - public String getNamespace() { - return namespace; - } - - public void setNamespace(String namespace) { - this.namespace = namespace; - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/elasticsearch/ElasticSearchClientException.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/elasticsearch/ElasticSearchClientException.java deleted file mode 100644 index 5568d733cceda2aaade3f529b35d8a0d7408398c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/elasticsearch/ElasticSearchClientException.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.elasticsearch; - -import org.apache.skywalking.apm.collector.client.ClientException; - -/** - * @author peng-yongsheng - */ -class ElasticSearchClientException extends ClientException { - ElasticSearchClientException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/grpc/GRPCClient.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/grpc/GRPCClient.java deleted file mode 100644 index ecf5cdac5c9504b24fe315333063d2c0c741f11a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/grpc/GRPCClient.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.grpc; - -import io.grpc.ManagedChannel; -import io.grpc.ManagedChannelBuilder; -import org.apache.skywalking.apm.collector.client.Client; - -/** - * @author peng-yongsheng - */ -public class GRPCClient implements Client { - - private final String host; - - private final int port; - - private ManagedChannel channel; - - public GRPCClient(String host, int port) { - this.host = host; - this.port = port; - } - - @Override public void initialize() { - channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext(true).build(); - } - - @Override public void shutdown() { - channel.shutdownNow(); - } - - public ManagedChannel getChannel() { - return channel; - } - - @Override public String toString() { - return host + ":" + port; - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/grpc/GRPCClientConfig.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/grpc/GRPCClientConfig.java deleted file mode 100644 index c069505185020ca26c82c5dda6b548ab6019b6b4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/grpc/GRPCClientConfig.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.grpc; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author peng-yongsheng - */ -public abstract class GRPCClientConfig extends ModuleConfig { - - private String host; - private int port; - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - - public int getPort() { - return port; - } - - public void setPort(int port) { - this.port = port; - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/grpc/GRPCClientException.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/grpc/GRPCClientException.java deleted file mode 100644 index 2bf741252046feafda18b82ecbf5a60f80976b84..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/grpc/GRPCClientException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.grpc; - -import org.apache.skywalking.apm.collector.client.ClientException; - -/** - * @author peng-yongsheng - */ -public class GRPCClientException extends ClientException { - - public GRPCClientException(String message) { - super(message); - } - - public GRPCClientException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/h2/H2Client.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/h2/H2Client.java deleted file mode 100644 index 18c4ac3b51db31b452fae03e7347a8712cadc788..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/h2/H2Client.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.h2; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import org.apache.skywalking.apm.collector.client.Client; -import org.h2.util.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class H2Client implements Client { - - private final Logger logger = LoggerFactory.getLogger(H2Client.class); - - private Connection conn; - private String url; - private String userName; - private String password; - - public H2Client() { - this.url = "jdbc:h2:mem:collector"; - this.userName = ""; - this.password = ""; - } - - public H2Client(String url, String userName, String password) { - this.url = url; - this.userName = userName; - this.password = password; - } - - @Override public void initialize() throws H2ClientException { - try { - Class.forName("org.h2.Driver"); - conn = DriverManager. - getConnection(this.url, this.userName, this.password); - } catch (Exception e) { - throw new H2ClientException(e.getMessage(), e); - } - } - - @Override public void shutdown() { - IOUtils.closeSilently(conn); - } - - public Connection getConnection() { - return conn; - } - - public void execute(String sql) throws H2ClientException { - try (Statement statement = getConnection().createStatement()) { - statement.execute(sql); - statement.closeOnCompletion(); - } catch (SQLException e) { - throw new H2ClientException(e.getMessage(), e); - } - } - - public ResultSet executeQuery(String sql, Object[] params) throws H2ClientException { - logger.debug("execute query with result: {}", sql); - ResultSet rs; - PreparedStatement statement; - try { - statement = getConnection().prepareStatement(sql); - if (params != null) { - for (int i = 0; i < params.length; i++) { - statement.setObject(i + 1, params[i]); - } - } - rs = statement.executeQuery(); - statement.closeOnCompletion(); - } catch (SQLException e) { - throw new H2ClientException(e.getMessage(), e); - } - return rs; - } - - public boolean execute(String sql, Object[] params) throws H2ClientException { - logger.debug("execute insert/update/delete: {}", sql); - boolean flag; - Connection conn = getConnection(); - try (PreparedStatement statement = conn.prepareStatement(sql)) { - conn.setAutoCommit(true); - if (params != null) { - for (int i = 0; i < params.length; i++) { - statement.setObject(i + 1, params[i]); - } - } - flag = statement.execute(); - } catch (SQLException e) { - throw new H2ClientException(e.getMessage(), e); - } - return flag; - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/h2/H2ClientConfig.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/h2/H2ClientConfig.java deleted file mode 100644 index 041776897fa3182a7992772a9b83f9402c1fd051..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/h2/H2ClientConfig.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.h2; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author peng-yongsheng - */ -public abstract class H2ClientConfig extends ModuleConfig { - - private String url; - private String userName; - private String password; - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/h2/H2ClientException.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/h2/H2ClientException.java deleted file mode 100644 index fb82ffc78cb2c352daa686eea052138461716adb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/h2/H2ClientException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.h2; - -import org.apache.skywalking.apm.collector.client.ClientException; - -/** - * @author peng-yongsheng - */ -public class H2ClientException extends ClientException { - - public H2ClientException(String message) { - super(message); - } - - public H2ClientException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/redis/RedisClient.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/redis/RedisClient.java deleted file mode 100644 index 2d4c5494a300bedce017195121c6a5ff5b115f06..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/redis/RedisClient.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.redis; - -import org.apache.skywalking.apm.collector.client.ClientException; -import org.apache.skywalking.apm.collector.client.Client; -import redis.clients.jedis.Jedis; - -/** - * @author peng-yongsheng - */ -public class RedisClient implements Client { - - private Jedis jedis; - - private final String host; - private final int port; - - public RedisClient(String host, int port) { - this.host = host; - this.port = port; - } - - @Override public void initialize() throws ClientException { - jedis = new Jedis(host, port); - } - - @Override public void shutdown() { - - } - - public void setex(String key, int seconds, String value) { - jedis.setex(key, seconds, value); - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/redis/RedisClientConfig.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/redis/RedisClientConfig.java deleted file mode 100644 index 00c27634a548986c6116d84c73b6d0fa51aa72ac..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/redis/RedisClientConfig.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.redis; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author peng-yongsheng - */ -public abstract class RedisClientConfig extends ModuleConfig { - private String host; - private int port; - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - - public int getPort() { - return port; - } - - public void setPort(int port) { - this.port = port; - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/redis/RedisClientException.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/redis/RedisClientException.java deleted file mode 100644 index facd482c6338343054bd58c58a83664a1bd234f5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/redis/RedisClientException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.redis; - -import org.apache.skywalking.apm.collector.client.ClientException; - -/** - * @author peng-yongsheng - */ -public class RedisClientException extends ClientException { - - public RedisClientException(String message) { - super(message); - } - - public RedisClientException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/shardingjdbc/ShardingjdbcClient.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/shardingjdbc/ShardingjdbcClient.java deleted file mode 100644 index 31849703606581855407907bbd98d72bff5d0148..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/shardingjdbc/ShardingjdbcClient.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.shardingjdbc; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - -import javax.sql.DataSource; - -import org.apache.commons.dbcp.BasicDataSource; -import org.apache.skywalking.apm.collector.client.Client; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import io.shardingjdbc.core.api.ShardingDataSourceFactory; -import io.shardingjdbc.core.api.config.ShardingRuleConfiguration; - -/** - * @author linjiaqi - */ -public class ShardingjdbcClient implements Client { - - private static final Logger logger = LoggerFactory.getLogger(ShardingjdbcClient.class); - - private Map shardingjdbcClientConfig; - - private ShardingRuleConfiguration shardingRuleConfiguration; - - private Map shardingDataSource = new HashMap(); - - private DataSource dataSource; - - public ShardingjdbcClient(Map shardingjdbcClientConfig, ShardingRuleConfiguration shardingRuleConfiguration) { - this.shardingjdbcClientConfig = shardingjdbcClientConfig; - this.shardingRuleConfiguration = shardingRuleConfiguration; - } - - @Override public void initialize() throws ShardingjdbcClientException { - try { - shardingjdbcClientConfig.forEach((key, value) -> { - BasicDataSource basicDataSource = new BasicDataSource(); - basicDataSource.setDriverClassName(value.getDriverClass()); - basicDataSource.setUrl(value.getUrl()); - basicDataSource.setUsername(value.getUserName()); - basicDataSource.setPassword(value.getPassword()); - shardingDataSource.put(key, basicDataSource); - logger.info("add sharding datasource: {}, url: {}", key, value.getUrl()); - }); - dataSource = ShardingDataSourceFactory.createDataSource(shardingDataSource, shardingRuleConfiguration, - new HashMap(), new Properties()); - } catch (Exception e) { - logger.error("case the exception is 'Cannot load JDBC driver class', please add the driver mysql-connector-java-5.1.36.jar to collector-libs manual"); - throw new ShardingjdbcClientException(e.getMessage(), e); - } - } - - @Override public void shutdown() { - - } - - public Connection getConnection() throws SQLException { - return dataSource.getConnection(); - } - - public void execute(String sql) throws ShardingjdbcClientException { - Connection conn = null; - Statement statement = null; - try { - conn = getConnection(); - statement = conn.createStatement(); - statement.execute(sql); - } catch (SQLException e) { - throw new ShardingjdbcClientException(e.getMessage(), e); - } finally { - try { - if (statement != null) { - statement.close(); - } - if (conn != null) { - conn.close(); - } - } catch (SQLException e) { - throw new ShardingjdbcClientException(e.getMessage(), e); - } - } - } - - public ResultSet executeQuery(String sql, Object[] params) throws ShardingjdbcClientException { - logger.debug("execute query with result: {}", sql); - ResultSet rs; - PreparedStatement statement; - try { - statement = getConnection().prepareStatement(sql); - if (params != null) { - for (int i = 0; i < params.length; i++) { - statement.setObject(i + 1, params[i]); - } - } - rs = statement.executeQuery(); - } catch (SQLException e) { - throw new ShardingjdbcClientException(e.getMessage(), e); - } - return rs; - } - - public boolean execute(String sql, Object[] params) throws ShardingjdbcClientException { - logger.debug("execute insert/update/delete: {}", sql); - boolean flag; - Connection conn = null; - PreparedStatement statement = null; - try { - conn = getConnection(); - conn.setAutoCommit(true); - statement = conn.prepareStatement(sql); - if (params != null) { - for (int i = 0; i < params.length; i++) { - statement.setObject(i + 1, params[i]); - } - } - flag = statement.execute(); - } catch (SQLException e) { - throw new ShardingjdbcClientException(e.getMessage(), e); - } finally { - try { - if (statement != null) { - statement.close(); - } - if (conn != null) { - conn.close(); - } - } catch (SQLException e) { - throw new ShardingjdbcClientException(e.getMessage(), e); - } - } - return flag; - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/shardingjdbc/ShardingjdbcClientConfig.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/shardingjdbc/ShardingjdbcClientConfig.java deleted file mode 100644 index 5e132cb90b6f8b16898f143317597e574fe6787e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/shardingjdbc/ShardingjdbcClientConfig.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.shardingjdbc; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author linjiaqi - */ -public class ShardingjdbcClientConfig extends ModuleConfig { - - private String driverClass; - private String url; - private String userName; - private String password; - - public ShardingjdbcClientConfig() { - - } - - public ShardingjdbcClientConfig(String driverClass, String url, String username, String password) { - this.driverClass = driverClass; - this.url = url; - this.userName = username; - this.password = password; - } - - public String getDriverClass() { - return driverClass; - } - - public void setDriverClass(String driverClass) { - this.driverClass = driverClass; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/shardingjdbc/ShardingjdbcClientException.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/shardingjdbc/ShardingjdbcClientException.java deleted file mode 100644 index 6b99dd9e5b70cb25231dfa18806c7a696a2b9aa4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/shardingjdbc/ShardingjdbcClientException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.shardingjdbc; - -import org.apache.skywalking.apm.collector.client.ClientException; - -/** - * @author linjiaqi - */ -public class ShardingjdbcClientException extends ClientException { - - public ShardingjdbcClientException(String message) { - super(message); - } - - public ShardingjdbcClientException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/zookeeper/ZookeeperClient.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/zookeeper/ZookeeperClient.java deleted file mode 100644 index b25aafb0241771324011c16e3f49e89103a74599..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/zookeeper/ZookeeperClient.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.zookeeper; - -import java.io.IOException; -import java.util.List; -import org.apache.skywalking.apm.collector.client.Client; -import org.apache.zookeeper.CreateMode; -import org.apache.zookeeper.KeeperException; -import org.apache.zookeeper.Watcher; -import org.apache.zookeeper.ZooKeeper; -import org.apache.zookeeper.data.ACL; -import org.apache.zookeeper.data.Stat; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class ZookeeperClient implements Client { - - private static final Logger logger = LoggerFactory.getLogger(ZookeeperClient.class); - - private ZooKeeper zk; - - private final String hostPort; - private final int sessionTimeout; - private final Watcher watcher; - - public ZookeeperClient(String hostPort, int sessionTimeout, Watcher watcher) { - this.hostPort = hostPort; - this.sessionTimeout = sessionTimeout; - this.watcher = watcher; - } - - @Override public void initialize() throws ZookeeperClientException { - try { - zk = new ZooKeeper(hostPort, sessionTimeout, watcher); - } catch (IOException e) { - throw new ZookeeperClientException(e.getMessage(), e); - } - } - - @Override public void shutdown() { - - } - - public void create(final String path, byte data[], List acl, - CreateMode createMode) throws ZookeeperClientException { - try { - zk.create(path, data, acl, createMode); - } catch (KeeperException | InterruptedException e) { - throw new ZookeeperClientException(e.getMessage(), e); - } - } - - public Stat exists(final String path, boolean watch) throws ZookeeperClientException { - try { - return zk.exists(path, watch); - } catch (KeeperException | InterruptedException e) { - throw new ZookeeperClientException(e.getMessage(), e); - } - } - - public void delete(final String path, int version) throws ZookeeperClientException { - try { - zk.delete(path, version); - } catch (KeeperException | InterruptedException e) { - throw new ZookeeperClientException(e.getMessage(), e); - } - } - - public byte[] getData(String path, boolean watch, Stat stat) throws ZookeeperClientException { - try { - return zk.getData(path, watch, stat); - } catch (KeeperException | InterruptedException e) { - throw new ZookeeperClientException(e.getMessage(), e); - } - } - - public Stat setData(final String path, byte data[], int version) throws ZookeeperClientException { - try { - return zk.setData(path, data, version); - } catch (KeeperException | InterruptedException e) { - throw new ZookeeperClientException(e.getMessage(), e); - } - } - - public List getChildren(final String path, boolean watch) throws ZookeeperClientException { - try { - return zk.getChildren(path, watch); - } catch (KeeperException | InterruptedException e) { - throw new ZookeeperClientException(e.getMessage(), e); - } - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/zookeeper/ZookeeperClientConfig.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/zookeeper/ZookeeperClientConfig.java deleted file mode 100644 index 2d8c79e13a637b6c90e798bdd98f09e9229ff182..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/zookeeper/ZookeeperClientConfig.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.zookeeper; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author peng-yongsheng - */ -public abstract class ZookeeperClientConfig extends ModuleConfig { - - private String hostPort; - private int sessionTimeout; - - public String getHostPort() { - return hostPort; - } - - public void setHostPort(String hostPort) { - this.hostPort = hostPort; - } - - public int getSessionTimeout() { - return sessionTimeout; - } - - public void setSessionTimeout(int sessionTimeout) { - this.sessionTimeout = sessionTimeout; - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/zookeeper/ZookeeperClientException.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/zookeeper/ZookeeperClientException.java deleted file mode 100644 index dfb45f0495386cbe941e4623742aececb98a7f8d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/zookeeper/ZookeeperClientException.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.zookeeper; - -import org.apache.skywalking.apm.collector.client.ClientException; - -/** - * @author peng-yongsheng - */ -public class ZookeeperClientException extends ClientException { - public ZookeeperClientException(String message) { - super(message); - } - - public ZookeeperClientException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/zookeeper/util/PathUtils.java b/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/zookeeper/util/PathUtils.java deleted file mode 100644 index 2b9a0b85a2f0d006ee5b589e7fdf5e17cfa6df93..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/client-component/src/main/java/org/apache/skywalking/apm/collector/client/zookeeper/util/PathUtils.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.client.zookeeper.util; - -/** - * @author peng-yongsheng - */ -public class PathUtils { - - public static String convertKey2Path(String key) { - String[] keys = key.split("\\."); - StringBuilder pathBuilder = new StringBuilder(); - for (String subPath : keys) { - pathBuilder.append("/").append(subPath); - } - return pathBuilder.toString(); - } -} diff --git a/apm-collector/apm-collector-component/pom.xml b/apm-collector/apm-collector-component/pom.xml deleted file mode 100644 index dca59305e216e7ecc41737a4db70b65234c89dd3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - apm-collector - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - apm-collector-component - pom - - client-component - server-component - - - - - org.apache.skywalking - apm-collector-core - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-component/server-component/pom.xml b/apm-collector/apm-collector-component/server-component/pom.xml deleted file mode 100644 index 9bdc82585261ed3f82513b5beb47b9d7277c041d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/server-component/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - apm-collector-component - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - server-component - jar - - 20.0 - - - - - com.google.guava - guava - - - - - - org.apache.skywalking - apm-network - ${project.version} - - - guava - com.google.guava - - - - - org.eclipse.jetty - jetty-server - - - org.eclipse.jetty - jetty-servlet - - - diff --git a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/Server.java b/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/Server.java deleted file mode 100644 index 8a8e32ca72b2d1ef5db8ed320f128b1e8dc64ec1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/Server.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.server; - -/** - * @author peng-yongsheng, wusheng - */ -public interface Server { - - String hostPort(); - - String serverClassify(); - - void initialize() throws ServerException; - - void start() throws ServerException; - - boolean isSSLOpen(); - - boolean isStatusEqual(Server target); -} diff --git a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/ServerException.java b/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/ServerException.java deleted file mode 100644 index 08783db24ad71151461c9fe72605af8e7322e5dd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/ServerException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.server; - -import org.apache.skywalking.apm.collector.core.CollectorException; - -/** - * @author peng-yongsheng - */ -public abstract class ServerException extends CollectorException { - - public ServerException(String message) { - super(message); - } - - public ServerException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/ServerHandler.java b/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/ServerHandler.java deleted file mode 100644 index ef446b6f0d6712778432dff2a0f97e235ff5cd1d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/ServerHandler.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.server; - -/** - * @author peng-yongsheng - */ -public interface ServerHandler { -} diff --git a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/grpc/GRPCHandler.java b/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/grpc/GRPCHandler.java deleted file mode 100644 index 8d41c41d72a58e3cb98d8aae481f37b255f65e63..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/grpc/GRPCHandler.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.server.grpc; - -import org.apache.skywalking.apm.collector.server.ServerHandler; - -/** - * @author peng-yongsheng - */ -public interface GRPCHandler extends ServerHandler { -} diff --git a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/grpc/GRPCServer.java b/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/grpc/GRPCServer.java deleted file mode 100644 index 7d6cc2e1672d34bf1886e920efac79157ad94d86..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/grpc/GRPCServer.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.server.grpc; - -import io.grpc.BindableService; -import io.grpc.ServerServiceDefinition; -import io.grpc.netty.GrpcSslContexts; -import io.grpc.netty.NettyServerBuilder; -import io.netty.handler.ssl.SslContextBuilder; -import io.netty.handler.ssl.SslProvider; -import java.io.File; -import java.io.IOException; -import java.net.InetSocketAddress; -import java.util.Objects; -import org.apache.skywalking.apm.collector.server.Server; -import org.apache.skywalking.apm.collector.server.ServerException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng, wusheng - */ -public class GRPCServer implements Server { - - private static final Logger logger = LoggerFactory.getLogger(GRPCServer.class); - - private final String host; - private final int port; - private io.grpc.Server server; - private NettyServerBuilder nettyServerBuilder; - private SslContextBuilder sslContextBuilder; - private File certChainFile; - private File privateKeyFile; - - public GRPCServer(String host, int port) { - this.host = host; - this.port = port; - } - - /** - * Require for `server.crt` and `server.pem` for open ssl at server side. - * - * @param host - * @param port - * @param certChainFile `server.crt` file - * @param privateKeyFile `server.pem` file - */ - public GRPCServer(String host, int port, File certChainFile, File privateKeyFile) { - this.host = host; - this.port = port; - this.certChainFile = certChainFile; - this.privateKeyFile = privateKeyFile; - this.sslContextBuilder = SslContextBuilder.forServer(certChainFile, - privateKeyFile); - } - - @Override - public String hostPort() { - return host + ":" + port; - } - - @Override - public String serverClassify() { - return "Google-RPC"; - } - - @Override - public void initialize() throws ServerException { - InetSocketAddress address = new InetSocketAddress(host, port); - nettyServerBuilder = NettyServerBuilder.forAddress(address); - logger.info("Server started, host {} listening on {}", host, port); - } - - @Override - public void start() throws ServerException { - try { - if (sslContextBuilder != null) { - nettyServerBuilder = nettyServerBuilder.sslContext( - GrpcSslContexts.configure(sslContextBuilder, - SslProvider.OPENSSL).build()); - } - server = nettyServerBuilder.build(); - server.start(); - } catch (IOException e) { - throw new GRPCServerException(e.getMessage(), e); - } - } - - public void addHandler(BindableService handler) { - nettyServerBuilder.addService(handler); - } - - public void addHandler(ServerServiceDefinition definition) { - nettyServerBuilder.addService(definition); - } - - @Override - public boolean isSSLOpen() { - return sslContextBuilder == null; - } - - @Override - public boolean isStatusEqual(Server target) { - if (this == target) - return true; - if (target == null || getClass() != target.getClass()) - return false; - GRPCServer that = (GRPCServer)target; - return port == that.port && - Objects.equals(host, that.host) && - Objects.equals(certChainFile, that.certChainFile) && - Objects.equals(privateKeyFile, that.privateKeyFile); - } -} diff --git a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/grpc/GRPCServerConfig.java b/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/grpc/GRPCServerConfig.java deleted file mode 100644 index ea56d4264ae92a98257814d962d6ab218df03a81..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/grpc/GRPCServerConfig.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.server.grpc; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author peng-yongsheng - */ -public abstract class GRPCServerConfig extends ModuleConfig { - - private String host; - private int port; - private String sslCertChainFilePath; - private String sslPrivateKeyFilePath; - private String authentication; - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - - public int getPort() { - return port; - } - - public void setPort(int port) { - this.port = port; - } - - public String getSslCertChainFilePath() { - return sslCertChainFilePath; - } - - public void setSslCertChainFilePath(String sslCertChainFilePath) { - this.sslCertChainFilePath = sslCertChainFilePath; - } - - public String getSslPrivateKeyFilePath() { - return sslPrivateKeyFilePath; - } - - public void setSslPrivateKeyFilePath(String sslPrivateKeyFilePath) { - this.sslPrivateKeyFilePath = sslPrivateKeyFilePath; - } - - public String getAuthentication() { - return authentication; - } - - public void setAuthentication(String authentication) { - this.authentication = authentication; - } -} diff --git a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/grpc/GRPCServerException.java b/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/grpc/GRPCServerException.java deleted file mode 100644 index c68549620073058df203f028af31889f4f2e479a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/grpc/GRPCServerException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.server.grpc; - -import org.apache.skywalking.apm.collector.server.ServerException; - -/** - * @author peng-yongsheng - */ -public class GRPCServerException extends ServerException { - - public GRPCServerException(String message) { - super(message); - } - - public GRPCServerException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/ArgumentsParseException.java b/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/ArgumentsParseException.java deleted file mode 100644 index fa1aac0d3893dea59cdda37e1f9322eac0caccc3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/ArgumentsParseException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.server.jetty; - -import org.apache.skywalking.apm.collector.core.CollectorException; - -/** - * @author peng-yongsheng - */ -public class ArgumentsParseException extends CollectorException { - - public ArgumentsParseException(String message) { - super(message); - } - - public ArgumentsParseException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyHandler.java b/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyHandler.java deleted file mode 100644 index 6738ad4223cf62d87211f2d21aed879d96dd9143..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyHandler.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.server.jetty; - -import javax.servlet.http.HttpServlet; -import org.apache.skywalking.apm.collector.server.ServerHandler; - -/** - * @author peng-yongsheng - */ -public abstract class JettyHandler extends HttpServlet implements ServerHandler { - public abstract String pathSpec(); -} diff --git a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyJsonHandler.java b/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyJsonHandler.java deleted file mode 100644 index f79f8c7f18cbe15dc1c9cf2246373c15fb6c191d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyJsonHandler.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.server.jetty; - -import com.google.gson.JsonElement; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Enumeration; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static java.util.Objects.nonNull; - -/** - * @author wusheng - */ -public abstract class JettyJsonHandler extends JettyHandler { - private static final Logger logger = LoggerFactory.getLogger(JettyHandler.class); - - @Override - protected final void doGet(HttpServletRequest req, HttpServletResponse resp) { - try { - reply(resp, doGet(req)); - } catch (ArgumentsParseException | IOException e) { - try { - replyError(resp, e.getMessage(), HttpServletResponse.SC_BAD_REQUEST); - } catch (IOException replyException) { - logger.error(replyException.getMessage(), e); - } - } - } - - protected abstract JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException; - - @Override - protected final void doPost(HttpServletRequest req, HttpServletResponse resp) { - try { - reply(resp, doPost(req)); - } catch (ArgumentsParseException | IOException e) { - try { - replyError(resp, e.getMessage(), HttpServletResponse.SC_BAD_REQUEST); - } catch (IOException replyException) { - logger.error(replyException.getMessage(), e); - } - } - } - - protected abstract JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException, IOException; - - @Override - protected final void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - super.doHead(req, resp); - } - - @Override protected final long getLastModified(HttpServletRequest req) { - return super.getLastModified(req); - } - - @Override - protected final void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - super.doPut(req, resp); - } - - @Override - protected final void doDelete(HttpServletRequest req, - HttpServletResponse resp) throws ServletException, IOException { - super.doDelete(req, resp); - } - - @Override - protected final void doOptions(HttpServletRequest req, - HttpServletResponse resp) throws ServletException, IOException { - super.doOptions(req, resp); - } - - @Override - protected final void doTrace(HttpServletRequest req, - HttpServletResponse resp) throws ServletException, IOException { - super.doTrace(req, resp); - } - - @Override - protected final void service(HttpServletRequest req, - HttpServletResponse resp) throws ServletException, IOException { - super.service(req, resp); - } - - @Override public final void service(ServletRequest req, ServletResponse res) throws ServletException, IOException { - super.service(req, res); - } - - @Override public final void destroy() { - super.destroy(); - } - - @Override public final String getInitParameter(String name) { - return super.getInitParameter(name); - } - - @Override public final Enumeration getInitParameterNames() { - return super.getInitParameterNames(); - } - - @Override public final ServletConfig getServletConfig() { - return super.getServletConfig(); - } - - @Override public final ServletContext getServletContext() { - return super.getServletContext(); - } - - @Override public final String getServletInfo() { - return super.getServletInfo(); - } - - @Override public final void init(ServletConfig config) throws ServletException { - super.init(config); - } - - @Override public final void init() throws ServletException { - super.init(); - } - - @Override public final void log(String msg) { - super.log(msg); - } - - @Override public final void log(String message, Throwable t) { - super.log(message, t); - } - - @Override public final String getServletName() { - return super.getServletName(); - } - - private void reply(HttpServletResponse response, JsonElement resJson) throws IOException { - response.setContentType("application/json"); - response.setCharacterEncoding("utf-8"); - response.setStatus(HttpServletResponse.SC_OK); - - PrintWriter out = response.getWriter(); - if (nonNull(resJson)) { - out.print(resJson); - } - out.flush(); - out.close(); - } - - private void replyError(HttpServletResponse response, String errorMessage, int status) throws IOException { - response.setContentType("application/json"); - response.setCharacterEncoding("utf-8"); - response.setStatus(status); - response.setHeader("error-message", errorMessage); - - PrintWriter out = response.getWriter(); - out.flush(); - out.close(); - } -} diff --git a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyServer.java b/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyServer.java deleted file mode 100644 index dd9e5961d3e212a3421f5b364d46a14dc3e00e4b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyServer.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.server.jetty; - -import java.net.InetSocketAddress; -import java.util.Objects; -import org.apache.skywalking.apm.collector.server.Server; -import org.apache.skywalking.apm.collector.server.ServerException; -import org.eclipse.jetty.servlet.ServletContextHandler; -import org.eclipse.jetty.servlet.ServletHolder; -import org.eclipse.jetty.servlet.ServletMapping; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng, wusheng - */ -public class JettyServer implements Server { - - private static final Logger logger = LoggerFactory.getLogger(JettyServer.class); - - private final String host; - private final int port; - private final String contextPath; - private org.eclipse.jetty.server.Server server; - private ServletContextHandler servletContextHandler; - - public JettyServer(String host, int port, String contextPath) { - this.host = host; - this.port = port; - this.contextPath = contextPath; - } - - @Override - public String hostPort() { - return host + ":" + port; - } - - @Override - public String serverClassify() { - return "Jetty"; - } - - @Override - public void initialize() throws ServerException { - server = new org.eclipse.jetty.server.Server(new InetSocketAddress(host, port)); - - servletContextHandler = new ServletContextHandler(ServletContextHandler.NO_SESSIONS); - servletContextHandler.setContextPath(contextPath); - logger.info("http server root context path: {}", contextPath); - - server.setHandler(servletContextHandler); - } - - public void addHandler(JettyHandler handler) { - ServletHolder servletHolder = new ServletHolder(); - servletHolder.setServlet(handler); - servletContextHandler.addServlet(servletHolder, handler.pathSpec()); - } - - @Override - public boolean isSSLOpen() { - return false; - } - - @Override - public boolean isStatusEqual(Server target) { - return equals(target); - } - - @Override - public void start() throws ServerException { - logger.info("start server, host: {}, port: {}", host, port); - try { - for (ServletMapping servletMapping : servletContextHandler.getServletHandler().getServletMappings()) { - logger.info("jetty servlet mappings: {} register by {}", servletMapping.getPathSpecs(), servletMapping.getServletName()); - } - server.start(); - } catch (Exception e) { - throw new JettyServerException(e.getMessage(), e); - } - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - JettyServer that = (JettyServer)o; - return port == that.port && - Objects.equals(host, that.host); - } - - @Override - public int hashCode() { - return Objects.hash(host, port); - } -} diff --git a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyServerConfig.java b/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyServerConfig.java deleted file mode 100644 index 7158030979d7f2af53acc93cddbb556c8d316625..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyServerConfig.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.server.jetty; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author peng-yongsheng - */ -public abstract class JettyServerConfig extends ModuleConfig { - - private String host; - private int port; - private String contextPath; - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - - public int getPort() { - return port; - } - - public void setPort(int port) { - this.port = port; - } - - public String getContextPath() { - return contextPath; - } - - public void setContextPath(String contextPath) { - this.contextPath = contextPath; - } -} diff --git a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyServerException.java b/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyServerException.java deleted file mode 100644 index b8c0dfc8dea5484ab0afb6244ceba0ef638e108d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-component/server-component/src/main/java/org/apache/skywalking/apm/collector/server/jetty/JettyServerException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.server.jetty; - -import org.apache.skywalking.apm.collector.server.ServerException; - -/** - * @author peng-yongsheng - */ -public class JettyServerException extends ServerException { - - public JettyServerException(String message) { - super(message); - } - - public JettyServerException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/pom.xml b/apm-collector/apm-collector-configuration/collector-configuration-define/pom.xml deleted file mode 100644 index 558e5185527a193c46121217ec0a4442bf7ef9bb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - apm-collector-configuration - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-configuration-define - jar - \ No newline at end of file diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModule.java b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModule.java deleted file mode 100644 index 3b970daf97d8758df169136cb4fcf0a48275d364..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModule.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration; - -import org.apache.skywalking.apm.collector.configuration.service.*; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; - -/** - * @author peng-yongsheng - */ -public class ConfigurationModule extends ModuleDefine { - - public static final String NAME = "configuration"; - - @Override public String name() { - return NAME; - } - - @Override public Class[] services() { - return new Class[] { - ICollectorConfig.class, - IApdexThresholdService.class, - IServiceAlarmRuleConfig.class, IInstanceAlarmRuleConfig.class, IApplicationAlarmRuleConfig.class, - IServiceReferenceAlarmRuleConfig.class, IInstanceReferenceAlarmRuleConfig.class, IApplicationReferenceAlarmRuleConfig.class, - IComponentLibraryCatalogService.class, IResponseTimeDistributionConfigService.class, IWorkerCacheSizeConfig.class}; - } -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IApdexThresholdService.java b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IApdexThresholdService.java deleted file mode 100644 index 98a0afcd3b1e89f66661b1eb0c0fc17b5f147b33..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IApdexThresholdService.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface IApdexThresholdService extends Service { - - /** - * Apdex T applies to web transactions only - * - * @param applicationId - * @return This value is in milli-seconds. - */ - Integer getApplicationApdexThreshold(int applicationId); -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IApplicationAlarmRuleConfig.java b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IApplicationAlarmRuleConfig.java deleted file mode 100644 index 08a19fb7b3a91424bb2e5facfb616ed0467eb5c6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IApplicationAlarmRuleConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface IApplicationAlarmRuleConfig extends Service { - double calleeErrorRateThreshold(); - - double calleeAverageResponseTimeThreshold(); - - double callerErrorRateThreshold(); - - double callerAverageResponseTimeThreshold(); -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IApplicationReferenceAlarmRuleConfig.java b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IApplicationReferenceAlarmRuleConfig.java deleted file mode 100644 index 39596e4f15fb870db4790daa9b90770abe2e3954..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IApplicationReferenceAlarmRuleConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface IApplicationReferenceAlarmRuleConfig extends Service { - double calleeErrorRateThreshold(); - - double calleeAverageResponseTimeThreshold(); - - double callerErrorRateThreshold(); - - double callerAverageResponseTimeThreshold(); -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ICollectorConfig.java b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ICollectorConfig.java deleted file mode 100644 index 5c2f4bfe164ad33dcefda4abbc34822adadb2318..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ICollectorConfig.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author wu-sheng - */ -public interface ICollectorConfig extends Service { - /** - * @return the namespace of Collector, empty String if no custom namespace - */ - String getNamespace(); -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IInstanceAlarmRuleConfig.java b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IInstanceAlarmRuleConfig.java deleted file mode 100644 index b53ccaeacec20186945c308d5eaf41744b260d71..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IInstanceAlarmRuleConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface IInstanceAlarmRuleConfig extends Service { - double calleeErrorRateThreshold(); - - double calleeAverageResponseTimeThreshold(); - - double callerErrorRateThreshold(); - - double callerAverageResponseTimeThreshold(); -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IInstanceReferenceAlarmRuleConfig.java b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IInstanceReferenceAlarmRuleConfig.java deleted file mode 100644 index e59c7aed89ca0b4e798a08ac98004497f044b87f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IInstanceReferenceAlarmRuleConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface IInstanceReferenceAlarmRuleConfig extends Service { - double calleeErrorRateThreshold(); - - double calleeAverageResponseTimeThreshold(); - - double callerErrorRateThreshold(); - - double callerAverageResponseTimeThreshold(); -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IResponseTimeDistributionConfigService.java b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IResponseTimeDistributionConfigService.java deleted file mode 100644 index 5a6d25e8c6dcda04141e1a9838e49ecb28525fbe..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IResponseTimeDistributionConfigService.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface IResponseTimeDistributionConfigService extends Service { - - int getResponseTimeStep(); - - int getCountOfResponseTimeSteps(); - - /** - * Equals to getResponseTimeStep() * getCountOfResponseTimeSteps() ,just for economizes computing resources - * - * @return - */ - int getTotalTimeOfResponseTimeSteps(); - -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IServiceAlarmRuleConfig.java b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IServiceAlarmRuleConfig.java deleted file mode 100644 index 778c0cdb4c15ab59a2e751ca5e7654d824d3ec6f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IServiceAlarmRuleConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface IServiceAlarmRuleConfig extends Service { - double calleeErrorRateThreshold(); - - double calleeAverageResponseTimeThreshold(); - - double callerErrorRateThreshold(); - - double callerAverageResponseTimeThreshold(); -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IServiceReferenceAlarmRuleConfig.java b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IServiceReferenceAlarmRuleConfig.java deleted file mode 100644 index 97eee2144401a7fb2d378f61cbf9eea064b4d13d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IServiceReferenceAlarmRuleConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface IServiceReferenceAlarmRuleConfig extends Service { - double calleeErrorRateThreshold(); - - double calleeAverageResponseTimeThreshold(); - - double callerErrorRateThreshold(); - - double callerAverageResponseTimeThreshold(); -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IWorkerCacheSizeConfig.java b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IWorkerCacheSizeConfig.java deleted file mode 100644 index 34d312f7bddd1065f7493f240941133e8472cfd9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IWorkerCacheSizeConfig.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface IWorkerCacheSizeConfig extends Service { - int cacheSize(); -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/InitialComponentCatalogException.java b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/InitialComponentCatalogException.java deleted file mode 100644 index 78859a51fb87f12ffb127441175d27f1bd52ec59..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/InitialComponentCatalogException.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -/** - * @author wusheng - */ -public class InitialComponentCatalogException extends RuntimeException { - public InitialComponentCatalogException(String message) { - super(message); - } -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine deleted file mode 100644 index 5e282b6518ead1ecc5f0208b1162a0b86eb22211..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.configuration.ConfigurationModule diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/pom.xml b/apm-collector/apm-collector-configuration/collector-configuration-provider/pom.xml deleted file mode 100644 index de5a70c8943be228aa8b9b6153a8fb128ed3974d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - apm-collector-configuration - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-configuration-provider - jar - - - - org.apache.skywalking - collector-configuration-define - ${project.version} - - - - org.yaml - snakeyaml - - - diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleConfig.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleConfig.java deleted file mode 100644 index 3cdf372f2ea934cf6f24e77eb25532258fda3442..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleConfig.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author peng-yongsheng - */ -class ConfigurationModuleConfig extends ModuleConfig { - - private String namespace; - private int applicationApdexThreshold; - private double serviceErrorRateThreshold; - private int serviceAverageResponseTimeThreshold; - private double instanceErrorRateThreshold; - private int instanceAverageResponseTimeThreshold; - private double applicationErrorRateThreshold; - private int applicationAverageResponseTimeThreshold; - private int thermodynamicResponseTimeStep; - private int thermodynamicCountOfResponseTimeSteps; - private int workerCacheMaxSize; - - public String getNamespace() { - return namespace; - } - - public void setNamespace(String namespace) { - this.namespace = namespace; - } - - public int getApplicationApdexThreshold() { - return applicationApdexThreshold; - } - - public void setApplicationApdexThreshold(int applicationApdexThreshold) { - this.applicationApdexThreshold = applicationApdexThreshold; - } - - public double getServiceErrorRateThreshold() { - return serviceErrorRateThreshold; - } - - public void setServiceErrorRateThreshold(double serviceErrorRateThreshold) { - this.serviceErrorRateThreshold = serviceErrorRateThreshold; - } - - public int getServiceAverageResponseTimeThreshold() { - return serviceAverageResponseTimeThreshold; - } - - public void setServiceAverageResponseTimeThreshold(int serviceAverageResponseTimeThreshold) { - this.serviceAverageResponseTimeThreshold = serviceAverageResponseTimeThreshold; - } - - public double getInstanceErrorRateThreshold() { - return instanceErrorRateThreshold; - } - - public void setInstanceErrorRateThreshold(double instanceErrorRateThreshold) { - this.instanceErrorRateThreshold = instanceErrorRateThreshold; - } - - public int getInstanceAverageResponseTimeThreshold() { - return instanceAverageResponseTimeThreshold; - } - - public void setInstanceAverageResponseTimeThreshold(int instanceAverageResponseTimeThreshold) { - this.instanceAverageResponseTimeThreshold = instanceAverageResponseTimeThreshold; - } - - public double getApplicationErrorRateThreshold() { - return applicationErrorRateThreshold; - } - - public void setApplicationErrorRateThreshold(double applicationErrorRateThreshold) { - this.applicationErrorRateThreshold = applicationErrorRateThreshold; - } - - public int getApplicationAverageResponseTimeThreshold() { - return applicationAverageResponseTimeThreshold; - } - - public void setApplicationAverageResponseTimeThreshold(int applicationAverageResponseTimeThreshold) { - this.applicationAverageResponseTimeThreshold = applicationAverageResponseTimeThreshold; - } - - public int getThermodynamicResponseTimeStep() { - return thermodynamicResponseTimeStep; - } - - public void setThermodynamicResponseTimeStep(int thermodynamicResponseTimeStep) { - this.thermodynamicResponseTimeStep = thermodynamicResponseTimeStep; - } - - public int getThermodynamicCountOfResponseTimeSteps() { - return thermodynamicCountOfResponseTimeSteps; - } - - public void setThermodynamicCountOfResponseTimeSteps(int thermodynamicCountOfResponseTimeSteps) { - this.thermodynamicCountOfResponseTimeSteps = thermodynamicCountOfResponseTimeSteps; - } - - public int getWorkerCacheMaxSize() { - return workerCacheMaxSize; - } - - public void setWorkerCacheMaxSize(int workerCacheMaxSize) { - this.workerCacheMaxSize = workerCacheMaxSize; - } -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java deleted file mode 100644 index 0f9044d87a026df7b115eb21ff1d3fdb01d9dd84..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration; - -import org.apache.skywalking.apm.collector.configuration.service.*; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.core.util.*; - -/** - * @author peng-yongsheng - */ -public class ConfigurationModuleProvider extends ModuleProvider { - - private final ConfigurationModuleConfig config; - - public ConfigurationModuleProvider() { - super(); - this.config = new ConfigurationModuleConfig(); - } - - @Override public String name() { - return "default"; - } - - @Override public Class module() { - return ConfigurationModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() throws ServiceNotProvidedException { - String namespace = StringUtils.isNotEmpty(config.getNamespace()) ? config.getNamespace() : Const.EMPTY_STRING; - int applicationApdexThreshold = config.getApplicationApdexThreshold() == 0 ? 2000 : config.getApplicationApdexThreshold(); - double serviceErrorRateThreshold = config.getServiceErrorRateThreshold() == 0 ? 0.10 : config.getServiceErrorRateThreshold() / 100; - int serviceAverageResponseTimeThreshold = config.getServiceAverageResponseTimeThreshold() == 0 ? 2000 : config.getServiceAverageResponseTimeThreshold(); - double instanceErrorRateThreshold = config.getInstanceErrorRateThreshold() == 0 ? 0.10 : config.getInstanceErrorRateThreshold() / 100; - int instanceAverageResponseTimeThreshold = config.getInstanceAverageResponseTimeThreshold() == 0 ? 2000 : config.getInstanceAverageResponseTimeThreshold(); - double applicationErrorRateThreshold = config.getApplicationErrorRateThreshold() == 0 ? 0.10 : config.getApplicationErrorRateThreshold() / 100; - int applicationAverageResponseTimeThreshold = config.getApplicationAverageResponseTimeThreshold() == 0 ? 2000 : config.getApplicationAverageResponseTimeThreshold(); - - int thermodynamicResponseTimeStep = config.getThermodynamicResponseTimeStep() == 0 ? 50 : config.getThermodynamicResponseTimeStep(); - int thermodynamicCountOfResponseTimeSteps = config.getThermodynamicCountOfResponseTimeSteps() == 0 ? 40 : config.getThermodynamicCountOfResponseTimeSteps(); - - int workerCacheMaxSize = config.getWorkerCacheMaxSize() == 0 ? 10000 : config.getWorkerCacheMaxSize(); - - this.registerServiceImplementation(ICollectorConfig.class, new CollectorConfigService(namespace)); - this.registerServiceImplementation(IComponentLibraryCatalogService.class, new ComponentLibraryCatalogService()); - this.registerServiceImplementation(IApdexThresholdService.class, new ApdexThresholdService(applicationApdexThreshold)); - this.registerServiceImplementation(IServiceAlarmRuleConfig.class, new ServiceAlarmRuleConfig(serviceErrorRateThreshold, serviceAverageResponseTimeThreshold)); - this.registerServiceImplementation(IInstanceAlarmRuleConfig.class, new InstanceAlarmRuleConfig(instanceErrorRateThreshold, instanceAverageResponseTimeThreshold)); - this.registerServiceImplementation(IApplicationAlarmRuleConfig.class, new ApplicationAlarmRuleConfig(applicationErrorRateThreshold, applicationAverageResponseTimeThreshold)); - this.registerServiceImplementation(IServiceReferenceAlarmRuleConfig.class, new ServiceReferenceAlarmRuleConfig(serviceErrorRateThreshold, serviceAverageResponseTimeThreshold)); - this.registerServiceImplementation(IInstanceReferenceAlarmRuleConfig.class, new InstanceReferenceAlarmRuleConfig(instanceErrorRateThreshold, instanceAverageResponseTimeThreshold)); - this.registerServiceImplementation(IApplicationReferenceAlarmRuleConfig.class, new ApplicationReferenceAlarmRuleConfig(applicationErrorRateThreshold, applicationAverageResponseTimeThreshold)); - this.registerServiceImplementation(IResponseTimeDistributionConfigService.class, new ResponseTimeDistributionConfigService(thermodynamicResponseTimeStep, thermodynamicCountOfResponseTimeSteps)); - this.registerServiceImplementation(IWorkerCacheSizeConfig.class, new WorkerCacheSizeConfigService(workerCacheMaxSize)); - } - - @Override public void start() { - } - - @Override public void notifyAfterCompleted() { - } - - @Override public String[] requiredModules() { - return new String[0]; - } -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApdexThresholdService.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApdexThresholdService.java deleted file mode 100644 index 5b841096e92d5293b1ae7410d90a607b9a62d1a7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApdexThresholdService.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -/** - * @author peng-yongsheng - */ -public class ApdexThresholdService implements IApdexThresholdService { - - private int apdexThreshold; - - public ApdexThresholdService(int apdexThreshold) { - this.apdexThreshold = apdexThreshold; - } - - /** - * Apdex T applies to web transactions only - * - * @param applicationId - * @return This value is in milli-seconds. - */ - @Override public Integer getApplicationApdexThreshold(int applicationId) { - return apdexThreshold; - } -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApplicationAlarmRuleConfig.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApplicationAlarmRuleConfig.java deleted file mode 100644 index 53ec719363b51e93940f5586ffea23f490ea4ae1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApplicationAlarmRuleConfig.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmRuleConfig implements IApplicationAlarmRuleConfig { - - private double errorRateThreshold; - private int averageResponseTimeThreshold; - - public ApplicationAlarmRuleConfig(double errorRateThreshold, int averageResponseTimeThreshold) { - this.errorRateThreshold = errorRateThreshold; - this.averageResponseTimeThreshold = averageResponseTimeThreshold; - } - - @Override public double calleeErrorRateThreshold() { - return errorRateThreshold; - } - - @Override public double calleeAverageResponseTimeThreshold() { - return averageResponseTimeThreshold; - } - - @Override public double callerErrorRateThreshold() { - return errorRateThreshold; - } - - @Override public double callerAverageResponseTimeThreshold() { - return averageResponseTimeThreshold; - } -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApplicationReferenceAlarmRuleConfig.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApplicationReferenceAlarmRuleConfig.java deleted file mode 100644 index 0e9ef86cb84f2d87a51dfc34afb72d96ba51bd9c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApplicationReferenceAlarmRuleConfig.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceAlarmRuleConfig implements IApplicationReferenceAlarmRuleConfig { - - private double errorRateThreshold; - private int averageResponseTimeThreshold; - - public ApplicationReferenceAlarmRuleConfig(double errorRateThreshold, int averageResponseTimeThreshold) { - this.errorRateThreshold = errorRateThreshold; - this.averageResponseTimeThreshold = averageResponseTimeThreshold; - } - - @Override public double calleeErrorRateThreshold() { - return errorRateThreshold; - } - - @Override public double calleeAverageResponseTimeThreshold() { - return averageResponseTimeThreshold; - } - - @Override public double callerErrorRateThreshold() { - return errorRateThreshold; - } - - @Override public double callerAverageResponseTimeThreshold() { - return averageResponseTimeThreshold; - } -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/CollectorConfigService.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/CollectorConfigService.java deleted file mode 100644 index 1ccf8321dad0cb45884c015dd8492149691b7bf8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/CollectorConfigService.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -/** - * @author wu-sheng - */ -public class CollectorConfigService implements ICollectorConfig { - private String namespace; - - public CollectorConfigService(String namespace) { - this.namespace = namespace == null ? "" : namespace; - } - - @Override public String getNamespace() { - return namespace; - } -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/InstanceAlarmRuleConfig.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/InstanceAlarmRuleConfig.java deleted file mode 100644 index 3f3122346481cb5d0047f0bd1a40e11d137b0c86..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/InstanceAlarmRuleConfig.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -/** - * @author peng-yongsheng - */ -public class InstanceAlarmRuleConfig implements IInstanceAlarmRuleConfig { - - private double errorRateThreshold; - private int averageResponseTimeThreshold; - - public InstanceAlarmRuleConfig(double errorRateThreshold, int averageResponseTimeThreshold) { - this.errorRateThreshold = errorRateThreshold; - this.averageResponseTimeThreshold = averageResponseTimeThreshold; - } - - @Override public double calleeErrorRateThreshold() { - return errorRateThreshold; - } - - @Override public double calleeAverageResponseTimeThreshold() { - return averageResponseTimeThreshold; - } - - @Override public double callerErrorRateThreshold() { - return errorRateThreshold; - } - - @Override public double callerAverageResponseTimeThreshold() { - return averageResponseTimeThreshold; - } -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/InstanceReferenceAlarmRuleConfig.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/InstanceReferenceAlarmRuleConfig.java deleted file mode 100644 index 6076ee72569cd1d6709113e9ee2172f6118b69ab..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/InstanceReferenceAlarmRuleConfig.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceAlarmRuleConfig implements IInstanceReferenceAlarmRuleConfig { - - private double errorRateThreshold; - private int averageResponseTimeThreshold; - - public InstanceReferenceAlarmRuleConfig(double errorRateThreshold, int averageResponseTimeThreshold) { - this.errorRateThreshold = errorRateThreshold; - this.averageResponseTimeThreshold = averageResponseTimeThreshold; - } - - @Override public double calleeErrorRateThreshold() { - return errorRateThreshold; - } - - @Override public double calleeAverageResponseTimeThreshold() { - return averageResponseTimeThreshold; - } - - @Override public double callerErrorRateThreshold() { - return errorRateThreshold; - } - - @Override public double callerAverageResponseTimeThreshold() { - return averageResponseTimeThreshold; - } -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ResponseTimeDistributionConfigService.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ResponseTimeDistributionConfigService.java deleted file mode 100644 index 87ed2a2c3bb2e6318757ae5ed02523aa63bdb9ea..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ResponseTimeDistributionConfigService.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionConfigService implements IResponseTimeDistributionConfigService { - - private final int responseTimeStep; - private final int countOfResponseTimeSteps; - private final int totalTimeOfResponseTimeSteps; - - public ResponseTimeDistributionConfigService(int responseTimeStep, int countOfResponseTimeSteps) { - this.responseTimeStep = responseTimeStep; - this.countOfResponseTimeSteps = countOfResponseTimeSteps + 1; - this.totalTimeOfResponseTimeSteps = this.responseTimeStep * this.countOfResponseTimeSteps; - } - - @Override public int getResponseTimeStep() { - return responseTimeStep; - } - - @Override public int getCountOfResponseTimeSteps() { - return countOfResponseTimeSteps; - } - - @Override - public int getTotalTimeOfResponseTimeSteps() { - return totalTimeOfResponseTimeSteps; - } -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ServiceAlarmRuleConfig.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ServiceAlarmRuleConfig.java deleted file mode 100644 index ae4e04f47b005ae2c1a99fe068d05910844e7763..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ServiceAlarmRuleConfig.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -/** - * @author peng-yongsheng - */ -public class ServiceAlarmRuleConfig implements IServiceAlarmRuleConfig { - - private double errorRateThreshold; - private int averageResponseTimeThreshold; - - public ServiceAlarmRuleConfig(double errorRateThreshold, int averageResponseTimeThreshold) { - this.errorRateThreshold = errorRateThreshold; - this.averageResponseTimeThreshold = averageResponseTimeThreshold; - } - - @Override public double calleeErrorRateThreshold() { - return errorRateThreshold; - } - - @Override public double calleeAverageResponseTimeThreshold() { - return averageResponseTimeThreshold; - } - - @Override public double callerErrorRateThreshold() { - return errorRateThreshold; - } - - @Override public double callerAverageResponseTimeThreshold() { - return averageResponseTimeThreshold; - } -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ServiceReferenceAlarmRuleConfig.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ServiceReferenceAlarmRuleConfig.java deleted file mode 100644 index 0fba6fa4e8b7df1cea3c04f5c397e4a4885aeb0f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ServiceReferenceAlarmRuleConfig.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceAlarmRuleConfig implements IServiceReferenceAlarmRuleConfig { - - private double errorRateThreshold; - private int averageResponseTimeThreshold; - - public ServiceReferenceAlarmRuleConfig(double errorRateThreshold, int averageResponseTimeThreshold) { - this.errorRateThreshold = errorRateThreshold; - this.averageResponseTimeThreshold = averageResponseTimeThreshold; - } - - @Override public double calleeErrorRateThreshold() { - return errorRateThreshold; - } - - @Override public double calleeAverageResponseTimeThreshold() { - return averageResponseTimeThreshold; - } - - @Override public double callerErrorRateThreshold() { - return errorRateThreshold; - } - - @Override public double callerAverageResponseTimeThreshold() { - return averageResponseTimeThreshold; - } -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/WorkerCacheSizeConfigService.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/WorkerCacheSizeConfigService.java deleted file mode 100644 index a66855b816965409f87c39f25e5c87a75c59f9bf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/WorkerCacheSizeConfigService.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -/** - * @author peng-yongsheng - */ -public class WorkerCacheSizeConfigService implements IWorkerCacheSizeConfig { - - private int workerCacheMaxSize; - - public WorkerCacheSizeConfigService(int workerCacheMaxSize) { - this.workerCacheMaxSize = workerCacheMaxSize; - } - - @Override public int cacheSize() { - return workerCacheMaxSize; - } -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index 716552e3604cd88e2edd18113e0ec62c40906041..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.configuration.ConfigurationModuleProvider diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/test/java/org/apache/skywalking/apm/collector/configuration/service/ComponentLibraryCatalogServiceTest.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/test/java/org/apache/skywalking/apm/collector/configuration/service/ComponentLibraryCatalogServiceTest.java deleted file mode 100644 index a8ff28d2eecde45e061c53bafaecf3c73e288345..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/test/java/org/apache/skywalking/apm/collector/configuration/service/ComponentLibraryCatalogServiceTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.configuration.service; - -import org.junit.Assert; -import org.junit.Test; - -/** - * @author wusheng - */ -public class ComponentLibraryCatalogServiceTest { - @Test - public void testInitAndSettings() { - ComponentLibraryCatalogService service = new ComponentLibraryCatalogService(); - Assert.assertEquals(1, service.getComponentId("Tomcat")); - Assert.assertEquals(7, service.getServerIdBasedOnComponent(30)); - Assert.assertEquals(21, service.getServerIdBasedOnComponent(21)); - Assert.assertEquals("Jedis", service.getServerName(30)); - } -} diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/test/resources/component-libraries.yml b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/test/resources/component-libraries.yml deleted file mode 100644 index 5a8f425e7376a2112070757c4a0bac20bad388b8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/test/resources/component-libraries.yml +++ /dev/null @@ -1,137 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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. - -########################################## -# This is only a test case define file -########################################## - -# Define all component libraries' names and IDs, used in monitored application. -# This is a bothway mapping, agent or SDK could use the value(ID) to represent the component name in uplink data. -# -# ###### -# id -# ###### -# We highly recommend DO NOT change the IDs in these file, just append new one, and make sure the ID unique. -# Any replacement will cause visualization and aggregation error. -# -# All IDs in this files are reserved, even some IDs removed by some reasons, those IDs will be abandoned. -# -# ###### -# languages -# ###### -# Languages declare which languages are using this component. Multi languages should be separated by `,` - -Tomcat: - id: 1 - languages: Java -HttpClient: - id: 2 - languages: Java -Dubbo: - id: 3 - languages: Java -H2: - id: 4 - languages: Java -Mysql: - id: 5 - languages: Java -ORACLE: - id: 6 - languages: Java -Redis: - id: 7 - languages: Java -Motan: - id: 8 - languages: Java -MongoDB: - id: 9 - languages: Java -Resin: - id: 10 - languages: Java -Feign: - id: 11 - languages: Java -OKHttp: - id: 12 - languages: Java -SpringRestTemplate: - id: 13 - languages: Java -SpringMVC: - id: 14 - languages: Java -Struts2: - id: 15 - languages: Java -NutzMVC: - id: 16 - languages: Java -NutzHttp: - id: 17 - languages: Java -JettyClient: - id: 18 - languages: Java -JettyServer: - id: 19 - languages: Java -Memcached: - id: 20 - languages: Java -ShardingJDBC: - id: 21 - languages: Java -PostgreSQL: - id: 22 - languages: Java -GRPC: - id: 23 - languages: Java -ElasticJob: - id: 24 - languages: Java -RocketMQ: - id: 25 - languages: Java -httpasyncclient: - id: 26 - languages: Java -Kafka: - id: 27 - languages: Java -ServiceComb: - id: 28 - languages: Java -Hystrix: - id: 29 - languages: Java -Jedis: - id: 30 - languages: Java -SOFARPC: - id: 43 - languages: Java - - -# Component Server mapping defines the server display names of some components -# e.g. -# Jedis is a client library in Java for Redis server -Component-Server-Mappings: - Jedis: Redis - diff --git a/apm-collector/apm-collector-configuration/pom.xml b/apm-collector/apm-collector-configuration/pom.xml deleted file mode 100644 index a3413a98e478b21b32d9f4fac85bffed6e46ad63..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-configuration/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - apm-collector - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - apm-collector-configuration - pom - - collector-configuration-define - collector-configuration-provider - - - - - org.apache.skywalking - apm-collector-core - ${project.version} - - - diff --git a/apm-collector/apm-collector-core/pom.xml b/apm-collector/apm-collector-core/pom.xml deleted file mode 100644 index 7b491357876186cf63e36825b2face07e30d4369..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - apm-collector - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - apm-collector-core - jar - - - - com.google.code.gson - gson - - - joda-time - joda-time - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/CollectorException.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/CollectorException.java deleted file mode 100644 index b1e2cf72413331362221f633dcf3318a7fc088fe..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/CollectorException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core; - -/** - * @author peng-yongsheng - */ -public class CollectorException extends Exception { - - public CollectorException(String message) { - super(message); - } - - public CollectorException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/UnexpectedException.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/UnexpectedException.java deleted file mode 100644 index d059bac43d2edfd7b34de2d87a7845548f14d871..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/UnexpectedException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core; - -/** - * @author wu-sheng - */ -public class UnexpectedException extends RuntimeException { - public UnexpectedException(String message) { - super(message); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/annotations/trace/BatchParameter.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/annotations/trace/BatchParameter.java deleted file mode 100644 index e49570db6ed467a6a5447db8f08c7026b7121313..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/annotations/trace/BatchParameter.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.annotations.trace; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @author wusheng - */ -@Target(ElementType.PARAMETER) -@Retention(RetentionPolicy.RUNTIME) -public @interface BatchParameter { -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/annotations/trace/GraphComputingMetric.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/annotations/trace/GraphComputingMetric.java deleted file mode 100644 index d5dec9a86f076381783a46494263ec0aa278e502..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/annotations/trace/GraphComputingMetric.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.annotations.trace; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * The method with this annotation should be traced, - * and the metrics(avg response time, call count, success rate) could be collected by the instrument agent. - * - * This is an optional annotation. - * - * @author wusheng - */ -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -public @interface GraphComputingMetric { - String name(); -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/cache/Collection.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/cache/Collection.java deleted file mode 100644 index dfab1fac4ecdeabbf51d73e0bee339b6a8309d5c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/cache/Collection.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.cache; - -/** - * @author peng-yongsheng - */ -public interface Collection { - - void reading(); - - boolean isReading(); - - void writing(); - - boolean isWriting(); - - void clear(); - - int size(); - - void finishReading(); - - void finishWriting(); - - Data collection(); -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/cache/Window.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/cache/Window.java deleted file mode 100644 index 9790526a00f2e07986aa32ea5abde40004c45f23..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/cache/Window.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.cache; - -import java.util.concurrent.atomic.AtomicInteger; - -/** - * @author peng-yongsheng - */ -public abstract class Window { - - private AtomicInteger windowSwitch = new AtomicInteger(0); - - private WINDOW_COLLECTION pointer; - - private WINDOW_COLLECTION windowDataA; - private WINDOW_COLLECTION windowDataB; - - protected Window() { - this.windowDataA = collectionInstance(); - this.windowDataB = collectionInstance(); - this.pointer = windowDataA; - } - - public abstract WINDOW_COLLECTION collectionInstance(); - - public boolean trySwitchPointer() { - return windowSwitch.incrementAndGet() == 1 && !getLast().isReading(); - } - - public void trySwitchPointerFinally() { - windowSwitch.addAndGet(-1); - } - - public void switchPointer() { - if (pointer == windowDataA) { - pointer = windowDataB; - } else { - pointer = windowDataA; - } - getLast().reading(); - } - - protected WINDOW_COLLECTION getCurrentAndWriting() { - if (pointer == windowDataA) { - windowDataA.writing(); - return windowDataA; - } else { - windowDataB.writing(); - return windowDataB; - } - } - - private WINDOW_COLLECTION getCurrent() { - return pointer; - } - - public int currentCollectionSize() { - return getCurrent().size(); - } - - public WINDOW_COLLECTION getLast() { - if (pointer == windowDataA) { - return windowDataB; - } else { - return windowDataA; - } - } - - public void finishReadingLast() { - getLast().clear(); - getLast().finishReading(); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/AbstractData.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/AbstractData.java deleted file mode 100644 index 5af3ff2dfb2e662a209404c381e09aeab7c43ced..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/AbstractData.java +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -import org.apache.skywalking.apm.collector.core.data.column.*; - -import static java.util.Objects.nonNull; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractData implements RemoteData { - private final String[] dataStrings; - private final Long[] dataLongs; - private final Double[] dataDoubles; - private final Integer[] dataIntegers; - private final byte[][] dataBytes; - - private final StringLinkedList[] dataStringLists; - private final LongLinkedList[] dataLongLists; - private final DoubleLinkedList[] dataDoubleLists; - private final IntegerLinkedList[] dataIntegerLists; - - private final StringColumn[] stringColumns; - private final LongColumn[] longColumns; - private final IntegerColumn[] integerColumns; - private final DoubleColumn[] doubleColumns; - private final ByteColumn[] byteColumns; - - private final StringListColumn[] stringListColumns; - private final LongListColumn[] longListColumns; - private final IntegerListColumn[] integerListColumns; - private final DoubleListColumn[] doubleListColumns; - - AbstractData(StringColumn[] stringColumns, LongColumn[] longColumns, - IntegerColumn[] integerColumns, - DoubleColumn[] doubleColumns, ByteColumn[] byteColumns, - StringListColumn[] stringListColumns, - LongListColumn[] longListColumns, - IntegerListColumn[] integerListColumns, DoubleListColumn[] doubleListColumns) { - this.stringColumns = stringColumns; - this.longColumns = longColumns; - this.integerColumns = integerColumns; - this.doubleColumns = doubleColumns; - this.byteColumns = byteColumns; - - this.stringListColumns = stringListColumns; - this.longListColumns = longListColumns; - this.integerListColumns = integerListColumns; - this.doubleListColumns = doubleListColumns; - - this.dataStrings = new String[stringColumns.length]; - this.dataLongs = new Long[longColumns.length]; - this.dataIntegers = new Integer[integerColumns.length]; - this.dataDoubles = new Double[doubleColumns.length]; - this.dataBytes = new byte[byteColumns.length][]; - - this.dataStringLists = new StringLinkedList[stringListColumns.length]; - for (int i = 0; i < this.dataStringLists.length; i++) { - this.dataStringLists[i] = new StringLinkedList(); - } - - this.dataLongLists = new LongLinkedList[longListColumns.length]; - for (int i = 0; i < this.dataLongLists.length; i++) { - this.dataLongLists[i] = new LongLinkedList(); - } - - this.dataIntegerLists = new IntegerLinkedList[integerListColumns.length]; - for (int i = 0; i < this.dataIntegerLists.length; i++) { - this.dataIntegerLists[i] = new IntegerLinkedList(); - } - - this.dataDoubleLists = new DoubleLinkedList[doubleListColumns.length]; - for (int i = 0; i < this.dataDoubleLists.length; i++) { - this.dataDoubleLists[i] = new DoubleLinkedList(); - } - } - - @Override public final int getDataStringsCount() { - return dataStrings.length; - } - - @Override public final int getDataLongsCount() { - return dataLongs.length; - } - - @Override public final int getDataDoublesCount() { - return dataDoubles.length; - } - - @Override public final int getDataIntegersCount() { - return dataIntegers.length; - } - - @Override public final int getDataBytesCount() { - return dataBytes.length; - } - - @Override public int getDataStringListsCount() { - return dataStringLists.length; - } - - @Override public int getDataLongListsCount() { - return dataLongLists.length; - } - - @Override public int getDataDoubleListsCount() { - return dataDoubleLists.length; - } - - @Override public int getDataIntegerListsCount() { - return dataIntegerLists.length; - } - - @Override public final void setDataString(int position, String value) { - dataStrings[position] = value; - } - - @Override public final void setDataLong(int position, Long value) { - dataLongs[position] = value; - } - - @Override public final void setDataDouble(int position, Double value) { - dataDoubles[position] = value; - } - - @Override public final void setDataInteger(int position, Integer value) { - dataIntegers[position] = value; - } - - @Override public final void setDataBytes(int position, byte[] dataBytes) { - this.dataBytes[position] = dataBytes; - } - - @Override public final String getDataString(int position) { - return dataStrings[position]; - } - - @Override public final Long getDataLong(int position) { - if (position + 1 > dataLongs.length) { - throw new IndexOutOfBoundsException(); - } else if (dataLongs[position] == null) { - return 0L; - } else { - return dataLongs[position]; - } - } - - @Override public final Double getDataDouble(int position) { - if (position + 1 > dataDoubles.length) { - throw new IndexOutOfBoundsException(); - } else if (dataDoubles[position] == null) { - return 0D; - } else { - return dataDoubles[position]; - } - } - - @Override public final Integer getDataInteger(int position) { - if (position + 1 > dataIntegers.length) { - throw new IndexOutOfBoundsException(); - } else if (dataIntegers[position] == null) { - return 0; - } else { - return dataIntegers[position]; - } - } - - @Override public final byte[] getDataBytes(int position) { - return dataBytes[position]; - } - - @Override public StringLinkedList getDataStringList(int position) { - if (position + 1 > dataStringLists.length) { - throw new IndexOutOfBoundsException(); - } else { - return dataStringLists[position]; - } - } - - @Override public LongLinkedList getDataLongList(int position) { - if (position + 1 > dataLongLists.length) { - throw new IndexOutOfBoundsException(); - } else { - return dataLongLists[position]; - } - } - - @Override public DoubleLinkedList getDataDoubleList(int position) { - if (position + 1 > dataDoubleLists.length) { - throw new IndexOutOfBoundsException(); - } else { - return dataDoubleLists[position]; - } - } - - @Override public IntegerLinkedList getDataIntegerList(int position) { - if (position + 1 > dataIntegerLists.length) { - throw new IndexOutOfBoundsException(); - } else { - return dataIntegerLists[position]; - } - } - - public final void mergeAndFormulaCalculateData(AbstractData newData) { - mergeData(newData); - calculateFormula(); - } - - private void mergeData(AbstractData newData) { - for (int i = 0; i < stringColumns.length; i++) { - String stringData = stringColumns[i].getMergeOperation().operate(newData.getDataString(i), this.getDataString(i)); - this.dataStrings[i] = stringData; - } - for (int i = 0; i < longColumns.length; i++) { - Long longData = longColumns[i].getMergeOperation().operate(newData.getDataLong(i), this.getDataLong(i)); - this.dataLongs[i] = longData; - } - for (int i = 0; i < doubleColumns.length; i++) { - Double doubleData = doubleColumns[i].getMergeOperation().operate(newData.getDataDouble(i), this.getDataDouble(i)); - this.dataDoubles[i] = doubleData; - } - for (int i = 0; i < integerColumns.length; i++) { - Integer integerData = integerColumns[i].getMergeOperation().operate(newData.getDataInteger(i), this.getDataInteger(i)); - this.dataIntegers[i] = integerData; - } - for (int i = 0; i < byteColumns.length; i++) { - byte[] byteData = byteColumns[i].getMergeOperation().operate(newData.getDataBytes(i), this.getDataBytes(i)); - this.dataBytes[i] = byteData; - } - for (int i = 0; i < stringListColumns.length; i++) { - StringLinkedList stringListData = stringListColumns[i].getMergeOperation().operate(newData.getDataStringList(i), this.getDataStringList(i)); - this.dataStringLists[i] = stringListData; - } - for (int i = 0; i < longListColumns.length; i++) { - LongLinkedList longListData = longListColumns[i].getMergeOperation().operate(newData.getDataLongList(i), this.getDataLongList(i)); - this.dataLongLists[i] = longListData; - } - for (int i = 0; i < doubleListColumns.length; i++) { - DoubleLinkedList doubleListData = doubleListColumns[i].getMergeOperation().operate(newData.getDataDoubleList(i), this.getDataDoubleList(i)); - this.dataDoubleLists[i] = doubleListData; - } - for (int i = 0; i < integerListColumns.length; i++) { - IntegerLinkedList integerListData = integerListColumns[i].getMergeOperation().operate(newData.getDataIntegerList(i), this.getDataIntegerList(i)); - this.dataIntegerLists[i] = integerListData; - } - } - - @SuppressWarnings("unchecked") - public void calculateFormula() { - for (int i = 0; i < stringColumns.length; i++) { - if (nonNull(stringColumns[i].getFormulaOperation())) { - String stringData = (String)stringColumns[i].getFormulaOperation().operate(this); - this.dataStrings[i] = stringData; - } - } - for (int i = 0; i < longColumns.length; i++) { - if (nonNull(longColumns[i].getFormulaOperation())) { - Long longData = (Long)longColumns[i].getFormulaOperation().operate(this); - this.dataLongs[i] = longData; - } - } - for (int i = 0; i < doubleColumns.length; i++) { - if (nonNull(doubleColumns[i].getFormulaOperation())) { - Double doubleData = (Double)doubleColumns[i].getFormulaOperation().operate(this); - this.dataDoubles[i] = doubleData; - } - } - for (int i = 0; i < integerColumns.length; i++) { - if (nonNull(integerColumns[i].getFormulaOperation())) { - Integer integerData = (Integer)integerColumns[i].getFormulaOperation().operate(this); - this.dataIntegers[i] = integerData; - } - } - } - - @Override public final String toString() { - StringBuilder dataStr = new StringBuilder(); - dataStr.append("string: ["); - for (String dataString : dataStrings) { - dataStr.append(dataString).append(","); - } - dataStr.append("], longs: ["); - for (Long dataLong : dataLongs) { - dataStr.append(dataLong).append(","); - } - dataStr.append("], double: ["); - for (Double dataDouble : dataDoubles) { - dataStr.append(dataDouble).append(","); - } - dataStr.append("], integer: ["); - for (Integer dataInteger : dataIntegers) { - dataStr.append(dataInteger).append(","); - } - dataStr.append("]"); - return dataStr.toString(); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/Attribute.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/Attribute.java deleted file mode 100644 index 8f9c45dfc39f10fae521da970aba1a4a3e8b4da9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/Attribute.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -/** - * @author peng-yongsheng - */ -public class Attribute { - private final String name; - private final AttributeType type; - private final Operation operation; - - public Attribute(String name, AttributeType type, Operation operation) { - this.name = name; - this.type = type; - this.operation = operation; - } - - public String getName() { - return name; - } - - public AttributeType getType() { - return type; - } - - public Operation getOperation() { - return operation; - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/AttributeType.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/AttributeType.java deleted file mode 100644 index 59a95d83ca8c6ce6de051a7a5e0dc912c1cd371c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/AttributeType.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -/** - * @author peng-yongsheng - */ -public enum AttributeType { - STRING, LONG, DOUBLE, INTEGER, BYTE, BOOLEAN -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/ColumnDefine.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/ColumnDefine.java deleted file mode 100644 index 14ec107982d05f7b436e7dcce20fee03c4bfadac..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/ColumnDefine.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -/** - * @author peng-yongsheng - */ -public abstract class ColumnDefine { - private final ColumnName columnName; - private final String type; - - public ColumnDefine(ColumnName columnName, String type) { - this.columnName = columnName; - this.type = type; - } - - public final ColumnName getColumnName() { - return columnName; - } - - public final String getType() { - return type; - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/ColumnName.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/ColumnName.java deleted file mode 100644 index 92bb45c35d4c67b3d821f87943977757247fe734..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/ColumnName.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -/** - * @author peng-yongsheng - */ -public class ColumnName { - private final String fullName; - private final String shortName; - private boolean useShortName = false; - - public ColumnName(String fullName, String shortName) { - this.fullName = fullName; - this.shortName = shortName; - } - - public String getName() { - return useShortName ? shortName : fullName; - } - - public void useShortName() { - this.useShortName = true; - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/CommonTable.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/CommonTable.java deleted file mode 100644 index bdc33d4262e4aa4e9a30687baf1da16e393f783f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/CommonTable.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -/** - * @author peng-yongsheng - */ -public interface CommonTable { - String TABLE_TYPE = "type"; - - ColumnName ID = new ColumnName("id", "id"); - - ColumnName METRIC_ID = new ColumnName("metric_id", "mi"); - - ColumnName TIME_BUCKET = new ColumnName("time_bucket", "tb"); - - ColumnName SOURCE_VALUE = new ColumnName("source_value", "sv"); - - ColumnName TIMES = new ColumnName("times", "t"); -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/Data.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/Data.java deleted file mode 100644 index 540b3589eb59ca9f2e7cb3a2fc852a7274d3537b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/Data.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -/** - * @author peng-yongsheng - */ -public interface Data { - int getDataStringsCount(); - - int getDataLongsCount(); - - int getDataDoublesCount(); - - int getDataIntegersCount(); - - int getDataStringListsCount(); - - int getDataLongListsCount(); - - int getDataDoubleListsCount(); - - int getDataIntegerListsCount(); - - int getDataBytesCount(); - - void setDataString(int position, String value); - - void setDataLong(int position, Long value); - - void setDataDouble(int position, Double value); - - void setDataInteger(int position, Integer value); - - void setDataBytes(int position, byte[] dataBytes); - - String getDataString(int position); - - Long getDataLong(int position); - - Double getDataDouble(int position); - - Integer getDataInteger(int position); - - StringLinkedList getDataStringList(int position); - - LongLinkedList getDataLongList(int position); - - DoubleLinkedList getDataDoubleList(int position); - - IntegerLinkedList getDataIntegerList(int position); - - byte[] getDataBytes(int position); -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/DoubleLinkedList.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/DoubleLinkedList.java deleted file mode 100644 index b3254efe5fbe4119b0383ba06acf4fd70766fe5a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/DoubleLinkedList.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -import java.util.LinkedList; - -/** - * @author peng-yongsheng - */ -public class DoubleLinkedList extends LinkedList { -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/FormulaOperation.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/FormulaOperation.java deleted file mode 100644 index 2136351472963581b8af64f617b6ead8782a11b2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/FormulaOperation.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -/** - * @author peng-yongsheng - */ -public interface FormulaOperation extends Operation { - OUTPUT_DATA operate(INPUT_DATA data); -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/IntegerLinkedList.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/IntegerLinkedList.java deleted file mode 100644 index 2374a2021b605cb25e1b2a3388e2c6068995f878..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/IntegerLinkedList.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -import java.util.LinkedList; - -/** - * @author peng-yongsheng - */ -public class IntegerLinkedList extends LinkedList { -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/LongLinkedList.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/LongLinkedList.java deleted file mode 100644 index 88dd6d98430ad432ff9508d4c608bfb4decc81a3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/LongLinkedList.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -import java.util.LinkedList; - -/** - * @author peng-yongsheng - */ -public class LongLinkedList extends LinkedList { -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/MergeOperation.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/MergeOperation.java deleted file mode 100644 index 5ebc927066ce4b1bcd398c320963fe24920e8356..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/MergeOperation.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -/** - * @author peng-yongsheng - */ -public interface MergeOperation extends Operation { - String operate(String newValue, String oldValue); - - Long operate(Long newValue, Long oldValue); - - Integer operate(Integer newValue, Integer oldValue); - - Double operate(Double newValue, Double oldValue); - - byte[] operate(byte[] newValue, byte[] oldValue); - - StringLinkedList operate(StringLinkedList newValue, StringLinkedList oldValue); - - LongLinkedList operate(LongLinkedList newValue, LongLinkedList oldValue); - - IntegerLinkedList operate(IntegerLinkedList newValue, IntegerLinkedList oldValue); - - DoubleLinkedList operate(DoubleLinkedList newValue, DoubleLinkedList oldValue); -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/Operation.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/Operation.java deleted file mode 100644 index 3d682e6701837160435e8ae2d72ad564ea8082eb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/Operation.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -/** - * @author peng-yongsheng - */ -public interface Operation { -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/QueueData.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/QueueData.java deleted file mode 100644 index 9036dfd4ac91c3fbd2c87b6dbef0cb69dff92cfa..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/QueueData.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -import org.apache.skywalking.apm.collector.core.queue.EndOfBatchContext; - -/** - * @author peng-yongsheng - */ -public interface QueueData { - - EndOfBatchContext getEndOfBatchContext(); - - void setEndOfBatchContext(EndOfBatchContext context); -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/RemoteData.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/RemoteData.java deleted file mode 100644 index 001397e8011ad74b973ed987c478d17009a5ae7a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/RemoteData.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -/** - * @author peng-yongsheng - */ -public interface RemoteData extends Data { - String selectKey(); -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/StorageDefineLoader.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/StorageDefineLoader.java deleted file mode 100644 index 1d95620d5ee5d965efa50bb02a7cd59d73b93e2f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/StorageDefineLoader.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -import java.util.LinkedList; -import java.util.List; -import org.apache.skywalking.apm.collector.core.define.DefineException; -import org.apache.skywalking.apm.collector.core.define.DefinitionLoader; -import org.apache.skywalking.apm.collector.core.define.Loader; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class StorageDefineLoader implements Loader> { - - private static final Logger logger = LoggerFactory.getLogger(StorageDefineLoader.class); - - @Override public List load() throws DefineException { - List tableDefines = new LinkedList<>(); - - StorageDefinitionFile definitionFile = new StorageDefinitionFile(); - logger.info("storage definition file name: {}", definitionFile.fileName()); - DefinitionLoader definitionLoader = DefinitionLoader.load(TableDefine.class, definitionFile); - for (TableDefine tableDefine : definitionLoader) { - logger.info("loaded storage definition class: {}", tableDefine.getClass().getName()); - tableDefines.add(tableDefine); - } - return tableDefines; - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/StorageDefinitionFile.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/StorageDefinitionFile.java deleted file mode 100644 index 6f075bd5c85da394fcd64fff5b1b0ea501491972..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/StorageDefinitionFile.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -import org.apache.skywalking.apm.collector.core.define.DefinitionFile; - -/** - * @author peng-yongsheng - */ -public class StorageDefinitionFile extends DefinitionFile { - @Override protected String fileName() { - return "storage.define"; - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/StreamData.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/StreamData.java deleted file mode 100644 index 0ee3a6b1ebccebb6a7a5284b390d8f607bf8a352..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/StreamData.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.queue.EndOfBatchContext; - -/** - * @author peng-yongsheng - */ -public abstract class StreamData extends AbstractData implements QueueData { - - private static final ByteColumn[] BYTE_COLUMNS = {}; - - private static final StringListColumn[] STRING_LIST_COLUMNS = {}; - - private static final LongListColumn[] LONG_LIST_COLUMNS = {}; - - private static final IntegerListColumn[] INTEGER_LIST_COLUMNS = {}; - - private static final DoubleListColumn[] DOUBLE_LIST_COLUMNS = {}; - - private EndOfBatchContext endOfBatchContext; - - @Override public final EndOfBatchContext getEndOfBatchContext() { - return this.endOfBatchContext; - } - - @Override public final void setEndOfBatchContext(EndOfBatchContext context) { - this.endOfBatchContext = context; - } - - public StreamData(StringColumn[] stringColumns, LongColumn[] longColumns, - IntegerColumn[] integerColumns, - DoubleColumn[] doubleColumns, StringListColumn[] stringListColumns, - LongListColumn[] longListColumns, - IntegerListColumn[] integerListColumns, DoubleListColumn[] doubleListColumns) { - super(stringColumns, longColumns, integerColumns, doubleColumns, BYTE_COLUMNS, stringListColumns, longListColumns, integerListColumns, doubleListColumns); - } - - public StreamData(StringColumn[] stringColumns, LongColumn[] longColumns, - IntegerColumn[] integerColumns, DoubleColumn[] doubleColumns) { - super(stringColumns, longColumns, integerColumns, doubleColumns, BYTE_COLUMNS, STRING_LIST_COLUMNS, LONG_LIST_COLUMNS, INTEGER_LIST_COLUMNS, DOUBLE_LIST_COLUMNS); - } - - public StreamData(StringColumn[] stringColumns, LongColumn[] longColumns, - IntegerColumn[] integerColumns, DoubleColumn[] doubleColumns, - ByteColumn[] byteColumns) { - super(stringColumns, longColumns, integerColumns, doubleColumns, byteColumns, STRING_LIST_COLUMNS, LONG_LIST_COLUMNS, INTEGER_LIST_COLUMNS, DOUBLE_LIST_COLUMNS); - } - - @Override public final String selectKey() { - return getMetricId(); - } - - public abstract String getId(); - - public abstract void setId(String id); - - public abstract String getMetricId(); - - public abstract void setMetricId(String metricId); -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/StringLinkedList.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/StringLinkedList.java deleted file mode 100644 index 7293e672758a3034a67629a8f3f1d4262c88ac86..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/StringLinkedList.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -import java.util.LinkedList; - -/** - * @author peng-yongsheng - */ -public class StringLinkedList extends LinkedList { -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/TableDefine.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/TableDefine.java deleted file mode 100644 index d6791c463c5aa35c766b8926603fb9e66524d631..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/TableDefine.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data; - -import java.util.LinkedList; -import java.util.List; - -/** - * @author peng-yongsheng - */ -public abstract class TableDefine { - private final String name; - private final List columnDefines; - - public TableDefine(String name) { - this.name = name; - this.columnDefines = new LinkedList<>(); - } - - public abstract void initialize(); - - public final void addColumn(ColumnDefine columnDefine) { - columnDefines.add(columnDefine); - } - - public final String getName() { - return name; - } - - public final List getColumnDefines() { - return columnDefines; - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/ByteColumn.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/ByteColumn.java deleted file mode 100644 index 2063af253ee6f9f70f232059ca938184880651ee..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/ByteColumn.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data.column; - -import org.apache.skywalking.apm.collector.core.data.*; - -/** - * @author peng-yongsheng - */ -public class ByteColumn extends Column { - - public ByteColumn(ColumnName columnName, MergeOperation mergeOperation) { - super(columnName, mergeOperation); - } - - public ByteColumn(ColumnName columnName, MergeOperation mergeOperation, FormulaOperation formulaOperation) { - super(columnName, mergeOperation, formulaOperation); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/Column.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/Column.java deleted file mode 100644 index d7fee6913396d531d073f8e515f11094bf2ab3c5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/Column.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data.column; - -import org.apache.skywalking.apm.collector.core.data.*; - -/** - * @author peng-yongsheng - */ -class Column { - private final ColumnName columnName; - private final MergeOperation mergeOperation; - private final FormulaOperation formulaOperation; - - Column(ColumnName columnName, MergeOperation mergeOperation) { - this.columnName = columnName; - this.mergeOperation = mergeOperation; - this.formulaOperation = null; - } - - Column(ColumnName columnName, MergeOperation mergeOperation, - FormulaOperation formulaOperation) { - this.columnName = columnName; - this.mergeOperation = mergeOperation; - this.formulaOperation = formulaOperation; - } - - public final ColumnName getColumnName() { - return columnName; - } - - public final MergeOperation getMergeOperation() { - return mergeOperation; - } - - public final FormulaOperation getFormulaOperation() { - return formulaOperation; - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/DoubleColumn.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/DoubleColumn.java deleted file mode 100644 index bc5182c8c70137efd714e3e2970cf1c93bb406a8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/DoubleColumn.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data.column; - -import org.apache.skywalking.apm.collector.core.data.*; - -/** - * @author peng-yongsheng - */ -public class DoubleColumn extends Column { - - public DoubleColumn(ColumnName columnName, MergeOperation mergeOperation) { - super(columnName, mergeOperation); - } - - public DoubleColumn(ColumnName columnName, MergeOperation mergeOperation, FormulaOperation formulaOperation) { - super(columnName, mergeOperation, formulaOperation); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/DoubleListColumn.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/DoubleListColumn.java deleted file mode 100644 index f07da95e9a33bc79ee00b7ea68453c87c214f9a2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/DoubleListColumn.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data.column; - -import org.apache.skywalking.apm.collector.core.data.*; - -/** - * @author peng-yongsheng - */ -public class DoubleListColumn extends Column { - - public DoubleListColumn(ColumnName columnName, MergeOperation mergeOperation) { - super(columnName, mergeOperation); - } - - public DoubleListColumn(ColumnName columnName, MergeOperation mergeOperation, FormulaOperation formulaOperation) { - super(columnName, mergeOperation, formulaOperation); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/IntegerColumn.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/IntegerColumn.java deleted file mode 100644 index 6e734ce6b9065bfeb6d2d78bdf1f1348c828c742..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/IntegerColumn.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data.column; - -import org.apache.skywalking.apm.collector.core.data.*; - -/** - * @author peng-yongsheng - */ -public class IntegerColumn extends Column { - - public IntegerColumn(ColumnName columnName, MergeOperation mergeOperation) { - super(columnName, mergeOperation); - } - - public IntegerColumn(ColumnName columnName, MergeOperation mergeOperation, FormulaOperation formulaOperation) { - super(columnName, mergeOperation, formulaOperation); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/IntegerListColumn.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/IntegerListColumn.java deleted file mode 100644 index cc92f1b16ac4fe3af64f9c766891b5032efc6627..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/IntegerListColumn.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data.column; - -import org.apache.skywalking.apm.collector.core.data.*; - -/** - * @author peng-yongsheng - */ -public class IntegerListColumn extends Column { - - public IntegerListColumn(ColumnName columnName, MergeOperation mergeOperation) { - super(columnName, mergeOperation); - } - - public IntegerListColumn(ColumnName columnName, MergeOperation mergeOperation, FormulaOperation formulaOperation) { - super(columnName, mergeOperation, formulaOperation); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/LongColumn.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/LongColumn.java deleted file mode 100644 index 2319d8117596751ac21a98a79e716a92e7f51caa..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/LongColumn.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data.column; - -import org.apache.skywalking.apm.collector.core.data.*; - -/** - * @author peng-yongsheng - */ -public class LongColumn extends Column { - - public LongColumn(ColumnName columnName, MergeOperation mergeOperation) { - super(columnName, mergeOperation); - } - - public LongColumn(ColumnName columnName, MergeOperation mergeOperation, FormulaOperation formulaOperation) { - super(columnName, mergeOperation, formulaOperation); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/LongListColumn.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/LongListColumn.java deleted file mode 100644 index 406fc30c41ae69bb21291de649ff2098506cb0b4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/LongListColumn.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data.column; - -import org.apache.skywalking.apm.collector.core.data.*; - -/** - * @author peng-yongsheng - */ -public class LongListColumn extends Column { - - public LongListColumn(ColumnName columnName, MergeOperation mergeOperation) { - super(columnName, mergeOperation); - } - - public LongListColumn(ColumnName columnName, MergeOperation mergeOperation, FormulaOperation formulaOperation) { - super(columnName, mergeOperation, formulaOperation); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/StringColumn.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/StringColumn.java deleted file mode 100644 index 915e73308db640939ff387b19b90c824e19d4d8b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/StringColumn.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data.column; - -import org.apache.skywalking.apm.collector.core.data.*; - -/** - * @author peng-yongsheng - */ -public class StringColumn extends Column { - - public StringColumn(ColumnName columnName, MergeOperation mergeOperation) { - super(columnName, mergeOperation); - } - - public StringColumn(ColumnName columnName, MergeOperation mergeOperation, FormulaOperation formulaOperation) { - super(columnName, mergeOperation, formulaOperation); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/StringListColumn.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/StringListColumn.java deleted file mode 100644 index 6a12de4688499128808433f9278eaaf637bdc0c1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/column/StringListColumn.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data.column; - -import org.apache.skywalking.apm.collector.core.data.*; - -/** - * @author peng-yongsheng - */ -public class StringListColumn extends Column { - - public StringListColumn(ColumnName columnName, MergeOperation mergeOperation) { - super(columnName, mergeOperation); - } - - public StringListColumn(ColumnName columnName, MergeOperation mergeOperation, FormulaOperation formulaOperation) { - super(columnName, mergeOperation, formulaOperation); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/operator/AddMergeOperation.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/operator/AddMergeOperation.java deleted file mode 100644 index c3465579e63afc825431669481c6355e50cbcb64..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/operator/AddMergeOperation.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data.operator; - -import org.apache.skywalking.apm.collector.core.data.*; - -/** - * @author peng-yongsheng - */ -public class AddMergeOperation implements MergeOperation { - - @Override public String operate(String newValue, String oldValue) { - throw new UnsupportedOperationException("not support string addition operation"); - } - - @Override public Long operate(Long newValue, Long oldValue) { - return newValue + oldValue; - } - - @Override public Double operate(Double newValue, Double oldValue) { - return newValue + oldValue; - } - - @Override public Integer operate(Integer newValue, Integer oldValue) { - return newValue + oldValue; - } - - @Override public byte[] operate(byte[] newValue, byte[] oldValue) { - throw new UnsupportedOperationException("not support byte array addition operation"); - } - - @Override public StringLinkedList operate(StringLinkedList newValue, StringLinkedList oldValue) { - throw new UnsupportedOperationException("not support string list addition operation"); - } - - @Override public LongLinkedList operate(LongLinkedList newValue, LongLinkedList oldValue) { - throw new UnsupportedOperationException("not support long list addition operation"); - } - - @Override public IntegerLinkedList operate(IntegerLinkedList newValue, IntegerLinkedList oldValue) { - throw new UnsupportedOperationException("not support integer list addition operation"); - } - - @Override public DoubleLinkedList operate(DoubleLinkedList newValue, DoubleLinkedList oldValue) { - throw new UnsupportedOperationException("not support double list addition operation"); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/operator/CoverMergeOperation.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/operator/CoverMergeOperation.java deleted file mode 100644 index c49bd02fc0bb1b3a240a433d542e89825c45a097..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/operator/CoverMergeOperation.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data.operator; - -import org.apache.skywalking.apm.collector.core.data.*; - -/** - * @author peng-yongsheng - */ -public class CoverMergeOperation implements MergeOperation { - - @Override public String operate(String newValue, String oldValue) { - return newValue; - } - - @Override public Long operate(Long newValue, Long oldValue) { - return newValue; - } - - @Override public Double operate(Double newValue, Double oldValue) { - return newValue; - } - - @Override public Integer operate(Integer newValue, Integer oldValue) { - return newValue; - } - - @Override public byte[] operate(byte[] newValue, byte[] oldValue) { - return newValue; - } - - @Override public StringLinkedList operate(StringLinkedList newValue, StringLinkedList oldValue) { - return newValue; - } - - @Override public LongLinkedList operate(LongLinkedList newValue, LongLinkedList oldValue) { - return newValue; - } - - @Override public IntegerLinkedList operate(IntegerLinkedList newValue, IntegerLinkedList oldValue) { - return newValue; - } - - @Override public DoubleLinkedList operate(DoubleLinkedList newValue, DoubleLinkedList oldValue) { - return newValue; - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/operator/MaxMergeOperation.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/operator/MaxMergeOperation.java deleted file mode 100644 index 81399caaac0912498b496d575954070069674e7b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/operator/MaxMergeOperation.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data.operator; - -import org.apache.skywalking.apm.collector.core.data.*; - -/** - * @author peng-yongsheng - */ -public class MaxMergeOperation implements MergeOperation { - - @Override public String operate(String newValue, String oldValue) { - throw new UnsupportedOperationException("not support string maximum operation"); - } - - @Override public Long operate(Long newValue, Long oldValue) { - if (newValue >= oldValue) { - return newValue; - } else { - return oldValue; - } - } - - @Override public Double operate(Double newValue, Double oldValue) { - if (newValue >= oldValue) { - return newValue; - } else { - return oldValue; - } - } - - @Override public Integer operate(Integer newValue, Integer oldValue) { - if (newValue >= oldValue) { - return newValue; - } else { - return oldValue; - } - } - - @Override public byte[] operate(byte[] newValue, byte[] oldValue) { - throw new UnsupportedOperationException("not support byte array maximum operation"); - } - - @Override public StringLinkedList operate(StringLinkedList newValue, StringLinkedList oldValue) { - throw new UnsupportedOperationException("not support string list maximum operation"); - } - - @Override public LongLinkedList operate(LongLinkedList newValue, LongLinkedList oldValue) { - throw new UnsupportedOperationException("not support long list maximum operation"); - } - - @Override public IntegerLinkedList operate(IntegerLinkedList newValue, IntegerLinkedList oldValue) { - throw new UnsupportedOperationException("not support integer list maximum operation"); - } - - @Override public DoubleLinkedList operate(DoubleLinkedList newValue, DoubleLinkedList oldValue) { - throw new UnsupportedOperationException("not support double list maximum operation"); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/operator/MinMergeOperation.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/operator/MinMergeOperation.java deleted file mode 100644 index 4bc6022ee0ac2ace1babd5d4a9a613c019284d12..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/operator/MinMergeOperation.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data.operator; - -import org.apache.skywalking.apm.collector.core.data.*; - -/** - * @author peng-yongsheng - */ -public class MinMergeOperation implements MergeOperation { - - @Override public String operate(String newValue, String oldValue) { - throw new UnsupportedOperationException("not support string minimum operation"); - } - - @Override public Long operate(Long newValue, Long oldValue) { - if (newValue <= oldValue) { - return newValue; - } else { - return oldValue; - } - } - - @Override public Double operate(Double newValue, Double oldValue) { - if (newValue <= oldValue) { - return newValue; - } else { - return oldValue; - } - } - - @Override public Integer operate(Integer newValue, Integer oldValue) { - if (newValue <= oldValue) { - return newValue; - } else { - return oldValue; - } - } - - @Override public byte[] operate(byte[] newValue, byte[] oldValue) { - throw new UnsupportedOperationException("not support byte array minimum operation"); - } - - @Override public StringLinkedList operate(StringLinkedList newValue, StringLinkedList oldValue) { - throw new UnsupportedOperationException("not support string list minimum operation"); - } - - @Override public LongLinkedList operate(LongLinkedList newValue, LongLinkedList oldValue) { - throw new UnsupportedOperationException("not support long list minimum operation"); - } - - @Override public IntegerLinkedList operate(IntegerLinkedList newValue, IntegerLinkedList oldValue) { - throw new UnsupportedOperationException("not support integer list minimum operation"); - } - - @Override public DoubleLinkedList operate(DoubleLinkedList newValue, DoubleLinkedList oldValue) { - throw new UnsupportedOperationException("not support double list minimum operation"); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/operator/NonMergeOperation.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/operator/NonMergeOperation.java deleted file mode 100644 index 8a5f017a3cdf6faae84678b359f925af536dba28..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/data/operator/NonMergeOperation.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.data.operator; - -import org.apache.skywalking.apm.collector.core.data.*; - -/** - * @author peng-yongsheng - */ -public class NonMergeOperation implements MergeOperation { - - @Override public String operate(String newValue, String oldValue) { - return oldValue; - } - - @Override public Long operate(Long newValue, Long oldValue) { - return oldValue; - } - - @Override public Double operate(Double newValue, Double oldValue) { - return oldValue; - } - - @Override public Integer operate(Integer newValue, Integer oldValue) { - return oldValue; - } - - @Override public byte[] operate(byte[] newValue, byte[] oldValue) { - return oldValue; - } - - @Override public StringLinkedList operate(StringLinkedList newValue, StringLinkedList oldValue) { - return oldValue; - } - - @Override public LongLinkedList operate(LongLinkedList newValue, LongLinkedList oldValue) { - return oldValue; - } - - @Override public IntegerLinkedList operate(IntegerLinkedList newValue, IntegerLinkedList oldValue) { - return oldValue; - } - - @Override public DoubleLinkedList operate(DoubleLinkedList newValue, DoubleLinkedList oldValue) { - return oldValue; - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/define/DefineException.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/define/DefineException.java deleted file mode 100644 index 41f84ef0ac554e122ed121763526f61e2a07d738..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/define/DefineException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.define; - -import org.apache.skywalking.apm.collector.core.CollectorException; - -/** - * @author peng-yongsheng - */ -public abstract class DefineException extends CollectorException { - - public DefineException(String message) { - super(message); - } - - public DefineException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/define/DefinitionFile.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/define/DefinitionFile.java deleted file mode 100644 index c3d030b501e4ef9a7779dbf084d6d57a8ec5a9e8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/define/DefinitionFile.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.define; - -/** - * @author peng-yongsheng - */ -public abstract class DefinitionFile { - - private static final String CATALOG = "META-INF/defines/"; - - protected abstract String fileName(); - - public final String get() { - return CATALOG + fileName(); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/define/DefinitionLoader.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/define/DefinitionLoader.java deleted file mode 100644 index bd3d0e2fb0946cc7aa820869ddf6f48074e31d6c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/define/DefinitionLoader.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.define; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.URL; -import java.util.Enumeration; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Objects; -import java.util.Properties; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class DefinitionLoader implements Iterable { - - private static final Logger logger = LoggerFactory.getLogger(DefinitionLoader.class); - - private final Class definition; - private final DefinitionFile definitionFile; - - protected DefinitionLoader(Class svc, DefinitionFile definitionFile) { - this.definition = Objects.requireNonNull(svc, "definition interface cannot be null"); - this.definitionFile = definitionFile; - } - - public static DefinitionLoader load(Class definition, DefinitionFile definitionFile) { - return new DefinitionLoader(definition, definitionFile); - } - - @Override public final Iterator iterator() { - logger.info("load definition file: {}", definitionFile.get()); - List definitionList = new LinkedList<>(); - try { - Enumeration urlEnumeration = this.getClass().getClassLoader().getResources(definitionFile.get()); - while (urlEnumeration.hasMoreElements()) { - URL definitionFileURL = urlEnumeration.nextElement(); - logger.info("definition file url: {}", definitionFileURL.getPath()); - BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(definitionFileURL.openStream())); - Properties properties = new Properties(); - properties.load(bufferedReader); - - Enumeration defineItem = properties.propertyNames(); - while (defineItem.hasMoreElements()) { - String fullNameClass = (String)defineItem.nextElement(); - definitionList.add(fullNameClass); - } - } - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - - Iterator moduleDefineIterator = definitionList.iterator(); - - return new Iterator() { - @Override public boolean hasNext() { - return moduleDefineIterator.hasNext(); - } - - @Override public D next() { - String definitionClass = moduleDefineIterator.next(); - logger.info("definitionClass: {}", definitionClass); - try { - Class c = Class.forName(definitionClass); - return (D)c.newInstance(); - } catch (Exception e) { - logger.error(e.getMessage(), e); - } - return null; - } - }; - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/define/Loader.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/define/Loader.java deleted file mode 100644 index bbbfa7e0b84db34384a2b5257de8c0d012735a09..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/define/Loader.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.define; - -/** - * @author peng-yongsheng - */ -public interface Loader { - T load() throws DefineException; -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/framework/Executor.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/framework/Executor.java deleted file mode 100644 index 8cdd24881f13681f0070b2f069c24857386cf717..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/framework/Executor.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.framework; - -import org.apache.skywalking.apm.collector.core.CollectorException; - -/** - * @author peng-yongsheng - */ -public interface Executor { - void execute(INPUT input) throws CollectorException; -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/DirectWay.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/DirectWay.java deleted file mode 100644 index 1cfd824f282659d2d3434e064bd04c210877fa7a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/DirectWay.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.graph; - -/** - * @author wusheng - */ -public class DirectWay extends WayToNode { - public DirectWay(NodeProcessor destinationHandler) { - super(destinationHandler); - } - - @Override protected void in(INPUT o) { - out(o); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/Graph.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/Graph.java deleted file mode 100644 index e6f3ecbac92791d1ebd0eb3ac2a5a9cdb51aea30..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/Graph.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.graph; - -import java.util.concurrent.ConcurrentHashMap; - -/** - * @author peng-yongsheng, wu-sheng - */ -public final class Graph { - private int id; - private WayToNode entryWay; - private ConcurrentHashMap nodeIndex = new ConcurrentHashMap<>(); - - Graph(int id) { - this.id = id; - } - - public void start(INPUT input) { - entryWay.in(input); - } - - public Node addNode(NodeProcessor nodeProcessor) { - return addNode(new DirectWay(nodeProcessor)); - } - - public Node addNode(WayToNode entryWay) { - synchronized (this) { - this.entryWay = entryWay; - this.entryWay.buildDestination(this); - return entryWay.getDestination(); - } - } - - void checkForNewNode(Node node) { - int nodeId = node.getHandler().id(); - if (nodeIndex.containsKey(nodeId)) { - throw new PotentialCyclicGraphException("handler=" - + node.getHandler().getClass().getName() - + " already exists in graph[" + id + "]"); - } - nodeIndex.put(nodeId, node); - } - - public GraphNodeFinder toFinder() { - return new GraphNodeFinder(this); - } - - ConcurrentHashMap getNodeIndex() { - return nodeIndex; - } - - int getId() { - return id; - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/GraphManager.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/GraphManager.java deleted file mode 100644 index 3a807e594d6f1dadfed313a137bace07e3f5b4d4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/GraphManager.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.graph; - -import java.util.HashMap; -import java.util.Map; - -/** - * @author wusheng - */ -public enum GraphManager { - INSTANCE; - - private Map allGraphs = new HashMap<>(); - - /** - * Create a stream process graph. - * - * @param graphId represents a graph, which is used for finding it. - * @return - */ - public synchronized Graph createIfAbsent(int graphId, Class input) { - if (!allGraphs.containsKey(graphId)) { - Graph graph = new Graph(graphId); - allGraphs.put(graphId, graph); - return graph; - } else { - return allGraphs.get(graphId); - } - } - - public Graph findGraph(int graphId) { - Graph graph = allGraphs.get(graphId); - if (graph == null) { - throw new GraphNotFoundException("Graph id=" + graphId + " not found in this GraphManager"); - } - return graph; - } - - public Graph findGraph(int graphId, Class input) { - return findGraph(graphId); - } - - public void reset() { - allGraphs.clear(); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/GraphNodeFinder.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/GraphNodeFinder.java deleted file mode 100644 index 1876072edf5fb45a8cc6138e1d19a7cb2c0c3ff2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/GraphNodeFinder.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.graph; - -import java.util.concurrent.ConcurrentHashMap; - -/** - * @author wu-sheng - */ -public class GraphNodeFinder { - private Graph graph; - - GraphNodeFinder(Graph graph) { - this.graph = graph; - } - - public Next findNext(int handlerId) { - ConcurrentHashMap graphNodeIndex = graph.getNodeIndex(); - Node node = graphNodeIndex.get(handlerId); - if (node == null) { - throw new NodeNotFoundException("Can't find node with handlerId=" - + handlerId - + " in graph[" + graph.getId() + "]"); - } - return node.getNext(); - } - - /** - * Find an exist node to build the graph. - * - * @param handlerId of specific node in graph. - * @param outputClass of the found node - * @param type of given output class - * @return Node instance. - */ - public Node findNode(int handlerId, Class outputClass) { - ConcurrentHashMap graphNodeIndex = graph.getNodeIndex(); - Node node = graphNodeIndex.get(handlerId); - if (node == null) { - throw new NodeNotFoundException("Can't find node with handlerId=" - + handlerId - + " in graph[" + graph.getId() + "]"); - } - return node; - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/GraphNotFoundException.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/GraphNotFoundException.java deleted file mode 100644 index daab172479764cfc36f064c13ad648ffd09d5f83..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/GraphNotFoundException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.graph; - -/** - * @author wusheng - */ -public class GraphNotFoundException extends RuntimeException { - public GraphNotFoundException(String message) { - super(message); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/Next.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/Next.java deleted file mode 100644 index 1f406ae0dd97450bb877e9fac4a0be8b5659ed07..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/Next.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.graph; - -import java.util.LinkedList; -import java.util.List; -import org.apache.skywalking.apm.collector.core.framework.Executor; - -/** - * The Next is a delegate object for the following {@link Node}. - * - * @author peng-yongsheng, wu-sheng - */ -public class Next implements Executor { - - private final List ways; - - public Next() { - this.ways = new LinkedList<>(); - } - - final void addWay(WayToNode way) { - ways.add(way); - } - - /** - * Drive to the next nodes - * - * @param input - */ - @Override public void execute(INPUT input) { - ways.forEach(way -> way.in(input)); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/Node.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/Node.java deleted file mode 100644 index 52f8311936aab665afc5ab5e5a21144ecdb07367..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/Node.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.graph; - -/** - * The Node in the graph with explicit INPUT and OUTPUT types. - * - * @author peng-yongsheng, wu-sheng - */ -public final class Node { - private final NodeProcessor nodeProcessor; - private final Next next; - private final Graph graph; - - Node(Graph graph, NodeProcessor nodeProcessor) { - this.graph = graph; - this.nodeProcessor = nodeProcessor; - this.next = new Next<>(); - this.graph.checkForNewNode(this); - } - - public final Node addNext(NodeProcessor nodeProcessor) { - return this.addNext(new DirectWay(nodeProcessor)); - } - - public final Node addNext(WayToNode way) { - synchronized (graph) { - way.buildDestination(graph); - next.addWay(way); - return way.getDestination(); - } - } - - final void execute(INPUT input) { - nodeProcessor.process(input, next); - } - - NodeProcessor getHandler() { - return nodeProcessor; - } - - Next getNext() { - return next; - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/NodeProcessor.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/NodeProcessor.java deleted file mode 100644 index ac7cce5857547b93612fd614df6d66974d46e64e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/NodeProcessor.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.graph; - -/** - * @author peng-yongsheng, wu-sheng - */ -public interface NodeProcessor { - /** - * The unique id in the certain graph. - * - * @return id - */ - int id(); - - void process(input input, Next next); -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/PotentialCyclicGraphException.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/PotentialCyclicGraphException.java deleted file mode 100644 index 80577425b0f7877641dc2b13bc63a4e2be5b387e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/PotentialCyclicGraphException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.graph; - -/** - * @author wusheng - */ -public class PotentialCyclicGraphException extends RuntimeException { - public PotentialCyclicGraphException(String message) { - super(message); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/WayToNode.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/WayToNode.java deleted file mode 100644 index b800a8e7983a35cb69a12d1ea06eb4280ec6d3b3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/WayToNode.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.graph; - -/** - * @author wusheng - */ -public abstract class WayToNode { - private Node destination; - private NodeProcessor destinationHandler; - - public WayToNode(NodeProcessor destinationHandler) { - this.destinationHandler = destinationHandler; - } - - void buildDestination(Graph graph) { - destination = new Node(graph, destinationHandler); - } - - protected abstract void in(INPUT input); - - protected void out(INPUT input) { - destination.execute(input); - } - - Node getDestination() { - return destination; - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ApplicationConfiguration.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ApplicationConfiguration.java deleted file mode 100644 index a2dfeced2303bc8e899d0260fdbf44f651baacd4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ApplicationConfiguration.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -import java.util.HashMap; -import java.util.Properties; - -/** - * Modulization configurations. The {@link ModuleManager} is going to start, lookup, start modules based on this. - * - * @author wu-sheng, peng-yongsheng - */ -public class ApplicationConfiguration { - private HashMap modules = new HashMap<>(); - - public String[] moduleList() { - return modules.keySet().toArray(new String[0]); - } - - public ModuleConfiguration addModule(String moduleName) { - ModuleConfiguration newModule = new ModuleConfiguration(); - modules.put(moduleName, newModule); - return newModule; - } - - public boolean has(String moduleName) { - return modules.containsKey(moduleName); - } - - public ModuleConfiguration getModuleConfiguration(String name) { - return modules.get(name); - } - - /** - * The configurations about a certain module. - */ - public class ModuleConfiguration { - private HashMap providers = new HashMap<>(); - - private ModuleConfiguration() { - } - - public Properties getProviderConfiguration(String name) { - return providers.get(name).getProperties(); - } - - public boolean has(String name) { - return providers.containsKey(name); - } - - public ModuleConfiguration addProviderConfiguration(String name, Properties properties) { - ProviderConfiguration newProvider = new ProviderConfiguration(properties); - providers.put(name, newProvider); - return this; - } - } - - /** - * The configuration about a certain provider of a module. - */ - public class ProviderConfiguration { - private Properties properties; - - ProviderConfiguration(Properties properties) { - this.properties = properties; - } - - private Properties getProperties() { - return properties; - } - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/BootstrapFlow.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/BootstrapFlow.java deleted file mode 100644 index ef282d2ff1e09dc729e3085f168d5079784f9847..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/BootstrapFlow.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import org.apache.skywalking.apm.collector.core.util.CollectionUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author wu-sheng, peng-yongsheng - */ -class BootstrapFlow { - private static final Logger logger = LoggerFactory.getLogger(BootstrapFlow.class); - - private Map loadedModules; - private List startupSequence; - - BootstrapFlow(Map loadedModules) throws CycleDependencyException { - this.loadedModules = loadedModules; - startupSequence = new LinkedList<>(); - - makeSequence(); - } - - @SuppressWarnings("unchecked") - void start( - ModuleManager moduleManager) throws ModuleNotFoundException, ServiceNotProvidedException, ModuleStartException { - for (ModuleProvider provider : startupSequence) { - String[] requiredModules = provider.requiredModules(); - if (requiredModules != null) { - for (String module : requiredModules) { - if (!moduleManager.has(module)) { - throw new ModuleNotFoundException(module + " is required by " + provider.getModuleName() - + "." + provider.name() + ", but not found."); - } - } - } - logger.info("start the provider {} in {} module.", provider.name(), provider.getModuleName()); - provider.requiredCheck(provider.getModule().services()); - - provider.start(); - } - } - - void notifyAfterCompleted() throws ServiceNotProvidedException { - for (ModuleProvider provider : startupSequence) { - provider.notifyAfterCompleted(); - } - } - - private void makeSequence() throws CycleDependencyException { - List allProviders = new ArrayList<>(); - loadedModules.forEach((moduleName, module) -> allProviders.addAll(module.providers())); - - do { - int numOfToBeSequenced = allProviders.size(); - for (int i = 0; i < allProviders.size(); i++) { - ModuleProvider provider = allProviders.get(i); - String[] requiredModules = provider.requiredModules(); - if (CollectionUtils.isNotEmpty(requiredModules)) { - boolean isAllRequiredModuleStarted = true; - for (String module : requiredModules) { - // find module in all ready existed startupSequence - boolean exist = false; - for (ModuleProvider moduleProvider : startupSequence) { - if (moduleProvider.getModuleName().equals(module)) { - exist = true; - break; - } - } - if (!exist) { - isAllRequiredModuleStarted = false; - break; - } - } - - if (isAllRequiredModuleStarted) { - startupSequence.add(provider); - allProviders.remove(i); - i--; - } - } else { - startupSequence.add(provider); - allProviders.remove(i); - i--; - } - } - - if (numOfToBeSequenced == allProviders.size()) { - StringBuilder unSequencedProviders = new StringBuilder(); - allProviders.forEach(provider -> unSequencedProviders.append(provider.getModuleName()).append("[provider=").append(provider.getClass().getName()).append("]\n")); - throw new CycleDependencyException("Exist cycle module dependencies in \n" + unSequencedProviders.substring(0, unSequencedProviders.length() - 1)); - } - } - while (allProviders.size() != 0); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/CycleDependencyException.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/CycleDependencyException.java deleted file mode 100644 index 262426827d90f6f5bab4dee4fb2f110530c6b345..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/CycleDependencyException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -/** - * @author wu-sheng - */ -public class CycleDependencyException extends RuntimeException { - public CycleDependencyException(String message) { - super(message); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/DuplicateProviderException.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/DuplicateProviderException.java deleted file mode 100644 index 556932a4dba682ad81d2b96f187d55241497032e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/DuplicateProviderException.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -public class DuplicateProviderException extends Exception { - public DuplicateProviderException(String message) { - super(message); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleConfig.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleConfig.java deleted file mode 100644 index 110476680e8b90130d44fdb1e67d4e17c6bdd084..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleConfig.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -/** - * @author peng-yongsheng - */ -public abstract class ModuleConfig { -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleConfigException.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleConfigException.java deleted file mode 100644 index a2b2e441bea9ef0676309343b169651e43face7b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleConfigException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -/** - * @author peng-yongsheng - */ -public class ModuleConfigException extends Exception { - - public ModuleConfigException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleDefine.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleDefine.java deleted file mode 100644 index 2a492e5c9aebb30a896acba07f4df76f471659d6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleDefine.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -import java.lang.reflect.Field; -import java.util.Enumeration; -import java.util.LinkedList; -import java.util.List; -import java.util.Properties; -import java.util.ServiceLoader; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A module definition. - * - * @author wu-sheng, peng-yongsheng - */ -public abstract class ModuleDefine { - - private final Logger logger = LoggerFactory.getLogger(ModuleDefine.class); - - private LinkedList loadedProviders = new LinkedList<>(); - - /** - * @return the module name - */ - public abstract String name(); - - /** - * @return the {@link Service} provided by this module. - */ - public abstract Class[] services(); - - /** - * Run the prepare stage for the module, including finding all potential providers, and asking them to prepare. - * - * @param moduleManager of this module - * @param configuration of this module - * @throws ProviderNotFoundException when even don't find a single one providers. - */ - void prepare(ModuleManager moduleManager, - ApplicationConfiguration.ModuleConfiguration configuration) throws ProviderNotFoundException, ServiceNotProvidedException, ModuleConfigException { - ServiceLoader moduleProviderLoader = ServiceLoader.load(ModuleProvider.class); - boolean providerExist = false; - for (ModuleProvider provider : moduleProviderLoader) { - if (!configuration.has(provider.name())) { - continue; - } - - providerExist = true; - if (provider.module().equals(getClass())) { - ModuleProvider newProvider; - try { - newProvider = provider.getClass().newInstance(); - } catch (InstantiationException | IllegalAccessException e) { - throw new ProviderNotFoundException(e); - } - newProvider.setManager(moduleManager); - newProvider.setModule(this); - loadedProviders.add(newProvider); - } - } - - if (!providerExist) { - throw new ProviderNotFoundException(this.name() + " module no provider exists."); - } - - for (ModuleProvider moduleProvider : loadedProviders) { - logger.info("Prepare the {} provider in {} module.", moduleProvider.name(), this.name()); - try { - copyProperties(moduleProvider.createConfigBeanIfAbsent(), configuration.getProviderConfiguration(moduleProvider.name()), this.name(), moduleProvider.name()); - } catch (IllegalAccessException e) { - throw new ModuleConfigException(this.name() + " module config transport to config bean failure.", e); - } - moduleProvider.prepare(); - } - } - - private void copyProperties(ModuleConfig dest, Properties src, String moduleName, - String providerName) throws IllegalAccessException { - Enumeration propertyNames = src.propertyNames(); - while (propertyNames.hasMoreElements()) { - String propertyName = (String)propertyNames.nextElement(); - Class destClass = dest.getClass(); - - try { - Field field = getDeclaredField(destClass, propertyName); - field.setAccessible(true); - field.set(dest, src.get(propertyName)); - } catch (NoSuchFieldException e) { - logger.warn(propertyName + " setting is not supported in " + providerName + " provider of " + moduleName + " module"); - } - } - } - - private Field getDeclaredField(Class destClass, String fieldName) throws NoSuchFieldException { - if (destClass != null) { - Field[] fields = destClass.getDeclaredFields(); - for (Field field : fields) { - if (field.getName().equals(fieldName)) { - return field; - } - } - return getDeclaredField(destClass.getSuperclass(), fieldName); - } - - throw new NoSuchFieldException(); - } - - /** - * @return providers of this module - */ - final List providers() { - return loadedProviders; - } - - final ModuleProvider provider() throws DuplicateProviderException { - if (loadedProviders.size() > 1) { - throw new DuplicateProviderException(this.name() + " module exist " + loadedProviders.size() + " providers"); - } - - return loadedProviders.getFirst(); - } - - public final T getService(Class serviceType) throws ServiceNotProvidedRuntimeException { - try { - return provider().getService(serviceType); - } catch (DuplicateProviderException | ServiceNotProvidedException e) { - throw new ServiceNotProvidedRuntimeException(e.getMessage()); - } - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleManager.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleManager.java deleted file mode 100644 index 30d7e61ae154ae3f7c672ade103400997f7b60e2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleManager.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.Map; -import java.util.ServiceLoader; - -/** - * The ModuleManager takes charge of all {@link ModuleDefine}s in collector. - * - * @author wu-sheng, peng-yongsheng - */ -public class ModuleManager { - private boolean isInPrepareStage = true; - private Map loadedModules = new HashMap<>(); - - /** - * Init the given modules - */ - public void init( - ApplicationConfiguration applicationConfiguration) throws ModuleNotFoundException, ProviderNotFoundException, ServiceNotProvidedException, CycleDependencyException, ModuleConfigException, ModuleStartException { - String[] moduleNames = applicationConfiguration.moduleList(); - ServiceLoader moduleServiceLoader = ServiceLoader.load(ModuleDefine.class); - LinkedList moduleList = new LinkedList<>(Arrays.asList(moduleNames)); - for (ModuleDefine module : moduleServiceLoader) { - for (String moduleName : moduleNames) { - if (moduleName.equals(module.name())) { - ModuleDefine newInstance; - try { - newInstance = module.getClass().newInstance(); - } catch (InstantiationException | IllegalAccessException e) { - throw new ModuleNotFoundException(e); - } - newInstance.prepare(this, applicationConfiguration.getModuleConfiguration(moduleName)); - loadedModules.put(moduleName, newInstance); - moduleList.remove(moduleName); - } - } - } - // Finish prepare stage - isInPrepareStage = false; - - if (moduleList.size() > 0) { - throw new ModuleNotFoundException(moduleList.toString() + " missing."); - } - - BootstrapFlow bootstrapFlow = new BootstrapFlow(loadedModules); - - bootstrapFlow.start(this); - bootstrapFlow.notifyAfterCompleted(); - } - - public boolean has(String moduleName) { - return loadedModules.get(moduleName) != null; - } - - public ModuleDefine find(String moduleName) throws ModuleNotFoundRuntimeException { - assertPreparedStage(); - ModuleDefine module = loadedModules.get(moduleName); - if (module != null) - return module; - throw new ModuleNotFoundRuntimeException(moduleName + " missing."); - } - - private void assertPreparedStage() { - if (isInPrepareStage) { - throw new AssertionError("Still in preparing stage."); - } - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleNotFoundException.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleNotFoundException.java deleted file mode 100644 index 8ce0d63eefb45be4042ebab8838cc6d90db7d6b4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleNotFoundException.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -public class ModuleNotFoundException extends Exception { - - public ModuleNotFoundException(Throwable cause) { - super(cause); - } - - public ModuleNotFoundException(String message) { - super(message); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleNotFoundRuntimeException.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleNotFoundRuntimeException.java deleted file mode 100644 index 87303c3cf88569edb43361a54f0cac6eda0f234c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleNotFoundRuntimeException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -/** - * @author peng-yongsheng - */ -public class ModuleNotFoundRuntimeException extends RuntimeException { - - public ModuleNotFoundRuntimeException(Throwable cause) { - super(cause); - } - - public ModuleNotFoundRuntimeException(String message) { - super(message); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleProvider.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleProvider.java deleted file mode 100644 index 1e5171d25e4a70a4fe2a040f479423b778a62f0a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleProvider.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -import java.util.HashMap; -import java.util.Map; - -/** - * The ModuleProvider is an implementation of a {@link ModuleDefine}. - * - * And each module can have one or more implementation, which depends on `application.yml` - * - * @author wu-sheng, peng-yongsheng - */ -public abstract class ModuleProvider { - private ModuleManager manager; - private ModuleDefine module; - private Map, Service> services = new HashMap<>(); - - public ModuleProvider() { - } - - void setManager(ModuleManager manager) { - this.manager = manager; - } - - void setModule(ModuleDefine module) { - this.module = module; - } - - protected final ModuleManager getManager() { - return manager; - } - - /** - * @return the name of this provider. - */ - public abstract String name(); - - /** - * @return the module name - */ - public abstract Class module(); - - /** - * @return ModuleConfig - */ - public abstract ModuleConfig createConfigBeanIfAbsent(); - - /** - * In prepare stage, the module should initialize things which are irrelative other modules. - */ - public abstract void prepare() throws ServiceNotProvidedException; - - /** - * In start stage, the module has been ready for interop. - */ - public abstract void start() throws ServiceNotProvidedException, ModuleStartException; - - /** - * This callback executes after all modules start up successfully. - */ - public abstract void notifyAfterCompleted() throws ServiceNotProvidedException; - - /** - * @return module names which does this module require? - */ - public abstract String[] requiredModules(); - - /** - * Register a implementation for the service of this module provider. - */ - protected final void registerServiceImplementation(Class serviceType, - Service service) throws ServiceNotProvidedException { - if (serviceType.isInstance(service)) { - this.services.put(serviceType, service); - } else { - throw new ServiceNotProvidedException(serviceType + " is not implemented by " + service); - } - } - - /** - * Make sure all required services have been implemented. - * - * @param requiredServices must be implemented by the module. - * @throws ServiceNotProvidedException when exist unimplemented service. - */ - void requiredCheck(Class[] requiredServices) throws ServiceNotProvidedException { - if (requiredServices == null) - return; - - for (Class service : requiredServices) { - if (!services.containsKey(service)) { - throw new ServiceNotProvidedException("Service:" + service.getName() + " not provided"); - } - } - - if (requiredServices.length != services.size()) { - throw new ServiceNotProvidedException("The " + this.name() + " provider in " + module.name() + " module provide more service implementations than ModuleDefine requirements."); - } - } - - @SuppressWarnings("unchecked") T getService( - Class serviceType) throws ServiceNotProvidedException { - Service serviceImpl = services.get(serviceType); - if (serviceImpl != null) { - return (T)serviceImpl; - } - - throw new ServiceNotProvidedException("Service " + serviceType.getName() + " should not be provided, based on module define."); - } - - ModuleDefine getModule() { - return module; - } - - String getModuleName() { - return module.name(); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleStartException.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleStartException.java deleted file mode 100644 index 7253272864fc4cbf38883c8d90d1903a53d5b45e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ModuleStartException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -/** - * @author peng-yongsheng - */ -public class ModuleStartException extends Exception { - - public ModuleStartException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ProviderNotFoundException.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ProviderNotFoundException.java deleted file mode 100644 index 0beef25ba18f76071b0966535e1eb34e4c28f84d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ProviderNotFoundException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -public class ProviderNotFoundException extends Exception { - public ProviderNotFoundException(String message) { - super(message); - } - - public ProviderNotFoundException(Throwable e) { - super(e); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/Service.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/Service.java deleted file mode 100644 index 65f977b8d6fb4f06b79721f1165a5d9ee7db686f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/Service.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -/** - * The Service implementation is a service provided by its own modules. - * - * And every {@link ModuleProvider} must provide all the given services of the {@link ModuleDefine}. - * - * @author wu-sheng - */ -public interface Service { -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ServiceNotProvidedException.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ServiceNotProvidedException.java deleted file mode 100644 index 74a721ca1e6bc912ef86a98e6bd8025024e5f430..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ServiceNotProvidedException.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -public class ServiceNotProvidedException extends Exception { - public ServiceNotProvidedException(String message) { - super(message); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ServiceNotProvidedRuntimeException.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ServiceNotProvidedRuntimeException.java deleted file mode 100644 index 9ede02ea1a14a3c36dd001eb50d4aa9622bf38fa..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/module/ServiceNotProvidedRuntimeException.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -public class ServiceNotProvidedRuntimeException extends RuntimeException { - public ServiceNotProvidedRuntimeException(String message) { - super(message); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/queue/EndOfBatchContext.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/queue/EndOfBatchContext.java deleted file mode 100644 index e2507d1621f70914513b2339a4fc9f6ee8901462..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/queue/EndOfBatchContext.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.queue; - -/** - * @author peng-yongsheng - */ -public class EndOfBatchContext { - - private boolean isEndOfBatch; - - public EndOfBatchContext(boolean isEndOfBatch) { - this.isEndOfBatch = isEndOfBatch; - } - - public boolean isEndOfBatch() { - return isEndOfBatch; - } - - public void setEndOfBatch(boolean endOfBatch) { - isEndOfBatch = endOfBatch; - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/storage/TimePyramid.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/storage/TimePyramid.java deleted file mode 100644 index 7d437f4346872dfc1a559dada83a9ee011839b67..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/storage/TimePyramid.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.storage; - -/** - * @author peng-yongsheng - */ -public enum TimePyramid { - Minute(1, "minute"), Hour(2, "hour"), Day(3, "day"), Month(4, "month"); - - private final int value; - private final String name; - - TimePyramid(int value, String name) { - this.value = value; - this.name = name; - } - - public int getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/ApdexThresholdUtils.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/ApdexThresholdUtils.java deleted file mode 100644 index 43f84d35c93596d0b636cdb30b8e902b674ff938..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/ApdexThresholdUtils.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.util; - -/** - * @author peng-yongsheng - */ -public class ApdexThresholdUtils { - - public static Apdex compute(int threshold, long duration) { - if (duration <= threshold) { - return Apdex.Satisfied; - } else if (duration <= threshold * 4) { - return Apdex.Tolerating; - } else { - return Apdex.Frustrated; - } - } - - public enum Apdex { - Satisfied, Tolerating, Frustrated - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/BooleanUtils.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/BooleanUtils.java deleted file mode 100644 index 14a767cfc0596243dfc42f09ba92791f038d327c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/BooleanUtils.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.util; - -import org.apache.skywalking.apm.collector.core.UnexpectedException; - -/** - * @author peng-yongsheng - */ -public class BooleanUtils { - - public static final int TRUE = 1; - public static final int FALSE = 0; - - public static boolean valueToBoolean(int value) { - if (TRUE == value) { - return true; - } else if (FALSE == value) { - return false; - } else { - throw new UnexpectedException("Boolean value error, must be 0 or 1"); - } - } - - public static int booleanToValue(Boolean booleanValue) { - if (booleanValue) { - return TRUE; - } else { - return FALSE; - } - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/BytesUtils.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/BytesUtils.java deleted file mode 100644 index 58bf704361198e39284ca867ce57425bc6fe2358..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/BytesUtils.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.util; - -/** - * @author peng-yongsheng - */ -public class BytesUtils { - - public static byte[] long2Bytes(long num) { - byte[] byteNum = new byte[8]; - for (int ix = 0; ix < 8; ++ix) { - int offset = 64 - (ix + 1) * 8; - byteNum[ix] = (byte)((num >> offset) & 0xff); - } - return byteNum; - } - - public static long bytes2Long(byte[] byteNum) { - long num = 0; - for (int ix = 0; ix < 8; ++ix) { - num <<= 8; - num |= byteNum[ix] & 0xff; - } - return num; - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/CollectionUtils.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/CollectionUtils.java deleted file mode 100644 index 31d8c61f4ec6558f2b0af8e0c83112d77232515f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/CollectionUtils.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.util; - -import java.util.*; - -/** - * @author peng-yongsheng - */ -public class CollectionUtils { - - public static boolean isEmpty(Map map) { - return map == null || map.size() == 0; - } - - public static boolean isEmpty(List list) { - return list == null || list.size() == 0; - } - - public static boolean isEmpty(Set set) { - return set == null || set.size() == 0; - } - - public static boolean isNotEmpty(List list) { - return !isEmpty(list); - } - - public static boolean isNotEmpty(Set set) { - return !isEmpty(set); - } - - public static boolean isNotEmpty(Map map) { - return !isEmpty(map); - } - - public static boolean isNotEmpty(T[] array) { - return array != null && array.length > 0; - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/ColumnNameUtils.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/ColumnNameUtils.java deleted file mode 100644 index eb224aabc589f9a93c5375735e30f93009c20470..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/ColumnNameUtils.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.util; - -/** - * @author peng-yongsheng - */ -public enum ColumnNameUtils { - INSTANCE; - - public String rename(String columnName) { - StringBuilder renamedColumnName = new StringBuilder(); - char[] chars = columnName.toLowerCase().toCharArray(); - - boolean findUnderline = false; - for (char character : chars) { - if (character == '_') { - findUnderline = true; - } else if (findUnderline) { - renamedColumnName.append(String.valueOf(character).toUpperCase()); - findUnderline = false; - } else { - renamedColumnName.append(character); - } - } - return renamedColumnName.toString(); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/Const.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/Const.java deleted file mode 100644 index 860d8b8cf18de4b27d72ccd0d7687cea3d4d0ebd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/Const.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.util; - -/** - * @author peng-yongsheng - */ -public class Const { - public static final int NONE = 0; - public static final String ID_SPLIT = "_"; - public static final int NONE_APPLICATION_ID = 1; - public static final int NONE_INSTANCE_ID = 1; - public static final int NONE_SERVICE_ID = 1; - public static final String NONE_SERVICE_NAME = "None"; - public static final String USER_CODE = "User"; - public static final String SEGMENT_SPAN_SPLIT = "S"; - public static final String UNKNOWN = "Unknown"; - public static final String EXCEPTION = "Exception"; - public static final String EMPTY_STRING = ""; - public static final String FILE_SUFFIX = "sw"; - public static final int SPAN_TYPE_VIRTUAL = 9; - public static final String DOMAIN_OPERATION_NAME = "{domain}"; -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/FileUtils.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/FileUtils.java deleted file mode 100644 index 3a75fd8f1bce33024ccdf3b1dac6f1e7679c0488..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/FileUtils.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.util; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.RandomAccessFile; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public enum FileUtils { - INSTANCE; - - private static final Logger logger = LoggerFactory.getLogger(FileUtils.class); - - public String readLastLine(File file) { - RandomAccessFile randomAccessFile = null; - try { - randomAccessFile = new RandomAccessFile(file, "r"); - long length = randomAccessFile.length(); - if (length == 0) { - return Const.EMPTY_STRING; - } else { - long position = length - 1; - randomAccessFile.seek(position); - while (position >= 0) { - if (randomAccessFile.read() == '\n') { - return randomAccessFile.readLine(); - } - randomAccessFile.seek(position); - if (position == 0) { - return randomAccessFile.readLine(); - } - position--; - } - } - } catch (IOException e) { - logger.error(e.getMessage(), e); - } finally { - if (randomAccessFile != null) { - try { - randomAccessFile.close(); - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - } - } - return Const.EMPTY_STRING; - } - - public void writeAppendToLast(File file, RandomAccessFile randomAccessFile, String value) { - if (randomAccessFile == null) { - try { - randomAccessFile = new RandomAccessFile(file, "rwd"); - } catch (FileNotFoundException e) { - logger.error(e.getMessage(), e); - } - } - try { - long length = randomAccessFile.length(); - randomAccessFile.seek(length); - randomAccessFile.writeBytes(System.lineSeparator()); - randomAccessFile.writeBytes(value); - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/NumberFormatUtils.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/NumberFormatUtils.java deleted file mode 100644 index 43d72fd68a543039ec43856b8c46a27842452bc3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/NumberFormatUtils.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.util; - -import java.math.RoundingMode; -import java.text.DecimalFormat; - -/** - * @author peng-yongsheng - */ -public class NumberFormatUtils { - - public static Double rateNumberFormat(Double rate) { - DecimalFormat decimalFormat = new DecimalFormat("#.00"); - decimalFormat.setRoundingMode(RoundingMode.HALF_UP); - Double formattedRate = Double.valueOf(decimalFormat.format(rate)); - return Double.valueOf(formattedRate); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/ResourceUtils.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/ResourceUtils.java deleted file mode 100644 index 936df06084b5bf9fe8e7c0809b2623daa47eaa62..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/ResourceUtils.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.util; - -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.net.URL; - -/** - * @author peng-yongsheng - */ -public class ResourceUtils { - - public static Reader read(String fileName) throws FileNotFoundException { - URL url = ResourceUtils.class.getClassLoader().getResource(fileName); - if (url == null) { - throw new FileNotFoundException("file not found: " + fileName); - } - InputStream inputStream = ResourceUtils.class.getClassLoader().getResourceAsStream(fileName); - return new InputStreamReader(inputStream); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/StringUtils.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/StringUtils.java deleted file mode 100644 index feeb1b11190285f1567ab2c6f99fe7ca70c936b2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/StringUtils.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.util; - -/** - * @author peng-yongsheng - */ -public class StringUtils { - - public static final String EMPTY_STRING = ""; - - public static boolean isEmpty(Object str) { - return str == null || EMPTY_STRING.equals(str); - } - - public static boolean isNotEmpty(Object str) { - return !isEmpty(str); - } -} diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/TimeBucketUtils.java b/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/TimeBucketUtils.java deleted file mode 100644 index 1b996834139bf034e2ad36cce59b388311940b2f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/util/TimeBucketUtils.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.util; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; - -/** - * @author peng-yongsheng - */ -public enum TimeBucketUtils { - INSTANCE; - - @GraphComputingMetric(name = "/utils/timeBucket/getMinuteTimeBucket") - public long getMinuteTimeBucket(long time) { - Calendar calendar = Calendar.getInstance(); - calendar.setTimeInMillis(time); - - long year = calendar.get(Calendar.YEAR); - long month = calendar.get(Calendar.MONTH) + 1; - long day = calendar.get(Calendar.DAY_OF_MONTH); - long hour = calendar.get(Calendar.HOUR_OF_DAY); - long minute = calendar.get(Calendar.MINUTE); - - return year * 100000000 + month * 1000000 + day * 10000 + hour * 100 + minute; - } - - @GraphComputingMetric(name = "/utils/timeBucket/getSecondTimeBucket") - public long getSecondTimeBucket(long time) { - Calendar calendar = Calendar.getInstance(); - calendar.setTimeInMillis(time); - - long year = calendar.get(Calendar.YEAR); - long month = calendar.get(Calendar.MONTH) + 1; - long day = calendar.get(Calendar.DAY_OF_MONTH); - long hour = calendar.get(Calendar.HOUR_OF_DAY); - long minute = calendar.get(Calendar.MINUTE); - long second = calendar.get(Calendar.SECOND); - - return year * 10000000000L + month * 100000000 + day * 1000000 + hour * 10000 + minute * 100 + second; - } - - public String formatMinuteTimeBucket(long minuteTimeBucket) throws ParseException { - SimpleDateFormat minuteDateFormat = new SimpleDateFormat("yyyyMMddHHmm"); - Date date = minuteDateFormat.parse(String.valueOf(minuteTimeBucket)); - SimpleDateFormat parsedMinuteDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); - return parsedMinuteDateFormat.format(date); - } - - public long minuteToHour(long minuteBucket) { - return minuteBucket / 100; - } - - public long minuteToDay(long minuteBucket) { - return minuteBucket / 100 / 100; - } - - public long minuteToMonth(long minuteBucket) { - return minuteBucket / 100 / 100 / 100; - } -} diff --git a/apm-collector/apm-collector-core/src/main/resources/application-default.yml b/apm-collector/apm-collector-core/src/main/resources/application-default.yml deleted file mode 100644 index 28d60d1b797b014aeb01821940b814a90f60aefd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/main/resources/application-default.yml +++ /dev/null @@ -1,82 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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. - -cluster: - standalone: - url: jdbc:h2:~/memorydb - userName: sa -naming: - jetty: - host: localhost - port: 10800 - contextPath: / -cache: - guava: -remote: - gRPC: - host: localhost - port: 11800 -agent_gRPC: - gRPC: - host: localhost - port: 11800 - #Set these two setting to open ssl - #sslCertChainFile: $path - #sslPrivateKeyFile: $path - - #Set your own token to active auth - #authentication: xxxxxx -agent_jetty: - jetty: - host: localhost - port: 12800 - contextPath: / -analysis_segment_parser: - default: - bufferFilePath: ../buffer/ - bufferOffsetMaxFileSize: 10M - bufferSegmentMaxFileSize: 500M -analysis_jvm: - default: -analysis_register: - default: -analysis_metric: - default: -analysis_alarm: - default: -configuration: - default: -# namespace: xxxxx - applicationApdexThreshold: 2000 - serviceErrorRateThreshold: 10.00 - serviceAverageResponseTimeThreshold: 2000 - instanceErrorRateThreshold: 10.00 - instanceAverageResponseTimeThreshold: 2000 - applicationErrorRateThreshold: 10.00 - applicationAverageResponseTimeThreshold: 2000 -ui: - jetty: - host: localhost - port: 12800 - contextPath: / -jetty_manager: - default: -gRPC_manager: - default: -storage: - h2: - url: jdbc:h2:~/memorydb - userName: sa \ No newline at end of file diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/annotations/trace/TracedGraphElement.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/annotations/trace/TracedGraphElement.java deleted file mode 100644 index cf95fa3469c22ee5b8a0f747627d8915a10577bf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/annotations/trace/TracedGraphElement.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.annotations.trace; - -import java.util.List; - -/** - * This is an example about how to use the tracing annotation in collector. - * These annotations effect only in `-instrument` mode active. - * - * @author wusheng - */ -public class TracedGraphElement { - @GraphComputingMetric(name = "/traced/element/run") - public void run() { - - } - - @GraphComputingMetric(name = "/traced/element/runWithBatch") - public void runWithBatch(@BatchParameter List data) { - - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/define/DefinitionLoaderTest.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/define/DefinitionLoaderTest.java deleted file mode 100644 index f666ac31e55386dd0cafc9c701c67e61154cae8a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/define/DefinitionLoaderTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.define; - -import java.util.Iterator; -import org.junit.Assert; -import org.junit.Test; - -/** - * @author wu-sheng - */ -public class DefinitionLoaderTest { - @Test - public void testLoad() { - TestDefineFile define = new TestDefineFile(); - DefinitionLoader definitionLoader = new DefinitionLoader<>(ServiceInterface.class, define); - Iterator iterator = definitionLoader.iterator(); - if (iterator.hasNext()) { - ServiceInterface service = iterator.next(); - Assert.assertTrue(service instanceof ServiceInterface); - Assert.assertTrue(service instanceof ServiceImpl); - } - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/define/ServiceImpl.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/define/ServiceImpl.java deleted file mode 100644 index e49d3b511a55b842e2c21c6e1847090596fbf7ec..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/define/ServiceImpl.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.define; - -/** - * @author wu-sheng - */ -public class ServiceImpl implements ServiceInterface { -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/define/ServiceInterface.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/define/ServiceInterface.java deleted file mode 100644 index f65a71185021e9e951ed31d4e23620081ccc7120..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/define/ServiceInterface.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.define; - -/** - * @author wu-sheng - */ -public interface ServiceInterface { -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/define/TestDefineFile.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/define/TestDefineFile.java deleted file mode 100644 index d4ff74ce10d58ba641d6e0a06b590d3305e8f09b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/define/TestDefineFile.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.define; - -/** - * @author wu-sheng - */ -public class TestDefineFile extends DefinitionFile { - @Override protected String fileName() { - return "test_define.define"; - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/graph/GraphManagerTest.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/graph/GraphManagerTest.java deleted file mode 100644 index f3feac52076f22202400010c538bbe93b63c157c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/graph/GraphManagerTest.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.graph; - -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -/** - * @author wusheng - */ -public class GraphManagerTest { - private static PrintStream OUT_REF; - private ByteArrayOutputStream outputStream; - private static String LINE_SEPARATE = System.lineSeparator(); - - @Before - public void initAndHoldOut() { - OUT_REF = System.out; - outputStream = new ByteArrayOutputStream(); - PrintStream testStream = new PrintStream(outputStream); - System.setOut(testStream); - } - - @After - public void reset() { - System.setOut(OUT_REF); - } - - @Test - public void testGraph() { - Graph testGraph = GraphManager.INSTANCE.createIfAbsent(1, String.class); - Node node = testGraph.addNode(new Node1Processor()); - Node node1 = node.addNext(new Node2Processor()); - testGraph.start("Input String"); - - String output = outputStream.toString(); - String expected = "Node1 process: s=Input String" + LINE_SEPARATE + - "Node2 process: s=Input String" + LINE_SEPARATE; - - Assert.assertEquals(expected, output); - } - - @Test - public void testGraphWithChainStyle() { - Graph graph = GraphManager.INSTANCE.createIfAbsent(2, String.class); - graph.addNode(new Node1Processor()).addNext(new Node2Processor()).addNext(new Node4Processor()); - - graph.start("Input String"); - - String output = outputStream.toString(); - String expected = "Node1 process: s=Input String" + LINE_SEPARATE + - "Node2 process: s=Input String" + LINE_SEPARATE + - "Node4 process: int=123" + LINE_SEPARATE; - - Assert.assertEquals(expected, output); - } - - @Test(expected = PotentialCyclicGraphException.class) - public void testPotentialAcyclicGraph() { - Graph testGraph = GraphManager.INSTANCE.createIfAbsent(3, String.class); - Node node = testGraph.addNode(new Node1Processor()); - node.addNext(new Node1Processor()); - } - - @Test - public void testContinueStream() { - Graph graph = GraphManager.INSTANCE.createIfAbsent(4, String.class); - graph.addNode(new Node1Processor()).addNext(new Node2Processor()).addNext(new Node4Processor()); - - Next next = GraphManager.INSTANCE.findGraph(4, String.class).toFinder().findNext(2); - - next.execute(123); - String output = outputStream.toString(); - String expected = - "Node4 process: int=123" + LINE_SEPARATE; - - Assert.assertEquals(expected, output); - } - - @Test(expected = NodeNotFoundException.class) - public void handlerNotFound() { - Graph graph = GraphManager.INSTANCE.createIfAbsent(5, String.class); - graph.addNode(new Node1Processor()).addNext(new Node2Processor()).addNext(new Node4Processor()); - - Next next = GraphManager.INSTANCE.findGraph(5, String.class).toFinder().findNext(3); - } - - @Test - public void testDeadEndWay() { - Graph graph = GraphManager.INSTANCE.createIfAbsent(7, String.class); - graph.addNode(new Node1Processor()).addNext(new WayToNode(new Node2Processor()) { - @Override protected void in(String input) { - //don't call `out(intput)`; - } - }); - - graph.start("Input String"); - String output = outputStream.toString(); - String expected = "Node1 process: s=Input String" + LINE_SEPARATE; - - Assert.assertEquals(expected, output); - } - - @Test - public void testEntryWay() { - Graph graph = GraphManager.INSTANCE.createIfAbsent(8, String.class); - graph.addNode(new WayToNode(new Node1Processor()) { - @Override protected void in(String input) { - //don't call `out(intput)`; - } - }).addNext(new Node2Processor()); - - graph.start("Input String"); - - Assert.assertEquals("", outputStream.toString()); - } - - @After - public void tearDown() { - GraphManager.INSTANCE.reset(); - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/graph/Node1Processor.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/graph/Node1Processor.java deleted file mode 100644 index ae653bcce61456a59da3b7067080f3d8b2e35ffd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/graph/Node1Processor.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.graph; - -/** - * @author wusheng - */ -public class Node1Processor extends OutputProcessor implements NodeProcessor { - @Override public int id() { - return 1; - } - - @Override public void process(String s, Next next) { - outstream().println("Node1 process: s=" + s); - next.execute(s); - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/graph/Node2Processor.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/graph/Node2Processor.java deleted file mode 100644 index b5c3b8314a162fbba2f6bdb19238afb087a75b46..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/graph/Node2Processor.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.graph; - -/** - * @author wusheng - */ -public class Node2Processor extends OutputProcessor implements NodeProcessor { - @Override public int id() { - return 2; - } - - @Override public void process(String s, Next next) { - outstream().println("Node2 process: s=" + s); - next.execute(123); - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/graph/Node3Processor.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/graph/Node3Processor.java deleted file mode 100644 index 48e019e23efdd82d8c966799041ee6df5c02d4f7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/graph/Node3Processor.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.graph; - -/** - * @author wusheng - */ -public class Node3Processor extends OutputProcessor implements NodeProcessor { - @Override public int id() { - return 3; - } - - @Override - public void process(Long aLong, Next next) { - outstream().println("Node3 process: long=" + aLong); - next.execute(aLong); - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/graph/Node4Processor.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/graph/Node4Processor.java deleted file mode 100644 index df00e5bbffbcd801b3253ab83ba4cf0484a35b6c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/graph/Node4Processor.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.graph; - -/** - * @author wusheng - */ -public class Node4Processor extends OutputProcessor implements NodeProcessor { - @Override public int id() { - return 4; - } - - @Override - public void process(Integer in, Next next) { - outstream().println("Node4 process: int=" + in); - next.execute(new Long(in.intValue())); - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/graph/OutputProcessor.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/graph/OutputProcessor.java deleted file mode 100644 index 202e80799a11060aa270f8ba34299a4963d05abd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/graph/OutputProcessor.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.graph; - -import java.io.PrintStream; - -/** - * @author wu-sheng - */ -public class OutputProcessor { - protected PrintStream outstream() { - return System.out; - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ApplicationConfigurationTest.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ApplicationConfigurationTest.java deleted file mode 100644 index 3251b1f2946c2ed7aa2f16e00e42658276a673c0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ApplicationConfigurationTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -import java.util.Properties; -import org.junit.Assert; -import org.junit.Test; - -public class ApplicationConfigurationTest { - @Test - public void testBuildConfig() { - ApplicationConfiguration configuration = new ApplicationConfiguration(); - Properties p1 = new Properties(); - p1.setProperty("p1", "value1"); - p1.setProperty("p2", "value2"); - Properties p2 = new Properties(); - p2.setProperty("prop1", "value1-prop"); - p2.setProperty("prop2", "value2-prop"); - configuration.addModule("MO-1").addProviderConfiguration("MO-1-P1", p1).addProviderConfiguration("MO-1-P2", p2); - - Assert.assertArrayEquals(new String[] {"MO-1"}, configuration.moduleList()); - Assert.assertEquals("value2-prop", configuration.getModuleConfiguration("MO-1").getProviderConfiguration("MO-1-P2").getProperty("prop2")); - Assert.assertEquals(p1, configuration.getModuleConfiguration("MO-1").getProviderConfiguration("MO-1-P1")); - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/BaseModuleA.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/BaseModuleA.java deleted file mode 100644 index 774d519437d79026a65050633ffd2efdf3844978..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/BaseModuleA.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -/** - * @author wu-sheng - */ -public class BaseModuleA extends ModuleDefine { - @Override public String name() { - return "BaseA"; - } - - @Override public Class[] services() { - return new Class[] {ServiceABusiness1.class, ServiceABusiness2.class}; - } - - public interface ServiceABusiness1 extends Service { - void print(); - } - - public interface ServiceABusiness2 extends Service { - - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/BaseModuleB.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/BaseModuleB.java deleted file mode 100644 index 63c7fbc68cd0e9425f0bf84bc4a64426792bfecd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/BaseModuleB.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -/** - * @author wu-sheng - */ -public class BaseModuleB extends ModuleDefine { - @Override public String name() { - return "BaseB"; - } - - @Override public Class[] services() { - return new Class[] {BaseModuleB.ServiceBBusiness1.class, BaseModuleB.ServiceBBusiness2.class}; - } - - public interface ServiceBBusiness1 extends Service { - - } - - public interface ServiceBBusiness2 extends Service { - - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleABusiness1Impl.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleABusiness1Impl.java deleted file mode 100644 index cebc4e81f17156c2715421d75cd0efe87275afe1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleABusiness1Impl.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -/** - * @author wu-sheng - */ -public class ModuleABusiness1Impl implements BaseModuleA.ServiceABusiness1 { - - @Override public void print() { - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleABusiness2Impl.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleABusiness2Impl.java deleted file mode 100644 index 15692aa02bc9c80fdac78953268877b87729a865..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleABusiness2Impl.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -/** - * @author wu-sheng - */ -public class ModuleABusiness2Impl implements BaseModuleA.ServiceABusiness2 { - -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleAProvider.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleAProvider.java deleted file mode 100644 index f73369ebf358c982fe61951df3f9553f2900566f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleAProvider.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -/** - * @author wu-sheng - */ -public class ModuleAProvider extends ModuleProvider { - @Override public String name() { - return "P-A"; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return null; - } - - @Override public Class module() { - return BaseModuleA.class; - } - - @Override public void prepare() throws ServiceNotProvidedException { - this.registerServiceImplementation(BaseModuleA.ServiceABusiness1.class, new ModuleABusiness1Impl()); - this.registerServiceImplementation(BaseModuleA.ServiceABusiness2.class, new ModuleABusiness2Impl()); - } - - @Override public void start() { - } - - @Override public void notifyAfterCompleted() { - } - - @Override public String[] requiredModules() { - return new String[0]; - } - - class Config { - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleBBusiness1Impl.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleBBusiness1Impl.java deleted file mode 100644 index 2bcdce774a6b0c9914b2a4b2c0df83c4c7798193..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleBBusiness1Impl.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -/** - * @author wu-sheng - */ -public class ModuleBBusiness1Impl implements BaseModuleB.ServiceBBusiness1 { -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleBBusiness2Impl.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleBBusiness2Impl.java deleted file mode 100644 index 85afb1e78c7980c9d427e3e3964a1644a039d9d9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleBBusiness2Impl.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -/** - * @author wu-sheng - */ -public class ModuleBBusiness2Impl implements BaseModuleB.ServiceBBusiness2 { -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleBProvider.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleBProvider.java deleted file mode 100644 index 199f5f8f345891e6a87296610a2b2d25e630c879..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleBProvider.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -/** - * @author wu-sheng - */ -public class ModuleBProvider extends ModuleProvider { - - @Override public String name() { - return "P-B"; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return null; - } - - @Override public Class module() { - return BaseModuleB.class; - } - - @Override public void prepare() throws ServiceNotProvidedException { - this.registerServiceImplementation(BaseModuleB.ServiceBBusiness1.class, new ModuleBBusiness1Impl()); - this.registerServiceImplementation(BaseModuleB.ServiceBBusiness2.class, new ModuleBBusiness2Impl()); - } - - @Override public void start() { - } - - @Override public void notifyAfterCompleted() { - } - - @Override public String[] requiredModules() { - return new String[0]; - } - - class Config { - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleManagerTest.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleManagerTest.java deleted file mode 100644 index a00feb7bfbb50366a0983723e46780805796039d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/ModuleManagerTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -import java.util.Properties; -import org.junit.Assert; -import org.junit.Test; - -/** - * @author wu-sheng - */ -public class ModuleManagerTest { - @Test - public void testInit() throws ServiceNotProvidedException, ModuleNotFoundException, ProviderNotFoundException, DuplicateProviderException, ModuleConfigException, ModuleStartException { - ApplicationConfiguration configuration = new ApplicationConfiguration(); - configuration.addModule("Test").addProviderConfiguration("TestModule-Provider", new Properties()); - configuration.addModule("BaseA").addProviderConfiguration("P-A", new Properties()); - configuration.addModule("BaseB").addProviderConfiguration("P-B", new Properties()); - - ModuleManager manager = new ModuleManager(); - manager.init(configuration); - - BaseModuleA.ServiceABusiness1 serviceABusiness1 = manager.find("BaseA").provider().getService(BaseModuleA.ServiceABusiness1.class); - Assert.assertTrue(serviceABusiness1 != null); - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/TestModule.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/TestModule.java deleted file mode 100644 index 356c3d62a493c75997c7057229e0e0bda2abfadf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/TestModule.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -/** - * @author wu-sheng - */ -public class TestModule extends ModuleDefine { - @Override public String name() { - return "Test"; - } - - @Override public Class[] services() { - return new Class[0]; - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/TestModuleProvider.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/TestModuleProvider.java deleted file mode 100644 index 088975b2311e9188e29ff1145b078d2fa4e9dc4b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/module/TestModuleProvider.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -/** - * @author wu-sheng - */ -public class TestModuleProvider extends ModuleProvider { - @Override public String name() { - return "TestModule-Provider"; - } - - @Override public Class module() { - return TestModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return null; - } - - @Override public void prepare() { - } - - @Override public void start() { - } - - @Override public void notifyAfterCompleted() { - } - - @Override public String[] requiredModules() { - return new String[] {"BaseA", "BaseB"}; - } - - class Config { - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/BytesUtilsTest.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/BytesUtilsTest.java deleted file mode 100644 index a4cb5f394896fa1dd599eb0e3f44b990af10e1f1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/BytesUtilsTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.util; - -import org.junit.Assert; -import org.junit.Test; - -/** - * @author wu-sheng - */ -public class BytesUtilsTest { - @Test - public void testLong2Bytes() { - Assert.assertEquals(655390L, BytesUtils.bytes2Long(BytesUtils.long2Bytes(655390L))); - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/CollectionUtilsTest.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/CollectionUtilsTest.java deleted file mode 100644 index 9e47c582f6fbbaa7d50640a1196d4a7012db54c6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/CollectionUtilsTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.util; - -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import org.junit.Assert; -import org.junit.Test; - -/** - * @author wu-sheng - */ -public class CollectionUtilsTest { - @Test - public void testList() { - List list = new LinkedList<>(); - Assert.assertTrue(CollectionUtils.isEmpty(list)); - Assert.assertFalse(CollectionUtils.isNotEmpty(list)); - } - - @Test - public void testMap() { - Map map = new HashMap<>(); - Assert.assertTrue(CollectionUtils.isEmpty(map)); - Assert.assertFalse(CollectionUtils.isNotEmpty(map)); - } - - @Test - public void testArray() { - String[] array = new String[] {"abc"}; - Assert.assertTrue(CollectionUtils.isNotEmpty(array)); - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/ColumnNameUtilsTest.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/ColumnNameUtilsTest.java deleted file mode 100644 index 87f016675e65d3af1639e72c32d2ff5e082d251b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/ColumnNameUtilsTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.util; - -import org.junit.Assert; -import org.junit.Test; - -/** - * @author wu-sheng - */ -public class ColumnNameUtilsTest { - @Test - public void testRename() { - Assert.assertEquals("newAttributeNameFromColumnName", - ColumnNameUtils.INSTANCE.rename("new_attribute_name_from_column_name")); - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/NumberFormatUtilsTest.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/NumberFormatUtilsTest.java deleted file mode 100644 index e39c1f8610418a8123dc6fa18d207d90bd12e72b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/NumberFormatUtilsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.util; - -import org.junit.Assert; -import org.junit.Test; - -/** - * @author peng-yongsheng - */ -public class NumberFormatUtilsTest { - - @Test - public void testRateNumberFormat() { - Double rate = NumberFormatUtils.rateNumberFormat(12.1111); - Assert.assertEquals(rate, Double.valueOf(12.11)); - - rate = NumberFormatUtils.rateNumberFormat(12.1151); - Assert.assertEquals(rate, Double.valueOf(12.12)); - - rate = NumberFormatUtils.rateNumberFormat(12.1); - Assert.assertEquals(rate, Double.valueOf(12.1)); - - rate = NumberFormatUtils.rateNumberFormat(12.00); - Assert.assertEquals(rate, Double.valueOf(12.00)); - - rate = NumberFormatUtils.rateNumberFormat(4624.00); - Assert.assertEquals(rate, Double.valueOf(4624.00)); - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/ResourceUtilsTest.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/ResourceUtilsTest.java deleted file mode 100644 index 3f31b9ef9a214e70c777d81da87011723256cf41..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/ResourceUtilsTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.util; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.Reader; -import org.junit.Assert; -import org.junit.Test; - -/** - * @author wu-sheng - */ -public class ResourceUtilsTest { - @Test - public void testGetResource() throws IOException { - Reader read = ResourceUtils.read("TestResourceFile.txt"); - try { - BufferedReader reader = new BufferedReader(read); - String line1 = reader.readLine(); - Assert.assertEquals("skywalking", line1); - } finally { - read.close(); - } - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/StringUtilsTest.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/StringUtilsTest.java deleted file mode 100644 index a191f1a7d87f255763f83922dba52448a274e442..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/StringUtilsTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.util; - -import org.junit.Assert; -import org.junit.Test; - -/** - * @author wu-sheng - */ -public class StringUtilsTest { - @Test - public void testEmptyString() { - Assert.assertTrue(StringUtils.isEmpty(null)); - Assert.assertTrue(StringUtils.isEmpty("")); - - Assert.assertTrue(StringUtils.isNotEmpty("abc")); - } -} diff --git a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/TimeBucketUtilsTest.java b/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/TimeBucketUtilsTest.java deleted file mode 100644 index f119e3da4436a738b3edb44cac4515ec4e85a44b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/java/org/apache/skywalking/apm/collector/core/util/TimeBucketUtilsTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.util; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import org.junit.Assert; -import org.junit.Test; - -/** - * @author peng-yongsheng - */ -public class TimeBucketUtilsTest { - - @Test - public void testGetMinuteTimeBucket() throws ParseException { - SimpleDateFormat minuteDateFormat = new SimpleDateFormat("yyyyMMddHHmm"); - long timeBucket = TimeBucketUtils.INSTANCE.getMinuteTimeBucket(minuteDateFormat.parse("201803010201").getTime()); - Assert.assertEquals(201803010201L, timeBucket); - } - - @Test - public void testGetSecondTimeBucket() throws ParseException { - SimpleDateFormat minuteDateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); - long timeBucket = TimeBucketUtils.INSTANCE.getSecondTimeBucket(minuteDateFormat.parse("20180301020102").getTime()); - Assert.assertEquals(20180301020102L, timeBucket); - } - - /** - * Performance tests - * Running with vm option: -javaagent: collector-instrument-agent.jar - * - * @param args - */ - public static void main(String[] args) { - long now = System.currentTimeMillis(); - - for (int i = 0; i < 500000; i++) { - TimeBucketUtils.INSTANCE.getMinuteTimeBucket(now); - } - } -} diff --git a/apm-collector/apm-collector-core/src/test/resources/META-INF/defines/test_define.define b/apm-collector/apm-collector-core/src/test/resources/META-INF/defines/test_define.define deleted file mode 100644 index 53e3f410d2f5ad2d446d6a38ad0c3ab48a32296b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/resources/META-INF/defines/test_define.define +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.core.define.ServiceImpl diff --git a/apm-collector/apm-collector-core/src/test/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-core/src/test/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine deleted file mode 100644 index a3740c792a74a1ffcb761f4a19ecdbf48e2f1362..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ /dev/null @@ -1,22 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.core.module.TestModule -org.apache.skywalking.apm.collector.core.module.BaseModuleA -org.apache.skywalking.apm.collector.core.module.BaseModuleB diff --git a/apm-collector/apm-collector-core/src/test/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-core/src/test/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index cc940cebb0381743fc77602396e05d2684056cd8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,22 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.core.module.TestModuleProvider -org.apache.skywalking.apm.collector.core.module.ModuleAProvider -org.apache.skywalking.apm.collector.core.module.ModuleBProvider diff --git a/apm-collector/apm-collector-core/src/test/resources/TestResourceFile.txt b/apm-collector/apm-collector-core/src/test/resources/TestResourceFile.txt deleted file mode 100644 index d967dd633ea57ffa3b2f42f4a02665018bb66a63..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/resources/TestResourceFile.txt +++ /dev/null @@ -1 +0,0 @@ -skywalking \ No newline at end of file diff --git a/apm-collector/apm-collector-core/src/test/resources/log4j2.xml b/apm-collector/apm-collector-core/src/test/resources/log4j2.xml deleted file mode 100644 index c9eec4f6e22bc0b68dff05dca8c6151eb68a5f72..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-core/src/test/resources/log4j2.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/pom.xml b/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/pom.xml deleted file mode 100644 index 35d176a5345343edf52dee41079a09e356e4971f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - apm-collector-grpc-manager - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-grpc-manager-define - jar - diff --git a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/src/main/java/org/apache/skywalking/apm/collector/grpc/manager/GRPCManagerModule.java b/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/src/main/java/org/apache/skywalking/apm/collector/grpc/manager/GRPCManagerModule.java deleted file mode 100644 index bf362dd43d1425593a97de75bb435a4514528e7c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/src/main/java/org/apache/skywalking/apm/collector/grpc/manager/GRPCManagerModule.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.grpc.manager; - -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; -import org.apache.skywalking.apm.collector.grpc.manager.service.GRPCManagerService; - -/** - * @author peng-yongsheng - */ -public class GRPCManagerModule extends ModuleDefine { - - public static final String NAME = "gRPC_manager"; - - @Override public String name() { - return NAME; - } - - @Override public Class[] services() { - return new Class[] {GRPCManagerService.class}; - } -} diff --git a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/src/main/java/org/apache/skywalking/apm/collector/grpc/manager/service/GRPCManagerService.java b/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/src/main/java/org/apache/skywalking/apm/collector/grpc/manager/service/GRPCManagerService.java deleted file mode 100644 index 0c1b16181f40d8562895da8be27d2fae09d76221..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/src/main/java/org/apache/skywalking/apm/collector/grpc/manager/service/GRPCManagerService.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.grpc.manager.service; - -import org.apache.skywalking.apm.collector.core.module.Service; -import org.apache.skywalking.apm.collector.server.grpc.GRPCServer; - -import java.io.File; - -/** - * @author peng-yongsheng, wusheng - */ -public interface GRPCManagerService extends Service { - GRPCServer createIfAbsent(String host, int port) throws ServerCanNotBeCreatedException; - - GRPCServer createIfAbsent(String host, int port, File certChainFile, File privateKeyFile) throws ServerCanNotBeCreatedException; -} diff --git a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/src/main/java/org/apache/skywalking/apm/collector/grpc/manager/service/ServerCanNotBeCreatedException.java b/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/src/main/java/org/apache/skywalking/apm/collector/grpc/manager/service/ServerCanNotBeCreatedException.java deleted file mode 100644 index 5f7886358105f9bb95247096d15011a7efe7d0b1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/src/main/java/org/apache/skywalking/apm/collector/grpc/manager/service/ServerCanNotBeCreatedException.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.grpc.manager.service; - -import org.apache.skywalking.apm.collector.core.module.ServiceNotProvidedException; - -/** - * gRPC Server can't be created under certain circumstance - * - * @author wusheng - */ -public class ServerCanNotBeCreatedException extends ServiceNotProvidedException { - public ServerCanNotBeCreatedException(String message) { - super(message); - } -} diff --git a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine deleted file mode 100644 index f874d0c0e67783af6ffca5db053d8e5da122a455..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.grpc.manager.GRPCManagerModule diff --git a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/pom.xml b/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/pom.xml deleted file mode 100644 index bb1941ff3b2c0350102c1e72d4ba1edfdb3ef729..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - apm-collector-grpc-manager - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-grpc-manager-provider - jar - - - - org.apache.skywalking - collector-grpc-manager-define - ${project.version} - - - diff --git a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/src/main/java/org/apache/skywalking/apm/collector/grpc/manager/GRPCManagerConfig.java b/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/src/main/java/org/apache/skywalking/apm/collector/grpc/manager/GRPCManagerConfig.java deleted file mode 100644 index 2e1909d730efe897ea6656f3494330c8eae9101d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/src/main/java/org/apache/skywalking/apm/collector/grpc/manager/GRPCManagerConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.grpc.manager; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author peng-yongsheng - */ -class GRPCManagerConfig extends ModuleConfig { -} diff --git a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/src/main/java/org/apache/skywalking/apm/collector/grpc/manager/GRPCManagerProvider.java b/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/src/main/java/org/apache/skywalking/apm/collector/grpc/manager/GRPCManagerProvider.java deleted file mode 100644 index dddf65b135d7f56ce46b1b41ab9d18394b81c4ff..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/src/main/java/org/apache/skywalking/apm/collector/grpc/manager/GRPCManagerProvider.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.grpc.manager; - -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; -import org.apache.skywalking.apm.collector.core.module.ModuleProvider; -import org.apache.skywalking.apm.collector.core.module.ServiceNotProvidedException; -import org.apache.skywalking.apm.collector.grpc.manager.service.GRPCManagerService; -import org.apache.skywalking.apm.collector.grpc.manager.service.GRPCManagerServiceImpl; -import org.apache.skywalking.apm.collector.server.ServerException; -import org.apache.skywalking.apm.collector.server.grpc.GRPCServer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class GRPCManagerProvider extends ModuleProvider { - - private static final Logger logger = LoggerFactory.getLogger(GRPCManagerProvider.class); - - private final GRPCManagerConfig config; - private Map servers = new HashMap<>(); - - public GRPCManagerProvider() { - super(); - this.config = new GRPCManagerConfig(); - } - - @Override public String name() { - return "default"; - } - - @Override public Class module() { - return GRPCManagerModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() throws ServiceNotProvidedException { - this.registerServiceImplementation(GRPCManagerService.class, new GRPCManagerServiceImpl(servers)); - } - - @Override public void start() { - } - - @Override public void notifyAfterCompleted() { - servers.values().forEach(server -> { - try { - server.start(); - } catch (ServerException e) { - logger.error(e.getMessage(), e); - } - }); - } - - @Override public String[] requiredModules() { - return new String[0]; - } -} diff --git a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/src/main/java/org/apache/skywalking/apm/collector/grpc/manager/service/GRPCManagerServiceImpl.java b/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/src/main/java/org/apache/skywalking/apm/collector/grpc/manager/service/GRPCManagerServiceImpl.java deleted file mode 100644 index 9e53ef3e8256229670a6a4047d179ede2afc4da1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/src/main/java/org/apache/skywalking/apm/collector/grpc/manager/service/GRPCManagerServiceImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.grpc.manager.service; - -import java.io.File; -import java.util.Map; -import org.apache.skywalking.apm.collector.server.ServerException; -import org.apache.skywalking.apm.collector.server.grpc.GRPCServer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class GRPCManagerServiceImpl implements GRPCManagerService { - - private static final Logger logger = LoggerFactory.getLogger(GRPCManagerServiceImpl.class); - - private final Map servers; - - public GRPCManagerServiceImpl(Map servers) { - this.servers = servers; - } - - @Override - public GRPCServer createIfAbsent(String host, int port) throws ServerCanNotBeCreatedException { - return createOrChooseServer(host, port, new GRPCServer(host, port)); - } - - @Override - public GRPCServer createIfAbsent(String host, int port, File certChainFile, - File privateKeyFile) throws ServerCanNotBeCreatedException { - return createOrChooseServer(host, port, new GRPCServer(host, port, certChainFile, privateKeyFile)); - } - - private GRPCServer createOrChooseServer(String host, int port, - GRPCServer newServer) throws ServerCanNotBeCreatedException { - String id = host + String.valueOf(port); - GRPCServer existServer = servers.get(id); - if (existServer != null) { - if (existServer.isStatusEqual(newServer)) { - return existServer; - } else { - throw new ServerCanNotBeCreatedException("Can't create server with same port but different setting. SSL setting must equal too."); - } - } else { - try { - newServer.initialize(); - } catch (ServerException e) { - logger.error(e.getMessage(), e); - } - servers.put(id, newServer); - return newServer; - } - } -} diff --git a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index 54388e5e50bf0b42f3a7b21e5cf7378f779417ed..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.grpc.manager.GRPCManagerProvider diff --git a/apm-collector/apm-collector-grpc-manager/pom.xml b/apm-collector/apm-collector-grpc-manager/pom.xml deleted file mode 100644 index fd1fa23911f7945304a95622793bba64d50370bf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-grpc-manager/pom.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - apm-collector - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - apm-collector-grpc-manager - pom - - collector-grpc-manager-define - collector-grpc-manager-provider - - - - - org.apache.skywalking - apm-collector-core - ${project.version} - - - org.apache.skywalking - server-component - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-instrument/pom.xml b/apm-collector/apm-collector-instrument/pom.xml deleted file mode 100644 index d3c14aca4dffc1bfe40a7d3691fb7fce06bfba0e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-instrument/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - apm-collector - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - apm-collector-instrument - - - - org.apache.skywalking - apm-collector-core - ${project.version} - provided - - - net.bytebuddy - byte-buddy - - - - - collector-instrument-agent - - - maven-shade-plugin - - - package - - shade - - - false - true - true - true - - - - - org.apache.skywalking.apm.collector.instrument.CollectorInstrumentAgent - - - - - - - com.*:* - org.slf4j:* - org.apache.logging.log4j:* - - - - - - - - - diff --git a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/CollectorInstrumentAgent.java b/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/CollectorInstrumentAgent.java deleted file mode 100644 index 7b90547299315a77d5777e58189b6054b7c7e7c1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/CollectorInstrumentAgent.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.instrument; - -import java.lang.instrument.Instrumentation; -import net.bytebuddy.agent.builder.AgentBuilder; -import net.bytebuddy.description.method.MethodDescription; -import net.bytebuddy.description.type.TypeDescription; -import net.bytebuddy.dynamic.DynamicType; -import net.bytebuddy.implementation.MethodDelegation; -import net.bytebuddy.matcher.ElementMatcher; -import net.bytebuddy.utility.JavaModule; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static net.bytebuddy.matcher.ElementMatchers.declaresMethod; -import static net.bytebuddy.matcher.ElementMatchers.isAnnotatedWith; -import static net.bytebuddy.matcher.ElementMatchers.named; - -/** - * There are a lot of monitoring requirements in collector side. - * The agent way is easy, pluggable, and match the target services/graph-nodes automatically. - * - * This agent is designed and expected running in the same class loader of the collector application, - * so I will keep all class loader issue out of concern, - * in order to keep the trace and monitor codes as simple as possible. - * - * @author wu-sheng, peng-yongsheng - */ -public class CollectorInstrumentAgent { - private final static Logger logger = LoggerFactory.getLogger(CollectorInstrumentAgent.class); - - public static void premain(String agentArgs, Instrumentation instrumentation) { - logger.info("Collector performance instrument agent startup"); - - new AgentBuilder.Default().type( - declaresMethod(isAnnotationedMatch()) - ).transform((builder, typeDescription, classLoader, module) -> { - builder = builder.method(isAnnotationedMatch()) - .intercept(MethodDelegation.withDefaultConfiguration() - .to(new ServiceMetricTracing())); - return builder; - }).with(new AgentBuilder.Listener() { - @Override - public void onDiscovery(String typeName, ClassLoader classLoader, JavaModule module, boolean loaded) { - } - - @Override - public void onTransformation(TypeDescription typeDescription, ClassLoader classLoader, JavaModule module, - boolean loaded, DynamicType dynamicType) { - } - - @Override - public void onIgnored(TypeDescription typeDescription, ClassLoader classLoader, JavaModule module, - boolean loaded) { - } - - @Override public void onError(String typeName, ClassLoader classLoader, JavaModule module, boolean loaded, - Throwable throwable) { - logger.error("Enhance service " + typeName + " error.", throwable); - } - - @Override - public void onComplete(String typeName, ClassLoader classLoader, JavaModule module, boolean loaded) { - } - }).installOn(instrumentation); - } - - private static ElementMatcher isAnnotationedMatch() { - return isAnnotatedWith(named("org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric")); - } -} diff --git a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/MetricTree.java b/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/MetricTree.java deleted file mode 100644 index 1500b84dfda0900e472fcf7a8c6476a9a543a374..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/MetricTree.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.instrument; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Method; -import java.util.*; -import java.util.concurrent.*; -import org.apache.skywalking.apm.collector.core.annotations.trace.BatchParameter; -import org.slf4j.*; - -/** - * @author wusheng, peng-yongsheng - */ -public enum MetricTree implements Runnable { - INSTANCE; - - private static final Logger logger = LoggerFactory.getLogger(MetricTree.class); - - private List metrics = new LinkedList<>(); - private String lineSeparator = System.getProperty("line.separator"); - - MetricTree() { - ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor(); - service.scheduleAtFixedRate(this, 60, 60, TimeUnit.SECONDS); - } - - synchronized MetricNode lookup(String metricName) { - MetricNode node = new MetricNode(metricName); - metrics.add(node); - return node; - } - - @Override - public void run() { - try { - metrics.forEach(MetricNode::exchange); - - StringBuilder logBuffer = new StringBuilder(); - logBuffer.append(lineSeparator); - logBuffer.append("##################################################################################################################").append(lineSeparator); - logBuffer.append("# Collector Service Report #").append(lineSeparator); - logBuffer.append("##################################################################################################################").append(lineSeparator); - - metrics.forEach((MetricNode metric) -> metric.toOutput(new ReportWriter() { - @Override public void writeMetricName(String name) { - logBuffer.append(name).append(lineSeparator); - } - - @Override public void writeMetric(String metrics) { - logBuffer.append("\t"); - logBuffer.append(metrics).append(lineSeparator); - } - })); - - metrics.forEach(MetricNode::clear); - - logger.warn(logBuffer.toString()); - } catch (Throwable e) { - logger.error(e.getMessage(), e); - } - } - - class MetricNode { - private final String metricName; - private volatile ServiceMetric metric; - - MetricNode(String metricName) { - this.metricName = metricName; - } - - ServiceMetric getMetric(Method targetMethod) { - if (metric == null) { - int detectedBatchIndex = -1; - if (targetMethod != null) { - Annotation[][] annotations = targetMethod.getParameterAnnotations(); - if (annotations != null) { - int index = 0; - for (Annotation[] parameterAnnotation : annotations) { - if (parameterAnnotation != null) { - for (Annotation annotation : parameterAnnotation) { - if (annotation instanceof BatchParameter) { - detectedBatchIndex = index; - break; - } - } - } - if (detectedBatchIndex > -1) { - break; - } - index++; - } - } - } - metric = new ServiceMetric(detectedBatchIndex); - } - return metric; - } - - void exchange() { - if (metric != null) { - metric.exchangeWindows(); - } - } - - void clear() { - if (metric != null) { - metric.clear(); - } - } - - void toOutput(ReportWriter writer) { - writer.writeMetricName(metricName); - if (metric != null) { - metric.toOutput(writer); - } - } - } -} diff --git a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/ReportWriter.java b/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/ReportWriter.java deleted file mode 100644 index 303bcccdef85c605ac7004c956a7f10582e6ce40..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/ReportWriter.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.instrument; - -/** - * @author wusheng - */ -public interface ReportWriter { - void writeMetricName(String name); - - void writeMetric(String metrics); -} diff --git a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/ServiceMetric.java b/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/ServiceMetric.java deleted file mode 100644 index 671e7e8987eb0a7aa93bbaf25b5ebadf354a952f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/ServiceMetric.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.instrument; - -import java.util.List; -import java.util.concurrent.atomic.AtomicBoolean; - -/** - * @author wusheng, peng-yongsheng - */ -public class ServiceMetric { - private ServiceMetricRecord winA; - private ServiceMetricRecord winB; - private AtomicBoolean isUsingWinA; - private volatile int detectedBatchIndex; - - ServiceMetric(int detectedBatchIndex) { - winA = detectedBatchIndex > -1 ? new ServiceMetricBatchRecord() : new ServiceMetricRecord(); - winB = detectedBatchIndex > -1 ? new ServiceMetricBatchRecord() : new ServiceMetricRecord(); - isUsingWinA = new AtomicBoolean(true); - this.detectedBatchIndex = detectedBatchIndex; - } - - void trace(long nanoseconds, boolean occurException, Object[] allArguments) { - ServiceMetricRecord usingRecord = isUsingWinA.get() ? winA : winB; - if (detectedBatchIndex > -1) { - List listArgs = (List)allArguments[detectedBatchIndex]; - ((ServiceMetricBatchRecord)usingRecord).add(nanoseconds, occurException, listArgs == null ? 0 : listArgs.size()); - } else { - usingRecord.add(nanoseconds, occurException); - } - } - - void exchangeWindows() { - isUsingWinA.set(!isUsingWinA.get()); - } - - void clear() { - if (isUsingWinA.get()) { - winB.clear(); - } else { - winA.clear(); - } - } - - void toOutput(ReportWriter writer) { - - /* - * If using A, then B is available and free to output. - */ - writer.writeMetric(isUsingWinA.get() ? winB.toString() : winA.toString()); - } -} diff --git a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/ServiceMetricBatchRecord.java b/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/ServiceMetricBatchRecord.java deleted file mode 100644 index cbe3f062329e9401a298cc0be6358ac05dfd1531..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/ServiceMetricBatchRecord.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.instrument; - -import java.util.concurrent.atomic.AtomicLong; - -/** - * @author wusheng - */ -public class ServiceMetricBatchRecord extends ServiceMetricRecord { - private AtomicLong batchRowSize; - - ServiceMetricBatchRecord() { - super(); - batchRowSize = new AtomicLong(0); - } - - void add(long nanoseconds, boolean occurException, int rowSize) { - super.add(nanoseconds, occurException); - batchRowSize.addAndGet(rowSize); - } - - @Override void clear() { - super.clear(); - batchRowSize.set(0); - } - - @Override - public String toString() { - if (getMetricRecordCount() == 0) { - return "Avg=N/A"; - } - return super.toString() + " Rows per call = " + (batchRowSize.get() / getMetricRecordCount()); - } -} diff --git a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/ServiceMetricRecord.java b/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/ServiceMetricRecord.java deleted file mode 100644 index ca8bcb9a8e72a8640e5bdc5af97e00c72576ba23..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/ServiceMetricRecord.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.instrument; - -import java.util.concurrent.atomic.AtomicLong; - -/** - * @author wusheng, peng-yongsheng - */ -public class ServiceMetricRecord { - private AtomicLong totalNanoseconds; - private AtomicLong counter; - private AtomicLong errorCounter; - - ServiceMetricRecord() { - totalNanoseconds = new AtomicLong(0); - counter = new AtomicLong(0); - errorCounter = new AtomicLong(0); - } - - void add(long nanoseconds, boolean occurException) { - totalNanoseconds.addAndGet(nanoseconds); - counter.incrementAndGet(); - if (occurException) - errorCounter.incrementAndGet(); - } - - void clear() { - totalNanoseconds.set(0); - counter.set(0); - errorCounter.set(0); - } - - long getMetricRecordCount() { - return counter.get(); - } - - @Override public String toString() { - if (counter.longValue() == 0) { - return "Avg=N/A"; - } - return "Avg=" + (totalNanoseconds.longValue() / counter.longValue()) + " (nanosecond)" + - ", Success Rate=" + (counter.longValue() - errorCounter.longValue()) * 100 / counter.longValue() + - "%, Calls=" + counter.longValue() + ", Total=" + totalNanoseconds.longValue() + " (nanosecond)"; - } -} diff --git a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/ServiceMetricTracing.java b/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/ServiceMetricTracing.java deleted file mode 100644 index add628e1113f744c94ba5de7d94f5dc1387c9cc1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/ServiceMetricTracing.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.instrument; - -import java.lang.reflect.Method; -import java.util.concurrent.*; -import net.bytebuddy.implementation.bind.annotation.*; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; - -/** - * @author wu-sheng - */ -public class ServiceMetricTracing { - - private volatile ConcurrentHashMap metrics = new ConcurrentHashMap<>(); - - ServiceMetricTracing() { - } - - @RuntimeType - public Object intercept( - @This Object inst, - @SuperCall Callable zuper, - @AllArguments Object[] allArguments, - @Origin Method method - ) throws Throwable { - ServiceMetric metric = this.metrics.get(method); - if (metric == null) { - GraphComputingMetric annotation = method.getAnnotation(GraphComputingMetric.class); - String metricName = annotation.name(); - synchronized (inst) { - MetricTree.MetricNode metricNode = MetricTree.INSTANCE.lookup(metricName); - ServiceMetric serviceMetric = metricNode.getMetric(method); - metrics.put(method, serviceMetric); - metric = serviceMetric; - } - } - boolean occurError = false; - long startNanosecond = System.nanoTime(); - long endNanosecond; - try { - return zuper.call(); - } catch (Throwable t) { - occurError = true; - throw t; - } finally { - endNanosecond = System.nanoTime(); - - metric.trace(endNanosecond - startNanosecond, occurError, allArguments); - } - } -} diff --git a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/tools/Metric.java b/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/tools/Metric.java deleted file mode 100644 index 297c8232c9ed14b2268db28d8c0f579672635b2b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/tools/Metric.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.instrument.tools; - -/** - * @author peng-yongsheng - */ -public class Metric { - - private String metricName; - private long avg; - private long rate; - private long calls; - private long total; - - String getMetricName() { - return metricName; - } - - void setMetricName(String metricName) { - this.metricName = metricName; - } - - long getAvg() { - return avg; - } - - void setAvg(long avg) { - this.avg = avg; - } - - long getRate() { - return rate; - } - - void setRate(long rate) { - this.rate = rate; - } - - long getCalls() { - return calls; - } - - void setCalls(long calls) { - this.calls = calls; - } - - long getTotal() { - return total; - } - - String getTotalWithUnit() { - return transport(total); - } - - void setTotal(long total) { - this.total = total; - } - - void merge(Metric metric) { - this.total = this.total + metric.getTotal(); - this.calls = this.calls + metric.getCalls(); - this.avg = this.total / this.calls; - } - - private String transport(long nanoseconds) { - long ns2ms = 1000000; - long ns2s = ns2ms * 1000; - long ns2m = ns2s * 60; - - if (ns2ms <= nanoseconds && nanoseconds < ns2s) { - return nanoseconds / ns2ms + "(ms)"; - } else if (ns2s <= nanoseconds && nanoseconds < ns2m) { - return nanoseconds / ns2s + "(s)"; - } else if (nanoseconds >= ns2m) { - return nanoseconds / ns2m + "(m)"; - } - return nanoseconds + "(ns)"; - } -} diff --git a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/tools/MetricReader.java b/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/tools/MetricReader.java deleted file mode 100644 index c37f2dd79c4ab022e3ad73f4cc8e1289ae08ba6b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/tools/MetricReader.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.instrument.tools; - -import java.io.BufferedReader; -import java.io.IOException; - -/** - * @author peng-yongsheng - */ -class MetricReader { - - private static final String AVG = "Avg"; - private static final String SUCCESS_RATE = "Success Rate"; - private static final String CALLS = "Calls"; - private static final String TOTAL = "Total"; - - private final BufferedReader bufferedReader; - - MetricReader(BufferedReader bufferedReader) { - this.bufferedReader = bufferedReader; - } - - void read(Metric metric) throws IOException { - String line = bufferedReader.readLine(); - - String[] metrics = line.trim().split(","); - for (String metricStr : metrics) { - String[] keyValue = metricStr.split("="); - - String key = keyValue[0].trim(); - long value = getValue(keyValue[1]); - switch (key) { - case AVG: - metric.setAvg(value); - break; - case SUCCESS_RATE: - metric.setRate(value); - break; - case CALLS: - metric.setCalls(value); - break; - case TOTAL: - metric.setTotal(value); - } - } - } - - private long getValue(String valueStr) { - char[] chars = valueStr.toCharArray(); - char[] value = new char[chars.length]; - - int index = 0; - for (char aChar : chars) { - if (Character.isDigit(aChar)) { - value[index] = aChar; - index++; - } - } - - return Long.valueOf(String.valueOf(value).substring(0, index)); - } -} diff --git a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/tools/Report.java b/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/tools/Report.java deleted file mode 100644 index bf4dcf49701847dc7e6896ab315a56dc2e8d5fce..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/tools/Report.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.instrument.tools; - -import java.util.LinkedList; -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class Report { - - private final List metrics; - - Report() { - this.metrics = new LinkedList<>(); - } - - void addMetric(Metric metric) { - this.metrics.add(metric); - } - - List getMetrics() { - return metrics; - } -} diff --git a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/tools/ReportBufferReader.java b/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/tools/ReportBufferReader.java deleted file mode 100644 index c288c85ccc135b228f379fdf9b59e698c3c29bf4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/tools/ReportBufferReader.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.instrument.tools; - -import java.io.BufferedReader; -import java.io.IOException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -class ReportBufferReader { - - private final Logger logger = LoggerFactory.getLogger(ReportBufferReader.class); - - Report read(BufferedReader bufferedReader) throws IOException { - Report report = new Report(); - - String line; - while ((line = bufferedReader.readLine()) != null) { - if (line.startsWith(":end")) { - break; - } - - if (!line.startsWith("/") && !line.startsWith("\t")) { - continue; - } - - Metric metric = new Metric(); - metric.setMetricName(line); - new MetricReader(bufferedReader).read(metric); - - logger.info("metric name: {}, avg: {}, rate: {}, calls: {}, total: {}", - metric.getMetricName(), - metric.getAvg(), - metric.getRate(), - metric.getCalls(), - metric.getTotal()); - - report.addMetric(metric); - } - - return report; - } -} diff --git a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/tools/ReportFormatRunner.java b/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/tools/ReportFormatRunner.java deleted file mode 100644 index f368dd49b452c66a17ce401a35bd9fdbfe49367a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/tools/ReportFormatRunner.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.instrument.tools; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class ReportFormatRunner { - - private final Logger logger = LoggerFactory.getLogger(ReportFormatRunner.class); - - public static void main(String[] args) { - ReportFormatRunner runner = new ReportFormatRunner(); - Report report = runner.readString(); - - ReportFormatter formatter = new ReportFormatter(); - formatter.format(report); - } - - private Report readString() { - BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); - logger.info("Please input the report: "); - - ReportBufferReader reader = new ReportBufferReader(); - try { - Report report = reader.read(bufferedReader); - bufferedReader.close(); - return report; - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - - return null; - } -} diff --git a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/tools/ReportFormatter.java b/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/tools/ReportFormatter.java deleted file mode 100644 index 7489510416a51f68b36d03767bc393c87cd5aaba..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-instrument/src/main/java/org/apache/skywalking/apm/collector/instrument/tools/ReportFormatter.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.instrument.tools; - -import java.util.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -class ReportFormatter { - - private final Logger logger = LoggerFactory.getLogger(ReportFormatter.class); - - private Map metricMap = new LinkedHashMap<>(); - - void format(Report report) { - logger.info(System.lineSeparator() + "Formatted report: "); - - report.getMetrics().forEach(metric -> { - if (metricMap.containsKey(metric.getMetricName())) { - Metric existMetric = metricMap.get(metric.getMetricName()); - existMetric.setTotal(existMetric.getTotal() + metric.getTotal()); - existMetric.setCalls(existMetric.getCalls() + metric.getCalls()); - existMetric.setAvg(existMetric.getTotal() / existMetric.getCalls()); - } else { - metricMap.put(metric.getMetricName(), metric); - } - }); - - logger.info(""); - - metricMap.values().forEach(metric -> - logger.info("metric name: {}, avg: {}, rate: {}, calls: {}, total: {}", - metric.getMetricName(), - metric.getAvg(), - metric.getRate(), - metric.getCalls(), - metric.getTotalWithUnit())); - } -} diff --git a/apm-collector/apm-collector-instrument/src/main/resources/log4j2.xml b/apm-collector/apm-collector-instrument/src/main/resources/log4j2.xml deleted file mode 100644 index 6ec10de16bf50485f7fa6fcf085665d0a8c2433e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-instrument/src/main/resources/log4j2.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/apm-collector/apm-collector-instrument/src/test/java/org/apache/skywalking/apm/collector/instrument/MetricTreePrintTestCase.java b/apm-collector/apm-collector-instrument/src/test/java/org/apache/skywalking/apm/collector/instrument/MetricTreePrintTestCase.java deleted file mode 100644 index 9988ebf1fef611383294f4115ff6098b18bc144a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-instrument/src/test/java/org/apache/skywalking/apm/collector/instrument/MetricTreePrintTestCase.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.instrument; - -import java.util.ArrayList; -import org.junit.Test; - -/** - * @author peng-yongsheng - */ -public class MetricTreePrintTestCase { - - @Test - public void testPrint() { - ServiceMetric table1PersistenceDay = MetricTree.INSTANCE.lookup("/persistence/onWork/table_1/day").getMetric(null); - table1PersistenceDay.trace(1000, false, newArguments()); - - ServiceMetric table1PersistenceHour = MetricTree.INSTANCE.lookup("/persistence/onWork/table_1/hour").getMetric(null); - table1PersistenceHour.trace(2000, false, newArguments()); - - ServiceMetric table1Aggregate = MetricTree.INSTANCE.lookup("/aggregate/onWork/table_1").getMetric(null); - table1Aggregate.trace(3000, false, newArguments()); - - ServiceMetric table2Aggregate = MetricTree.INSTANCE.lookup("/aggregate/onWork/table_2").getMetric(null); - table2Aggregate.trace(4000, false, newArguments()); - - MetricTree.INSTANCE.run(); - } - - private Object[] newArguments() { - Object[] arguments = new Object[1]; - arguments[0] = new ArrayList<>(100); - return arguments; - } -} diff --git a/apm-collector/apm-collector-instrument/src/test/resources/log4j2.xml b/apm-collector/apm-collector-instrument/src/test/resources/log4j2.xml deleted file mode 100644 index c9eec4f6e22bc0b68dff05dca8c6151eb68a5f72..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-instrument/src/test/resources/log4j2.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-define/pom.xml b/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-define/pom.xml deleted file mode 100644 index 6df4aa5220a96bb132e2b07a166838e222d8e8db..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-define/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - apm-collector-jetty-manager - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-jetty-manager-define - jar - diff --git a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-define/src/main/java/org/apache/skywalking/apm/collector/jetty/manager/JettyManagerModule.java b/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-define/src/main/java/org/apache/skywalking/apm/collector/jetty/manager/JettyManagerModule.java deleted file mode 100644 index 20145acd710b3482b82a6284d7ea90687621de87..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-define/src/main/java/org/apache/skywalking/apm/collector/jetty/manager/JettyManagerModule.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.jetty.manager; - -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; -import org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService; - -/** - * @author peng-yongsheng - */ -public class JettyManagerModule extends ModuleDefine { - - public static final String NAME = "jetty_manager"; - - @Override public String name() { - return NAME; - } - - @Override public Class[] services() { - return new Class[] {JettyManagerService.class}; - } -} diff --git a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-define/src/main/java/org/apache/skywalking/apm/collector/jetty/manager/service/JettyManagerService.java b/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-define/src/main/java/org/apache/skywalking/apm/collector/jetty/manager/service/JettyManagerService.java deleted file mode 100644 index 3de2daa9c586390ed6d9896e66c2c03a57da55f5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-define/src/main/java/org/apache/skywalking/apm/collector/jetty/manager/service/JettyManagerService.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.jetty.manager.service; - -import org.apache.skywalking.apm.collector.core.module.Service; -import org.apache.skywalking.apm.collector.server.jetty.JettyHandler; -import org.apache.skywalking.apm.collector.server.jetty.JettyServer; - -/** - * @author peng-yongsheng - */ -public interface JettyManagerService extends Service { - JettyServer createIfAbsent(String host, int port, String contextPath); - - void addHandler(String host, int port, JettyHandler serverHandler); -} diff --git a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine deleted file mode 100644 index 8faa4a31fa7ef053aebf58e58bedda553123bdf4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.jetty.manager.JettyManagerModule diff --git a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/pom.xml b/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/pom.xml deleted file mode 100644 index df7455ae15883953cd4a3e12732c5d5518e1f848..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - apm-collector-jetty-manager - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-jetty-manager-provider - jar - - - - org.apache.skywalking - collector-jetty-manager-define - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/src/main/java/org/apache/skywalking/apm/collector/jetty/manager/JettyManagerConfig.java b/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/src/main/java/org/apache/skywalking/apm/collector/jetty/manager/JettyManagerConfig.java deleted file mode 100644 index 3749c76edd2ec972dc092c9699233f91b9d6a679..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/src/main/java/org/apache/skywalking/apm/collector/jetty/manager/JettyManagerConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.jetty.manager; - -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; - -/** - * @author peng-yongsheng - */ -class JettyManagerConfig extends ModuleConfig { -} diff --git a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/src/main/java/org/apache/skywalking/apm/collector/jetty/manager/JettyManagerProvider.java b/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/src/main/java/org/apache/skywalking/apm/collector/jetty/manager/JettyManagerProvider.java deleted file mode 100644 index a1fa901ef3fcf559e646d4c61cc9491858b9c5c2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/src/main/java/org/apache/skywalking/apm/collector/jetty/manager/JettyManagerProvider.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.jetty.manager; - -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; -import org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService; -import org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerServiceImpl; -import org.apache.skywalking.apm.collector.server.ServerException; -import org.apache.skywalking.apm.collector.server.jetty.JettyServer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class JettyManagerProvider extends ModuleProvider { - - private static final Logger logger = LoggerFactory.getLogger(JettyManagerProvider.class); - - private final JettyManagerConfig jettyManagerConfig; - private Map servers = new HashMap<>(); - - public JettyManagerProvider() { - this.jettyManagerConfig = new JettyManagerConfig(); - } - - @Override public String name() { - return "default"; - } - - @Override public Class module() { - return JettyManagerModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return jettyManagerConfig; - } - - @Override public void prepare() throws ServiceNotProvidedException { - this.registerServiceImplementation(JettyManagerService.class, new JettyManagerServiceImpl(servers)); - } - - @Override public void start() { - } - - @Override public void notifyAfterCompleted() { - servers.values().forEach(server -> { - try { - server.start(); - } catch (ServerException e) { - logger.error(e.getMessage(), e); - } - }); - } - - @Override public String[] requiredModules() { - return new String[0]; - } -} diff --git a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/src/main/java/org/apache/skywalking/apm/collector/jetty/manager/service/JettyManagerServiceImpl.java b/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/src/main/java/org/apache/skywalking/apm/collector/jetty/manager/service/JettyManagerServiceImpl.java deleted file mode 100644 index 454d51c6e0d73170ef2ac1e1e37d3b3d24b4d174..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/src/main/java/org/apache/skywalking/apm/collector/jetty/manager/service/JettyManagerServiceImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.jetty.manager.service; - -import java.util.Map; -import org.apache.skywalking.apm.collector.core.UnexpectedException; -import org.apache.skywalking.apm.collector.server.ServerException; -import org.apache.skywalking.apm.collector.server.jetty.JettyHandler; -import org.apache.skywalking.apm.collector.server.jetty.JettyServer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class JettyManagerServiceImpl implements JettyManagerService { - - private static final Logger logger = LoggerFactory.getLogger(JettyManagerServiceImpl.class); - - private final Map servers; - - public JettyManagerServiceImpl(Map servers) { - this.servers = servers; - } - - @Override public JettyServer createIfAbsent(String host, int port, String contextPath) { - String id = host + String.valueOf(port); - if (servers.containsKey(id)) { - return servers.get(id); - } else { - JettyServer server = new JettyServer(host, port, contextPath); - try { - server.initialize(); - } catch (ServerException e) { - logger.error(e.getMessage(), e); - } - servers.put(id, server); - return server; - } - } - - @Override public void addHandler(String host, int port, JettyHandler serverHandler) { - String id = host + String.valueOf(port); - if (servers.containsKey(id)) { - servers.get(id).addHandler(serverHandler); - } else { - throw new UnexpectedException("Please create server before add server handler."); - } - } -} diff --git a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index 077444150f9f795c775f1f0db91f760e565591a6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.jetty.manager.JettyManagerProvider diff --git a/apm-collector/apm-collector-jetty-manager/pom.xml b/apm-collector/apm-collector-jetty-manager/pom.xml deleted file mode 100644 index 886e9cf3e71be18559521d929aa69542fbb32564..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-jetty-manager/pom.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - apm-collector - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - apm-collector-jetty-manager - pom - - collector-jetty-manager-define - collector-jetty-manager-provider - - - - - org.apache.skywalking - apm-collector-core - ${project.version} - - - org.apache.skywalking - server-component - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-naming/collector-naming-define/pom.xml b/apm-collector/apm-collector-naming/collector-naming-define/pom.xml deleted file mode 100644 index eb8eca37f7aa01014ed23a686e6d5f01c550b066..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-naming/collector-naming-define/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - apm-collector-naming - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-naming-define - jar - \ No newline at end of file diff --git a/apm-collector/apm-collector-naming/collector-naming-define/src/main/java/org/apache/skywalking/apm/collector/naming/NamingModule.java b/apm-collector/apm-collector-naming/collector-naming-define/src/main/java/org/apache/skywalking/apm/collector/naming/NamingModule.java deleted file mode 100644 index 1be5377d9663082f529ef53f62c3b001760bb584..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-naming/collector-naming-define/src/main/java/org/apache/skywalking/apm/collector/naming/NamingModule.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.naming; - -import org.apache.skywalking.apm.collector.core.module.Service; -import org.apache.skywalking.apm.collector.naming.service.NamingHandlerRegisterService; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; - -/** - * @author peng-yongsheng - */ -public class NamingModule extends ModuleDefine { - - public static final String NAME = "naming"; - - @Override public String name() { - return NAME; - } - - @Override public Class[] services() { - return new Class[] {NamingHandlerRegisterService.class}; - } -} diff --git a/apm-collector/apm-collector-naming/collector-naming-define/src/main/java/org/apache/skywalking/apm/collector/naming/service/NamingHandlerRegisterService.java b/apm-collector/apm-collector-naming/collector-naming-define/src/main/java/org/apache/skywalking/apm/collector/naming/service/NamingHandlerRegisterService.java deleted file mode 100644 index abaf40ccc5304da1678f4c27dff5cb6bff323286..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-naming/collector-naming-define/src/main/java/org/apache/skywalking/apm/collector/naming/service/NamingHandlerRegisterService.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.naming.service; - -import org.apache.skywalking.apm.collector.core.module.Service; -import org.apache.skywalking.apm.collector.server.ServerHandler; - -/** - * @author peng-yongsheng - */ -public interface NamingHandlerRegisterService extends Service { - void register(ServerHandler namingHandler); -} diff --git a/apm-collector/apm-collector-naming/collector-naming-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-naming/collector-naming-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine deleted file mode 100644 index 71c245ff3569cd8c5fe0e4cc57e7ce05c75ff1ac..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-naming/collector-naming-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.naming.NamingModule diff --git a/apm-collector/apm-collector-naming/collector-naming-jetty-provider/pom.xml b/apm-collector/apm-collector-naming/collector-naming-jetty-provider/pom.xml deleted file mode 100644 index 1f45f224baf6837a415633bcee60f2d18725ffe1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-naming/collector-naming-jetty-provider/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - apm-collector-naming - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-naming-jetty-provider - jar - - - - org.apache.skywalking - collector-naming-define - ${project.version} - - - org.apache.skywalking - collector-jetty-manager-define - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/naming/jetty/NamingModuleJettyConfig.java b/apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/naming/jetty/NamingModuleJettyConfig.java deleted file mode 100644 index 2f0117f953d1723c2acdb6826c0879fa1c2eedfd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/naming/jetty/NamingModuleJettyConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.naming.jetty; - -import org.apache.skywalking.apm.collector.server.jetty.JettyServerConfig; - -/** - * @author peng-yongsheng - */ -class NamingModuleJettyConfig extends JettyServerConfig { -} diff --git a/apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/naming/jetty/NamingModuleJettyProvider.java b/apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/naming/jetty/NamingModuleJettyProvider.java deleted file mode 100644 index 09a46562cc29ca5439ea52e36de0b1f5c972a55e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/naming/jetty/NamingModuleJettyProvider.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.naming.jetty; - -import org.apache.skywalking.apm.collector.cluster.ClusterModule; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; -import org.apache.skywalking.apm.collector.jetty.manager.JettyManagerModule; -import org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService; -import org.apache.skywalking.apm.collector.naming.NamingModule; -import org.apache.skywalking.apm.collector.naming.jetty.service.NamingJettyHandlerRegisterService; -import org.apache.skywalking.apm.collector.naming.service.NamingHandlerRegisterService; - -/** - * @author peng-yongsheng - */ -public class NamingModuleJettyProvider extends ModuleProvider { - - private final NamingModuleJettyConfig config; - - public NamingModuleJettyProvider() { - super(); - this.config = new NamingModuleJettyConfig(); - } - - @Override public String name() { - return "jetty"; - } - - @Override public Class module() { - return NamingModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() throws ServiceNotProvidedException { - this.registerServiceImplementation(NamingHandlerRegisterService.class, new NamingJettyHandlerRegisterService(config.getHost(), config.getPort(), getManager())); - } - - @Override public void start() { - JettyManagerService managerService = getManager().find(JettyManagerModule.NAME).getService(JettyManagerService.class); - managerService.createIfAbsent(config.getHost(), config.getPort(), config.getContextPath()); - } - - @Override public void notifyAfterCompleted() { - } - - @Override public String[] requiredModules() { - return new String[] {ClusterModule.NAME, JettyManagerModule.NAME}; - } -} diff --git a/apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/naming/jetty/service/NamingJettyHandlerRegisterService.java b/apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/naming/jetty/service/NamingJettyHandlerRegisterService.java deleted file mode 100644 index 0c7157ca7f8eaba159aeef4150efc6b6aed941f6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/naming/jetty/service/NamingJettyHandlerRegisterService.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.naming.jetty.service; - -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.jetty.manager.JettyManagerModule; -import org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService; -import org.apache.skywalking.apm.collector.naming.service.NamingHandlerRegisterService; -import org.apache.skywalking.apm.collector.server.ServerHandler; -import org.apache.skywalking.apm.collector.server.jetty.JettyHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class NamingJettyHandlerRegisterService implements NamingHandlerRegisterService { - - private static final Logger logger = LoggerFactory.getLogger(NamingJettyHandlerRegisterService.class); - - private final ModuleManager moduleManager; - private final String host; - private final int port; - - public NamingJettyHandlerRegisterService(String host, int port, ModuleManager moduleManager) { - this.moduleManager = moduleManager; - this.host = host; - this.port = port; - } - - @Override - public void register(ServerHandler namingHandler) { - if (!(namingHandler instanceof JettyHandler)) { - throw new IllegalArgumentException("NamingJettyHandlerRegisterService support JettyHandler only."); - } - JettyManagerService managerService = moduleManager.find(JettyManagerModule.NAME).getService(JettyManagerService.class); - managerService.addHandler(this.host, this.port, (JettyHandler)namingHandler); - } -} diff --git a/apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index cf1d59997284fd18f3309489ddc4d38d582c29a8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-naming/collector-naming-jetty-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.naming.jetty.NamingModuleJettyProvider diff --git a/apm-collector/apm-collector-naming/pom.xml b/apm-collector/apm-collector-naming/pom.xml deleted file mode 100644 index bc664b9fb29b100538d7c89c5d452f1f4a3b5d55..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-naming/pom.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - apm-collector - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - apm-collector-naming - pom - - collector-naming-define - collector-naming-jetty-provider - - - - - org.apache.skywalking - apm-collector-core - ${project.version} - - - org.apache.skywalking - collector-cluster-define - ${project.version} - - - org.apache.skywalking - server-component - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-remote/collector-remote-define/pom.xml b/apm-collector/apm-collector-remote/collector-remote-define/pom.xml deleted file mode 100644 index ed6a2078b8ecbea14c4bcbc06f07ed0aaba37279..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-define/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - apm-collector-remote - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-remote-define - jar - \ No newline at end of file diff --git a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/RemoteException.java b/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/RemoteException.java deleted file mode 100644 index 6dadb6160cda2f58ac692196e47009fd0e4d9197..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/RemoteException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote; - -import org.apache.skywalking.apm.collector.core.CollectorException; - -/** - * @author peng-yongsheng - */ -public abstract class RemoteException extends CollectorException { - - public RemoteException(String message) { - super(message); - } - - public RemoteException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/RemoteModule.java b/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/RemoteModule.java deleted file mode 100644 index 646cfc3b6a281958143e54403821689124b2e962..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/RemoteModule.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote; - -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; - -/** - * @author peng-yongsheng - */ -public class RemoteModule extends ModuleDefine { - - public static final String NAME = "remote"; - - @Override public String name() { - return NAME; - } - - @Override public Class[] services() { - return new Class[] {RemoteSenderService.class, RemoteDataRegisterService.class}; - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/RoutingRule.java b/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/RoutingRule.java deleted file mode 100644 index 7420f06254368a3f4b0eee27bd8920b0f1ce8fd6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/RoutingRule.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote; - -/** - * @author peng-yongsheng - */ -public enum RoutingRule { - HashCode, ForeverFirst -} diff --git a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/CommonRemoteDataRegisterService.java b/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/CommonRemoteDataRegisterService.java deleted file mode 100644 index 8f60ffc8d59dd200e11f8b0a0d14b1b21b84ca37..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/CommonRemoteDataRegisterService.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.service; - -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.core.data.RemoteData; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class CommonRemoteDataRegisterService implements RemoteDataRegisterService, RemoteDataIDGetter, RemoteDataInstanceCreatorGetter { - - private static final Logger logger = LoggerFactory.getLogger(CommonRemoteDataRegisterService.class); - - private Integer id; - private final Map, Integer> dataClassMapping; - private final Map dataInstanceCreatorMapping; - - public CommonRemoteDataRegisterService() { - this.id = 1; - this.dataClassMapping = new HashMap<>(); - this.dataInstanceCreatorMapping = new HashMap<>(); - } - - @Override public void register(Class dataClass, RemoteDataInstanceCreator instanceCreator) { - if (!dataClassMapping.containsKey(dataClass)) { - dataClassMapping.put(dataClass, this.id); - dataInstanceCreatorMapping.put(this.id, instanceCreator); - this.id++; - } else { - logger.warn("The data class {} was registered.", dataClass.getName()); - } - } - - @Override - public Integer getRemoteDataId(Class dataClass) throws RemoteDataMappingIdNotFoundException { - if (dataClassMapping.containsKey(dataClass)) { - return dataClassMapping.get(dataClass); - } else { - throw new RemoteDataMappingIdNotFoundException("Could not found the id of remote data class " + dataClass.getName()); - } - } - - @Override public RemoteDataInstanceCreator getInstanceCreator( - Integer remoteDataId) throws RemoteDataInstanceCreatorNotFoundException { - if (dataInstanceCreatorMapping.containsKey(remoteDataId)) { - return dataInstanceCreatorMapping.get(remoteDataId); - } else { - throw new RemoteDataInstanceCreatorNotFoundException("Could not found the instance creator of remote data id " + remoteDataId); - } - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteClient.java b/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteClient.java deleted file mode 100644 index 153eaba16bffcdc8762fc2a3f50a290f267f96ec..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteClient.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.service; - -import org.apache.skywalking.apm.collector.core.data.RemoteData; - -/** - * @author peng-yongsheng - */ -public interface RemoteClient extends Comparable { - String getAddress(); - - void push(int graphId, int nodeId, RemoteData data); - - boolean equals(String address); -} diff --git a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteClientService.java b/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteClientService.java deleted file mode 100644 index 5706ef1edcfca64d70c550ab047dded817874c0b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteClientService.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.service; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface RemoteClientService extends Service { - RemoteClient create(String host, int port, int channelSize, int bufferSize); -} diff --git a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteDataIDGetter.java b/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteDataIDGetter.java deleted file mode 100644 index 8e993dcf173b6e817bdeed6e47a5172bfa0dbec0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteDataIDGetter.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.service; - -import org.apache.skywalking.apm.collector.core.data.RemoteData; - -/** - * @author peng-yongsheng - */ -public interface RemoteDataIDGetter { - Integer getRemoteDataId(Class dataClass) throws RemoteDataMappingIdNotFoundException; -} diff --git a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteDataInstanceCreatorGetter.java b/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteDataInstanceCreatorGetter.java deleted file mode 100644 index 82eac5635d55d6c054bdc7955ebdf230fe59ad61..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteDataInstanceCreatorGetter.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.service; - -/** - * @author peng-yongsheng - */ -public interface RemoteDataInstanceCreatorGetter { - RemoteDataRegisterService.RemoteDataInstanceCreator getInstanceCreator( - Integer remoteDataId) throws RemoteDataInstanceCreatorNotFoundException; -} diff --git a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteDataInstanceCreatorNotFoundException.java b/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteDataInstanceCreatorNotFoundException.java deleted file mode 100644 index 998b8b4ef6d416f46acf3f2accecec82d948ae2f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteDataInstanceCreatorNotFoundException.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.service; - -import org.apache.skywalking.apm.collector.remote.RemoteException; - -/** - * @author peng-yongsheng - */ -public class RemoteDataInstanceCreatorNotFoundException extends RemoteException { - public RemoteDataInstanceCreatorNotFoundException(String message) { - super(message); - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteDataMappingIdNotFoundException.java b/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteDataMappingIdNotFoundException.java deleted file mode 100644 index e1819d670897ab3036a62919a5a021f1024f13dc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteDataMappingIdNotFoundException.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.service; - -import org.apache.skywalking.apm.collector.remote.RemoteException; - -/** - * @author peng-yongsheng - */ -public class RemoteDataMappingIdNotFoundException extends RemoteException { - public RemoteDataMappingIdNotFoundException(String message) { - super(message); - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteDataRegisterService.java b/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteDataRegisterService.java deleted file mode 100644 index 133413c22e5360535bcda6641568becb39b61b3f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteDataRegisterService.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.service; - -import org.apache.skywalking.apm.collector.core.data.RemoteData; -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface RemoteDataRegisterService extends Service { - void register(Class dataClass, RemoteDataInstanceCreator instanceCreator); - - interface RemoteDataInstanceCreator { - REMOTE_DATA createInstance(); - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteDeserializeService.java b/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteDeserializeService.java deleted file mode 100644 index ef6ad0cf89b86ecdd811ab041c3e0d97960d0a1d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteDeserializeService.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.service; - -/** - * @author peng-yongsheng - */ -public interface RemoteDeserializeService { - void deserialize(RemoteData remoteData, org.apache.skywalking.apm.collector.core.data.RemoteData data); -} diff --git a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteSenderService.java b/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteSenderService.java deleted file mode 100644 index e20fbad16696a3ad6d286f484c3e0331a516c64b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteSenderService.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.service; - -import org.apache.skywalking.apm.collector.core.data.RemoteData; -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface RemoteSenderService extends Service { - Mode send(int graphId, int nodeId, RemoteData remoteData, Selector selector); - - enum Mode { - Remote, Local - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteSerializeService.java b/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteSerializeService.java deleted file mode 100644 index d7b51064ed83bc0d335ce53799a2472113345567..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/RemoteSerializeService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.service; - -import org.apache.skywalking.apm.collector.core.data.RemoteData; - -/** - * @author peng-yongsheng - */ -public interface RemoteSerializeService { - Builder serialize(RemoteData data); -} diff --git a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/Selector.java b/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/Selector.java deleted file mode 100644 index 22237cb808954333f892bc287f6f62559c4f484f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-define/src/main/java/org/apache/skywalking/apm/collector/remote/service/Selector.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.service; - -/** - * @author peng-yongsheng - */ -public enum Selector { - HashCode, Rolling, ForeverFirst -} diff --git a/apm-collector/apm-collector-remote/collector-remote-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-remote/collector-remote-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine deleted file mode 100644 index d28444c2286401f70fa83e8236eed0f404060665..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.remote.RemoteModule diff --git a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/pom.xml b/apm-collector/apm-collector-remote/collector-remote-grpc-provider/pom.xml deleted file mode 100644 index d954d63728d59abe46a97367bc1e022281dae774..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/pom.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - apm-collector-remote - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-remote-grpc-provider - jar - - - 1.4.1.Final - 0.5.0 - - - - - org.apache.skywalking - collector-remote-define - ${project.version} - - - org.apache.skywalking - collector-grpc-manager-define - ${project.version} - - - org.apache.skywalking - apm-datacarrier - ${project.version} - - - - - - - kr.motd.maven - os-maven-plugin - ${os-maven-plugin.version} - - - - - org.xolstice.maven.plugins - protobuf-maven-plugin - ${protobuf-maven-plugin.version} - - - com.google.protobuf:protoc:3.3.0:exe:${os.detected.classifier} - - grpc-java - io.grpc:protoc-gen-grpc-java:1.4.0:exe:${os.detected.classifier} - - - - - - compile - compile-custom - - - - - - - diff --git a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/RemoteModuleGRPCConfig.java b/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/RemoteModuleGRPCConfig.java deleted file mode 100644 index f3a2d2635e893af9fe02b6c7480624bbd8d9549b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/RemoteModuleGRPCConfig.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.grpc; - -import org.apache.skywalking.apm.collector.client.grpc.GRPCClientConfig; - -/** - * @author peng-yongsheng - */ -class RemoteModuleGRPCConfig extends GRPCClientConfig { - - private int channelSize; - private int bufferSize; - - public int getChannelSize() { - return channelSize; - } - - public void setChannelSize(int channelSize) { - this.channelSize = channelSize; - } - - public int getBufferSize() { - return bufferSize; - } - - public void setBufferSize(int bufferSize) { - this.bufferSize = bufferSize; - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/RemoteModuleGRPCProvider.java b/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/RemoteModuleGRPCProvider.java deleted file mode 100644 index 2c7866a2cac430f913777b4f052d985bf12e1b7f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/RemoteModuleGRPCProvider.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.grpc; - -import org.apache.skywalking.apm.collector.cluster.ClusterModule; -import org.apache.skywalking.apm.collector.cluster.service.ModuleListenerService; -import org.apache.skywalking.apm.collector.cluster.service.ModuleRegisterService; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; -import org.apache.skywalking.apm.collector.grpc.manager.GRPCManagerModule; -import org.apache.skywalking.apm.collector.grpc.manager.service.GRPCManagerService; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.grpc.handler.RemoteCommonServiceHandler; -import org.apache.skywalking.apm.collector.remote.grpc.service.GRPCRemoteSenderService; -import org.apache.skywalking.apm.collector.remote.service.CommonRemoteDataRegisterService; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.server.grpc.GRPCServer; - -/** - * @author peng-yongsheng - */ -public class RemoteModuleGRPCProvider extends ModuleProvider { - - private final RemoteModuleGRPCConfig config; - public static final String NAME = "gRPC"; - - private GRPCRemoteSenderService remoteSenderService; - private CommonRemoteDataRegisterService remoteDataRegisterService; - - public RemoteModuleGRPCProvider() { - super(); - this.config = new RemoteModuleGRPCConfig(); - } - - @Override public String name() { - return NAME; - } - - @Override public Class module() { - return RemoteModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() throws ServiceNotProvidedException { - Integer channelSize = config.getChannelSize() == 0 ? 5 : config.getChannelSize(); - Integer bufferSize = config.getBufferSize() == 0 ? 1000 : config.getBufferSize(); - - remoteDataRegisterService = new CommonRemoteDataRegisterService(); - remoteSenderService = new GRPCRemoteSenderService(config.getHost(), config.getPort(), channelSize, bufferSize, remoteDataRegisterService); - this.registerServiceImplementation(RemoteSenderService.class, remoteSenderService); - this.registerServiceImplementation(RemoteDataRegisterService.class, remoteDataRegisterService); - } - - @Override public void start() throws ServiceNotProvidedException { - GRPCManagerService managerService = getManager().find(GRPCManagerModule.NAME).getService(GRPCManagerService.class); - GRPCServer gRPCServer = managerService.createIfAbsent(config.getHost(), config.getPort()); - gRPCServer.addHandler(new RemoteCommonServiceHandler(remoteDataRegisterService)); - - ModuleRegisterService moduleRegisterService = getManager().find(ClusterModule.NAME).getService(ModuleRegisterService.class); - moduleRegisterService.register(RemoteModule.NAME, this.name(), new RemoteModuleGRPCRegistration(config.getHost(), config.getPort())); - - ModuleListenerService moduleListenerService = getManager().find(ClusterModule.NAME).getService(ModuleListenerService.class); - moduleListenerService.addListener(remoteSenderService); - } - - @Override public void notifyAfterCompleted() { - } - - @Override public String[] requiredModules() { - return new String[] {ClusterModule.NAME, GRPCManagerModule.NAME}; - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/RemoteModuleGRPCRegistration.java b/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/RemoteModuleGRPCRegistration.java deleted file mode 100644 index fa0c979f16d4b1fb9269d03bb96f8552d522763c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/RemoteModuleGRPCRegistration.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.grpc; - -import org.apache.skywalking.apm.collector.cluster.ModuleRegistration; -import org.apache.skywalking.apm.collector.core.util.Const; - -/** - * @author peng-yongsheng - */ -public class RemoteModuleGRPCRegistration extends ModuleRegistration { - - private final String host; - private final int port; - - public RemoteModuleGRPCRegistration(String host, int port) { - this.host = host; - this.port = port; - } - - @Override public Value buildValue() { - return new Value(host, port, Const.EMPTY_STRING); - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/handler/RemoteCommonServiceHandler.java b/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/handler/RemoteCommonServiceHandler.java deleted file mode 100644 index 876bb5f173a424bf7549bc7e6942bc020ad111a0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/handler/RemoteCommonServiceHandler.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.grpc.handler; - -import io.grpc.stub.StreamObserver; -import org.apache.skywalking.apm.collector.core.graph.GraphManager; -import org.apache.skywalking.apm.collector.core.graph.Next; -import org.apache.skywalking.apm.collector.remote.grpc.proto.Empty; -import org.apache.skywalking.apm.collector.remote.grpc.proto.RemoteCommonServiceGrpc; -import org.apache.skywalking.apm.collector.remote.grpc.proto.RemoteData; -import org.apache.skywalking.apm.collector.remote.grpc.proto.RemoteMessage; -import org.apache.skywalking.apm.collector.remote.grpc.service.GRPCRemoteDeserializeService; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataInstanceCreatorGetter; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataInstanceCreatorNotFoundException; -import org.apache.skywalking.apm.collector.server.grpc.GRPCHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class RemoteCommonServiceHandler extends RemoteCommonServiceGrpc.RemoteCommonServiceImplBase implements GRPCHandler { - - private static final Logger logger = LoggerFactory.getLogger(RemoteCommonServiceHandler.class); - - private final RemoteDataInstanceCreatorGetter instanceCreatorGetter; - private final GRPCRemoteDeserializeService service; - - public RemoteCommonServiceHandler(RemoteDataInstanceCreatorGetter instanceCreatorGetter) { - this.instanceCreatorGetter = instanceCreatorGetter; - this.service = new GRPCRemoteDeserializeService(); - } - - @SuppressWarnings("unchecked") - @Override public StreamObserver call(StreamObserver responseObserver) { - return new StreamObserver() { - @Override public void onNext(RemoteMessage message) { - int graphId = message.getGraphId(); - int nodeId = message.getNodeId(); - int remoteDataId = message.getRemoteDataId(); - RemoteData remoteData = message.getRemoteData(); - - try { - org.apache.skywalking.apm.collector.core.data.RemoteData output = instanceCreatorGetter.getInstanceCreator(remoteDataId).createInstance(); - service.deserialize(remoteData, output); - Next next = GraphManager.INSTANCE.findGraph(graphId).toFinder().findNext(nodeId); - next.execute(output); - } catch (RemoteDataInstanceCreatorNotFoundException e) { - logger.error(e.getMessage(), e); - } - } - - @Override public void onError(Throwable throwable) { - logger.error(throwable.getMessage(), throwable); - } - - @Override public void onCompleted() { - responseObserver.onNext(Empty.newBuilder().build()); - responseObserver.onCompleted(); - } - }; - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/GRPCRemoteClient.java b/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/GRPCRemoteClient.java deleted file mode 100644 index dcb2a13cfcd52246f8048d0ca006b533d9daea2b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/GRPCRemoteClient.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.grpc.service; - -import io.grpc.stub.StreamObserver; -import java.util.List; -import org.apache.skywalking.apm.collector.client.grpc.GRPCClient; -import org.apache.skywalking.apm.collector.remote.grpc.proto.Empty; -import org.apache.skywalking.apm.collector.remote.grpc.proto.RemoteCommonServiceGrpc; -import org.apache.skywalking.apm.collector.remote.grpc.proto.RemoteMessage; -import org.apache.skywalking.apm.collector.remote.service.RemoteClient; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataIDGetter; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataMappingIdNotFoundException; -import org.apache.skywalking.apm.commons.datacarrier.DataCarrier; -import org.apache.skywalking.apm.commons.datacarrier.buffer.BufferStrategy; -import org.apache.skywalking.apm.commons.datacarrier.consumer.IConsumer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class GRPCRemoteClient implements RemoteClient { - - private static final Logger logger = LoggerFactory.getLogger(GRPCRemoteClient.class); - - private final GRPCRemoteSerializeService service; - private final GRPCClient client; - private final DataCarrier carrier; - private final String address; - private final RemoteDataIDGetter remoteDataIDGetter; - - GRPCRemoteClient(GRPCClient client, RemoteDataIDGetter remoteDataIDGetter, int channelSize, int bufferSize) { - this.address = client.toString(); - this.client = client; - this.service = new GRPCRemoteSerializeService(); - this.remoteDataIDGetter = remoteDataIDGetter; - this.carrier = new DataCarrier<>(channelSize, bufferSize); - this.carrier.setBufferStrategy(BufferStrategy.BLOCKING); - this.carrier.consume(new RemoteMessageConsumer(), 1); - } - - @Override public final String getAddress() { - return this.address; - } - - @Override public void push(int graphId, int nodeId, org.apache.skywalking.apm.collector.core.data.RemoteData data) { - try { - Integer remoteDataId = remoteDataIDGetter.getRemoteDataId(data.getClass()); - RemoteMessage.Builder builder = RemoteMessage.newBuilder(); - builder.setGraphId(graphId); - builder.setNodeId(nodeId); - builder.setRemoteDataId(remoteDataId); - builder.setRemoteData(service.serialize(data)); - - this.carrier.produce(builder.build()); - } catch (RemoteDataMappingIdNotFoundException e) { - logger.error(e.getMessage(), e); - } - } - - class RemoteMessageConsumer implements IConsumer { - @Override public void init() { - } - - @Override public void consume(List remoteMessages) { - StreamObserver streamObserver = createStreamObserver(); - for (RemoteMessage remoteMessage : remoteMessages) { - streamObserver.onNext(remoteMessage); - } - streamObserver.onCompleted(); - } - - @Override public void onError(List remoteMessages, Throwable t) { - logger.error(t.getMessage(), t); - } - - @Override public void onExit() { - } - } - - private StreamObserver createStreamObserver() { - RemoteCommonServiceGrpc.RemoteCommonServiceStub stub = RemoteCommonServiceGrpc.newStub(client.getChannel()); - - StreamStatus status = new StreamStatus(false); - return stub.call(new StreamObserver() { - @Override public void onNext(Empty empty) { - } - - @Override public void onError(Throwable throwable) { - logger.error(throwable.getMessage(), throwable); - } - - @Override public void onCompleted() { - status.finished(); - } - }); - } - - class StreamStatus { - - private final Logger logger = LoggerFactory.getLogger(StreamStatus.class); - - private volatile boolean status; - - StreamStatus(boolean status) { - this.status = status; - } - - public boolean isFinish() { - return status; - } - - void finished() { - this.status = true; - } - - /** - * @param maxTimeout max wait time, milliseconds. - */ - public void wait4Finish(long maxTimeout) { - long time = 0; - while (!status) { - if (time > maxTimeout) { - break; - } - try2Sleep(5); - time += 5; - } - } - - /** - * Try to sleep, and ignore the {@link InterruptedException} - * - * @param millis the length of time to sleep in milliseconds - */ - private void try2Sleep(long millis) { - try { - Thread.sleep(millis); - } catch (InterruptedException e) { - logger.error(e.getMessage(), e); - } - } - } - - @Override public boolean equals(String address) { - return this.address.equals(address); - } - - @Override public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - - GRPCRemoteClient client = (GRPCRemoteClient)o; - - return address != null ? address.equals(client.address) : client.address == null; - } - - @Override public int hashCode() { - return address != null ? address.hashCode() : 0; - } - - @Override public int compareTo(RemoteClient o) { - return this.address.compareTo(o.getAddress()); - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/GRPCRemoteClientService.java b/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/GRPCRemoteClientService.java deleted file mode 100644 index 58aa87bb60a8a9a28699d49263fa6bec844eb090..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/GRPCRemoteClientService.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.grpc.service; - -import org.apache.skywalking.apm.collector.client.grpc.GRPCClient; -import org.apache.skywalking.apm.collector.remote.service.RemoteClient; -import org.apache.skywalking.apm.collector.remote.service.RemoteClientService; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataIDGetter; - -/** - * @author peng-yongsheng - */ -public class GRPCRemoteClientService implements RemoteClientService { - - private final RemoteDataIDGetter remoteDataIDGetter; - - GRPCRemoteClientService(RemoteDataIDGetter remoteDataIDGetter) { - this.remoteDataIDGetter = remoteDataIDGetter; - } - - @Override public RemoteClient create(String host, int port, int channelSize, int bufferSize) { - GRPCClient client = new GRPCClient(host, port); - client.initialize(); - return new GRPCRemoteClient(client, remoteDataIDGetter, channelSize, bufferSize); - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/GRPCRemoteDeserializeService.java b/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/GRPCRemoteDeserializeService.java deleted file mode 100644 index e2fe21aeca889ca5b2972d717005e3f21a43f064..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/GRPCRemoteDeserializeService.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.grpc.service; - -import org.apache.skywalking.apm.collector.remote.grpc.proto.RemoteData; -import org.apache.skywalking.apm.collector.remote.service.RemoteDeserializeService; - -/** - * @author peng-yongsheng - */ -public class GRPCRemoteDeserializeService implements RemoteDeserializeService { - - @Override - public void deserialize(RemoteData remoteData, org.apache.skywalking.apm.collector.core.data.RemoteData data) { - for (int i = 0; i < remoteData.getDataStringsCount(); i++) { - data.setDataString(i, remoteData.getDataStrings(i)); - } - - for (int i = 0; i < remoteData.getDataIntegersCount(); i++) { - data.setDataInteger(i, remoteData.getDataIntegers(i)); - } - - for (int i = 0; i < remoteData.getDataLongsCount(); i++) { - data.setDataLong(i, remoteData.getDataLongs(i)); - } - - for (int i = 0; i < remoteData.getDataDoublesCount(); i++) { - data.setDataDouble(i, remoteData.getDataDoubles(i)); - } - - for (int i = 0; i < remoteData.getDataStringListsCount(); i++) { - data.getDataStringList(i).addAll(remoteData.getDataStringLists(i).getValueList()); - } - - for (int i = 0; i < remoteData.getDataIntegerListsCount(); i++) { - data.getDataIntegerList(i).addAll(remoteData.getDataIntegerLists(i).getValueList()); - } - - for (int i = 0; i < remoteData.getDataLongListsCount(); i++) { - data.getDataLongList(i).addAll(remoteData.getDataLongLists(i).getValueList()); - } - - for (int i = 0; i < remoteData.getDataDoubleListsCount(); i++) { - data.getDataDoubleList(i).addAll(remoteData.getDataDoubleLists(i).getValueList()); - } - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/GRPCRemoteSenderService.java b/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/GRPCRemoteSenderService.java deleted file mode 100644 index 19fd37533c7ab9ca18ea50a3ee869d3b170c7494..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/GRPCRemoteSenderService.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.grpc.service; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import org.apache.skywalking.apm.collector.cluster.ClusterModuleListener; -import org.apache.skywalking.apm.collector.core.UnexpectedException; -import org.apache.skywalking.apm.collector.core.data.RemoteData; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.remote.grpc.RemoteModuleGRPCProvider; -import org.apache.skywalking.apm.collector.remote.grpc.service.selector.ForeverFirstSelector; -import org.apache.skywalking.apm.collector.remote.grpc.service.selector.HashCodeSelector; -import org.apache.skywalking.apm.collector.remote.grpc.service.selector.RollingSelector; -import org.apache.skywalking.apm.collector.remote.service.RemoteClient; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataIDGetter; -import org.apache.skywalking.apm.collector.remote.service.RemoteSenderService; -import org.apache.skywalking.apm.collector.remote.service.Selector; - -/** - * @author peng-yongsheng - */ -public class GRPCRemoteSenderService extends ClusterModuleListener implements RemoteSenderService { - - private static final String PATH = "/" + RemoteModule.NAME + "/" + RemoteModuleGRPCProvider.NAME; - private final GRPCRemoteClientService service; - private List remoteClients; - private final String selfAddress; - private final HashCodeSelector hashCodeSelector; - private final ForeverFirstSelector foreverFirstSelector; - private final RollingSelector rollingSelector; - private final int channelSize; - private final int bufferSize; - - @Override public Mode send(int graphId, int nodeId, RemoteData remoteData, Selector selector) { - RemoteClient remoteClient; - switch (selector) { - case HashCode: - remoteClient = hashCodeSelector.select(remoteClients, remoteData); - return sendToRemoteWhenNotSelf(remoteClient, graphId, nodeId, remoteData); - case Rolling: - remoteClient = rollingSelector.select(remoteClients, remoteData); - return sendToRemoteWhenNotSelf(remoteClient, graphId, nodeId, remoteData); - case ForeverFirst: - remoteClient = foreverFirstSelector.select(remoteClients, remoteData); - return sendToRemoteWhenNotSelf(remoteClient, graphId, nodeId, remoteData); - } - throw new UnexpectedException("Selector not match, Just support hash, rolling, forever first selector."); - } - - private Mode sendToRemoteWhenNotSelf(RemoteClient remoteClient, int graphId, int nodeId, RemoteData remoteData) { - if (remoteClient.equals(selfAddress)) { - return Mode.Local; - } else { - remoteClient.push(graphId, nodeId, remoteData); - return Mode.Remote; - } - } - - public GRPCRemoteSenderService(String host, int port, int channelSize, int bufferSize, - RemoteDataIDGetter remoteDataIDGetter) { - this.service = new GRPCRemoteClientService(remoteDataIDGetter); - this.remoteClients = new ArrayList<>(); - this.selfAddress = host + ":" + String.valueOf(port); - this.hashCodeSelector = new HashCodeSelector(); - this.foreverFirstSelector = new ForeverFirstSelector(); - this.rollingSelector = new RollingSelector(); - this.channelSize = channelSize; - this.bufferSize = bufferSize; - } - - @Override public String path() { - return PATH; - } - - @Override public synchronized void serverJoinNotify(String serverAddress) { - List newRemoteClients = new LinkedList<>(); - newRemoteClients.addAll(remoteClients); - - String host = serverAddress.split(":")[0]; - int port = Integer.parseInt(serverAddress.split(":")[1]); - RemoteClient remoteClient = service.create(host, port, channelSize, bufferSize); - newRemoteClients.add(remoteClient); - - Collections.sort(newRemoteClients); - - this.remoteClients = newRemoteClients; - } - - @Override public synchronized void serverQuitNotify(String serverAddress) { - List newRemoteClients = new LinkedList<>(); - newRemoteClients.addAll(remoteClients); - - for (int i = newRemoteClients.size() - 1; i >= 0; i--) { - RemoteClient remoteClient = newRemoteClients.get(i); - if (remoteClient.equals(serverAddress)) { - newRemoteClients.remove(i); - } - } - - this.remoteClients = newRemoteClients; - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/GRPCRemoteSerializeService.java b/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/GRPCRemoteSerializeService.java deleted file mode 100644 index 207bbdc774b97cba885ae97e66cf8c0ee014797e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/GRPCRemoteSerializeService.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.grpc.service; - -import org.apache.skywalking.apm.collector.core.util.*; -import org.apache.skywalking.apm.collector.remote.grpc.proto.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteSerializeService; - -/** - * @author peng-yongsheng - */ -public class GRPCRemoteSerializeService implements RemoteSerializeService { - - @Override public RemoteData.Builder serialize(org.apache.skywalking.apm.collector.core.data.RemoteData data) { - RemoteData.Builder remoteBuilder = RemoteData.newBuilder(); - for (int i = 0; i < data.getDataStringsCount(); i++) { - if (StringUtils.isNotEmpty(data.getDataString(i))) { - remoteBuilder.addDataStrings(data.getDataString(i)); - } else { - remoteBuilder.addDataStrings(Const.EMPTY_STRING); - } - } - - for (int i = 0; i < data.getDataIntegersCount(); i++) { - remoteBuilder.addDataIntegers(data.getDataInteger(i)); - } - - for (int i = 0; i < data.getDataLongsCount(); i++) { - remoteBuilder.addDataLongs(data.getDataLong(i)); - } - - for (int i = 0; i < data.getDataDoublesCount(); i++) { - remoteBuilder.addDataDoubles(data.getDataDouble(i)); - } - - for (int i = 0; i < data.getDataStringListsCount(); i++) { - StringList.Builder stringList = StringList.newBuilder(); - data.getDataStringList(i).forEach(stringList::addValue); - remoteBuilder.addDataStringLists(stringList); - } - - for (int i = 0; i < data.getDataLongListsCount(); i++) { - LongList.Builder longList = LongList.newBuilder(); - data.getDataLongList(i).forEach(longList::addValue); - remoteBuilder.addDataLongLists(longList); - } - - for (int i = 0; i < data.getDataIntegerListsCount(); i++) { - IntegerList.Builder integerList = IntegerList.newBuilder(); - data.getDataIntegerList(i).forEach(integerList::addValue); - remoteBuilder.addDataIntegerLists(integerList); - } - - for (int i = 0; i < data.getDataDoubleListsCount(); i++) { - DoubleList.Builder doubleList = DoubleList.newBuilder(); - data.getDataDoubleList(i).forEach(doubleList::addValue); - remoteBuilder.addDataDoubleLists(doubleList); - } - - return remoteBuilder; - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/selector/ForeverFirstSelector.java b/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/selector/ForeverFirstSelector.java deleted file mode 100644 index 86d0a6e2f63d0a47fb6bfef88944b3add9c3c18c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/selector/ForeverFirstSelector.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.grpc.service.selector; - -import java.util.List; -import org.apache.skywalking.apm.collector.core.data.RemoteData; -import org.apache.skywalking.apm.collector.remote.service.RemoteClient; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class ForeverFirstSelector implements RemoteClientSelector { - - private static final Logger logger = LoggerFactory.getLogger(ForeverFirstSelector.class); - - @Override public RemoteClient select(List clients, RemoteData remoteData) { - if (logger.isDebugEnabled()) { - logger.debug("clients size: {}", clients.size()); - } - return clients.get(0); - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/selector/HashCodeSelector.java b/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/selector/HashCodeSelector.java deleted file mode 100644 index ffdc3ae212d039e05165d2e4f2d8d2bbf50c48c1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/selector/HashCodeSelector.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.grpc.service.selector; - -import java.util.List; -import org.apache.skywalking.apm.collector.core.data.RemoteData; -import org.apache.skywalking.apm.collector.remote.service.RemoteClient; - -/** - * @author peng-yongsheng - */ -public class HashCodeSelector implements RemoteClientSelector { - - @Override public RemoteClient select(List clients, RemoteData remoteData) { - int size = clients.size(); - int selectIndex = Math.abs(remoteData.selectKey().hashCode()) % size; - return clients.get(selectIndex); - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/selector/RemoteClientSelector.java b/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/selector/RemoteClientSelector.java deleted file mode 100644 index 51137d1b6170349f6c910fdaecdc75befe4e3b74..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/selector/RemoteClientSelector.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.grpc.service.selector; - -import java.util.List; -import org.apache.skywalking.apm.collector.core.data.RemoteData; -import org.apache.skywalking.apm.collector.remote.service.RemoteClient; - -/** - * @author peng-yongsheng - */ -public interface RemoteClientSelector { - RemoteClient select(List clients, RemoteData remoteData); -} diff --git a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/selector/RollingSelector.java b/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/selector/RollingSelector.java deleted file mode 100644 index 3a242c5967b19b9ea475adc5c9ff5e4107262aea..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/remote/grpc/service/selector/RollingSelector.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.remote.grpc.service.selector; - -import java.util.List; -import org.apache.skywalking.apm.collector.core.data.RemoteData; -import org.apache.skywalking.apm.collector.remote.service.RemoteClient; - -/** - * @author peng-yongsheng - */ -public class RollingSelector implements RemoteClientSelector { - - private int index = 0; - - @Override public RemoteClient select(List clients, RemoteData remoteData) { - int size = clients.size(); - index++; - int selectIndex = Math.abs(index) % size; - return clients.get(selectIndex); - } -} diff --git a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/proto/RemoteCommonService.proto b/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/proto/RemoteCommonService.proto deleted file mode 100644 index 04dcf46c41fad23d92fedaf15865edac9c0a3882..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/proto/RemoteCommonService.proto +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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. - * - */ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "org.apache.skywalking.apm.collector.remote.grpc.proto"; - -service RemoteCommonService { - rpc call (stream RemoteMessage) returns (Empty) { - } -} - -message RemoteMessage { - int32 graphId = 1; - int32 nodeId = 2; - int32 remoteDataId = 3; - RemoteData remoteData = 4; -} - -message RemoteData { - repeated string dataStrings = 1; - repeated int64 dataLongs = 2; - repeated double dataDoubles = 3; - repeated int32 dataIntegers = 4; - repeated bool dataBooleans = 5; - repeated StringList dataStringLists = 6; - repeated LongList dataLongLists = 7; - repeated DoubleList dataDoubleLists = 8; - repeated IntegerList dataIntegerLists = 9; -} - -message Empty { -} - -message StringList { - repeated string value = 1; -} - -message LongList { - repeated int64 value = 1; -} - -message DoubleList { - repeated double value = 1; -} - -message IntegerList { - repeated int32 value = 1; -} \ No newline at end of file diff --git a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index 42e51b95e01e03241dafbf6c17d7746ce90b2f56..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.remote.grpc.RemoteModuleGRPCProvider diff --git a/apm-collector/apm-collector-remote/collector-remote-kafka-provider/pom.xml b/apm-collector/apm-collector-remote/collector-remote-kafka-provider/pom.xml deleted file mode 100644 index 0100df6e267b7e06af38aab0f884c97877f505aa..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/collector-remote-kafka-provider/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - apm-collector-remote - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-remote-kafka-provider - jar - - - - org.apache.skywalking - collector-remote-define - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-remote/pom.xml b/apm-collector/apm-collector-remote/pom.xml deleted file mode 100644 index 4df5b8daa0aa945b1fb2f00f9cc9047413120e3c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-remote/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - apm-collector - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - apm-collector-remote - pom - - collector-remote-define - collector-remote-kafka-provider - collector-remote-grpc-provider - - - - - org.apache.skywalking - apm-collector-core - ${project.version} - - - org.apache.skywalking - collector-cluster-define - ${project.version} - - - org.apache.skywalking - client-component - ${project.version} - - - org.apache.skywalking - server-component - ${project.version} - - - \ No newline at end of file diff --git a/apm-collector/apm-collector-storage/collector-storage-define/pom.xml b/apm-collector/apm-collector-storage/collector-storage-define/pom.xml deleted file mode 100644 index 571e9cd48ee7350061ce7fffb30210c8b72ab48d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - apm-collector-storage - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-storage-define - jar - diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/StorageException.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/StorageException.java deleted file mode 100644 index efd0dad3976f5514378e326f6d7edcf281eeceb4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/StorageException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage; - -import org.apache.skywalking.apm.collector.core.CollectorException; - -/** - * @author peng-yongsheng - */ -public abstract class StorageException extends CollectorException { - - public StorageException(String message) { - super(message); - } - - public StorageException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/StorageInstallException.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/StorageInstallException.java deleted file mode 100644 index 4f99bfed7e3b7282152b07a585657f73706a59f9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/StorageInstallException.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage; - -/** - * @author peng-yongsheng - */ -public class StorageInstallException extends StorageException { - - public StorageInstallException(String message) { - super(message); - } - - public StorageInstallException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/StorageInstaller.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/StorageInstaller.java deleted file mode 100644 index 3ad986d12ae811fbc7b96ea6c756fc4919cb0c23..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/StorageInstaller.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage; - -import java.util.List; -import org.apache.skywalking.apm.collector.client.Client; -import org.apache.skywalking.apm.collector.core.data.StorageDefineLoader; -import org.apache.skywalking.apm.collector.core.data.TableDefine; -import org.apache.skywalking.apm.collector.core.define.DefineException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public abstract class StorageInstaller { - - private final Logger logger = LoggerFactory.getLogger(StorageInstaller.class); - - private final boolean isHighPerformanceMode; - - public StorageInstaller(boolean isHighPerformanceMode) { - this.isHighPerformanceMode = isHighPerformanceMode; - } - - public final void install(Client client) throws StorageException { - StorageDefineLoader defineLoader = new StorageDefineLoader(); - try { - List tableDefines = defineLoader.load(); - defineFilter(tableDefines); - Boolean debug = System.getProperty("debug") != null; - - for (TableDefine tableDefine : tableDefines) { - tableDefine.initialize(); - settingHighPerformance(tableDefine); - if (!isExists(client, tableDefine)) { - logger.info("table: {} not exists", tableDefine.getName()); - createTable(client, tableDefine); - } else if (debug) { - logger.info("table: {} exists", tableDefine.getName()); - deleteTable(client, tableDefine); - createTable(client, tableDefine); - } - columnCheck(client, tableDefine); - } - } catch (DefineException e) { - throw new StorageInstallException(e.getMessage(), e); - } - } - - private void settingHighPerformance(TableDefine tableDefine) { - tableDefine.getColumnDefines().forEach(column -> { - if (isHighPerformanceMode) { - column.getColumnName().useShortName(); - } - }); - } - - protected abstract void defineFilter(List tableDefines); - - protected abstract boolean isExists(Client client, TableDefine tableDefine) throws StorageException; - - protected abstract void columnCheck(Client client, TableDefine tableDefine) throws StorageException; - - protected abstract void deleteTable(Client client, TableDefine tableDefine) throws StorageException; - - protected abstract void createTable(Client client, TableDefine tableDefine) throws StorageException; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/StorageModule.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/StorageModule.java deleted file mode 100644 index f78216ecfc098bee5a8bf9bfeffc3ca816ae91f2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/StorageModule.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage; - -import java.util.*; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; -import org.apache.skywalking.apm.collector.storage.base.dao.IBatchDAO; -import org.apache.skywalking.apm.collector.storage.dao.*; -import org.apache.skywalking.apm.collector.storage.dao.acp.*; -import org.apache.skywalking.apm.collector.storage.dao.alarm.*; -import org.apache.skywalking.apm.collector.storage.dao.amp.*; -import org.apache.skywalking.apm.collector.storage.dao.ampp.*; -import org.apache.skywalking.apm.collector.storage.dao.armp.*; -import org.apache.skywalking.apm.collector.storage.dao.cache.*; -import org.apache.skywalking.apm.collector.storage.dao.cpu.*; -import org.apache.skywalking.apm.collector.storage.dao.gc.*; -import org.apache.skywalking.apm.collector.storage.dao.imp.*; -import org.apache.skywalking.apm.collector.storage.dao.impp.*; -import org.apache.skywalking.apm.collector.storage.dao.irmp.*; -import org.apache.skywalking.apm.collector.storage.dao.memory.*; -import org.apache.skywalking.apm.collector.storage.dao.mpool.*; -import org.apache.skywalking.apm.collector.storage.dao.register.*; -import org.apache.skywalking.apm.collector.storage.dao.rtd.*; -import org.apache.skywalking.apm.collector.storage.dao.smp.*; -import org.apache.skywalking.apm.collector.storage.dao.srmp.*; -import org.apache.skywalking.apm.collector.storage.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.ttl.ITTLConfigService; - -/** - * @author peng-yongsheng - */ -public class StorageModule extends ModuleDefine { - - public static final String NAME = "storage"; - - @Override public String name() { - return NAME; - } - - @Override public Class[] services() { - List classes = new ArrayList<>(); - classes.add(IBatchDAO.class); - - classes.add(ITTLConfigService.class); - - addCacheDAO(classes); - addRegisterDAO(classes); - addPersistenceDAO(classes); - addUiDAO(classes); - addAlarmDAO(classes); - - return classes.toArray(new Class[] {}); - } - - private void addCacheDAO(List classes) { - classes.add(IApplicationCacheDAO.class); - classes.add(IInstanceCacheDAO.class); - classes.add(IServiceNameCacheDAO.class); - classes.add(INetworkAddressCacheDAO.class); - } - - private void addRegisterDAO(List classes) { - classes.add(IApplicationRegisterDAO.class); - classes.add(IInstanceRegisterDAO.class); - classes.add(IServiceNameRegisterDAO.class); - classes.add(INetworkAddressRegisterDAO.class); - } - - private void addPersistenceDAO(List classes) { - classes.add(ICpuMinuteMetricPersistenceDAO.class); - classes.add(ICpuHourMetricPersistenceDAO.class); - classes.add(ICpuDayMetricPersistenceDAO.class); - classes.add(ICpuMonthMetricPersistenceDAO.class); - - classes.add(IGCMinuteMetricPersistenceDAO.class); - classes.add(IGCHourMetricPersistenceDAO.class); - classes.add(IGCDayMetricPersistenceDAO.class); - classes.add(IGCMonthMetricPersistenceDAO.class); - - classes.add(IMemoryMinuteMetricPersistenceDAO.class); - classes.add(IMemoryHourMetricPersistenceDAO.class); - classes.add(IMemoryDayMetricPersistenceDAO.class); - classes.add(IMemoryMonthMetricPersistenceDAO.class); - - classes.add(IMemoryPoolMinuteMetricPersistenceDAO.class); - classes.add(IMemoryPoolHourMetricPersistenceDAO.class); - classes.add(IMemoryPoolDayMetricPersistenceDAO.class); - classes.add(IMemoryPoolMonthMetricPersistenceDAO.class); - - classes.add(IApplicationComponentMinutePersistenceDAO.class); - classes.add(IApplicationComponentHourPersistenceDAO.class); - classes.add(IApplicationComponentDayPersistenceDAO.class); - classes.add(IApplicationComponentMonthPersistenceDAO.class); - - classes.add(IApplicationMappingMinutePersistenceDAO.class); - classes.add(IApplicationMappingHourPersistenceDAO.class); - classes.add(IApplicationMappingDayPersistenceDAO.class); - classes.add(IApplicationMappingMonthPersistenceDAO.class); - - classes.add(IInstanceMappingMinutePersistenceDAO.class); - classes.add(IInstanceMappingHourPersistenceDAO.class); - classes.add(IInstanceMappingDayPersistenceDAO.class); - classes.add(IInstanceMappingMonthPersistenceDAO.class); - - classes.add(IGlobalTracePersistenceDAO.class); - classes.add(ISegmentDurationPersistenceDAO.class); - classes.add(ISegmentPersistenceDAO.class); - classes.add(IInstanceHeartBeatPersistenceDAO.class); - classes.add(IServiceNameHeartBeatPersistenceDAO.class); - - classes.add(IResponseTimeDistributionMinutePersistenceDAO.class); - classes.add(IResponseTimeDistributionHourPersistenceDAO.class); - classes.add(IResponseTimeDistributionDayPersistenceDAO.class); - classes.add(IResponseTimeDistributionMonthPersistenceDAO.class); - - classes.add(IApplicationMinuteMetricPersistenceDAO.class); - classes.add(IApplicationHourMetricPersistenceDAO.class); - classes.add(IApplicationDayMetricPersistenceDAO.class); - classes.add(IApplicationMonthMetricPersistenceDAO.class); - - classes.add(IApplicationReferenceMinuteMetricPersistenceDAO.class); - classes.add(IApplicationReferenceHourMetricPersistenceDAO.class); - classes.add(IApplicationReferenceDayMetricPersistenceDAO.class); - classes.add(IApplicationReferenceMonthMetricPersistenceDAO.class); - - classes.add(IServiceMinuteMetricPersistenceDAO.class); - classes.add(IServiceHourMetricPersistenceDAO.class); - classes.add(IServiceDayMetricPersistenceDAO.class); - classes.add(IServiceMonthMetricPersistenceDAO.class); - - classes.add(IServiceReferenceMinuteMetricPersistenceDAO.class); - classes.add(IServiceReferenceHourMetricPersistenceDAO.class); - classes.add(IServiceReferenceDayMetricPersistenceDAO.class); - classes.add(IServiceReferenceMonthMetricPersistenceDAO.class); - - classes.add(IInstanceMinuteMetricPersistenceDAO.class); - classes.add(IInstanceHourMetricPersistenceDAO.class); - classes.add(IInstanceDayMetricPersistenceDAO.class); - classes.add(IInstanceMonthMetricPersistenceDAO.class); - - classes.add(IInstanceReferenceMinuteMetricPersistenceDAO.class); - classes.add(IInstanceReferenceHourMetricPersistenceDAO.class); - classes.add(IInstanceReferenceDayMetricPersistenceDAO.class); - classes.add(IInstanceReferenceMonthMetricPersistenceDAO.class); - } - - private void addUiDAO(List classes) { - classes.add(IInstanceUIDAO.class); - classes.add(INetworkAddressUIDAO.class); - classes.add(IServiceNameServiceUIDAO.class); - classes.add(IServiceMetricUIDAO.class); - - classes.add(ICpuMetricUIDAO.class); - classes.add(IGCMetricUIDAO.class); - classes.add(IMemoryMetricUIDAO.class); - - classes.add(IGlobalTraceUIDAO.class); - classes.add(IResponseTimeDistributionUIDAO.class); - classes.add(IInstanceMetricUIDAO.class); - classes.add(IApplicationComponentUIDAO.class); - classes.add(IApplicationMappingUIDAO.class); - classes.add(IApplicationMetricUIDAO.class); - classes.add(IApplicationReferenceMetricUIDAO.class); - classes.add(ISegmentDurationUIDAO.class); - classes.add(ISegmentUIDAO.class); - classes.add(IServiceReferenceMetricUIDAO.class); - - classes.add(IApplicationAlarmUIDAO.class); - classes.add(IInstanceAlarmUIDAO.class); - classes.add(IServiceAlarmUIDAO.class); - classes.add(IApplicationAlarmListUIDAO.class); - } - - private void addAlarmDAO(List classes) { - classes.add(IServiceReferenceAlarmPersistenceDAO.class); - classes.add(IServiceReferenceAlarmListPersistenceDAO.class); - classes.add(IInstanceReferenceAlarmPersistenceDAO.class); - classes.add(IInstanceReferenceAlarmListPersistenceDAO.class); - classes.add(IApplicationReferenceAlarmPersistenceDAO.class); - classes.add(IApplicationReferenceAlarmListPersistenceDAO.class); - - classes.add(IServiceAlarmPersistenceDAO.class); - classes.add(IServiceAlarmListPersistenceDAO.class); - classes.add(IInstanceAlarmPersistenceDAO.class); - classes.add(IInstanceAlarmListPersistenceDAO.class); - classes.add(IApplicationAlarmPersistenceDAO.class); - - classes.add(IApplicationAlarmListMinutePersistenceDAO.class); - classes.add(IApplicationAlarmListHourPersistenceDAO.class); - classes.add(IApplicationAlarmListDayPersistenceDAO.class); - classes.add(IApplicationAlarmListMonthPersistenceDAO.class); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/base/dao/AbstractDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/base/dao/AbstractDAO.java deleted file mode 100644 index 55e8e193aea6bf6843ee85a8de03c058fb16ce7e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/base/dao/AbstractDAO.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.base.dao; - -import org.apache.skywalking.apm.collector.client.Client; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractDAO implements DAO { - private final C client; - - public AbstractDAO(C client) { - this.client = client; - } - - public final C getClient() { - return client; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/base/dao/DAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/base/dao/DAO.java deleted file mode 100644 index d633415a7bd8ed4eddd9b62f624fa36cfe92a8e5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/base/dao/DAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.base.dao; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface DAO extends Service { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/base/dao/IBatchDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/base/dao/IBatchDAO.java deleted file mode 100644 index 2b1e335e30a4177c2d072b6b366e1978bbcd2f6a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/base/dao/IBatchDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.base.dao; - -import java.util.List; - -/** - * @author peng-yongsheng - */ -public interface IBatchDAO extends DAO { - void batchPersistence(List batchCollection); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/base/dao/IPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/base/dao/IPersistenceDAO.java deleted file mode 100644 index fcf1af45f2ddf9610e51f1246e53b73e144f5591..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/base/dao/IPersistenceDAO.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.base.dao; - -import java.io.IOException; -import org.apache.skywalking.apm.collector.core.data.StreamData; - -/** - * @author peng-yongsheng - */ -public interface IPersistenceDAO extends DAO { - - STREAM_DATA get(String id); - - INSERT prepareBatchInsert(STREAM_DATA data) throws IOException; - - UPDATE prepareBatchUpdate(STREAM_DATA data) throws IOException; - - void deleteHistory(Long timeBucketBefore); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/base/sql/SqlBuilder.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/base/sql/SqlBuilder.java deleted file mode 100644 index 8f3f9974ebaeb12809963cb082bb50d4ea208d69..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/base/sql/SqlBuilder.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.base.sql; - -import java.text.MessageFormat; -import java.util.*; - -/** - * @author peng-yongsheng, clevertension - */ -public class SqlBuilder { - public static String buildSql(String sql, Object... args) { - return MessageFormat.format(sql, args); - } - - public static String buildSql(String sql, List args) { - MessageFormat messageFormat = new MessageFormat(sql); - return messageFormat.format(args.toArray(new Object[0])); - } - - public static String buildBatchInsertSql(String tableName, Set columnNames) { - StringBuilder sb = new StringBuilder("insert into "); - sb.append(tableName).append("("); - columnNames.forEach(columnName -> sb.append(columnName).append(",")); - sb.delete(sb.length() - 1, sb.length()); - sb.append(") values("); - for (int i = 0; i < columnNames.size(); i++) { - sb.append("?,"); - } - sb.delete(sb.length() - 1, sb.length()); - sb.append(")"); - return sb.toString(); - } - - public static String buildBatchUpdateSql(String tableName, Set columnNames, String whereClauseName) { - StringBuilder sb = new StringBuilder("update "); - sb.append(tableName).append(" set "); - columnNames.forEach(columnName -> sb.append(columnName).append("=?,")); - sb.delete(sb.length() - 1, sb.length()); - sb.append(" where ").append(whereClauseName).append("=?"); - return sb.toString(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IGlobalTracePersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IGlobalTracePersistenceDAO.java deleted file mode 100644 index ae27d2147047ef23bb5efcbb07b76e8441cc47c8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IGlobalTracePersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.global.GlobalTrace; - -/** - * @author peng-yongsheng - */ -public interface IGlobalTracePersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceHeartBeatPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceHeartBeatPersistenceDAO.java deleted file mode 100644 index 95da511c05bf42db4f153011e81630d86a56dba3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IInstanceHeartBeatPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.register.Instance; - -/** - * @author peng-yongsheng - */ -public interface IInstanceHeartBeatPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ISegmentDurationPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ISegmentDurationPersistenceDAO.java deleted file mode 100644 index d9819e55160acc5366b1609573267556c6c33166..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ISegmentDurationPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentDuration; - -/** - * @author peng-yongsheng - */ -public interface ISegmentDurationPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ISegmentPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ISegmentPersistenceDAO.java deleted file mode 100644 index 803e284c55ca9182fbb0e57df49c8c8e9dce6fa5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ISegmentPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.segment.Segment; - -/** - * @author peng-yongsheng - */ -public interface ISegmentPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IServiceNameHeartBeatPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IServiceNameHeartBeatPersistenceDAO.java deleted file mode 100644 index 52d14517f7c30be1e6ecd9bc1fb46b441505514a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IServiceNameHeartBeatPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; - -/** - * @author peng-yongsheng - */ -public interface IServiceNameHeartBeatPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/acp/IApplicationComponentDayPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/acp/IApplicationComponentDayPersistenceDAO.java deleted file mode 100644 index f108ea00be054bf5dea5443287d035845ac157ef..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/acp/IApplicationComponentDayPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.acp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; - -/** - * @author peng-yongsheng - */ -public interface IApplicationComponentDayPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/acp/IApplicationComponentHourPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/acp/IApplicationComponentHourPersistenceDAO.java deleted file mode 100644 index 6af2384f7ee966b4404996459806551d399bad2f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/acp/IApplicationComponentHourPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.acp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; - -/** - * @author peng-yongsheng - */ -public interface IApplicationComponentHourPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/acp/IApplicationComponentMinutePersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/acp/IApplicationComponentMinutePersistenceDAO.java deleted file mode 100644 index 72cf17ac68fb148d5a9401ab5c2675e4f602ef5d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/acp/IApplicationComponentMinutePersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.acp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; - -/** - * @author peng-yongsheng - */ -public interface IApplicationComponentMinutePersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/acp/IApplicationComponentMonthPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/acp/IApplicationComponentMonthPersistenceDAO.java deleted file mode 100644 index b4268f2e315833f897bdc1a9c072b0d54df53d5c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/acp/IApplicationComponentMonthPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.acp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; - -/** - * @author peng-yongsheng - */ -public interface IApplicationComponentMonthPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationAlarmListDayPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationAlarmListDayPersistenceDAO.java deleted file mode 100644 index 6e0acea8b563b8357fe92cfe7140f34f1823d2b5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationAlarmListDayPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.alarm; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; - -/** - * @author peng-yongsheng - */ -public interface IApplicationAlarmListDayPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationAlarmListHourPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationAlarmListHourPersistenceDAO.java deleted file mode 100644 index bdf4e10257b56314e417f2e31b3dcf1da01b261c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationAlarmListHourPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.alarm; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; - -/** - * @author peng-yongsheng - */ -public interface IApplicationAlarmListHourPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationAlarmListMinutePersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationAlarmListMinutePersistenceDAO.java deleted file mode 100644 index 077c4a9b32c2a5600d6f1d80a060f4b2753f0ed7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationAlarmListMinutePersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.alarm; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; - -/** - * @author peng-yongsheng - */ -public interface IApplicationAlarmListMinutePersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationAlarmListMonthPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationAlarmListMonthPersistenceDAO.java deleted file mode 100644 index 08c0c81706744c70b77b0e04097a09f565232395..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationAlarmListMonthPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.alarm; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; - -/** - * @author peng-yongsheng - */ -public interface IApplicationAlarmListMonthPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationAlarmPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationAlarmPersistenceDAO.java deleted file mode 100644 index 85d6befc775c2e10a22caa1fbd67127421652a1f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationAlarmPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.alarm; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm; - -/** - * @author peng-yongsheng - */ -public interface IApplicationAlarmPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationReferenceAlarmListPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationReferenceAlarmListPersistenceDAO.java deleted file mode 100644 index bacdf4435b6af2526705f1f10ce34b5d7f7e4334..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationReferenceAlarmListPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.alarm; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmList; - -/** - * @author peng-yongsheng - */ -public interface IApplicationReferenceAlarmListPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationReferenceAlarmPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationReferenceAlarmPersistenceDAO.java deleted file mode 100644 index 22af6a5539e52ec04e8536203bc3c7dcac298f6e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IApplicationReferenceAlarmPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.alarm; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm; - -/** - * @author peng-yongsheng - */ -public interface IApplicationReferenceAlarmPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IInstanceAlarmListPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IInstanceAlarmListPersistenceDAO.java deleted file mode 100644 index 81e34144d9d4692174cedcf9a038a23ad364b823..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IInstanceAlarmListPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.alarm; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmList; - -/** - * @author peng-yongsheng - */ -public interface IInstanceAlarmListPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IInstanceAlarmPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IInstanceAlarmPersistenceDAO.java deleted file mode 100644 index 0acc34fddad86792173bf9d490e40da159e944e1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IInstanceAlarmPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.alarm; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarm; - -/** - * @author peng-yongsheng - */ -public interface IInstanceAlarmPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IInstanceReferenceAlarmListPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IInstanceReferenceAlarmListPersistenceDAO.java deleted file mode 100644 index 54c8069277d3d1ae847975608111267241da3e61..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IInstanceReferenceAlarmListPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.alarm; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmList; - -/** - * @author peng-yongsheng - */ -public interface IInstanceReferenceAlarmListPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IInstanceReferenceAlarmPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IInstanceReferenceAlarmPersistenceDAO.java deleted file mode 100644 index df63ee0dda05500a9b22a1853325ea57896525b5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IInstanceReferenceAlarmPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.alarm; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarm; - -/** - * @author peng-yongsheng - */ -public interface IInstanceReferenceAlarmPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IServiceAlarmListPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IServiceAlarmListPersistenceDAO.java deleted file mode 100644 index 12b0ff7f65cb9b9eb45bd9ac8cd3dc0bafc32da6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IServiceAlarmListPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.alarm; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmList; - -/** - * @author peng-yongsheng - */ -public interface IServiceAlarmListPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IServiceAlarmPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IServiceAlarmPersistenceDAO.java deleted file mode 100644 index ceda5315ef7d23a169c18047d9b8e58a3d4e81eb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IServiceAlarmPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.alarm; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarm; - -/** - * @author peng-yongsheng - */ -public interface IServiceAlarmPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IServiceReferenceAlarmListPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IServiceReferenceAlarmListPersistenceDAO.java deleted file mode 100644 index 00d45cb23dd53aef1fe79a09cc3314a22391c28b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IServiceReferenceAlarmListPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.alarm; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmList; - -/** - * @author peng-yongsheng - */ -public interface IServiceReferenceAlarmListPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IServiceReferenceAlarmPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IServiceReferenceAlarmPersistenceDAO.java deleted file mode 100644 index 5da49e57a1cf65d7e71150733f7eb84a19344484..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/alarm/IServiceReferenceAlarmPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.alarm; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarm; - -/** - * @author peng-yongsheng - */ -public interface IServiceReferenceAlarmPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/amp/IApplicationDayMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/amp/IApplicationDayMetricPersistenceDAO.java deleted file mode 100644 index 5263b64a7edbc1764311bc71bc9dc65b20af90df..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/amp/IApplicationDayMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.amp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; - -/** - * @author peng-yongsheng - */ -public interface IApplicationDayMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/amp/IApplicationHourMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/amp/IApplicationHourMetricPersistenceDAO.java deleted file mode 100644 index 13adca49138823d32a1ed64eebb1054314b03c4c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/amp/IApplicationHourMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.amp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; - -/** - * @author peng-yongsheng - */ -public interface IApplicationHourMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/amp/IApplicationMinuteMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/amp/IApplicationMinuteMetricPersistenceDAO.java deleted file mode 100644 index 55459d1f9abbf5f0b950e28c6c48679264d7063c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/amp/IApplicationMinuteMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.amp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; - -/** - * @author peng-yongsheng - */ -public interface IApplicationMinuteMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/amp/IApplicationMonthMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/amp/IApplicationMonthMetricPersistenceDAO.java deleted file mode 100644 index e6547d84ae24bb61cddeca477f2010eb1001b8dd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/amp/IApplicationMonthMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.amp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; - -/** - * @author peng-yongsheng - */ -public interface IApplicationMonthMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingDayPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingDayPersistenceDAO.java deleted file mode 100644 index 0d0e67cb4d117be6e3c6c99e022190532dbd6041..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingDayPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ampp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; - -/** - * @author peng-yongsheng - */ -public interface IApplicationMappingDayPersistenceDAO extends IPersistenceDAO { -} \ No newline at end of file diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingHourPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingHourPersistenceDAO.java deleted file mode 100644 index bbc3b55c8965502c1bc6416604a4fc94a0bdd0f4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingHourPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ampp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; - -/** - * @author peng-yongsheng - */ -public interface IApplicationMappingHourPersistenceDAO extends IPersistenceDAO { -} \ No newline at end of file diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingMinutePersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingMinutePersistenceDAO.java deleted file mode 100644 index 24d5c38a20fa676f992b3822fe563eb56739aa19..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingMinutePersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ampp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; - -/** - * @author peng-yongsheng - */ -public interface IApplicationMappingMinutePersistenceDAO extends IPersistenceDAO { -} \ No newline at end of file diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingMonthPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingMonthPersistenceDAO.java deleted file mode 100644 index 3e0f6b72f74e8c9d899db15fb55b4e3f5308e01e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ampp/IApplicationMappingMonthPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ampp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; - -/** - * @author peng-yongsheng - */ -public interface IApplicationMappingMonthPersistenceDAO extends IPersistenceDAO { -} \ No newline at end of file diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/armp/IApplicationReferenceDayMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/armp/IApplicationReferenceDayMetricPersistenceDAO.java deleted file mode 100644 index 0f2cc394ccd554f24abf1ed550fb56d8d083c481..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/armp/IApplicationReferenceDayMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.armp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; - -/** - * @author peng-yongsheng - */ -public interface IApplicationReferenceDayMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/armp/IApplicationReferenceHourMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/armp/IApplicationReferenceHourMetricPersistenceDAO.java deleted file mode 100644 index 9f59debd0647719a2e9936d80de8c43021bacf57..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/armp/IApplicationReferenceHourMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.armp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; - -/** - * @author peng-yongsheng - */ -public interface IApplicationReferenceHourMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/armp/IApplicationReferenceMinuteMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/armp/IApplicationReferenceMinuteMetricPersistenceDAO.java deleted file mode 100644 index 3d140d65e915289f85807a353131e15bb7b32da8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/armp/IApplicationReferenceMinuteMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.armp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; - -/** - * @author peng-yongsheng - */ -public interface IApplicationReferenceMinuteMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/armp/IApplicationReferenceMonthMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/armp/IApplicationReferenceMonthMetricPersistenceDAO.java deleted file mode 100644 index 286a886248cabacdbf7dc8f2421722e3795296d2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/armp/IApplicationReferenceMonthMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.armp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; - -/** - * @author peng-yongsheng - */ -public interface IApplicationReferenceMonthMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cache/IApplicationCacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cache/IApplicationCacheDAO.java deleted file mode 100644 index 972f22905eba6c3600b3697cb7f9f1531d66a4c1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cache/IApplicationCacheDAO.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.cache; - -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.table.register.Application; - -/** - * @author peng-yongsheng - */ -public interface IApplicationCacheDAO extends DAO { - int getApplicationIdByCode(String applicationCode); - - Application getApplication(int applicationId); - - int getApplicationIdByAddressId(int addressId); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cache/IInstanceCacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cache/IInstanceCacheDAO.java deleted file mode 100644 index b02a9431b2a04091f5e9e9b203f67c4749e15769..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cache/IInstanceCacheDAO.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.cache; - -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; - -/** - * @author peng-yongsheng - */ -public interface IInstanceCacheDAO extends DAO { - int getApplicationId(int instanceId); - - int getInstanceIdByAgentUUID(int applicationId, String agentUUID); - - int getInstanceIdByAddressId(int applicationId, int addressId); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cache/INetworkAddressCacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cache/INetworkAddressCacheDAO.java deleted file mode 100644 index c650cf068d5345bca410eefa4496195ccec5e792..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cache/INetworkAddressCacheDAO.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.cache; - -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddress; - -/** - * @author peng-yongsheng - */ -public interface INetworkAddressCacheDAO extends DAO { - int getAddressId(String networkAddress); - - NetworkAddress getAddressById(int addressId); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cache/IServiceNameCacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cache/IServiceNameCacheDAO.java deleted file mode 100644 index 67e7b3bd01da5d5b16df4108eee598d3217fbf6a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cache/IServiceNameCacheDAO.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.cache; - -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; - -/** - * @author peng-yongsheng - */ -public interface IServiceNameCacheDAO extends DAO { - ServiceName get(int serviceId); - - int getServiceId(int applicationId, int srcSpanType, String serviceName); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cpu/ICpuDayMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cpu/ICpuDayMetricPersistenceDAO.java deleted file mode 100644 index 9fc8cc9b568e383b94ce6e3e44dec8974b5eb3a2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cpu/ICpuDayMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.cpu; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; - -/** - * @author peng-yongsheng - */ -public interface ICpuDayMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cpu/ICpuHourMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cpu/ICpuHourMetricPersistenceDAO.java deleted file mode 100644 index 0e9a8d674035ce0da2b504ea82f71b8bff915b19..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cpu/ICpuHourMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.cpu; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; - -/** - * @author peng-yongsheng - */ -public interface ICpuHourMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cpu/ICpuMinuteMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cpu/ICpuMinuteMetricPersistenceDAO.java deleted file mode 100644 index ec1b83c65050295bdb2f4aae37ccb2c5a77291f9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cpu/ICpuMinuteMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.cpu; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; - -/** - * @author peng-yongsheng - */ -public interface ICpuMinuteMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cpu/ICpuMonthMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cpu/ICpuMonthMetricPersistenceDAO.java deleted file mode 100644 index f780fa014de027c0eb406a985432c804196a61e7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/cpu/ICpuMonthMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.cpu; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; - -/** - * @author peng-yongsheng - */ -public interface ICpuMonthMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/gc/IGCDayMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/gc/IGCDayMetricPersistenceDAO.java deleted file mode 100644 index 577eaae31fcaa834d16c2f65345f52b7b8183f17..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/gc/IGCDayMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.gc; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; - -/** - * @author peng-yongsheng - */ -public interface IGCDayMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/gc/IGCHourMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/gc/IGCHourMetricPersistenceDAO.java deleted file mode 100644 index 19ecf62d2a6bd7f017a1df9b93810356be41130c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/gc/IGCHourMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.gc; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; - -/** - * @author peng-yongsheng - */ -public interface IGCHourMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/gc/IGCMinuteMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/gc/IGCMinuteMetricPersistenceDAO.java deleted file mode 100644 index 65e26a42648333ccbb45fccedaf4e66bb6e963f0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/gc/IGCMinuteMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.gc; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; - -/** - * @author peng-yongsheng - */ -public interface IGCMinuteMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/gc/IGCMonthMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/gc/IGCMonthMetricPersistenceDAO.java deleted file mode 100644 index 8b13c6441cf278ac69672f22ce59cfb3097a7f57..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/gc/IGCMonthMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.gc; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; - -/** - * @author peng-yongsheng - */ -public interface IGCMonthMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/imp/IInstanceDayMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/imp/IInstanceDayMetricPersistenceDAO.java deleted file mode 100644 index 490ee6096ad36c061fe5d922c02d8b0d89c1decc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/imp/IInstanceDayMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.imp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; - -/** - * @author peng-yongsheng - */ -public interface IInstanceDayMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/imp/IInstanceHourMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/imp/IInstanceHourMetricPersistenceDAO.java deleted file mode 100644 index 1baa5885f9c9f6a6028d3ac8ae2344cbecb7025e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/imp/IInstanceHourMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.imp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; - -/** - * @author peng-yongsheng - */ -public interface IInstanceHourMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/imp/IInstanceMinuteMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/imp/IInstanceMinuteMetricPersistenceDAO.java deleted file mode 100644 index b8404f4d162dd05026dc5c8be9552de3eed0af06..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/imp/IInstanceMinuteMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.imp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; - -/** - * @author peng-yongsheng - */ -public interface IInstanceMinuteMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/imp/IInstanceMonthMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/imp/IInstanceMonthMetricPersistenceDAO.java deleted file mode 100644 index cee600873245c86a616d4de1ca07d01a3dcfea8a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/imp/IInstanceMonthMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.imp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; - -/** - * @author peng-yongsheng - */ -public interface IInstanceMonthMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/impp/IInstanceMappingDayPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/impp/IInstanceMappingDayPersistenceDAO.java deleted file mode 100644 index 475ffff8d43975ed718d97355e2d05de7e2fbaa0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/impp/IInstanceMappingDayPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.impp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; - -/** - * @author peng-yongsheng - */ -public interface IInstanceMappingDayPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/impp/IInstanceMappingHourPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/impp/IInstanceMappingHourPersistenceDAO.java deleted file mode 100644 index c70509dcc67dbe67aed9721c942589e18271a434..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/impp/IInstanceMappingHourPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.impp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; - -/** - * @author peng-yongsheng - */ -public interface IInstanceMappingHourPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/impp/IInstanceMappingMinutePersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/impp/IInstanceMappingMinutePersistenceDAO.java deleted file mode 100644 index ad40bd0284538e12c0e970b7bc02adc3742df837..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/impp/IInstanceMappingMinutePersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.impp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; - -/** - * @author peng-yongsheng - */ -public interface IInstanceMappingMinutePersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/impp/IInstanceMappingMonthPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/impp/IInstanceMappingMonthPersistenceDAO.java deleted file mode 100644 index 8dad357583553e951d41fdf64fdee95d4f916719..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/impp/IInstanceMappingMonthPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.impp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; - -/** - * @author peng-yongsheng - */ -public interface IInstanceMappingMonthPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/irmp/IInstanceReferenceDayMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/irmp/IInstanceReferenceDayMetricPersistenceDAO.java deleted file mode 100644 index 1d2cead681d382b588784b27bf35e10c3490833f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/irmp/IInstanceReferenceDayMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.irmp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public interface IInstanceReferenceDayMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/irmp/IInstanceReferenceHourMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/irmp/IInstanceReferenceHourMetricPersistenceDAO.java deleted file mode 100644 index bd6f8838eaadc0282741bb140df4772fc9769389..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/irmp/IInstanceReferenceHourMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.irmp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public interface IInstanceReferenceHourMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/irmp/IInstanceReferenceMinuteMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/irmp/IInstanceReferenceMinuteMetricPersistenceDAO.java deleted file mode 100644 index b7507cddc8ba9cc61f05a011414c3479cc6ae280..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/irmp/IInstanceReferenceMinuteMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.irmp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public interface IInstanceReferenceMinuteMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/irmp/IInstanceReferenceMonthMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/irmp/IInstanceReferenceMonthMetricPersistenceDAO.java deleted file mode 100644 index cae66c8456fcfc2ce28b54d031f62e5ca54d313e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/irmp/IInstanceReferenceMonthMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.irmp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public interface IInstanceReferenceMonthMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/memory/IMemoryDayMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/memory/IMemoryDayMetricPersistenceDAO.java deleted file mode 100644 index 5b3d5fc2d0da58a5c69680ba88208cf8c3a00837..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/memory/IMemoryDayMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.memory; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; - -/** - * @author peng-yongsheng - */ -public interface IMemoryDayMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/memory/IMemoryHourMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/memory/IMemoryHourMetricPersistenceDAO.java deleted file mode 100644 index a9be95b7a73468df1f2a6eb726d371bc8de77fe2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/memory/IMemoryHourMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.memory; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; - -/** - * @author peng-yongsheng - */ -public interface IMemoryHourMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/memory/IMemoryMinuteMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/memory/IMemoryMinuteMetricPersistenceDAO.java deleted file mode 100644 index 6916cbab4d7e5586b5c583c3ddb58fc1f3ed42db..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/memory/IMemoryMinuteMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.memory; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; - -/** - * @author peng-yongsheng - */ -public interface IMemoryMinuteMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/memory/IMemoryMonthMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/memory/IMemoryMonthMetricPersistenceDAO.java deleted file mode 100644 index 6752698f0a9b03c959a1a74a26de34b59249284a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/memory/IMemoryMonthMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.memory; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; - -/** - * @author peng-yongsheng - */ -public interface IMemoryMonthMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/mpool/IMemoryPoolDayMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/mpool/IMemoryPoolDayMetricPersistenceDAO.java deleted file mode 100644 index 2eb50e205b1c059c5fb67dda7c317385debe933a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/mpool/IMemoryPoolDayMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.mpool; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; - -/** - * @author peng-yongsheng - */ -public interface IMemoryPoolDayMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/mpool/IMemoryPoolHourMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/mpool/IMemoryPoolHourMetricPersistenceDAO.java deleted file mode 100644 index 1b69805260d5b546cd786616aef62fb7e0ae6f48..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/mpool/IMemoryPoolHourMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.mpool; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; - -/** - * @author peng-yongsheng - */ -public interface IMemoryPoolHourMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/mpool/IMemoryPoolMinuteMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/mpool/IMemoryPoolMinuteMetricPersistenceDAO.java deleted file mode 100644 index 0ac82b156419234ed12159652bd79b922e5b7a30..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/mpool/IMemoryPoolMinuteMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.mpool; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; - -/** - * @author peng-yongsheng - */ -public interface IMemoryPoolMinuteMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/mpool/IMemoryPoolMonthMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/mpool/IMemoryPoolMonthMetricPersistenceDAO.java deleted file mode 100644 index e8eabb582fec0abdb1d4817354a24c3dce11dd11..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/mpool/IMemoryPoolMonthMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.mpool; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; - -/** - * @author peng-yongsheng - */ -public interface IMemoryPoolMonthMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/register/IApplicationRegisterDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/register/IApplicationRegisterDAO.java deleted file mode 100644 index bd67f9e2092f89dcd11340097eb8c2a04b4f6c26..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/register/IApplicationRegisterDAO.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.register; - -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.table.register.Application; - -/** - * @author peng-yongsheng - */ -public interface IApplicationRegisterDAO extends DAO { - int getMaxApplicationId(); - - int getMinApplicationId(); - - void save(Application application); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/register/IInstanceRegisterDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/register/IInstanceRegisterDAO.java deleted file mode 100644 index 04e0a1bc78ee5fdc6cc897a9b9f390f2eb835bd9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/register/IInstanceRegisterDAO.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.register; - -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.table.register.Instance; - -/** - * @author peng-yongsheng - */ -public interface IInstanceRegisterDAO extends DAO { - int getMaxInstanceId(); - - int getMinInstanceId(); - - void save(Instance instance); - - void updateHeartbeatTime(int instanceId, long heartbeatTime); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/register/INetworkAddressRegisterDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/register/INetworkAddressRegisterDAO.java deleted file mode 100644 index 848f7adf3fdf5b584fa0f0e8f8ea6902696e61ec..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/register/INetworkAddressRegisterDAO.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.register; - -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddress; - -/** - * @author peng-yongsheng - */ -public interface INetworkAddressRegisterDAO extends DAO { - int getMaxNetworkAddressId(); - - int getMinNetworkAddressId(); - - void save(NetworkAddress networkAddress); - - void update(String id, int spanLayer, int serverType); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/register/IServiceNameRegisterDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/register/IServiceNameRegisterDAO.java deleted file mode 100644 index 0c9b8ad4a32ae80cdfbcd51a34ac6dbb77ca2308..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/register/IServiceNameRegisterDAO.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.register; - -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; - -/** - * @author peng-yongsheng - */ -public interface IServiceNameRegisterDAO extends DAO { - int getMaxServiceId(); - - int getMinServiceId(); - - void save(ServiceName serviceName); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/rtd/IResponseTimeDistributionDayPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/rtd/IResponseTimeDistributionDayPersistenceDAO.java deleted file mode 100644 index 5d70aafc99183a6e98fdd5b2d4af3ade69adc63f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/rtd/IResponseTimeDistributionDayPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.rtd; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; - -/** - * @author peng-yongsheng - */ -public interface IResponseTimeDistributionDayPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/rtd/IResponseTimeDistributionHourPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/rtd/IResponseTimeDistributionHourPersistenceDAO.java deleted file mode 100644 index ff6649899ea4ef5ea3e7c452b539c4bd718de3b8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/rtd/IResponseTimeDistributionHourPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.rtd; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; - -/** - * @author peng-yongsheng - */ -public interface IResponseTimeDistributionHourPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/rtd/IResponseTimeDistributionMinutePersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/rtd/IResponseTimeDistributionMinutePersistenceDAO.java deleted file mode 100644 index bcae6b8c555f58a5fdfdd98c95ffa188ce7abd3e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/rtd/IResponseTimeDistributionMinutePersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.rtd; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; - -/** - * @author peng-yongsheng - */ -public interface IResponseTimeDistributionMinutePersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/rtd/IResponseTimeDistributionMonthPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/rtd/IResponseTimeDistributionMonthPersistenceDAO.java deleted file mode 100644 index 13725b40b97b4a93e61f4f0aaea3758a19aa1327..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/rtd/IResponseTimeDistributionMonthPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.rtd; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; - -/** - * @author peng-yongsheng - */ -public interface IResponseTimeDistributionMonthPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/smp/IServiceDayMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/smp/IServiceDayMetricPersistenceDAO.java deleted file mode 100644 index fa7b0e6d9f0886c575f96c74f3d014d71b2bd01b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/smp/IServiceDayMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.smp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; - -/** - * @author peng-yongsheng - */ -public interface IServiceDayMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/smp/IServiceHourMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/smp/IServiceHourMetricPersistenceDAO.java deleted file mode 100644 index 44e7b692f48cfacffe7197498783cdf6f11ae3c5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/smp/IServiceHourMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.smp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; - -/** - * @author peng-yongsheng - */ -public interface IServiceHourMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/smp/IServiceMinuteMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/smp/IServiceMinuteMetricPersistenceDAO.java deleted file mode 100644 index dd48b105e448223c7e91f9ab1d22b9096c26ae50..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/smp/IServiceMinuteMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.smp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; - -/** - * @author peng-yongsheng - */ -public interface IServiceMinuteMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/smp/IServiceMonthMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/smp/IServiceMonthMetricPersistenceDAO.java deleted file mode 100644 index 8c7764b1c093956dd002ab6f777ce49887e69c05..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/smp/IServiceMonthMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.smp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; - -/** - * @author peng-yongsheng - */ -public interface IServiceMonthMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/srmp/IServiceReferenceDayMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/srmp/IServiceReferenceDayMetricPersistenceDAO.java deleted file mode 100644 index 590f7191d515c1f6b0e599c7f005fb16b7c8cc65..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/srmp/IServiceReferenceDayMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.srmp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public interface IServiceReferenceDayMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/srmp/IServiceReferenceHourMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/srmp/IServiceReferenceHourMetricPersistenceDAO.java deleted file mode 100644 index d7329d1aaeef4e3a5eb094f1cca42219ce8692d9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/srmp/IServiceReferenceHourMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.srmp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public interface IServiceReferenceHourMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/srmp/IServiceReferenceMinuteMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/srmp/IServiceReferenceMinuteMetricPersistenceDAO.java deleted file mode 100644 index 69021ecf9dd1ccafd0b827a8558cd65ae419d9e9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/srmp/IServiceReferenceMinuteMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.srmp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public interface IServiceReferenceMinuteMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/srmp/IServiceReferenceMonthMetricPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/srmp/IServiceReferenceMonthMetricPersistenceDAO.java deleted file mode 100644 index e3e7eaf73f940581cbfef047ec8c3eda6b3a6eb7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/srmp/IServiceReferenceMonthMetricPersistenceDAO.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.srmp; - -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; - -/** - * @author peng-yongsheng - */ -public interface IServiceReferenceMonthMetricPersistenceDAO extends IPersistenceDAO { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationAlarmListUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationAlarmListUIDAO.java deleted file mode 100644 index 9719e5c48606e0c9e16c807256058ca75ae7d0ac..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationAlarmListUIDAO.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; - -/** - * Interface to be implemented for execute database query operation - * from {@link org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface IApplicationAlarmListUIDAO extends DAO { - - /** - *

SQL as: select TIME_BUCKET, APPLICATION_ID, count(APPLICATION_ID) from APPLICATION_ALARM_LIST - * where TIME_BUCKET ge ${startTimeBucket} and TIME_BUCKET le ${endTimeBucket} - * group by TIME_BUCKET, APPLICATION_ID - * - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param step the step which represent time formats - * @param startTimeBucket start time bucket - * @param endTimeBucket end time bucket - * @return not nullable result list - */ - List getAlarmedApplicationNum(Step step, long startTimeBucket, long endTimeBucket); - - class AlarmTrend { - private long timeBucket; - private int numberOfApplication; - - public long getTimeBucket() { - return timeBucket; - } - - public void setTimeBucket(long timeBucket) { - this.timeBucket = timeBucket; - } - - public int getNumberOfApplication() { - return numberOfApplication; - } - - public void setNumberOfApplication(int numberOfApplication) { - this.numberOfApplication = numberOfApplication; - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationAlarmUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationAlarmUIDAO.java deleted file mode 100644 index 9be57ef77f5d45fe1a3c1b5d22d804d5d3f75781..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationAlarmUIDAO.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.text.ParseException; -import java.util.List; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.ui.alarm.Alarm; - -/** - * Interface to be implemented for execute database query operation - * from {@link org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface IApplicationAlarmUIDAO extends DAO { - - /** - *

SQL as: select APPLICATION_ID, ALARM_CONTENT, LAST_TIME_BUCKET, ALARM_TYPE from APPLICATION_ALARM - * where LAST_TIME_BUCKET ge ${startTimeBucket} and LAST_TIME_BUCKET le ${endTimeBucket} - * and ALARM_CONTENT like '%{keyword}%' - * and APPLICATION_ID in (${applicationIds}) - *

Note: keyword maybe not given - * - * @param keyword fuzzy query - * @param applicationIds may not be given - * @param startTimeBucket start time bucket - * @param endTimeBucket end time bucket - * @param limit limits the number of rows returned by the query - * @param from specified how many rows to skip - * @return application alarm items - * @throws ParseException alarm time parse exception - */ - Alarm loadAlarmList(String keyword, List applicationIds, long startTimeBucket, long endTimeBucket, - int limit, int from) throws ParseException; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationComponentUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationComponentUIDAO.java deleted file mode 100644 index f4abbc266ff8d520d52fea24912a63253263a2a1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationComponentUIDAO.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; - -/** - * Interface to be implemented for execute database query operation - * from {@link org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface IApplicationComponentUIDAO extends DAO { - - /** - * Returns application components that collected between start time bucket - * and end time bucket. - * - *

SQL as: select COMPONENT_ID, APPLICATION_ID from APPLICATION_COMPONENT - * where TIME_BUCKET ge ${startTimeBucket} and TIME_BUCKET le ${endTimeBucket} - * group by COMPONENT_ID, APPLICATION_ID - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param step the step which represent time formats - * @param startTimeBucket start time bucket - * @param endTimeBucket end time bucket - * @return not nullable result list - */ - List load(Step step, long startTimeBucket, long endTimeBucket); - - class ApplicationComponent { - private int componentId; - private int applicationId; - - public int getComponentId() { - return componentId; - } - - public void setComponentId(int componentId) { - this.componentId = componentId; - } - - public int getApplicationId() { - return applicationId; - } - - public void setApplicationId(int applicationId) { - this.applicationId = applicationId; - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationMappingUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationMappingUIDAO.java deleted file mode 100644 index dc2c73fbbfcf9b5ee519f6fca5deac2872beeac9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationMappingUIDAO.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; - -/** - * Interface to be implemented for execute database query operation - * from {@link org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface IApplicationMappingUIDAO extends DAO { - - /** - * Returns application mapping data that collected between start time bucket - * and end time bucket. The application id was registered from server side, - * mapping application id was register from client side. So, this returned - * collection can be use to distinguished the application reference metrics - * which aggregated from server side or client side. - * - *

SQL as: select APPLICATION_ID, MAPPING_APPLICATION_ID from APPLICATION_MAPPING - * where TIME_BUCKET ge ${startTimeBucket} and TIME_BUCKET le ${endTimeBucket} - * group by APPLICATION_ID, MAPPING_APPLICATION_ID - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param step the step which represent time formats - * @param startTimeBucket start time bucket - * @param endTimeBucket end time bucket - * @return not nullable result list - */ - List load(Step step, long startTimeBucket, long endTimeBucket); - - class ApplicationMapping { - private int applicationId; - private int mappingApplicationId; - - public int getApplicationId() { - return applicationId; - } - - public void setApplicationId(int applicationId) { - this.applicationId = applicationId; - } - - public int getMappingApplicationId() { - return mappingApplicationId; - } - - public void setMappingApplicationId(int mappingApplicationId) { - this.mappingApplicationId = mappingApplicationId; - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationMetricUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationMetricUIDAO.java deleted file mode 100644 index 5e02648fb145d1e718b55e875515b81ffdc0b41c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationMetricUIDAO.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.ui.overview.ApplicationThroughput; - -/** - * Interface to be implemented for execute database query operation - * from {@link org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface IApplicationMetricUIDAO extends DAO { - - /** - * Returns the top n application throughput between start time bucket - * and end time bucket. - * - *

SQL as: select APPLICATION_ID, sum(TRANSACTION_CALLS) / minutesBetween as tps - * from APPLICATION_METRIC - * where TIME_BUCKET ge ${startTimeBucket} and TIME_BUCKET le ${endTimeBucket} - * and SOURCE_VALUE = ${metricSource} - * group by APPLICATION_ID - * order by tps desc - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - *

Note: SQL should be "select APPLICATION_ID, 0 as tps" when betweenSecond - * equal 0. - * - * @param step the step which represent time formats - * @param startTimeBucket start time bucket - * @param endTimeBucket end time bucket - * @param minutesBetween the minutes between start time bucket and end time bucket - * @param topN how many rows should return - * @param metricSource source of this metric, server side or client side - * @return not nullable result list - */ - List getTopNApplicationThroughput(Step step, long startTimeBucket, long endTimeBucket, - int minutesBetween, int topN, MetricSource metricSource); - - /** - * Returns aggregated application metrics that collected between start time bucket - * and end time bucket. - * - *

SQL as: select APPLICATION_ID, sum(TRANSACTION_CALLS), sum(TRANSACTION_ERROR_CALLS), - * sum(TRANSACTION_DURATION_SUM), sum(TRANSACTION_ERROR_DURATION_SUM), - * sum(SATISFIED_COUNT), sum(TOLERATING_COUNT), sum(FRUSTRATED_COUNT) - * from APPLICATION_METRIC - * where TIME_BUCKET ge ${startTimeBucket} and TIME_BUCKET le ${endTimeBucket} - * and SOURCE_VALUE = ${metricSource} - * group by APPLICATION_ID - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param step the step which represent time formats - * @param startTimeBucket start time bucket - * @param endTimeBucket end time bucket - * @param metricSource source of this metric, server side or client side - * @return not nullable result list - */ - List getApplications(Step step, long startTimeBucket, long endTimeBucket, - MetricSource metricSource); - - class ApplicationMetric { - private int id; - private long calls; - private long errorCalls; - private long durations; - private long errorDurations; - private long satisfiedCount; - private long toleratingCount; - private long frustratedCount; - - public void setId(int id) { - this.id = id; - } - - public void setCalls(long calls) { - this.calls = calls; - } - - public void setErrorCalls(long errorCalls) { - this.errorCalls = errorCalls; - } - - public void setDurations(long durations) { - this.durations = durations; - } - - public void setErrorDurations(long errorDurations) { - this.errorDurations = errorDurations; - } - - public int getId() { - return id; - } - - public long getCalls() { - return calls; - } - - public long getErrorCalls() { - return errorCalls; - } - - public long getDurations() { - return durations; - } - - public long getErrorDurations() { - return errorDurations; - } - - public long getSatisfiedCount() { - return satisfiedCount; - } - - public void setSatisfiedCount(long satisfiedCount) { - this.satisfiedCount = satisfiedCount; - } - - public long getToleratingCount() { - return toleratingCount; - } - - public void setToleratingCount(long toleratingCount) { - this.toleratingCount = toleratingCount; - } - - public long getFrustratedCount() { - return frustratedCount; - } - - public void setFrustratedCount(long frustratedCount) { - this.frustratedCount = frustratedCount; - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationReferenceMetricUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationReferenceMetricUIDAO.java deleted file mode 100644 index c8a7fd59f1b5e7916722427c96c9917cb7522d1d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationReferenceMetricUIDAO.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; - -/** - * Interface to be implemented for execute database query operation - * from {@link org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface IApplicationReferenceMetricUIDAO extends DAO { - - /** - * Returns aggregated application reference metrics that collected between - * start time bucket and end time bucket. - * - *

SQL as: select FRONT_APPLICATION_ID, BEHIND_APPLICATION_ID, - * sum(TRANSACTION_CALLS), sum(TRANSACTION_ERROR_CALLS), sum(TRANSACTION_DURATION_SUM), sum(TRANSACTION_ERROR_DURATION_SUM) - * from APPLICATION_REFERENCE_METRIC - * where TIME_BUCKET ge ${startTimeBucket} and TIME_BUCKET le ${endTimeBucket} - * and SOURCE_VALUE = ${metricSource} - * and ( FRONT_APPLICATION_ID in (${applicationIds}) or BEHIND_APPLICATION_ID in (${applicationIds}) ) - * group by FRONT_APPLICATION_ID, BEHIND_APPLICATION_ID - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - *

Note: ${applicationIds} may not be given - * - * @param step the step which represent time formats - * @param startTimeBucket start time bucket - * @param endTimeBucket end time bucket - * @param metricSource source of this metric, server side or client side - * @param applicationIds source or target application ids, - * @return not nullable result list - */ - List getReferences(Step step, long startTimeBucket, long endTimeBucket, - MetricSource metricSource, Integer... applicationIds); - - class ApplicationReferenceMetric { - private int source; - private int target; - private long calls; - private long errorCalls; - private long durations; - private long errorDurations; - - public int getSource() { - return source; - } - - public void setSource(int source) { - this.source = source; - } - - public int getTarget() { - return target; - } - - public void setTarget(int target) { - this.target = target; - } - - public long getCalls() { - return calls; - } - - public void setCalls(long calls) { - this.calls = calls; - } - - public long getErrorCalls() { - return errorCalls; - } - - public void setErrorCalls(long errorCalls) { - this.errorCalls = errorCalls; - } - - public long getDurations() { - return durations; - } - - public void setDurations(long durations) { - this.durations = durations; - } - - public long getErrorDurations() { - return errorDurations; - } - - public void setErrorDurations(long errorDurations) { - this.errorDurations = errorDurations; - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/ICpuMetricUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/ICpuMetricUIDAO.java deleted file mode 100644 index 8d63f809becd1d101952396073428df830198138..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/ICpuMetricUIDAO.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; - -/** - * Interface to be implemented for execute database query operation - * from {@link CpuMetricTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface ICpuMetricUIDAO extends DAO { - - /** - * CPU Trend describes the trend of CPU in the given duration, which represents by the - * DurationPoint list in the `step` Unit. - *

SQL as: select USAGE_PERCENT, TIMES from CPU_METRIC where ID in (durationPoints), - * rule of ID generation is "${durationPoint}_${instanceId}". - *

The average usage percent formula is "( USAGE_PERCENT * 100 ) / TIMES", in order - * to avoid the result includes decimal value, cast the class to {@link Integer}. - *

Every element in return list must match DurationPoint list, which also means that, - * the two list must be in same size, and index match. - *

If some element of the return list can't be found, the implementor must set 0 as - * default value. - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param instanceId the owner id of this cpu metrics - * @param step the step which represent time formats - * @param durationPoints the time points in the time span - * @return every duration points average cpu usage percent metrics. - * @see org.apache.skywalking.apm.collector.storage.ui.common.Step - */ - List getCPUTrend(int instanceId, Step step, List durationPoints); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IGCMetricUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IGCMetricUIDAO.java deleted file mode 100644 index 2fb7b27d410fa8e85e68074da07d4041d60341d0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IGCMetricUIDAO.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; - -/** - * Interface to be implemented for execute database query operation - * from {@link GCMetricTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface IGCMetricUIDAO extends DAO { - - /** - * Young GC Trend describes the trend of young generation garbage collection in the given - * duration, which represents by the DurationPoint list in the `step` Unit. - *

SQL as: select COUNT, TIMES, DURATION from GC_METRIC where ID in (durationPoints), rule of - * ID generation is "${durationPoint}_${instanceId}_${gcPhrase}", - * {@link org.apache.skywalking.apm.network.language.agent.GCPhrase#NEW_VALUE} - *

The young generation GC count - *

The average young generation GC average duration formula is "DURATION / TIMES". - *

Every element in return list must match DurationPoint list, which also means that, - * the two list must be in same size, and index match. - *

If some element of the return list can't be found, the implementor must set 0 as - * default value. - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param instanceId the owner id of this GC metrics - * @param step the step which represent time formats - * @param durationPoints the time points in the time span - * @return every duration points average young generation GC count and duration metrics. - * @see org.apache.skywalking.apm.collector.storage.ui.common.Step - * @see org.apache.skywalking.apm.network.language.agent.GCPhrase - */ - List getYoungGCTrend(int instanceId, Step step, List durationPoints); - - /** - * Old GC Trend describes the trend of old generation garbage collection in the given - * duration, which represents by the DurationPoint list in the `step` Unit. - *

SQL as: select COUNT, TIMES, DURATION from GC_METRIC where ID in (durationPoints), rule of - * ID generation is "${durationPoint}_${instanceId}_${gcPhrase}", - * {@link org.apache.skywalking.apm.network.language.agent.GCPhrase#OLD_VALUE} - *

The old generation GC count - *

The average old generation GC average duration formula is "DURATION / TIMES". - *

Every element in return list must match DurationPoint list, which also means that, - * the two list must be in same size, and index match. - *

If some element of the return list can't be found, the implementor must set 0 as - * default value. - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param instanceId the owner id of this GC metrics - * @param step the step which represent time formats - * @param durationPoints the time points in the time span - * @return every duration points average old generation GC count and duration metrics. - * @see org.apache.skywalking.apm.collector.storage.ui.common.Step - * @see org.apache.skywalking.apm.network.language.agent.GCPhrase - */ - List getOldGCTrend(int instanceId, Step step, List durationPoints); - - class Trend { - private int averageCount; - private int averageDuration; - - public Trend(int averageCount, int averageDuration) { - this.averageCount = averageCount; - this.averageDuration = averageDuration; - } - - public int getAverageCount() { - return averageCount; - } - - public int getAverageDuration() { - return averageDuration; - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IGlobalTraceUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IGlobalTraceUIDAO.java deleted file mode 100644 index ae9eb22aa012531fb4cd80d77e57494e57864fff..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IGlobalTraceUIDAO.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; - -/** - * Interface to be implemented for execute database query operation - * from {@link org.apache.skywalking.apm.collector.storage.table.global.GlobalTraceTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.table.global.GlobalTraceTable - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface IGlobalTraceUIDAO extends DAO { - - /** - * Returns global trace ids by query operation with given segment id. - * Generally, only one global trace id will be found, but found more - * than one id when given segment id been in a batch process. - *

SQL as: select TRACE_ID from GLOBAL_TRACE where SEGMENT_ID = ${segmentId}, - * - * @param segmentId argument to bind to the query - * @return not nullable result list containing global trace ids. - */ - List getGlobalTraceId(String segmentId); - - /** - * Returns segment ids by query operation with given global trace id. - *

SQL as: select SEGMENT_ID from GLOBAL_TRACE where TRACE_ID = ${globalTraceId}, - * - * @param globalTraceId argument to bind to the query - * @return not nullable result list containing segment ids. - */ - List getSegmentIds(String globalTraceId); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IInstanceAlarmUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IInstanceAlarmUIDAO.java deleted file mode 100644 index 86474efd1ba8fba04fb3d6c8f13d42526872d32d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IInstanceAlarmUIDAO.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.text.ParseException; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.ui.alarm.Alarm; - -/** - * Interface to be implemented for execute database query operation - * from {@link org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface IInstanceAlarmUIDAO extends DAO { - - /** - *

SQL as: select INSTANCE_ID, ALARM_CONTENT, LAST_TIME_BUCKET, ALARM_TYPE from INSTANCE_ALARM - * where LAST_TIME_BUCKET ge ${startTimeBucket} and LAST_TIME_BUCKET le ${endTimeBucket} - * and ALARM_CONTENT like '%{keyword}%' - *

Note: keyword maybe not given - * - * @param keyword fuzzy query - * @param startTimeBucket start time bucket - * @param endTimeBucket end time bucket - * @param limit limits the number of rows returned by the query - * @param from specified how many rows to skip - * @return instance alarm items - * @throws ParseException alarm time parse exception - */ - Alarm loadAlarmList(String keyword, long startTimeBucket, long endTimeBucket, int limit, - int from) throws ParseException; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IInstanceMetricUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IInstanceMetricUIDAO.java deleted file mode 100644 index cda708abc26cadb36af3e29e391593a14252f597..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IInstanceMetricUIDAO.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; - -/** - * Interface to be implemented for execute database query operation - * from {@link org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface IInstanceMetricUIDAO extends DAO { - - /** - * Returns the top n instance throughput between start time bucket - * and end time bucket. - * - *

SQL as: select APPLICATION_ID, sum(TRANSACTION_CALLS) / ${minutesBetween} as tps - * from INSTANCE_METRIC - * where TIME_BUCKET ge ${startTimeBucket} and TIME_BUCKET le ${endTimeBucket} - * and SOURCE_VALUE = ${metricSource} - * and APPLICATION_ID = ${applicationId} - * group by INSTANCE_ID - * order by tps desc - * - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - *

Note: ${applicationId} may not be given - * - * @param applicationId owner of instances - * @param step the step which represent time formats - * @param startTimeBucket start time bucket - * @param endTimeBucket end time bucket - * @param minutesBetween the minutes between start time bucket and end time bucket - * @param topN how many rows should return - * @param metricSource source of this metric, server side or client side - * @return not nullable result list - */ - List getServerThroughput(int applicationId, Step step, long startTimeBucket, long endTimeBucket, - int minutesBetween, int topN, MetricSource metricSource); - - /** - * Server TPS Trend describes the trend of instance throughout in the given duration, - * which represents by the DurationPoint list in the `step` Unit. - * - *

SQL as: select TRANSACTION_CALLS from INSTANCE_METRIC where ID in (durationPoints), - * rule of ID generation is "${durationPoint}_${instanceId}_${MetricSource.Callee}". - * - *

The formula is "TRANSACTION_CALLS * durationPoint#minutesBetween" - * - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param instanceId which instance should be query - * @param step the step which represent time formats - * @param durationPoints the time points in the time span - * @return every duration points average instance throughput metrics. - */ - List getServerThroughputTrend(int instanceId, Step step, List durationPoints); - - /** - * Response time Trend describes the trend of instance average response time in the given duration, - * which represents by the DurationPoint list in the `step` Unit. - * - *

SQL as: select TRANSACTION_DURATION_SUM / TRANSACTION_CALLS from INSTANCE_METRIC where ID in (durationPoints), - * rule of ID generation is "${durationPoint}_${instanceId}_${MetricSource.Callee}". - * - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param instanceId which instance should be query - * @param step the step which represent time formats - * @param durationPoints the time points in the time span - * @return every duration points average instance response time metrics. - */ - List getResponseTimeTrend(int instanceId, Step step, List durationPoints); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IInstanceUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IInstanceUIDAO.java deleted file mode 100644 index 8c74fd3f8671e06e1d8894907712a499518396ee..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IInstanceUIDAO.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.core.util.BooleanUtils; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.table.register.Instance; -import org.apache.skywalking.apm.collector.storage.ui.application.Application; -import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo; - -/** - * Interface to be implemented for execute database query operation - * from {@link org.apache.skywalking.apm.collector.storage.table.register.InstanceTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.table.register.InstanceTable - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface IInstanceUIDAO extends DAO { - - /** - * Returns applications by query operation with given arguments. - *

SQL as: select APPLICATION_ID, count(APPLICATION_ID) from INSTANCE - * where IS_ADDRESS = {@link BooleanUtils#FALSE} and - * (( HEARTBEAT_TIME ge ${endSecondTimeBucket} and REGISTER_TIME le ${endSecondTimeBucket}) - * or - * (REGISTER_TIME le ${endSecondTimeBucket} and HEARTBEAT_TIME ge ${startSecondTimeBucket})) - * and APPLICATION_ID in (${applicationIds}) - * group by APPLICATION_ID - *

Note: ${applicationIds} may not be given - * - * @param startSecondTimeBucket start time format pattern is "yyyyMMddHHmmss" - * @param endSecondTimeBucket end time format pattern is "yyyyMMddHHmmss" - * @param applicationIds owner ids of instances - * @return not nullable result list containing application ids and number of instance. - */ - List getApplications(long startSecondTimeBucket, long endSecondTimeBucket, int... applicationIds); - - /** - * Returns the detail of instance by given instance id. - *

SQL as: select * from INSTANCE where INSTANCE_ID = ${instanceId} - * - * @param instanceId argument to bind to the query - * @return the single instance object, may be null if not exist - */ - Instance getInstance(int instanceId); - - /** - * Returns the detail of instances by given arguments. - *

SQL as: select * from INSTANCE - * where IS_ADDRESS = {@link BooleanUtils#FALSE} and - * (( HEARTBEAT_TIME ge ${endSecondTimeBucket} and REGISTER_TIME le ${endSecondTimeBucket}) - * or - * (REGISTER_TIME le ${endSecondTimeBucket} and HEARTBEAT_TIME ge ${startSecondTimeBucket})) - * and OS_INFO like '%${keyword}%' - *

Note: ${keyword} may not be given - * - * @param keyword any words contains in OS information, use fuzzy search - * @param startSecondTimeBucket start time format pattern is "yyyyMMddHHmmss" - * @param endSecondTimeBucket end time format pattern is "yyyyMMddHHmmss" - * @return not nullable result list containing detail of instances. - */ - List searchServer(String keyword, long startSecondTimeBucket, long endSecondTimeBucket); - - /** - * Returns the detail of instances by given arguments. - *

SQL as: select * from INSTANCE where - * where IS_ADDRESS = {@link BooleanUtils#FALSE} and - * (( HEARTBEAT_TIME ge ${endSecondTimeBucket} and REGISTER_TIME le ${endSecondTimeBucket}) - * or - * (REGISTER_TIME le ${endSecondTimeBucket} and HEARTBEAT_TIME ge ${startSecondTimeBucket})) - * and APPLICATION_ID = ${applicationId} - * - * @param applicationId owner of instances - * @param startSecondTimeBucket start time format pattern is "yyyyMMddHHmmss" - * @param endSecondTimeBucket end time format pattern is "yyyyMMddHHmmss" - * @return not nullable result list containing detail of instances. - */ - List getAllServer(int applicationId, long startSecondTimeBucket, long endSecondTimeBucket); - - /** - * Returns the earliest register time in all instances which - * belonged to the given application id. - *

SQL as: select REGISTER_TIME from INSTANCE where - * and APPLICATION_ID = ${applicationId} - * order by REGISTER_TIME asc - * - * @param applicationId owner of instances - * @return the earliest register time - */ - long getEarliestRegisterTime(int applicationId); - - /** - * Returns the latest heart beat time in all instances which - * belonged to the given application id. - *

SQL as: select HEARTBEAT_TIME from INSTANCE where - * and APPLICATION_ID = ${applicationId} - * order by HEARTBEAT_TIME desc - * - * @param applicationId owner of instances - * @return the latest heart beat time - */ - long getLatestHeartBeatTime(int applicationId); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IMemoryMetricUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IMemoryMetricUIDAO.java deleted file mode 100644 index e9936f67b17d9e378df85e2fe652ba29e7e8ad1d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IMemoryMetricUIDAO.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.util.LinkedList; -import java.util.List; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; - -/** - * Interface to be implemented for execute database query operation - * from {@link MemoryMetricTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface IMemoryMetricUIDAO extends DAO { - - /** - * Heap memory Trend describes the trend of Memory in the given duration, which - * represents by the DurationPoint list in the `step` Unit. - *

SQL as: select MAX, USED, TIMES from MEMORY_METRIC where ID in (durationPoints), - * rule of ID generation is "${durationPoint}_${instanceId}_${isHeap}". - * {@link org.apache.skywalking.apm.collector.core.util.BooleanUtils#TRUE} - *

The average usage percent formula is "MAX / TIMES" and "USED / TIMES" - *

Every element in return list must match DurationPoint list, which also means that, - * the two list must be in same size, and index match. - *

If some element of the return list can't be found, the implementor must set 0 as - * default value. - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param instanceId the owner id of this memory metrics - * @param step the step which represent time formats - * @param durationPoints the time points in the time span - * @return every duration points average heap memory max and usage percent metrics. - * @see org.apache.skywalking.apm.collector.storage.ui.common.Step - * @see org.apache.skywalking.apm.collector.core.util.BooleanUtils - */ - Trend getHeapMemoryTrend(int instanceId, Step step, List durationPoints); - - /** - * Non heap memory Trend describes the trend of Memory in the given duration, which - * represents by the DurationPoint list in the `step` Unit. - *

SQL as: select MAX, USED, TIMES from MEMORY_METRIC where ID in (durationPoints), - * rule of ID generation is "${durationPoint}_${instanceId}_${isHeap}". - * {@link org.apache.skywalking.apm.collector.core.util.BooleanUtils#FALSE} - *

The average usage percent formula is "MAX / TIMES" and "USED / TIMES" - *

Every element in return list must match DurationPoint list, which also means that, - * the two list must be in same size, and index match. - *

If some element of the return list can't be found, the implementor must set 0 as - * default value. - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param instanceId the owner id of this memory metrics - * @param step the step which represent time formats - * @param durationPoints the time points in the time span - * @return every duration points average non heap memory max and usage percent metrics. - * @see org.apache.skywalking.apm.collector.storage.ui.common.Step - * @see org.apache.skywalking.apm.collector.core.util.BooleanUtils - */ - Trend getNoHeapMemoryTrend(int instanceId, Step step, List durationPoints); - - class Trend { - private List metrics; - private List maxMetrics; - - public Trend() { - this.metrics = new LinkedList<>(); - this.maxMetrics = new LinkedList<>(); - } - - public List getMetrics() { - return metrics; - } - - public List getMaxMetrics() { - return maxMetrics; - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/INetworkAddressUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/INetworkAddressUIDAO.java deleted file mode 100644 index 97b8def0ca1f0fb47fe22b8af42a88d17e0db368..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/INetworkAddressUIDAO.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.ui.overview.ConjecturalApp; - -/** - * Interface to be implemented for execute database query operation - * from {@link org.apache.skywalking.apm.collector.storage.table.register.NetworkAddressTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.table.register.NetworkAddressTable - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface INetworkAddressUIDAO extends DAO { - - /** - *

SQL as: select count(NETWORK_ADDRESS) from network_address - * where SRC_SPAN_LAYER = ${srcSpanLayer} - * - * @param srcSpanLayer the source layer of this network address register from - * @return count of network address register from the given source span layer - */ - int getNumOfSpanLayer(int srcSpanLayer); - - /** - * Returns the conjectural applications and the application count in every server type. - * - *

SQL as: select SERVER_TYPE, count(SERVER_TYPE) from network_address - * where SRC_SPAN_LAYER in (SpanLayer.Database_VALUE, SpanLayer.Cache_VALUE, SpanLayer.MQ_VALUE) - * group by SERVER_TYPE - * - * @return not nullable result list - */ - List getConjecturalApps(); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IResponseTimeDistributionUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IResponseTimeDistributionUIDAO.java deleted file mode 100644 index a326a6eb2e77c65d81953f123c1ca5e560b6c20e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IResponseTimeDistributionUIDAO.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; - -/** - * Interface to be implemented for execute database query operation - * from {@link org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface IResponseTimeDistributionUIDAO extends DAO { - - /** - *

SQL as: select CALLS, ERROR_CALLS, SUCCESS_CALLS from RESPONSE_TIME_DISTRIBUTION - * where ID in (${responseTimeSteps}), - * - *

Rule of ID generation is "${responseTimeStep.getDurationPoint}_${responseTimeStep.getStep}", - * - *

Every element in return list must match ResponseTimeStep list, which also means that, - * the two list must be in same size, and yAxis match. - * - *

If some element of the return list can't be found, the implementor must set 0 as - * default value. - * - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param step the step which represent time formats - * @param responseTimeSteps the time points in the time span - * @see org.apache.skywalking.apm.collector.storage.ui.common.Step - */ - void loadMetrics(Step step, List responseTimeSteps); - - class ResponseTimeStep { - private final int step; - private final long durationPoint; - private final int yAxis; - private long calls; - private long errorCalls; - private long successCalls; - - public ResponseTimeStep(long durationPoint, int yAxis, int step) { - this.step = step; - this.durationPoint = durationPoint; - this.yAxis = yAxis; - } - - public int getStep() { - return step; - } - - public long getDurationPoint() { - return durationPoint; - } - - public int getyAxis() { - return yAxis; - } - - public long getCalls() { - return calls; - } - - public void setCalls(long calls) { - this.calls = calls; - } - - public long getErrorCalls() { - return errorCalls; - } - - public void setErrorCalls(long errorCalls) { - this.errorCalls = errorCalls; - } - - public long getSuccessCalls() { - return successCalls; - } - - public void setSuccessCalls(long successCalls) { - this.successCalls = successCalls; - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/ISegmentDurationUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/ISegmentDurationUIDAO.java deleted file mode 100644 index 97f93f3ffda851d6ef7d3a6ed83e117988b42873..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/ISegmentDurationUIDAO.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.ui.trace.QueryOrder; -import org.apache.skywalking.apm.collector.storage.ui.trace.TraceBrief; -import org.apache.skywalking.apm.collector.storage.ui.trace.TraceState; - -/** - * Interface to be implemented for execute database query operation - * from {@link org.apache.skywalking.apm.collector.storage.table.segment.SegmentDurationTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.table.segment.SegmentDurationTable - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface ISegmentDurationUIDAO extends DAO { - - /** - *

SQL as: select SEGMENT_ID, START_TIME, SERVICE_NAME, DURATION, IS_ERROR - * from SEGMENT_DURATION - * where TIME_BUCKET ge ${startSecondTimeBucket} and TIME_BUCKET le ${endSecondTimeBucket} - * and DURATION ge ${minDuration} and DURATION le ${maxDuration} - * and SERVICE_NAME like '%${operationName}%' - * and SEGMENT_ID in (${segmentIds}) - * and APPLICATION_ID = ${applicationId} - * LIMIT ${limit} OFFSET ${from} - * - *

Note: Every conditions maybe not given except limit and from condition. - * - * @param startSecondTimeBucket start time format pattern is "yyyyMMddHHmmss" - * @param endSecondTimeBucket end time format pattern is "yyyyMMddHHmmss" - * @param minDuration a range condition for query, segment duration greater than given value - * @param maxDuration a range condition for query, segment duration less than given value - * @param operationName the entry span's operation name, provide fuzzy query - * @param applicationId owner id of segment - * @param limit limits the number of rows returned by the query - * @param from specified how many rows to skip - * @param segmentIds mutual exclusion on other condition - * @return not nullable result list - */ - TraceBrief loadTop(long startSecondTimeBucket, long endSecondTimeBucket, long minDuration, long maxDuration, - String operationName, int applicationId, int limit, int from, TraceState traceState, QueryOrder queryOrder, String... segmentIds); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/ISegmentUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/ISegmentUIDAO.java deleted file mode 100644 index 208bb27f0d1ee682d86120e5e389bcd30d54516c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/ISegmentUIDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.network.language.agent.TraceSegmentObject; - -/** - * Interface to be implemented for execute database query operation - * from {@link org.apache.skywalking.apm.collector.storage.table.segment.SegmentTable}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.table.segment.SegmentTable - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface ISegmentUIDAO extends DAO { - - /** - *

SQL as: select DATA_BINARY from SEGMENT where SEGMENT_ID = ${segmentId}, - * - * @param segmentId argument to bind to the query - * @return detail of segment which deserialize into proto buffer object, - * {@link TraceSegmentObject#parseFrom(byte[])} - */ - TraceSegmentObject load(String segmentId); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IServiceAlarmUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IServiceAlarmUIDAO.java deleted file mode 100644 index eddbc820cd8988d6511b2ba2eef0f02a02449c28..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IServiceAlarmUIDAO.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.text.ParseException; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.ui.alarm.Alarm; - -/** - * Interface to be implemented for execute database query operation - * from {@link org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface IServiceAlarmUIDAO extends DAO { - - /** - *

SQL as: select SERVICE_ID, ALARM_CONTENT, LAST_TIME_BUCKET, ALARM_TYPE from SERVICE_ALARM - * where LAST_TIME_BUCKET ge ${startTimeBucket} and LAST_TIME_BUCKET le ${endTimeBucket} - * and ALARM_CONTENT like '%{keyword}%' - *

Note: keyword maybe not given - * - * @param keyword fuzzy query - * @param startTimeBucket start time bucket - * @param endTimeBucket end time bucket - * @param limit limits the number of rows returned by the query - * @param from specified how many rows to skip - * @return service alarm items - * @throws ParseException alarm time parse exception - */ - Alarm loadAlarmList(String keyword, long startTimeBucket, long endTimeBucket, int limit, - int from) throws ParseException; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IServiceMetricUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IServiceMetricUIDAO.java deleted file mode 100644 index d3e2f71ab4324ab6ed075a232e23ed276c51459f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IServiceMetricUIDAO.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.util.*; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.apache.skywalking.apm.collector.storage.ui.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; - -/** - * Interface to be implemented for execute database query operation - * from {@link org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface IServiceMetricUIDAO extends DAO { - - /** - * Service Response Time Trend describes the trend of Service metric in the given duration - * , which represents by the DurationPoint list in the `step` Unit. - * - *

SQL as: select TRANSACTION_DURATION_SUM / TRANSACTION_CALLS from SERVICE_METRIC - * where ID in (${durationPoints}) - * - *

rule of ID generation is "${durationPoint}_${serviceId}_${MetricSource.Callee}" - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param serviceId query condition - * @param step the step which represent time formats - * @param durationPoints the time points in the time span - * @return every duration points average response time metrics. - */ - List getServiceResponseTimeTrend(int serviceId, Step step, List durationPoints); - - /** - * Service throughout Trend describes the trend of Service metric in the given duration - * , which represents by the DurationPoint list in the `step` Unit. - * - *

SQL as: select TRANSACTION_CALLS / ${durationPoint#minutesBetween} from SERVICE_METRIC - * where ID in (${durationPoints}) - * - *

rule of ID generation is "${durationPoint}_${serviceId}_${MetricSource.Callee}" - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param serviceId query condition - * @param step the step which represent time formats - * @param durationPoints the time points in the time span - * @return every duration points average throughout metrics. - */ - List getServiceThroughputTrend(int serviceId, Step step, List durationPoints); - - /** - * Service SLA Trend describes the trend of Service SLA metrics in the given duration - * , which represents by the DurationPoint list in the `step` Unit. - * - *

SQL as: select (( TRANSACTION_CALLS - TRANSACTION_ERROR_CALLS ) * 10000) / TRANSACTION_CALLS - * from SERVICE_METRIC where ID in (${durationPoints}) - * - *

rule of ID generation is "${durationPoint}_${serviceId}_${MetricSource.Callee}" - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param serviceId query condition - * @param step the step which represent time formats - * @param durationPoints the time points in the time span - * @return every duration points service SLA metrics. - */ - List getServiceSLATrend(int serviceId, Step step, List durationPoints); - - /** - *

SQL as: select SERVICE_ID, sum(TRANSACTION_CALLS), sum(TRANSACTION_ERROR_CALLS) - * from SERVICE_METRIC - * where TIME_BUCKET ge ${startTimeBucket} and TIME_BUCKET le ${endTimeBucket} - * and SOURCE_VALUE = ${metricSource} and SERVICE_ID in (${serviceIds}) - * group by SERVICE_ID - * - *

The SLA formula is "( TRANSACTION_CALLS - TRANSACTION_ERROR_CALLS ) * 10000 ) / TRANSACTION_CALLS" - * - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param step the step which represent time formats - * @param startTimeBucket start time bucket - * @param endTimeBucket end time bucket - * @param metricSource source of this metric, server side or client side - * @param serviceIds query condition - * @return not nullable result list - */ - List getServicesMetric(Step step, long startTimeBucket, long endTimeBucket, - MetricSource metricSource, Collection serviceIds); - - /** - * Returns the top n slow services that collected between start time bucket - * and end time bucket. - * - *

SQL as: select SERVICE_ID, TRANSACTION_CALLS, TRANSACTION_AVERAGE_DURATION - * from SERVICE_METRIC where ID in (${durationPoints}) - * where TIME_BUCKET ge ${startTimeBucket} and TIME_BUCKET le ${endTimeBucket} - * and SOURCE_VALUE = ${metricSource} - * and APPLICATION_ID = ${applicationId} - * order by TRANSACTION_AVERAGE_DURATION desc - * limit ${topN} - * - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param applicationId query condition - * @param step the step which represent time formats - * @param startTimeBucket start time bucket - * @param endTimeBucket end time bucket - * @param topN how many rows should return - * @param metricSource source of this metric, server side or client side - * @return not nullable result list - */ - List getSlowService(int applicationId, Step step, long startTimeBucket, long endTimeBucket, - Integer topN, MetricSource metricSource); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IServiceNameServiceUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IServiceNameServiceUIDAO.java deleted file mode 100644 index 04f4e88a880d147e6cd4cf47bf0a333cfb3e7da1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IServiceNameServiceUIDAO.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.ui.service.ServiceInfo; - -/** - * Interface to be implemented for execute database query operation - * from {@link org.apache.skywalking.apm.collector.storage.table.register.ServiceNameTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.table.register.ServiceNameTable - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface IServiceNameServiceUIDAO extends DAO { - - /** - * Returns count of service name which register by entry span. - * - *

SQL as: select count(SERVICE_NAME) from SERVICE_NAME - * where SRC_SPAN_TYPE = SpanType.Entry_VALUE - * and HEARTBEAT_TIME ge ${startTimeMillis} - * - * @param startTimeMillis service heart beat time after given data - * @return count of service names - */ - int getCount(long startTimeMillis); - - /** - *

SQL as: select SERVICE_ID, SERVICE_NAME from SERVICE_NAME - * where SRC_SPAN_TYPE = SpanType.Entry_VALUE - * and SERVICE_NAME like '%{keyword}%' - * and APPLICATION_ID = ${applicationId} - * and HEARTBEAT_TIME ge ${startTimeMillis} - * - *

Note: keyword might not given - * - * @param keyword fuzzy query condition - * @param applicationId the owner id of this service - * @param startTimeMillis service heart beat time after given data - * @param topN how many rows should return - * @return not nullable result list - */ - List searchService(String keyword, int applicationId, long startTimeMillis, int topN); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IServiceReferenceMetricUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IServiceReferenceMetricUIDAO.java deleted file mode 100644 index d42776dd9241d47fc3fb6bac479b0921485a35a8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IServiceReferenceMetricUIDAO.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.storage.base.dao.DAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; - -/** - * Interface to be implemented for execute database query operation - * from {@link org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable#TABLE}. - * - * @author peng-yongsheng - * @see org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable - * @see org.apache.skywalking.apm.collector.storage.StorageModule - */ -public interface IServiceReferenceMetricUIDAO extends DAO { - - /** - * Returns the service reference metrics which call the given service id - * that collected between start time bucket and end time bucket. - * - *

SQL as: select FRONT_SERVICE_ID, sum(TRANSACTION_CALLS), sum(TRANSACTION_ERROR_CALLS), - * sum(TRANSACTION_DURATION_SUM), sum(TRANSACTION_ERROR_DURATION_SUM) - * from SERVICE_REFERENCE_METRIC - * where TIME_BUCKET ge ${startTimeBucket} and TIME_BUCKET le ${endTimeBucket} - * and SOURCE_VALUE = ${metricSource} - * and BEHIND_SERVICE_ID = ${behindServiceId} - * group by FRONT_SERVICE_ID - * - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param step the step which represent time formats - * @param startTimeBucket start time bucket - * @param endTimeBucket end time bucket - * @param metricSource source of this metric, server side or client side - * @param behindServiceId the callee service id - * @return not nullable result list - */ - List getFrontServices(Step step, long startTimeBucket, long endTimeBucket, - MetricSource metricSource, int behindServiceId); - - /** - * Returns the service reference metrics which call from the given service id - * that collected between start time bucket and end time bucket. - * - *

SQL as: select FRONT_SERVICE_ID, sum(TRANSACTION_CALLS), sum(TRANSACTION_ERROR_CALLS), - * sum(TRANSACTION_DURATION_SUM), sum(TRANSACTION_ERROR_DURATION_SUM) - * from SERVICE_REFERENCE_METRIC - * where TIME_BUCKET ge ${startTimeBucket} and TIME_BUCKET le ${endTimeBucket} - * and SOURCE_VALUE = ${metricSource} - * and BEHIND_SERVICE_ID = ${frontServiceId} - * group by BEHIND_SERVICE_ID - * - *

Use {@link org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step, String)} - * to generate table name which mixed with step name. - * - * @param step the step which represent time formats - * @param startTimeBucket start time bucket - * @param endTimeBucket end time bucket - * @param metricSource source of this metric, server side or client side - * @param frontServiceId the caller service id - * @return not nullable result list - */ - List getBehindServices(Step step, long startTimeBucket, long endTimeBucket, - MetricSource metricSource, int frontServiceId); - - class ServiceReferenceMetric { - private int source; - private int target; - private long calls; - private long errorCalls; - private long durations; - private long errorDurations; - - public int getSource() { - return source; - } - - public void setSource(int source) { - this.source = source; - } - - public int getTarget() { - return target; - } - - public void setTarget(int target) { - this.target = target; - } - - public long getCalls() { - return calls; - } - - public void setCalls(long calls) { - this.calls = calls; - } - - public long getErrorCalls() { - return errorCalls; - } - - public void setErrorCalls(long errorCalls) { - this.errorCalls = errorCalls; - } - - public long getDurations() { - return durations; - } - - public void setDurations(long durations) { - this.durations = durations; - } - - public long getErrorDurations() { - return errorDurations; - } - - public void setErrorDurations(long errorDurations) { - this.errorDurations = errorDurations; - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/Metric.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/Metric.java deleted file mode 100644 index 168c48138a3672942c8743599b6bb9e29adf3168..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/Metric.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table; - -/** - * @author peng-yongsheng - */ -public interface Metric { - - Integer getSourceValue(); - - void setSourceValue(Integer sourceValue); - - Long getTimeBucket(); - - void setTimeBucket(Long timeBucket); - - Long getTransactionCalls(); - - void setTransactionCalls(Long transactionCalls); - - Long getTransactionErrorCalls(); - - void setTransactionErrorCalls(Long transactionErrorCalls); - - Long getTransactionDurationSum(); - - void setTransactionDurationSum(Long transactionDurationSum); - - Long getTransactionErrorDurationSum(); - - void setTransactionErrorDurationSum(Long transactionErrorDurationSum); - - Long getTransactionAverageDuration(); - - void setTransactionAverageDuration(Long transactionAverageDuration); - - Long getBusinessTransactionCalls(); - - void setBusinessTransactionCalls(Long businessTransactionCalls); - - Long getBusinessTransactionErrorCalls(); - - void setBusinessTransactionErrorCalls(Long businessTransactionErrorCalls); - - Long getBusinessTransactionDurationSum(); - - void setBusinessTransactionDurationSum(Long businessTransactionDurationSum); - - Long getBusinessTransactionErrorDurationSum(); - - void setBusinessTransactionErrorDurationSum(Long businessTransactionErrorDurationSum); - - Long getBusinessTransactionAverageDuration(); - - void setBusinessTransactionAverageDuration(Long businessTransactionAverageDuration); - - Long getMqTransactionCalls(); - - void setMqTransactionCalls(Long mqTransactionCalls); - - Long getMqTransactionErrorCalls(); - - void setMqTransactionErrorCalls(Long mqTransactionErrorCalls); - - Long getMqTransactionDurationSum(); - - void setMqTransactionDurationSum(Long mqTransactionDurationSum); - - Long getMqTransactionErrorDurationSum(); - - void setMqTransactionErrorDurationSum(Long mqTransactionErrorDurationSum); - - Long getMqTransactionAverageDuration(); - - void setMqTransactionAverageDuration(Long mqTransactionAverageDuration); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/MetricColumns.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/MetricColumns.java deleted file mode 100644 index e11d8720fc8db494b6e275c79f33620907db15fa..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/MetricColumns.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table; - -import org.apache.skywalking.apm.collector.core.data.ColumnName; -import org.apache.skywalking.apm.collector.core.data.CommonTable; - -/** - * @author peng-yongsheng - */ -public interface MetricColumns extends CommonTable { - - ColumnName TRANSACTION_CALLS = new ColumnName("transaction_calls", "t1"); - - ColumnName TRANSACTION_ERROR_CALLS = new ColumnName("transaction_error_calls", "t2"); - - ColumnName TRANSACTION_DURATION_SUM = new ColumnName("transaction_duration_sum", "t3"); - - ColumnName TRANSACTION_ERROR_DURATION_SUM = new ColumnName("transaction_error_duration_sum", "t4"); - - ColumnName TRANSACTION_AVERAGE_DURATION = new ColumnName("transaction_average_duration", "t5"); - - ColumnName BUSINESS_TRANSACTION_CALLS = new ColumnName("business_transaction_calls", "b1"); - - ColumnName BUSINESS_TRANSACTION_ERROR_CALLS = new ColumnName("business_transaction_error_calls", "b2"); - - ColumnName BUSINESS_TRANSACTION_DURATION_SUM = new ColumnName("business_transaction_duration_sum", "b3"); - - ColumnName BUSINESS_TRANSACTION_ERROR_DURATION_SUM = new ColumnName("business_transaction_error_duration_sum", "b4"); - - ColumnName BUSINESS_TRANSACTION_AVERAGE_DURATION = new ColumnName("business_transaction_average_duration", "b5"); - - ColumnName MQ_TRANSACTION_CALLS = new ColumnName("mq_transaction_calls", "m1"); - - ColumnName MQ_TRANSACTION_ERROR_CALLS = new ColumnName("mq_transaction_error_calls", "m2"); - - ColumnName MQ_TRANSACTION_DURATION_SUM = new ColumnName("mq_transaction_duration_sum", "m3"); - - ColumnName MQ_TRANSACTION_ERROR_DURATION_SUM = new ColumnName("mq_transaction_error_duration_sum", "m4"); - - ColumnName MQ_TRANSACTION_AVERAGE_DURATION = new ColumnName("mq_transaction_average_duration", "m5"); - - ColumnName SATISFIED_COUNT = new ColumnName("satisfied_count", "a1"); - - ColumnName TOLERATING_COUNT = new ColumnName("tolerating_count", "a2"); - - ColumnName FRUSTRATED_COUNT = new ColumnName("frustrated_count", "a3"); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/MetricSource.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/MetricSource.java deleted file mode 100644 index 26af12fda6c49e1395a1a96b17e8ca9910ca29ce..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/MetricSource.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table; - -/** - * @author peng-yongsheng - */ -public enum MetricSource { - Caller(0), Callee(1); - - private final int value; - - private MetricSource(int value) { - this.value = value; - } - - public int getValue() { - return value; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/ReferenceColumns.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/ReferenceColumns.java deleted file mode 100644 index 18a6babe8a2371be577bfe37342b1d39b7f18f02..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/ReferenceColumns.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table; - -import org.apache.skywalking.apm.collector.core.data.ColumnName; - -/** - * @author peng-yongsheng - */ -public interface ReferenceColumns { - ColumnName FRONT_APPLICATION_ID = new ColumnName("front_application_id", "fai"); - - ColumnName BEHIND_APPLICATION_ID = new ColumnName("behind_application_id", "bai"); - - ColumnName FRONT_INSTANCE_ID = new ColumnName("front_instance_id", "fii"); - - ColumnName BEHIND_INSTANCE_ID = new ColumnName("behind_instance_id", "bii"); - - ColumnName FRONT_SERVICE_ID = new ColumnName("front_service_id", "fsi"); - - ColumnName BEHIND_SERVICE_ID = new ColumnName("behind_service_id", "bsi"); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/Alarm.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/Alarm.java deleted file mode 100644 index da8c3a0bbc553b39e9e7db97539082ab097d312d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/Alarm.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -/** - * @author peng-yongsheng - */ -public interface Alarm { - - Integer getAlarmType(); - - void setAlarmType(Integer alarmType); - - Integer getSourceValue(); - - void setSourceValue(Integer sourceValue); - - Long getLastTimeBucket(); - - void setLastTimeBucket(Long lastTimeBucket); - - String getAlarmContent(); - - void setAlarmContent(String alarmContent); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/AlarmColumns.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/AlarmColumns.java deleted file mode 100644 index 4b3ae312b712adbd6cebc61c772da9e3c85cf286..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/AlarmColumns.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.core.data.ColumnName; -import org.apache.skywalking.apm.collector.core.data.CommonTable; - -/** - * @author peng-yongsheng - */ -public interface AlarmColumns extends CommonTable { - - ColumnName ALARM_TYPE = new ColumnName("alarm_type", "aat"); - - ColumnName ALARM_CONTENT = new ColumnName("alarm_content", "aac"); - - ColumnName LAST_TIME_BUCKET = new ColumnName("last_time_bucket", "ltb"); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/AlarmType.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/AlarmType.java deleted file mode 100644 index b9332bddbd49754721946dd939ae64eef07458b3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/AlarmType.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -/** - * @author peng-yongsheng - */ -public enum AlarmType { - ERROR_RATE(0), SLOW_RTT(1); - - private final int value; - - AlarmType(int value) { - this.value = value; - } - - public int getValue() { - return value; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarm.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarm.java deleted file mode 100644 index 78a8449db227d0329ebab4aceaeafa0045560d09..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarm.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarm extends StreamData implements Alarm { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(ApplicationAlarmTable.ID, new NonMergeOperation()), - new StringColumn(ApplicationAlarmTable.ALARM_CONTENT, new CoverMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(ApplicationAlarmTable.LAST_TIME_BUCKET, new CoverMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(ApplicationAlarmTable.ALARM_TYPE, new NonMergeOperation()), - new IntegerColumn(ApplicationAlarmTable.SOURCE_VALUE, new NonMergeOperation()), - new IntegerColumn(ApplicationAlarmTable.APPLICATION_ID, new NonMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public ApplicationAlarm() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getId(); - } - - @Override public void setMetricId(String metricId) { - setId(metricId); - } - - @Override - public Integer getAlarmType() { - return getDataInteger(0); - } - - @Override - public void setAlarmType(Integer alarmType) { - setDataInteger(0, alarmType); - } - - @Override - public Integer getSourceValue() { - return getDataInteger(1); - } - - @Override - public void setSourceValue(Integer sourceValue) { - setDataInteger(1, sourceValue); - } - - public Integer getApplicationId() { - return getDataInteger(2); - } - - public void setApplicationId(Integer applicationId) { - setDataInteger(2, applicationId); - } - - @Override - public Long getLastTimeBucket() { - return getDataLong(0); - } - - @Override - public void setLastTimeBucket(Long lastTimeBucket) { - setDataLong(0, lastTimeBucket); - } - - @Override - public String getAlarmContent() { - return getDataString(1); - } - - @Override - public void setAlarmContent(String alarmContent) { - setDataString(1, alarmContent); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new ApplicationAlarm(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarmList.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarmList.java deleted file mode 100644 index 9c4aaadc92370c353ea602d5f657f3178abcb606..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarmList.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmList extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(ApplicationAlarmListTable.ID, new NonMergeOperation()), - new StringColumn(ApplicationAlarmListTable.METRIC_ID, new NonMergeOperation()), - new StringColumn(ApplicationAlarmListTable.ALARM_CONTENT, new CoverMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(ApplicationAlarmListTable.TIME_BUCKET, new NonMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(ApplicationAlarmListTable.ALARM_TYPE, new NonMergeOperation()), - new IntegerColumn(ApplicationAlarmListTable.SOURCE_VALUE, new NonMergeOperation()), - new IntegerColumn(ApplicationAlarmListTable.APPLICATION_ID, new NonMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public ApplicationAlarmList() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getDataString(1); - } - - @Override public void setMetricId(String metricId) { - setDataString(1, metricId); - } - - public String getAlarmContent() { - return getDataString(2); - } - - public void setAlarmContent(String alarmContent) { - setDataString(2, alarmContent); - } - - public Integer getAlarmType() { - return getDataInteger(0); - } - - public void setAlarmType(Integer alarmType) { - setDataInteger(0, alarmType); - } - - public Integer getSourceValue() { - return getDataInteger(1); - } - - public void setSourceValue(Integer sourceValue) { - setDataInteger(1, sourceValue); - } - - public Integer getApplicationId() { - return getDataInteger(2); - } - - public void setApplicationId(Integer applicationId) { - setDataInteger(2, applicationId); - } - - public Long getTimeBucket() { - return getDataLong(0); - } - - public void setTimeBucket(Long timeBucket) { - setDataLong(0, timeBucket); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new ApplicationAlarmList(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarmListTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarmListTable.java deleted file mode 100644 index f2e0d313757ec6f204650da99c93372ec6f0cb60..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarmListTable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.storage.table.register.RegisterColumns; - -/** - * @author peng-yongsheng - */ -public interface ApplicationAlarmListTable extends AlarmColumns, RegisterColumns { - String TABLE = "application_alarm_list"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarmTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarmTable.java deleted file mode 100644 index 15cabc7d31a8f721284480f2f374e835fa73f357..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarmTable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.storage.table.register.RegisterColumns; - -/** - * @author peng-yongsheng - */ -public interface ApplicationAlarmTable extends AlarmColumns, RegisterColumns { - String TABLE = "application_alarm"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarm.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarm.java deleted file mode 100644 index a48b3a5969d470a69c58a2d1f1c8fb2846d1f224..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarm.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceAlarm extends StreamData implements Alarm { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(ApplicationReferenceAlarmTable.ID, new NonMergeOperation()), - new StringColumn(ApplicationReferenceAlarmTable.ALARM_CONTENT, new CoverMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(ApplicationReferenceAlarmTable.LAST_TIME_BUCKET, new CoverMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(ApplicationReferenceAlarmTable.ALARM_TYPE, new NonMergeOperation()), - new IntegerColumn(ApplicationReferenceAlarmTable.SOURCE_VALUE, new NonMergeOperation()), - new IntegerColumn(ApplicationReferenceAlarmTable.FRONT_APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(ApplicationReferenceAlarmTable.BEHIND_APPLICATION_ID, new NonMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public ApplicationReferenceAlarm() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getId(); - } - - @Override public void setMetricId(String metricId) { - setId(metricId); - } - - @Override - public Integer getAlarmType() { - return getDataInteger(0); - } - - @Override - public void setAlarmType(Integer alarmType) { - setDataInteger(0, alarmType); - } - - @Override - public Integer getSourceValue() { - return getDataInteger(1); - } - - @Override - public void setSourceValue(Integer sourceValue) { - setDataInteger(1, sourceValue); - } - - public Integer getFrontApplicationId() { - return getDataInteger(2); - } - - public void setFrontApplicationId(Integer frontApplicationId) { - setDataInteger(2, frontApplicationId); - } - - public Integer getBehindApplicationId() { - return getDataInteger(3); - } - - public void setBehindApplicationId(Integer behindApplicationId) { - setDataInteger(3, behindApplicationId); - } - - @Override - public Long getLastTimeBucket() { - return getDataLong(0); - } - - @Override - public void setLastTimeBucket(Long lastTimeBucket) { - setDataLong(0, lastTimeBucket); - } - - @Override - public String getAlarmContent() { - return getDataString(1); - } - - @Override - public void setAlarmContent(String alarmContent) { - setDataString(1, alarmContent); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new ApplicationReferenceAlarm(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarmList.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarmList.java deleted file mode 100644 index 2349761f922dc88af16a4009e7b166e26697e2f6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarmList.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceAlarmList extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(ApplicationReferenceAlarmListTable.ID, new NonMergeOperation()), - new StringColumn(ApplicationReferenceAlarmListTable.ALARM_CONTENT, new CoverMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(ApplicationReferenceAlarmListTable.TIME_BUCKET, new NonMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(ApplicationReferenceAlarmListTable.ALARM_TYPE, new NonMergeOperation()), - new IntegerColumn(ApplicationReferenceAlarmListTable.SOURCE_VALUE, new NonMergeOperation()), - new IntegerColumn(ApplicationReferenceAlarmListTable.FRONT_APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(ApplicationReferenceAlarmListTable.BEHIND_APPLICATION_ID, new NonMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public ApplicationReferenceAlarmList() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getId(); - } - - @Override public void setMetricId(String metricId) { - setId(metricId); - } - - public Integer getAlarmType() { - return getDataInteger(0); - } - - public void setAlarmType(Integer alarmType) { - setDataInteger(0, alarmType); - } - - public Integer getSourceValue() { - return getDataInteger(1); - } - - public void setSourceValue(Integer sourceValue) { - setDataInteger(1, sourceValue); - } - - public Integer getFrontApplicationId() { - return getDataInteger(2); - } - - public void setFrontApplicationId(Integer frontApplicationId) { - setDataInteger(2, frontApplicationId); - } - - public Integer getBehindApplicationId() { - return getDataInteger(3); - } - - public void setBehindApplicationId(Integer behindApplicationId) { - setDataInteger(3, behindApplicationId); - } - - public Long getTimeBucket() { - return getDataLong(0); - } - - public void setTimeBucket(Long timeBucket) { - setDataLong(0, timeBucket); - } - - public String getAlarmContent() { - return getDataString(1); - } - - public void setAlarmContent(String alarmContent) { - setDataString(1, alarmContent); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new ApplicationReferenceAlarmList(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarmListTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarmListTable.java deleted file mode 100644 index 85fe2b68bef5a0d2f41f81743165eed9616aff7b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarmListTable.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.storage.table.MetricColumns; -import org.apache.skywalking.apm.collector.storage.table.ReferenceColumns; - -/** - * @author peng-yongsheng - */ -public interface ApplicationReferenceAlarmListTable extends MetricColumns, ReferenceColumns, AlarmColumns { - String TABLE = "application_reference_alarm_list"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarmTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarmTable.java deleted file mode 100644 index 4cb656e3e808d592201f9746dcd6d02a1944e513..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationReferenceAlarmTable.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.storage.table.ReferenceColumns; -import org.apache.skywalking.apm.collector.storage.table.register.RegisterColumns; - -/** - * @author peng-yongsheng - */ -public interface ApplicationReferenceAlarmTable extends ReferenceColumns, RegisterColumns, AlarmColumns { - String TABLE = "application_reference_alarm"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceAlarm.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceAlarm.java deleted file mode 100644 index 1643bdc87dc1dcfb8561b21af248e1b39e59ba76..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceAlarm.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class InstanceAlarm extends StreamData implements Alarm { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(InstanceAlarmTable.ID, new NonMergeOperation()), - new StringColumn(InstanceAlarmTable.ALARM_CONTENT, new CoverMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(InstanceAlarmTable.LAST_TIME_BUCKET, new CoverMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(InstanceAlarmTable.ALARM_TYPE, new NonMergeOperation()), - new IntegerColumn(InstanceAlarmTable.SOURCE_VALUE, new NonMergeOperation()), - new IntegerColumn(InstanceAlarmTable.APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(InstanceAlarmTable.INSTANCE_ID, new NonMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public InstanceAlarm() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getId(); - } - - @Override public void setMetricId(String metricId) { - setId(metricId); - } - - @Override - public Integer getAlarmType() { - return getDataInteger(0); - } - - @Override - public void setAlarmType(Integer alarmType) { - setDataInteger(0, alarmType); - } - - @Override - public Integer getSourceValue() { - return getDataInteger(1); - } - - @Override - public void setSourceValue(Integer sourceValue) { - setDataInteger(1, sourceValue); - } - - public Integer getApplicationId() { - return getDataInteger(2); - } - - public void setApplicationId(Integer applicationId) { - setDataInteger(2, applicationId); - } - - public Integer getInstanceId() { - return getDataInteger(3); - } - - public void setInstanceId(Integer instanceId) { - setDataInteger(3, instanceId); - } - - @Override - public Long getLastTimeBucket() { - return getDataLong(0); - } - - @Override - public void setLastTimeBucket(Long lastTimeBucket) { - setDataLong(0, lastTimeBucket); - } - - @Override - public String getAlarmContent() { - return getDataString(1); - } - - @Override - public void setAlarmContent(String alarmContent) { - setDataString(1, alarmContent); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new InstanceAlarm(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceAlarmList.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceAlarmList.java deleted file mode 100644 index 7acc3bc534f1482c5bda2a4f71b1e2b564692e32..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceAlarmList.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class InstanceAlarmList extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(InstanceAlarmListTable.ID, new NonMergeOperation()), - new StringColumn(InstanceAlarmListTable.ALARM_CONTENT, new CoverMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(InstanceAlarmListTable.TIME_BUCKET, new NonMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(InstanceAlarmListTable.ALARM_TYPE, new NonMergeOperation()), - new IntegerColumn(InstanceAlarmListTable.SOURCE_VALUE, new NonMergeOperation()), - new IntegerColumn(InstanceAlarmListTable.APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(InstanceAlarmListTable.INSTANCE_ID, new NonMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public InstanceAlarmList() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getId(); - } - - @Override public void setMetricId(String metricId) { - setId(metricId); - } - - public Integer getAlarmType() { - return getDataInteger(0); - } - - public void setAlarmType(Integer alarmType) { - setDataInteger(0, alarmType); - } - - public Integer getSourceValue() { - return getDataInteger(1); - } - - public void setSourceValue(Integer sourceValue) { - setDataInteger(1, sourceValue); - } - - public Integer getApplicationId() { - return getDataInteger(2); - } - - public void setApplicationId(Integer applicationId) { - setDataInteger(2, applicationId); - } - - public Integer getInstanceId() { - return getDataInteger(3); - } - - public void setInstanceId(Integer instanceId) { - setDataInteger(3, instanceId); - } - - public Long getTimeBucket() { - return getDataLong(0); - } - - public void setTimeBucket(Long timeBucket) { - setDataLong(0, timeBucket); - } - - public String getAlarmContent() { - return getDataString(1); - } - - public void setAlarmContent(String alarmContent) { - setDataString(1, alarmContent); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new InstanceAlarmList(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceAlarmListTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceAlarmListTable.java deleted file mode 100644 index b586e861f157e091a1b8ed374b5bc05d8a7ecefb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceAlarmListTable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.storage.table.register.RegisterColumns; - -/** - * @author peng-yongsheng - */ -public interface InstanceAlarmListTable extends RegisterColumns, AlarmColumns { - String TABLE = "instance_alarm_list"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceAlarmTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceAlarmTable.java deleted file mode 100644 index 34848e9c9e2154be94e1ab7ca2d6cc4c8efb42f0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceAlarmTable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.storage.table.register.RegisterColumns; - -/** - * @author peng-yongsheng - */ -public interface InstanceAlarmTable extends AlarmColumns, RegisterColumns { - String TABLE = "instance_alarm"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceReferenceAlarm.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceReferenceAlarm.java deleted file mode 100644 index d94b97dc9a52baa544e4796f84824382f63fa2e0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceReferenceAlarm.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceAlarm extends StreamData implements Alarm { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(InstanceReferenceAlarmTable.ID, new NonMergeOperation()), - new StringColumn(InstanceReferenceAlarmTable.ALARM_CONTENT, new CoverMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(InstanceReferenceAlarmTable.LAST_TIME_BUCKET, new CoverMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(InstanceReferenceAlarmTable.ALARM_TYPE, new NonMergeOperation()), - new IntegerColumn(InstanceReferenceAlarmTable.SOURCE_VALUE, new NonMergeOperation()), - new IntegerColumn(InstanceReferenceAlarmTable.FRONT_APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(InstanceReferenceAlarmTable.BEHIND_APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(InstanceReferenceAlarmTable.FRONT_INSTANCE_ID, new NonMergeOperation()), - new IntegerColumn(InstanceReferenceAlarmTable.BEHIND_INSTANCE_ID, new NonMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public InstanceReferenceAlarm() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getId(); - } - - @Override public void setMetricId(String metricId) { - setId(metricId); - } - - @Override - public Integer getAlarmType() { - return getDataInteger(0); - } - - @Override - public void setAlarmType(Integer alarmType) { - setDataInteger(0, alarmType); - } - - @Override - public Integer getSourceValue() { - return getDataInteger(1); - } - - @Override - public void setSourceValue(Integer sourceValue) { - setDataInteger(1, sourceValue); - } - - public Integer getFrontApplicationId() { - return getDataInteger(2); - } - - public void setFrontApplicationId(Integer frontApplicationId) { - setDataInteger(2, frontApplicationId); - } - - public Integer getBehindApplicationId() { - return getDataInteger(3); - } - - public void setBehindApplicationId(Integer behindApplicationId) { - setDataInteger(3, behindApplicationId); - } - - public Integer getFrontInstanceId() { - return getDataInteger(4); - } - - public void setFrontInstanceId(Integer frontInstanceId) { - setDataInteger(4, frontInstanceId); - } - - public Integer getBehindInstanceId() { - return getDataInteger(5); - } - - public void setBehindInstanceId(Integer behindInstanceId) { - setDataInteger(5, behindInstanceId); - } - - @Override - public Long getLastTimeBucket() { - return getDataLong(0); - } - - @Override - public void setLastTimeBucket(Long lastTimeBucket) { - setDataLong(0, lastTimeBucket); - } - - @Override - public String getAlarmContent() { - return getDataString(1); - } - - @Override - public void setAlarmContent(String alarmContent) { - setDataString(1, alarmContent); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new InstanceReferenceAlarm(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceReferenceAlarmList.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceReferenceAlarmList.java deleted file mode 100644 index c6e38da113278904172762e2995b9e4de0a6162a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceReferenceAlarmList.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceAlarmList extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(InstanceReferenceAlarmListTable.ID, new NonMergeOperation()), - new StringColumn(InstanceReferenceAlarmListTable.ALARM_CONTENT, new CoverMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(InstanceReferenceAlarmListTable.TIME_BUCKET, new NonMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(InstanceReferenceAlarmListTable.ALARM_TYPE, new NonMergeOperation()), - new IntegerColumn(InstanceReferenceAlarmListTable.SOURCE_VALUE, new NonMergeOperation()), - new IntegerColumn(InstanceReferenceAlarmListTable.FRONT_APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(InstanceReferenceAlarmListTable.BEHIND_APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(InstanceReferenceAlarmListTable.FRONT_INSTANCE_ID, new NonMergeOperation()), - new IntegerColumn(InstanceReferenceAlarmListTable.BEHIND_INSTANCE_ID, new NonMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public InstanceReferenceAlarmList() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getId(); - } - - @Override public void setMetricId(String metricId) { - setId(metricId); - } - - public Integer getAlarmType() { - return getDataInteger(0); - } - - public void setAlarmType(Integer alarmType) { - setDataInteger(0, alarmType); - } - - public Integer getSourceValue() { - return getDataInteger(1); - } - - public void setSourceValue(Integer sourceValue) { - setDataInteger(1, sourceValue); - } - - public Integer getFrontApplicationId() { - return getDataInteger(2); - } - - public void setFrontApplicationId(Integer frontApplicationId) { - setDataInteger(2, frontApplicationId); - } - - public Integer getBehindApplicationId() { - return getDataInteger(3); - } - - public void setBehindApplicationId(Integer behindApplicationId) { - setDataInteger(3, behindApplicationId); - } - - public Integer getFrontInstanceId() { - return getDataInteger(4); - } - - public void setFrontInstanceId(Integer frontInstanceId) { - setDataInteger(4, frontInstanceId); - } - - public Integer getBehindInstanceId() { - return getDataInteger(5); - } - - public void setBehindInstanceId(Integer behindInstanceId) { - setDataInteger(5, behindInstanceId); - } - - public Long getTimeBucket() { - return getDataLong(0); - } - - public void setTimeBucket(Long timeBucket) { - setDataLong(0, timeBucket); - } - - public String getAlarmContent() { - return getDataString(1); - } - - public void setAlarmContent(String alarmContent) { - setDataString(1, alarmContent); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new InstanceReferenceAlarmList(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceReferenceAlarmListTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceReferenceAlarmListTable.java deleted file mode 100644 index 23dbb2a41d4ab3894809865c1a188faebd68bf50..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceReferenceAlarmListTable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.storage.table.ReferenceColumns; - -/** - * @author peng-yongsheng - */ -public interface InstanceReferenceAlarmListTable extends ReferenceColumns, AlarmColumns { - String TABLE = "instance_reference_alarm_list"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceReferenceAlarmTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceReferenceAlarmTable.java deleted file mode 100644 index b548e7ecadf3e9dd05ab21bcfc200c58d4a8c4d6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/InstanceReferenceAlarmTable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.storage.table.ReferenceColumns; - -/** - * @author peng-yongsheng - */ -public interface InstanceReferenceAlarmTable extends ReferenceColumns, AlarmColumns { - String TABLE = "instance_reference_alarm"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceAlarm.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceAlarm.java deleted file mode 100644 index 12220f68e9ce68d91fff96df6ebf3cae543b9a01..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceAlarm.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class ServiceAlarm extends StreamData implements Alarm { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(ServiceAlarmTable.ID, new NonMergeOperation()), - new StringColumn(ServiceAlarmTable.ALARM_CONTENT, new CoverMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(ServiceAlarmTable.LAST_TIME_BUCKET, new CoverMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(ServiceAlarmTable.ALARM_TYPE, new NonMergeOperation()), - new IntegerColumn(ServiceAlarmTable.SOURCE_VALUE, new NonMergeOperation()), - new IntegerColumn(ServiceAlarmTable.APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(ServiceAlarmTable.INSTANCE_ID, new NonMergeOperation()), - new IntegerColumn(ServiceAlarmTable.SERVICE_ID, new NonMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public ServiceAlarm() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getId(); - } - - @Override public void setMetricId(String metricId) { - setId(metricId); - } - - @Override - public Integer getAlarmType() { - return getDataInteger(0); - } - - @Override - public void setAlarmType(Integer alarmType) { - setDataInteger(0, alarmType); - } - - @Override - public Integer getSourceValue() { - return getDataInteger(1); - } - - @Override - public void setSourceValue(Integer sourceValue) { - setDataInteger(1, sourceValue); - } - - public Integer getApplicationId() { - return getDataInteger(2); - } - - public void setApplicationId(Integer applicationId) { - setDataInteger(2, applicationId); - } - - public Integer getInstanceId() { - return getDataInteger(3); - } - - public void setInstanceId(Integer instanceId) { - setDataInteger(3, instanceId); - } - - public Integer getServiceId() { - return getDataInteger(4); - } - - public void setServiceId(Integer serviceId) { - setDataInteger(4, serviceId); - } - - @Override - public Long getLastTimeBucket() { - return getDataLong(0); - } - - @Override - public void setLastTimeBucket(Long lastTimeBucket) { - setDataLong(0, lastTimeBucket); - } - - @Override - public String getAlarmContent() { - return getDataString(1); - } - - @Override - public void setAlarmContent(String alarmContent) { - setDataString(1, alarmContent); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new ServiceAlarm(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceAlarmList.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceAlarmList.java deleted file mode 100644 index f60cc492879f3bb225bf8dbdd832fca671d13d98..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceAlarmList.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class ServiceAlarmList extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(ServiceAlarmListTable.ID, new NonMergeOperation()), - new StringColumn(ServiceAlarmListTable.ALARM_CONTENT, new CoverMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(ServiceAlarmListTable.TIME_BUCKET, new NonMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(ServiceAlarmListTable.ALARM_TYPE, new NonMergeOperation()), - new IntegerColumn(ServiceAlarmListTable.SOURCE_VALUE, new NonMergeOperation()), - new IntegerColumn(ServiceAlarmListTable.APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(ServiceAlarmListTable.INSTANCE_ID, new NonMergeOperation()), - new IntegerColumn(ServiceAlarmListTable.SERVICE_ID, new NonMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public ServiceAlarmList() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getId(); - } - - @Override public void setMetricId(String metricId) { - setId(metricId); - } - - public Integer getAlarmType() { - return getDataInteger(0); - } - - public void setAlarmType(Integer alarmType) { - setDataInteger(0, alarmType); - } - - public Integer getSourceValue() { - return getDataInteger(1); - } - - public void setSourceValue(Integer sourceValue) { - setDataInteger(1, sourceValue); - } - - public Integer getApplicationId() { - return getDataInteger(2); - } - - public void setApplicationId(Integer applicationId) { - setDataInteger(2, applicationId); - } - - public Integer getInstanceId() { - return getDataInteger(3); - } - - public void setInstanceId(Integer instanceId) { - setDataInteger(3, instanceId); - } - - public Integer getServiceId() { - return getDataInteger(4); - } - - public void setServiceId(Integer serviceId) { - setDataInteger(4, serviceId); - } - - public Long getTimeBucket() { - return getDataLong(0); - } - - public void setTimeBucket(Long timeBucket) { - setDataLong(0, timeBucket); - } - - public String getAlarmContent() { - return getDataString(1); - } - - public void setAlarmContent(String alarmContent) { - setDataString(1, alarmContent); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new ServiceAlarmList(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceAlarmListTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceAlarmListTable.java deleted file mode 100644 index 2ee0e0f0a11aec5ea7f78dfaeb1a952569df91cf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceAlarmListTable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.storage.table.register.RegisterColumns; - -/** - * @author peng-yongsheng - */ -public interface ServiceAlarmListTable extends RegisterColumns, AlarmColumns { - String TABLE = "service_alarm_list"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceAlarmTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceAlarmTable.java deleted file mode 100644 index 8f9b677bdadd01a7082e600865db50cd1beb2e68..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceAlarmTable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.storage.table.register.RegisterColumns; - -/** - * @author peng-yongsheng - */ -public interface ServiceAlarmTable extends RegisterColumns, AlarmColumns { - String TABLE = "service_alarm"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceReferenceAlarm.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceReferenceAlarm.java deleted file mode 100644 index 1d070d471851d219b31fccd4695a46b2b319e670..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceReferenceAlarm.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceAlarm extends StreamData implements Alarm { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(ServiceReferenceAlarmTable.ID, new NonMergeOperation()), - new StringColumn(ServiceReferenceAlarmTable.ALARM_CONTENT, new CoverMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(ServiceReferenceAlarmTable.LAST_TIME_BUCKET, new CoverMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(ServiceReferenceAlarmTable.ALARM_TYPE, new NonMergeOperation()), - new IntegerColumn(ServiceReferenceAlarmTable.SOURCE_VALUE, new NonMergeOperation()), - new IntegerColumn(ServiceReferenceAlarmTable.FRONT_APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(ServiceReferenceAlarmTable.BEHIND_APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(ServiceReferenceAlarmTable.FRONT_INSTANCE_ID, new NonMergeOperation()), - new IntegerColumn(ServiceReferenceAlarmTable.BEHIND_INSTANCE_ID, new NonMergeOperation()), - new IntegerColumn(ServiceReferenceAlarmTable.FRONT_SERVICE_ID, new NonMergeOperation()), - new IntegerColumn(ServiceReferenceAlarmTable.BEHIND_SERVICE_ID, new NonMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public ServiceReferenceAlarm() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getId(); - } - - @Override public void setMetricId(String metricId) { - setId(metricId); - } - - @Override - public Integer getAlarmType() { - return getDataInteger(0); - } - - @Override - public void setAlarmType(Integer alarmType) { - setDataInteger(0, alarmType); - } - - @Override - public Integer getSourceValue() { - return getDataInteger(1); - } - - @Override - public void setSourceValue(Integer sourceValue) { - setDataInteger(1, sourceValue); - } - - public Integer getFrontApplicationId() { - return getDataInteger(2); - } - - public void setFrontApplicationId(Integer frontApplicationId) { - setDataInteger(2, frontApplicationId); - } - - public Integer getBehindApplicationId() { - return getDataInteger(3); - } - - public void setBehindApplicationId(Integer behindApplicationId) { - setDataInteger(3, behindApplicationId); - } - - public Integer getFrontInstanceId() { - return getDataInteger(4); - } - - public void setFrontInstanceId(Integer frontInstanceId) { - setDataInteger(4, frontInstanceId); - } - - public Integer getBehindInstanceId() { - return getDataInteger(5); - } - - public void setBehindInstanceId(Integer behindInstanceId) { - setDataInteger(5, behindInstanceId); - } - - public Integer getFrontServiceId() { - return getDataInteger(6); - } - - public void setFrontServiceId(Integer frontServiceId) { - setDataInteger(6, frontServiceId); - } - - public Integer getBehindServiceId() { - return getDataInteger(7); - } - - public void setBehindServiceId(Integer behindServiceId) { - setDataInteger(7, behindServiceId); - } - - @Override - public Long getLastTimeBucket() { - return getDataLong(0); - } - - @Override - public void setLastTimeBucket(Long lastTimeBucket) { - setDataLong(0, lastTimeBucket); - } - - @Override - public String getAlarmContent() { - return getDataString(1); - } - - @Override - public void setAlarmContent(String alarmContent) { - setDataString(1, alarmContent); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new ServiceReferenceAlarm(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceReferenceAlarmList.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceReferenceAlarmList.java deleted file mode 100644 index ead2316ecf8aafa958e9ec65dec50a3fa02300f4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceReferenceAlarmList.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceAlarmList extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(ServiceReferenceAlarmListTable.ID, new NonMergeOperation()), - new StringColumn(ServiceReferenceAlarmListTable.ALARM_CONTENT, new CoverMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(ServiceReferenceAlarmListTable.TIME_BUCKET, new NonMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(ServiceReferenceAlarmListTable.ALARM_TYPE, new NonMergeOperation()), - new IntegerColumn(ServiceReferenceAlarmListTable.SOURCE_VALUE, new NonMergeOperation()), - new IntegerColumn(ServiceReferenceAlarmListTable.FRONT_APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(ServiceReferenceAlarmListTable.BEHIND_APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(ServiceReferenceAlarmListTable.FRONT_INSTANCE_ID, new NonMergeOperation()), - new IntegerColumn(ServiceReferenceAlarmListTable.BEHIND_INSTANCE_ID, new NonMergeOperation()), - new IntegerColumn(ServiceReferenceAlarmListTable.FRONT_SERVICE_ID, new NonMergeOperation()), - new IntegerColumn(ServiceReferenceAlarmListTable.BEHIND_SERVICE_ID, new NonMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public ServiceReferenceAlarmList() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getId(); - } - - @Override public void setMetricId(String metricId) { - setId(metricId); - } - - public Integer getAlarmType() { - return getDataInteger(0); - } - - public void setAlarmType(Integer alarmType) { - setDataInteger(0, alarmType); - } - - public Integer getSourceValue() { - return getDataInteger(1); - } - - public void setSourceValue(Integer sourceValue) { - setDataInteger(1, sourceValue); - } - - public Integer getFrontApplicationId() { - return getDataInteger(2); - } - - public void setFrontApplicationId(Integer frontApplicationId) { - setDataInteger(2, frontApplicationId); - } - - public Integer getBehindApplicationId() { - return getDataInteger(3); - } - - public void setBehindApplicationId(Integer behindApplicationId) { - setDataInteger(3, behindApplicationId); - } - - public Integer getFrontInstanceId() { - return getDataInteger(4); - } - - public void setFrontInstanceId(Integer frontInstanceId) { - setDataInteger(4, frontInstanceId); - } - - public Integer getBehindInstanceId() { - return getDataInteger(5); - } - - public void setBehindInstanceId(Integer behindInstanceId) { - setDataInteger(5, behindInstanceId); - } - - public Integer getFrontServiceId() { - return getDataInteger(6); - } - - public void setFrontServiceId(Integer frontServiceId) { - setDataInteger(6, frontServiceId); - } - - public Integer getBehindServiceId() { - return getDataInteger(7); - } - - public void setBehindServiceId(Integer behindServiceId) { - setDataInteger(7, behindServiceId); - } - - public Long getTimeBucket() { - return getDataLong(0); - } - - public void setTimeBucket(Long timeBucket) { - setDataLong(0, timeBucket); - } - - public String getAlarmContent() { - return getDataString(1); - } - - public void setAlarmContent(String alarmContent) { - setDataString(1, alarmContent); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new ServiceReferenceAlarmList(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceReferenceAlarmListTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceReferenceAlarmListTable.java deleted file mode 100644 index 1fc15d07015da64c57725192026b4ea46ef750a9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceReferenceAlarmListTable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.storage.table.ReferenceColumns; - -/** - * @author peng-yongsheng - */ -public interface ServiceReferenceAlarmListTable extends ReferenceColumns, AlarmColumns { - String TABLE = "service_reference_alarm_list"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceReferenceAlarmTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceReferenceAlarmTable.java deleted file mode 100644 index 87bec3bfc9a667276f9417c96ea569e4ced20621..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceReferenceAlarmTable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.alarm; - -import org.apache.skywalking.apm.collector.storage.table.ReferenceColumns; - -/** - * @author peng-yongsheng - */ -public interface ServiceReferenceAlarmTable extends ReferenceColumns, AlarmColumns { - String TABLE = "service_reference_alarm"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationComponent.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationComponent.java deleted file mode 100644 index 7bca4bd77cee8d8f804c84c8c3aa8e1ec51c2a1a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationComponent.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.application; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponent extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(ApplicationComponentTable.ID, new NonMergeOperation()), - new StringColumn(ApplicationComponentTable.METRIC_ID, new NonMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(ApplicationComponentTable.TIME_BUCKET, new CoverMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(ApplicationComponentTable.COMPONENT_ID, new CoverMergeOperation()), - new IntegerColumn(ApplicationComponentTable.APPLICATION_ID, new CoverMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public ApplicationComponent() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getDataString(1); - } - - @Override public void setMetricId(String metricId) { - setDataString(1, metricId); - } - - public Long getTimeBucket() { - return getDataLong(0); - } - - public void setTimeBucket(Long timeBucket) { - setDataLong(0, timeBucket); - } - - public Integer getComponentId() { - return getDataInteger(0); - } - - public void setComponentId(Integer componentId) { - setDataInteger(0, componentId); - } - - public Integer getApplicationId() { - return getDataInteger(1); - } - - public void setApplicationId(Integer applicationId) { - setDataInteger(1, applicationId); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new ApplicationComponent(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationComponentTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationComponentTable.java deleted file mode 100644 index 249dab6a5e81de94035f06030fa3a617fd8c8f28..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationComponentTable.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.application; - -import org.apache.skywalking.apm.collector.core.data.ColumnName; -import org.apache.skywalking.apm.collector.core.data.CommonTable; -import org.apache.skywalking.apm.collector.storage.table.register.RegisterColumns; - -/** - * @author peng-yongsheng - */ -public interface ApplicationComponentTable extends RegisterColumns, CommonTable { - String TABLE = "application_component"; - - ColumnName COMPONENT_ID = new ColumnName("component_id", "ci"); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMapping.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMapping.java deleted file mode 100644 index cbce18f4df744638068173f47bf51f6ac3b61e24..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMapping.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.application; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class ApplicationMapping extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(ApplicationMappingTable.ID, new NonMergeOperation()), - new StringColumn(ApplicationMappingTable.METRIC_ID, new NonMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(ApplicationMappingTable.TIME_BUCKET, new CoverMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(ApplicationMappingTable.APPLICATION_ID, new CoverMergeOperation()), - new IntegerColumn(ApplicationMappingTable.MAPPING_APPLICATION_ID, new CoverMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public ApplicationMapping() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getDataString(1); - } - - @Override public void setMetricId(String metricId) { - setDataString(1, metricId); - } - - public int getApplicationId() { - return getDataInteger(0); - } - - public void setApplicationId(int applicationId) { - setDataInteger(0, applicationId); - } - - public int getMappingApplicationId() { - return getDataInteger(1); - } - - public void setMappingApplicationId(int mappingApplicationId) { - setDataInteger(1, mappingApplicationId); - } - - public long getTimeBucket() { - return getDataLong(0); - } - - public void setTimeBucket(long timeBucket) { - setDataLong(0, timeBucket); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new ApplicationMapping(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMappingTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMappingTable.java deleted file mode 100644 index c70c983775098adc7fc4c0886faca1065e94cce8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMappingTable.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.application; - -import org.apache.skywalking.apm.collector.core.data.ColumnName; -import org.apache.skywalking.apm.collector.core.data.CommonTable; -import org.apache.skywalking.apm.collector.storage.table.register.RegisterColumns; - -/** - * @author peng-yongsheng - */ -public interface ApplicationMappingTable extends RegisterColumns, CommonTable { - String TABLE = "application_mapping"; - - ColumnName MAPPING_APPLICATION_ID = new ColumnName("mapping_application_id", "mai"); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMetric.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMetric.java deleted file mode 100644 index 2c16f27be0323b8463bc91e7c8b2e51d918bbefc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMetric.java +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.application; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; -import org.apache.skywalking.apm.collector.storage.table.Metric; - -/** - * @author peng-yongsheng - */ -public class ApplicationMetric extends StreamData implements Metric { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(ApplicationMetricTable.ID, new NonMergeOperation()), - new StringColumn(ApplicationMetricTable.METRIC_ID, new NonMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(ApplicationMetricTable.TIME_BUCKET, new NonMergeOperation()), - - new LongColumn(ApplicationMetricTable.TRANSACTION_CALLS, new AddMergeOperation()), - new LongColumn(ApplicationMetricTable.TRANSACTION_ERROR_CALLS, new AddMergeOperation()), - new LongColumn(ApplicationMetricTable.TRANSACTION_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ApplicationMetricTable.TRANSACTION_ERROR_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ApplicationMetricTable.TRANSACTION_AVERAGE_DURATION, new NonMergeOperation(), new TransactionAverageDurationFormulaOperation()), - new LongColumn(ApplicationMetricTable.BUSINESS_TRANSACTION_CALLS, new AddMergeOperation()), - new LongColumn(ApplicationMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, new AddMergeOperation()), - new LongColumn(ApplicationMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ApplicationMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ApplicationMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, new NonMergeOperation(), new BusinessTransactionAverageDurationFormulaOperation()), - new LongColumn(ApplicationMetricTable.MQ_TRANSACTION_CALLS, new AddMergeOperation()), - new LongColumn(ApplicationMetricTable.MQ_TRANSACTION_ERROR_CALLS, new AddMergeOperation()), - new LongColumn(ApplicationMetricTable.MQ_TRANSACTION_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ApplicationMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ApplicationMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, new NonMergeOperation(), new MqTransactionAverageDurationFormulaOperation()), - new LongColumn(ApplicationMetricTable.SATISFIED_COUNT, new AddMergeOperation()), - new LongColumn(ApplicationMetricTable.TOLERATING_COUNT, new AddMergeOperation()), - new LongColumn(ApplicationMetricTable.FRUSTRATED_COUNT, new AddMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(ApplicationMetricTable.SOURCE_VALUE, new NonMergeOperation()), - new IntegerColumn(ApplicationMetricTable.APPLICATION_ID, new NonMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public ApplicationMetric() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getDataString(1); - } - - @Override public void setMetricId(String metricId) { - setDataString(1, metricId); - } - - @Override - public Integer getSourceValue() { - return getDataInteger(0); - } - - @Override - public void setSourceValue(Integer sourceValue) { - setDataInteger(0, sourceValue); - } - - public int getApplicationId() { - return getDataInteger(1); - } - - public void setApplicationId(int applicationId) { - setDataInteger(1, applicationId); - } - - @Override - public Long getTimeBucket() { - return getDataLong(0); - } - - @Override - public void setTimeBucket(Long timeBucket) { - setDataLong(0, timeBucket); - } - - @Override - public Long getTransactionCalls() { - return getDataLong(1); - } - - @Override - public void setTransactionCalls(Long transactionCalls) { - setDataLong(1, transactionCalls); - } - - @Override - public Long getTransactionErrorCalls() { - return getDataLong(2); - } - - @Override - public void setTransactionErrorCalls(Long transactionErrorCalls) { - setDataLong(2, transactionErrorCalls); - } - - @Override - public Long getTransactionDurationSum() { - return getDataLong(3); - } - - @Override - public void setTransactionDurationSum(Long transactionDurationSum) { - setDataLong(3, transactionDurationSum); - } - - @Override - public Long getTransactionErrorDurationSum() { - return getDataLong(4); - } - - @Override - public void setTransactionErrorDurationSum(Long transactionErrorDurationSum) { - setDataLong(4, transactionErrorDurationSum); - } - - @Override public Long getTransactionAverageDuration() { - return getDataLong(5); - } - - @Override public void setTransactionAverageDuration(Long transactionAverageDuration) { - setDataLong(5, transactionAverageDuration); - } - - @Override - public Long getBusinessTransactionCalls() { - return getDataLong(6); - } - - @Override - public void setBusinessTransactionCalls(Long businessTransactionCalls) { - setDataLong(6, businessTransactionCalls); - } - - @Override - public Long getBusinessTransactionErrorCalls() { - return getDataLong(7); - } - - @Override - public void setBusinessTransactionErrorCalls(Long businessTransactionErrorCalls) { - setDataLong(7, businessTransactionErrorCalls); - } - - @Override - public Long getBusinessTransactionDurationSum() { - return getDataLong(8); - } - - @Override - public void setBusinessTransactionDurationSum(Long businessTransactionDurationSum) { - setDataLong(8, businessTransactionDurationSum); - } - - @Override - public Long getBusinessTransactionErrorDurationSum() { - return getDataLong(9); - } - - @Override - public void setBusinessTransactionErrorDurationSum(Long businessTransactionErrorDurationSum) { - setDataLong(9, businessTransactionErrorDurationSum); - } - - @Override public Long getBusinessTransactionAverageDuration() { - return getDataLong(10); - } - - @Override public void setBusinessTransactionAverageDuration(Long businessTransactionAverageDuration) { - setDataLong(10, businessTransactionAverageDuration); - } - - @Override - public Long getMqTransactionCalls() { - return getDataLong(11); - } - - @Override - public void setMqTransactionCalls(Long mqTransactionCalls) { - setDataLong(11, mqTransactionCalls); - } - - @Override - public Long getMqTransactionErrorCalls() { - return getDataLong(12); - } - - @Override - public void setMqTransactionErrorCalls(Long mqTransactionErrorCalls) { - setDataLong(12, mqTransactionErrorCalls); - } - - @Override - public Long getMqTransactionDurationSum() { - return getDataLong(13); - } - - @Override - public void setMqTransactionDurationSum(Long mqTransactionDurationSum) { - setDataLong(13, mqTransactionDurationSum); - } - - @Override - public Long getMqTransactionErrorDurationSum() { - return getDataLong(14); - } - - @Override - public void setMqTransactionErrorDurationSum(Long mqTransactionErrorDurationSum) { - setDataLong(14, mqTransactionErrorDurationSum); - } - - @Override public Long getMqTransactionAverageDuration() { - return getDataLong(15); - } - - @Override public void setMqTransactionAverageDuration(Long mqTransactionAverageDuration) { - setDataLong(15, mqTransactionAverageDuration); - } - - public long getSatisfiedCount() { - return getDataLong(16); - } - - public void setSatisfiedCount(long satisfiedCount) { - setDataLong(16, satisfiedCount); - } - - public long getToleratingCount() { - return getDataLong(17); - } - - public void setToleratingCount(long toleratingCount) { - setDataLong(17, toleratingCount); - } - - public long getFrustratedCount() { - return getDataLong(18); - } - - public void setFrustratedCount(long frustratedCount) { - setDataLong(18, frustratedCount); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new ApplicationMetric(); - } - } - - private static class TransactionAverageDurationFormulaOperation implements FormulaOperation { - - @Override public Long operate(ApplicationMetric data) { - return data.getTransactionCalls() == 0 ? 0 : data.getTransactionDurationSum() / data.getTransactionCalls(); - } - } - - private static class BusinessTransactionAverageDurationFormulaOperation implements FormulaOperation { - - @Override public Long operate(ApplicationMetric data) { - return data.getBusinessTransactionCalls() == 0 ? 0 : data.getBusinessTransactionDurationSum() / data.getBusinessTransactionCalls(); - } - } - - private static class MqTransactionAverageDurationFormulaOperation implements FormulaOperation { - - @Override public Long operate(ApplicationMetric data) { - return data.getMqTransactionCalls() == 0 ? 0 : data.getMqTransactionDurationSum() / data.getMqTransactionCalls(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMetricTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMetricTable.java deleted file mode 100644 index 4cb07d43ddf5d9887a4374dab92b9cb925286677..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationMetricTable.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.application; - -import org.apache.skywalking.apm.collector.storage.table.MetricColumns; -import org.apache.skywalking.apm.collector.storage.table.register.RegisterColumns; - -/** - * @author peng-yongsheng - */ -public interface ApplicationMetricTable extends MetricColumns, RegisterColumns { - String TABLE = "application_metric"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationReferenceMetric.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationReferenceMetric.java deleted file mode 100644 index ec7ef4d3c0e1869571bd5fad873c947dfd40f589..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationReferenceMetric.java +++ /dev/null @@ -1,320 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.application; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; -import org.apache.skywalking.apm.collector.storage.table.Metric; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMetric extends StreamData implements Metric { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(ApplicationReferenceMetricTable.ID, new NonMergeOperation()), - new StringColumn(ApplicationReferenceMetricTable.METRIC_ID, new NonMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(ApplicationReferenceMetricTable.TIME_BUCKET, new NonMergeOperation()), - - new LongColumn(ApplicationReferenceMetricTable.TRANSACTION_CALLS, new AddMergeOperation()), - new LongColumn(ApplicationReferenceMetricTable.TRANSACTION_ERROR_CALLS, new AddMergeOperation()), - new LongColumn(ApplicationReferenceMetricTable.TRANSACTION_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ApplicationReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ApplicationReferenceMetricTable.TRANSACTION_AVERAGE_DURATION, new NonMergeOperation(), new TransactionAverageDurationFormulaOperation()), - new LongColumn(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_CALLS, new AddMergeOperation()), - new LongColumn(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, new AddMergeOperation()), - new LongColumn(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, new NonMergeOperation(), new BusinessTransactionAverageDurationFormulaOperation()), - new LongColumn(ApplicationReferenceMetricTable.MQ_TRANSACTION_CALLS, new AddMergeOperation()), - new LongColumn(ApplicationReferenceMetricTable.MQ_TRANSACTION_ERROR_CALLS, new AddMergeOperation()), - new LongColumn(ApplicationReferenceMetricTable.MQ_TRANSACTION_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ApplicationReferenceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ApplicationReferenceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, new NonMergeOperation(), new MqTransactionAverageDurationFormulaOperation()), - - new LongColumn(ApplicationReferenceMetricTable.SATISFIED_COUNT, new AddMergeOperation()), - new LongColumn(ApplicationReferenceMetricTable.TOLERATING_COUNT, new AddMergeOperation()), - new LongColumn(ApplicationReferenceMetricTable.FRUSTRATED_COUNT, new AddMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(ApplicationReferenceMetricTable.SOURCE_VALUE, new NonMergeOperation()), - new IntegerColumn(ApplicationReferenceMetricTable.FRONT_APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(ApplicationReferenceMetricTable.BEHIND_APPLICATION_ID, new NonMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public ApplicationReferenceMetric() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getDataString(1); - } - - @Override public void setMetricId(String metricId) { - setDataString(1, metricId); - } - - @Override - public Integer getSourceValue() { - return getDataInteger(0); - } - - @Override - public void setSourceValue(Integer sourceValue) { - setDataInteger(0, sourceValue); - } - - public Integer getFrontApplicationId() { - return getDataInteger(1); - } - - public void setFrontApplicationId(Integer frontApplicationId) { - setDataInteger(1, frontApplicationId); - } - - public Integer getBehindApplicationId() { - return getDataInteger(2); - } - - public void setBehindApplicationId(Integer behindApplicationId) { - setDataInteger(2, behindApplicationId); - } - - @Override - public Long getTimeBucket() { - return getDataLong(0); - } - - @Override - public void setTimeBucket(Long timeBucket) { - setDataLong(0, timeBucket); - } - - @Override - public Long getTransactionCalls() { - return getDataLong(1); - } - - @Override - public void setTransactionCalls(Long transactionCalls) { - setDataLong(1, transactionCalls); - } - - @Override - public Long getTransactionErrorCalls() { - return getDataLong(2); - } - - @Override - public void setTransactionErrorCalls(Long transactionErrorCalls) { - setDataLong(2, transactionErrorCalls); - } - - @Override - public Long getTransactionDurationSum() { - return getDataLong(3); - } - - @Override - public void setTransactionDurationSum(Long transactionDurationSum) { - setDataLong(3, transactionDurationSum); - } - - @Override - public Long getTransactionErrorDurationSum() { - return getDataLong(4); - } - - @Override - public void setTransactionErrorDurationSum(Long transactionErrorDurationSum) { - setDataLong(4, transactionErrorDurationSum); - } - - @Override public Long getTransactionAverageDuration() { - return getDataLong(5); - } - - @Override public void setTransactionAverageDuration(Long transactionAverageDuration) { - setDataLong(5, transactionAverageDuration); - } - - @Override - public Long getBusinessTransactionCalls() { - return getDataLong(6); - } - - @Override - public void setBusinessTransactionCalls(Long businessTransactionCalls) { - setDataLong(6, businessTransactionCalls); - } - - @Override - public Long getBusinessTransactionErrorCalls() { - return getDataLong(7); - } - - @Override - public void setBusinessTransactionErrorCalls(Long businessTransactionErrorCalls) { - setDataLong(7, businessTransactionErrorCalls); - } - - @Override - public Long getBusinessTransactionDurationSum() { - return getDataLong(8); - } - - @Override - public void setBusinessTransactionDurationSum(Long businessTransactionDurationSum) { - setDataLong(8, businessTransactionDurationSum); - } - - @Override - public Long getBusinessTransactionErrorDurationSum() { - return getDataLong(9); - } - - @Override - public void setBusinessTransactionErrorDurationSum(Long businessTransactionErrorDurationSum) { - setDataLong(9, businessTransactionErrorDurationSum); - } - - @Override public Long getBusinessTransactionAverageDuration() { - return getDataLong(10); - } - - @Override public void setBusinessTransactionAverageDuration(Long businessTransactionAverageDuration) { - setDataLong(10, businessTransactionAverageDuration); - } - - @Override - public Long getMqTransactionCalls() { - return getDataLong(11); - } - - @Override - public void setMqTransactionCalls(Long mqTransactionCalls) { - setDataLong(11, mqTransactionCalls); - } - - @Override - public Long getMqTransactionErrorCalls() { - return getDataLong(12); - } - - @Override - public void setMqTransactionErrorCalls(Long mqTransactionErrorCalls) { - setDataLong(12, mqTransactionErrorCalls); - } - - @Override - public Long getMqTransactionDurationSum() { - return getDataLong(13); - } - - @Override - public void setMqTransactionDurationSum(Long mqTransactionDurationSum) { - setDataLong(13, mqTransactionDurationSum); - } - - @Override - public Long getMqTransactionErrorDurationSum() { - return getDataLong(14); - } - - @Override - public void setMqTransactionErrorDurationSum(Long mqTransactionErrorDurationSum) { - setDataLong(14, mqTransactionErrorDurationSum); - } - - @Override public Long getMqTransactionAverageDuration() { - return getDataLong(15); - } - - @Override public void setMqTransactionAverageDuration(Long mqTransactionAverageDuration) { - setDataLong(15, mqTransactionAverageDuration); - } - - public long getSatisfiedCount() { - return getDataLong(16); - } - - public void setSatisfiedCount(long satisfiedCount) { - setDataLong(16, satisfiedCount); - } - - public long getToleratingCount() { - return getDataLong(17); - } - - public void setToleratingCount(long toleratingCount) { - setDataLong(17, toleratingCount); - } - - public long getFrustratedCount() { - return getDataLong(18); - } - - public void setFrustratedCount(long frustratedCount) { - setDataLong(18, frustratedCount); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new ApplicationReferenceMetric(); - } - } - - private static class TransactionAverageDurationFormulaOperation implements FormulaOperation { - - @Override public Long operate(ApplicationReferenceMetric data) { - return data.getTransactionCalls() == 0 ? 0 : data.getTransactionDurationSum() / data.getTransactionCalls(); - } - } - - private static class BusinessTransactionAverageDurationFormulaOperation implements FormulaOperation { - - @Override public Long operate(ApplicationReferenceMetric data) { - return data.getBusinessTransactionCalls() == 0 ? 0 : data.getBusinessTransactionDurationSum() / data.getBusinessTransactionCalls(); - } - } - - private static class MqTransactionAverageDurationFormulaOperation implements FormulaOperation { - - @Override public Long operate(ApplicationReferenceMetric data) { - return data.getMqTransactionCalls() == 0 ? 0 : data.getMqTransactionDurationSum() / data.getMqTransactionCalls(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationReferenceMetricTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationReferenceMetricTable.java deleted file mode 100644 index e3ea1fcf4fd61c404e71467aae99973280ad7b2c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/application/ApplicationReferenceMetricTable.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.application; - -import org.apache.skywalking.apm.collector.storage.table.MetricColumns; -import org.apache.skywalking.apm.collector.storage.table.ReferenceColumns; - -/** - * @author peng-yongsheng - */ -public interface ApplicationReferenceMetricTable extends MetricColumns, ReferenceColumns { - String TABLE = "application_reference_metric"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/global/GlobalTrace.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/global/GlobalTrace.java deleted file mode 100644 index 7acc38d60e584e4a9338f03c065e9ea7d342da69..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/global/GlobalTrace.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.global; - -import org.apache.skywalking.apm.collector.core.data.StreamData; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; - -/** - * @author peng-yongsheng - */ -public class GlobalTrace extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(GlobalTraceTable.ID, new NonMergeOperation()), - new StringColumn(GlobalTraceTable.SEGMENT_ID, new CoverMergeOperation()), - new StringColumn(GlobalTraceTable.TRACE_ID, new CoverMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(GlobalTraceTable.TIME_BUCKET, new CoverMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public GlobalTrace() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getId(); - } - - @Override public void setMetricId(String metricId) { - setId(metricId); - } - - public String getSegmentId() { - return getDataString(1); - } - - public void setSegmentId(String segmentId) { - setDataString(1, segmentId); - } - - public String getTraceId() { - return getDataString(2); - } - - public void setTraceId(String globalTraceId) { - setDataString(2, globalTraceId); - } - - public Long getTimeBucket() { - return getDataLong(0); - } - - public void setTimeBucket(long timeBucket) { - setDataLong(0, timeBucket); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/global/GlobalTraceTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/global/GlobalTraceTable.java deleted file mode 100644 index 41e79b8fb0106b485968c41a8b5434c80894ebdf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/global/GlobalTraceTable.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.global; - -import org.apache.skywalking.apm.collector.core.data.ColumnName; -import org.apache.skywalking.apm.collector.core.data.CommonTable; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentTable; - -/** - * @author peng-yongsheng - */ -public interface GlobalTraceTable extends CommonTable, SegmentTable { - String TABLE = "global_trace"; - - ColumnName TRACE_ID = new ColumnName("trace_id", "ti"); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/global/ResponseTimeDistribution.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/global/ResponseTimeDistribution.java deleted file mode 100644 index 688899e12826f1192b0dace8110b2b7e56874561..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/global/ResponseTimeDistribution.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.global; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistribution extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(ResponseTimeDistributionTable.ID, new NonMergeOperation()), - new StringColumn(ResponseTimeDistributionTable.METRIC_ID, new NonMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(ResponseTimeDistributionTable.TIME_BUCKET, new CoverMergeOperation()), - new LongColumn(ResponseTimeDistributionTable.CALLS, new AddMergeOperation()), - new LongColumn(ResponseTimeDistributionTable.ERROR_CALLS, new AddMergeOperation()), - new LongColumn(ResponseTimeDistributionTable.SUCCESS_CALLS, new AddMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(ResponseTimeDistributionTable.STEP, new NonMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public ResponseTimeDistribution() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getDataString(1); - } - - @Override public void setMetricId(String metricId) { - setDataString(1, metricId); - } - - public int getStep() { - return getDataInteger(0); - } - - public void setStep(int step) { - setDataInteger(0, step); - } - - public long getTimeBucket() { - return getDataLong(0); - } - - public void setTimeBucket(long timeBucket) { - setDataLong(0, timeBucket); - } - - public long getCalls() { - return getDataLong(1); - } - - public void setCalls(long calls) { - setDataLong(1, calls); - } - - public long getErrorCalls() { - return getDataLong(2); - } - - public void setErrorCalls(long errorCalls) { - setDataLong(2, errorCalls); - } - - public long getSuccessCalls() { - return getDataLong(3); - } - - public void setSuccessCalls(long successCalls) { - setDataLong(3, successCalls); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new ResponseTimeDistribution(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/global/ResponseTimeDistributionTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/global/ResponseTimeDistributionTable.java deleted file mode 100644 index ba95eed99d993947ca5e284013df69c8ca283a3e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/global/ResponseTimeDistributionTable.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.global; - -import org.apache.skywalking.apm.collector.core.data.ColumnName; -import org.apache.skywalking.apm.collector.core.data.CommonTable; - -/** - * @author peng-yongsheng - */ -public interface ResponseTimeDistributionTable extends CommonTable { - String TABLE = "response_time_distribution"; - - ColumnName STEP = new ColumnName("step", "s"); - - ColumnName CALLS = new ColumnName("calls", "ac"); - - ColumnName ERROR_CALLS = new ColumnName("error_calls", "ec"); - - ColumnName SUCCESS_CALLS = new ColumnName("success_calls", "sc"); -} \ No newline at end of file diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/instance/InstanceMapping.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/instance/InstanceMapping.java deleted file mode 100644 index 3982b243cf3e871a82486e9788e048083ae7c4d3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/instance/InstanceMapping.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.instance; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class InstanceMapping extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(InstanceMappingTable.ID, new NonMergeOperation()), - new StringColumn(InstanceMappingTable.METRIC_ID, new NonMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(InstanceMappingTable.TIME_BUCKET, new CoverMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(InstanceMappingTable.APPLICATION_ID, new CoverMergeOperation()), - new IntegerColumn(InstanceMappingTable.INSTANCE_ID, new CoverMergeOperation()), - new IntegerColumn(InstanceMappingTable.ADDRESS_ID, new CoverMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public InstanceMapping() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getDataString(1); - } - - @Override public void setMetricId(String metricId) { - setDataString(1, metricId); - } - - public int getApplicationId() { - return getDataInteger(0); - } - - public void setApplicationId(int applicationId) { - setDataInteger(0, applicationId); - } - - public int getInstanceId() { - return getDataInteger(1); - } - - public void setInstanceId(int instanceId) { - setDataInteger(1, instanceId); - } - - public int getAddressId() { - return getDataInteger(2); - } - - public void setAddressId(int addressId) { - setDataInteger(2, addressId); - } - - public long getTimeBucket() { - return getDataLong(0); - } - - public void setTimeBucket(long timeBucket) { - setDataLong(0, timeBucket); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new InstanceMapping(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/instance/InstanceMappingTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/instance/InstanceMappingTable.java deleted file mode 100644 index 2ff72466fc979c9efe4353af1bdebcf676c25b06..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/instance/InstanceMappingTable.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.instance; - -import org.apache.skywalking.apm.collector.core.data.CommonTable; -import org.apache.skywalking.apm.collector.storage.table.register.RegisterColumns; - -/** - * @author peng-yongsheng - */ -public interface InstanceMappingTable extends RegisterColumns, CommonTable { - String TABLE = "instance_mapping"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/instance/InstanceMetric.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/instance/InstanceMetric.java deleted file mode 100644 index 0d5850e52ff59434e79cb23825610e10350e27e6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/instance/InstanceMetric.java +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.instance; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; -import org.apache.skywalking.apm.collector.storage.table.Metric; - -/** - * @author peng-yongsheng - */ -public class InstanceMetric extends StreamData implements Metric { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(InstanceMetricTable.ID, new NonMergeOperation()), - new StringColumn(InstanceMetricTable.METRIC_ID, new NonMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(InstanceMetricTable.TIME_BUCKET, new NonMergeOperation()), - - new LongColumn(InstanceMetricTable.TRANSACTION_CALLS, new AddMergeOperation()), - new LongColumn(InstanceMetricTable.TRANSACTION_ERROR_CALLS, new AddMergeOperation()), - new LongColumn(InstanceMetricTable.TRANSACTION_DURATION_SUM, new AddMergeOperation()), - new LongColumn(InstanceMetricTable.TRANSACTION_ERROR_DURATION_SUM, new AddMergeOperation()), - new LongColumn(InstanceMetricTable.TRANSACTION_AVERAGE_DURATION, new NonMergeOperation(), new TransactionAverageDurationFormulaOperation()), - new LongColumn(InstanceMetricTable.BUSINESS_TRANSACTION_CALLS, new AddMergeOperation()), - new LongColumn(InstanceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, new AddMergeOperation()), - new LongColumn(InstanceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, new AddMergeOperation()), - new LongColumn(InstanceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, new AddMergeOperation()), - new LongColumn(InstanceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, new NonMergeOperation(), new BusinessTransactionAverageDurationFormulaOperation()), - new LongColumn(InstanceMetricTable.MQ_TRANSACTION_CALLS, new AddMergeOperation()), - new LongColumn(InstanceMetricTable.MQ_TRANSACTION_ERROR_CALLS, new AddMergeOperation()), - new LongColumn(InstanceMetricTable.MQ_TRANSACTION_DURATION_SUM, new AddMergeOperation()), - new LongColumn(InstanceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, new AddMergeOperation()), - new LongColumn(InstanceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, new NonMergeOperation(), new MqTransactionAverageDurationFormulaOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(InstanceMetricTable.SOURCE_VALUE, new CoverMergeOperation()), - new IntegerColumn(InstanceMetricTable.APPLICATION_ID, new CoverMergeOperation()), - new IntegerColumn(InstanceMetricTable.INSTANCE_ID, new CoverMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public InstanceMetric() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getDataString(1); - } - - @Override public void setMetricId(String metricId) { - setDataString(1, metricId); - } - - @Override - public Integer getSourceValue() { - return getDataInteger(0); - } - - @Override - public void setSourceValue(Integer sourceValue) { - setDataInteger(0, sourceValue); - } - - public Integer getApplicationId() { - return getDataInteger(1); - } - - public void setApplicationId(Integer applicationId) { - setDataInteger(1, applicationId); - } - - public Integer getInstanceId() { - return getDataInteger(2); - } - - public void setInstanceId(Integer instanceId) { - setDataInteger(2, instanceId); - } - - @Override - public Long getTimeBucket() { - return getDataLong(0); - } - - @Override - public void setTimeBucket(Long timeBucket) { - setDataLong(0, timeBucket); - } - - @Override - public Long getTransactionCalls() { - return getDataLong(1); - } - - @Override - public void setTransactionCalls(Long transactionCalls) { - setDataLong(1, transactionCalls); - } - - @Override - public Long getTransactionErrorCalls() { - return getDataLong(2); - } - - @Override - public void setTransactionErrorCalls(Long transactionErrorCalls) { - setDataLong(2, transactionErrorCalls); - } - - @Override - public Long getTransactionDurationSum() { - return getDataLong(3); - } - - @Override - public void setTransactionDurationSum(Long transactionDurationSum) { - setDataLong(3, transactionDurationSum); - } - - @Override - public Long getTransactionErrorDurationSum() { - return getDataLong(4); - } - - @Override - public void setTransactionErrorDurationSum(Long transactionErrorDurationSum) { - setDataLong(4, transactionErrorDurationSum); - } - - @Override public Long getTransactionAverageDuration() { - return getDataLong(5); - } - - @Override public void setTransactionAverageDuration(Long transactionAverageDuration) { - setDataLong(5, transactionAverageDuration); - } - - @Override - public Long getBusinessTransactionCalls() { - return getDataLong(6); - } - - @Override - public void setBusinessTransactionCalls(Long businessTransactionCalls) { - setDataLong(6, businessTransactionCalls); - } - - @Override - public Long getBusinessTransactionErrorCalls() { - return getDataLong(7); - } - - @Override - public void setBusinessTransactionErrorCalls(Long businessTransactionErrorCalls) { - setDataLong(7, businessTransactionErrorCalls); - } - - @Override - public Long getBusinessTransactionDurationSum() { - return getDataLong(8); - } - - @Override - public void setBusinessTransactionDurationSum(Long businessTransactionDurationSum) { - setDataLong(8, businessTransactionDurationSum); - } - - @Override - public Long getBusinessTransactionErrorDurationSum() { - return getDataLong(9); - } - - @Override - public void setBusinessTransactionErrorDurationSum(Long businessTransactionErrorDurationSum) { - setDataLong(9, businessTransactionErrorDurationSum); - } - - @Override public Long getBusinessTransactionAverageDuration() { - return getDataLong(10); - } - - @Override public void setBusinessTransactionAverageDuration(Long businessTransactionAverageDuration) { - setDataLong(10, businessTransactionAverageDuration); - } - - @Override - public Long getMqTransactionCalls() { - return getDataLong(11); - } - - @Override - public void setMqTransactionCalls(Long mqTransactionCalls) { - setDataLong(11, mqTransactionCalls); - } - - @Override - public Long getMqTransactionErrorCalls() { - return getDataLong(12); - } - - @Override - public void setMqTransactionErrorCalls(Long mqTransactionErrorCalls) { - setDataLong(12, mqTransactionErrorCalls); - } - - @Override - public Long getMqTransactionDurationSum() { - return getDataLong(13); - } - - @Override - public void setMqTransactionDurationSum(Long mqTransactionDurationSum) { - setDataLong(13, mqTransactionDurationSum); - } - - @Override - public Long getMqTransactionErrorDurationSum() { - return getDataLong(14); - } - - @Override - public void setMqTransactionErrorDurationSum(Long mqTransactionErrorDurationSum) { - setDataLong(14, mqTransactionErrorDurationSum); - } - - @Override public Long getMqTransactionAverageDuration() { - return getDataLong(15); - } - - @Override public void setMqTransactionAverageDuration(Long mqTransactionAverageDuration) { - setDataLong(15, mqTransactionAverageDuration); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new InstanceMetric(); - } - } - - private static class TransactionAverageDurationFormulaOperation implements FormulaOperation { - - @Override public Long operate(InstanceMetric data) { - return data.getTransactionCalls() == 0 ? 0 : data.getTransactionDurationSum() / data.getTransactionCalls(); - } - } - - private static class BusinessTransactionAverageDurationFormulaOperation implements FormulaOperation { - - @Override public Long operate(InstanceMetric data) { - return data.getBusinessTransactionCalls() == 0 ? 0 : data.getBusinessTransactionDurationSum() / data.getBusinessTransactionCalls(); - } - } - - private static class MqTransactionAverageDurationFormulaOperation implements FormulaOperation { - - @Override public Long operate(InstanceMetric data) { - return data.getMqTransactionCalls() == 0 ? 0 : data.getMqTransactionDurationSum() / data.getMqTransactionCalls(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/instance/InstanceMetricTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/instance/InstanceMetricTable.java deleted file mode 100644 index 63eac38bc09ff408b6fe28ba28cdaf8cc1f2ab02..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/instance/InstanceMetricTable.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.instance; - -import org.apache.skywalking.apm.collector.storage.table.MetricColumns; -import org.apache.skywalking.apm.collector.storage.table.register.RegisterColumns; - -/** - * @author peng-yongsheng - */ -public interface InstanceMetricTable extends MetricColumns, RegisterColumns { - String TABLE = "instance_metric"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/instance/InstanceReferenceMetric.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/instance/InstanceReferenceMetric.java deleted file mode 100644 index 471a1743d6e874193bf6af6906ad090a360e3b65..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/instance/InstanceReferenceMetric.java +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.instance; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; -import org.apache.skywalking.apm.collector.storage.table.Metric; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMetric extends StreamData implements Metric { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(InstanceReferenceMetricTable.ID, new NonMergeOperation()), - new StringColumn(InstanceReferenceMetricTable.METRIC_ID, new NonMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(InstanceReferenceMetricTable.TIME_BUCKET, new NonMergeOperation()), - - new LongColumn(InstanceReferenceMetricTable.TRANSACTION_CALLS, new AddMergeOperation()), - new LongColumn(InstanceReferenceMetricTable.TRANSACTION_ERROR_CALLS, new AddMergeOperation()), - new LongColumn(InstanceReferenceMetricTable.TRANSACTION_DURATION_SUM, new AddMergeOperation()), - new LongColumn(InstanceReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM, new AddMergeOperation()), - new LongColumn(InstanceReferenceMetricTable.TRANSACTION_AVERAGE_DURATION, new NonMergeOperation(), new TransactionAverageDurationFormulaOperation()), - new LongColumn(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_CALLS, new AddMergeOperation()), - new LongColumn(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, new AddMergeOperation()), - new LongColumn(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, new AddMergeOperation()), - new LongColumn(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, new AddMergeOperation()), - new LongColumn(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, new NonMergeOperation(), new BusinessTransactionAverageDurationFormulaOperation()), - new LongColumn(InstanceReferenceMetricTable.MQ_TRANSACTION_CALLS, new AddMergeOperation()), - new LongColumn(InstanceReferenceMetricTable.MQ_TRANSACTION_ERROR_CALLS, new AddMergeOperation()), - new LongColumn(InstanceReferenceMetricTable.MQ_TRANSACTION_DURATION_SUM, new AddMergeOperation()), - new LongColumn(InstanceReferenceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, new AddMergeOperation()), - new LongColumn(InstanceReferenceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, new NonMergeOperation(), new MqTransactionAverageDurationFormulaOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(InstanceReferenceMetricTable.SOURCE_VALUE, new NonMergeOperation()), - new IntegerColumn(InstanceReferenceMetricTable.FRONT_APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(InstanceReferenceMetricTable.BEHIND_APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(InstanceReferenceMetricTable.FRONT_INSTANCE_ID, new NonMergeOperation()), - new IntegerColumn(InstanceReferenceMetricTable.BEHIND_INSTANCE_ID, new NonMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public InstanceReferenceMetric() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getDataString(1); - } - - @Override public void setMetricId(String metricId) { - setDataString(1, metricId); - } - - @Override - public Integer getSourceValue() { - return getDataInteger(0); - } - - @Override - public void setSourceValue(Integer sourceValue) { - setDataInteger(0, sourceValue); - } - - public Integer getFrontApplicationId() { - return getDataInteger(1); - } - - public void setFrontApplicationId(Integer frontApplicationId) { - setDataInteger(1, frontApplicationId); - } - - public Integer getBehindApplicationId() { - return getDataInteger(2); - } - - public void setBehindApplicationId(Integer behindApplicationId) { - setDataInteger(2, behindApplicationId); - } - - public Integer getFrontInstanceId() { - return getDataInteger(3); - } - - public void setFrontInstanceId(Integer frontInstanceId) { - setDataInteger(3, frontInstanceId); - } - - public Integer getBehindInstanceId() { - return getDataInteger(4); - } - - public void setBehindInstanceId(Integer behindInstanceId) { - setDataInteger(4, behindInstanceId); - } - - @Override - public Long getTimeBucket() { - return getDataLong(0); - } - - @Override - public void setTimeBucket(Long timeBucket) { - setDataLong(0, timeBucket); - } - - @Override - public Long getTransactionCalls() { - return getDataLong(1); - } - - @Override - public void setTransactionCalls(Long transactionCalls) { - setDataLong(1, transactionCalls); - } - - @Override - public Long getTransactionErrorCalls() { - return getDataLong(2); - } - - @Override - public void setTransactionErrorCalls(Long transactionErrorCalls) { - setDataLong(2, transactionErrorCalls); - } - - @Override - public Long getTransactionDurationSum() { - return getDataLong(3); - } - - @Override - public void setTransactionDurationSum(Long transactionDurationSum) { - setDataLong(3, transactionDurationSum); - } - - @Override - public Long getTransactionErrorDurationSum() { - return getDataLong(4); - } - - @Override - public void setTransactionErrorDurationSum(Long transactionErrorDurationSum) { - setDataLong(4, transactionErrorDurationSum); - } - - @Override public Long getTransactionAverageDuration() { - return getDataLong(5); - } - - @Override public void setTransactionAverageDuration(Long transactionAverageDuration) { - setDataLong(5, transactionAverageDuration); - } - - @Override - public Long getBusinessTransactionCalls() { - return getDataLong(6); - } - - @Override - public void setBusinessTransactionCalls(Long businessTransactionCalls) { - setDataLong(6, businessTransactionCalls); - } - - @Override - public Long getBusinessTransactionErrorCalls() { - return getDataLong(7); - } - - @Override - public void setBusinessTransactionErrorCalls(Long businessTransactionErrorCalls) { - setDataLong(7, businessTransactionErrorCalls); - } - - @Override - public Long getBusinessTransactionDurationSum() { - return getDataLong(8); - } - - @Override - public void setBusinessTransactionDurationSum(Long businessTransactionDurationSum) { - setDataLong(8, businessTransactionDurationSum); - } - - @Override - public Long getBusinessTransactionErrorDurationSum() { - return getDataLong(9); - } - - @Override - public void setBusinessTransactionErrorDurationSum(Long businessTransactionErrorDurationSum) { - setDataLong(9, businessTransactionErrorDurationSum); - } - - @Override public Long getBusinessTransactionAverageDuration() { - return getDataLong(10); - } - - @Override public void setBusinessTransactionAverageDuration(Long businessTransactionAverageDuration) { - setDataLong(10, businessTransactionAverageDuration); - } - - @Override - public Long getMqTransactionCalls() { - return getDataLong(11); - } - - @Override - public void setMqTransactionCalls(Long mqTransactionCalls) { - setDataLong(11, mqTransactionCalls); - } - - @Override - public Long getMqTransactionErrorCalls() { - return getDataLong(12); - } - - @Override - public void setMqTransactionErrorCalls(Long mqTransactionErrorCalls) { - setDataLong(12, mqTransactionErrorCalls); - } - - @Override - public Long getMqTransactionDurationSum() { - return getDataLong(13); - } - - @Override - public void setMqTransactionDurationSum(Long mqTransactionDurationSum) { - setDataLong(13, mqTransactionDurationSum); - } - - @Override - public Long getMqTransactionErrorDurationSum() { - return getDataLong(14); - } - - @Override - public void setMqTransactionErrorDurationSum(Long mqTransactionErrorDurationSum) { - setDataLong(14, mqTransactionErrorDurationSum); - } - - @Override public Long getMqTransactionAverageDuration() { - return getDataLong(15); - } - - @Override public void setMqTransactionAverageDuration(Long mqTransactionAverageDuration) { - setDataLong(15, mqTransactionAverageDuration); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new InstanceReferenceMetric(); - } - } - - private static class TransactionAverageDurationFormulaOperation implements FormulaOperation { - - @Override public Long operate(InstanceReferenceMetric data) { - return data.getTransactionCalls() == 0 ? 0 : data.getTransactionDurationSum() / data.getTransactionCalls(); - } - } - - private static class BusinessTransactionAverageDurationFormulaOperation implements FormulaOperation { - - @Override public Long operate(InstanceReferenceMetric data) { - return data.getBusinessTransactionCalls() == 0 ? 0 : data.getBusinessTransactionDurationSum() / data.getBusinessTransactionCalls(); - } - } - - private static class MqTransactionAverageDurationFormulaOperation implements FormulaOperation { - - @Override public Long operate(InstanceReferenceMetric data) { - return data.getMqTransactionCalls() == 0 ? 0 : data.getMqTransactionDurationSum() / data.getMqTransactionCalls(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/instance/InstanceReferenceMetricTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/instance/InstanceReferenceMetricTable.java deleted file mode 100644 index 9681dd036527cad5f12b455bb8a52813cffc27d1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/instance/InstanceReferenceMetricTable.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.instance; - -import org.apache.skywalking.apm.collector.storage.table.MetricColumns; -import org.apache.skywalking.apm.collector.storage.table.ReferenceColumns; - -/** - * @author peng-yongsheng - */ -public interface InstanceReferenceMetricTable extends MetricColumns, ReferenceColumns { - String TABLE = "instance_reference_metric"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/CpuMetric.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/CpuMetric.java deleted file mode 100644 index 36ee0ee3d06fb6b46dbc8e50bf7436638e39b434..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/CpuMetric.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.jvm; - -import org.apache.skywalking.apm.collector.core.data.StreamData; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; - -/** - * @author peng-yongsheng - */ -public class CpuMetric extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(CpuMetricTable.ID, new NonMergeOperation()), - new StringColumn(CpuMetricTable.METRIC_ID, new NonMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(CpuMetricTable.TIMES, new AddMergeOperation()), - new LongColumn(CpuMetricTable.TIME_BUCKET, new CoverMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - new DoubleColumn(CpuMetricTable.USAGE_PERCENT, new AddMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(CpuMetricTable.INSTANCE_ID, new CoverMergeOperation()), - }; - - public CpuMetric() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getDataString(1); - } - - @Override public void setMetricId(String metricId) { - setDataString(1, metricId); - } - - public Integer getInstanceId() { - return getDataInteger(0); - } - - public void setInstanceId(Integer instanceId) { - setDataInteger(0, instanceId); - } - - public Double getUsagePercent() { - return getDataDouble(0); - } - - public void setUsagePercent(Double usagePercent) { - setDataDouble(0, usagePercent); - } - - public Long getTimes() { - return getDataLong(0); - } - - public void setTimes(Long times) { - setDataLong(0, times); - } - - public Long getTimeBucket() { - return getDataLong(1); - } - - public void setTimeBucket(Long timeBucket) { - setDataLong(1, timeBucket); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/CpuMetricTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/CpuMetricTable.java deleted file mode 100644 index 12f2bff15f15a89b679cbd7a533a7206186d403c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/CpuMetricTable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.jvm; - -import org.apache.skywalking.apm.collector.core.data.ColumnName; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; - -/** - * @author peng-yongsheng - */ -public interface CpuMetricTable extends InstanceTable { - String TABLE = "cpu_metric"; - - ColumnName USAGE_PERCENT = new ColumnName("usage_percent", "up"); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/GCMetric.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/GCMetric.java deleted file mode 100644 index ec50077762a62751375ae47fc1d8de2a79606c79..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/GCMetric.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.jvm; - -import org.apache.skywalking.apm.collector.core.data.StreamData; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; - -/** - * @author peng-yongsheng - */ -public class GCMetric extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(GCMetricTable.ID, new NonMergeOperation()), - new StringColumn(GCMetricTable.METRIC_ID, new NonMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(GCMetricTable.COUNT, new AddMergeOperation()), - new LongColumn(GCMetricTable.TIMES, new AddMergeOperation()), - new LongColumn(GCMetricTable.TIME_BUCKET, new CoverMergeOperation()), - new LongColumn(GCMetricTable.DURATION, new AddMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(GCMetricTable.INSTANCE_ID, new CoverMergeOperation()), - new IntegerColumn(GCMetricTable.PHRASE, new CoverMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public GCMetric() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getDataString(1); - } - - @Override public void setMetricId(String metricId) { - setDataString(1, metricId); - } - - public Long getCount() { - return getDataLong(0); - } - - public void setCount(Long count) { - setDataLong(0, count); - } - - public Long getTimes() { - return getDataLong(1); - } - - public void setTimes(Long times) { - setDataLong(1, times); - } - - public Long getTimeBucket() { - return getDataLong(2); - } - - public void setTimeBucket(Long timeBucket) { - setDataLong(2, timeBucket); - } - - public Long getDuration() { - return getDataLong(3); - } - - public void setDuration(Long duration) { - setDataLong(3, duration); - } - - public Integer getInstanceId() { - return getDataInteger(0); - } - - public void setInstanceId(Integer instanceId) { - setDataInteger(0, instanceId); - } - - public Integer getPhrase() { - return getDataInteger(1); - } - - public void setPhrase(Integer phrase) { - setDataInteger(1, phrase); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/GCMetricTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/GCMetricTable.java deleted file mode 100644 index 915ee4324646f932e290dbd401208fe16a5b4679..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/GCMetricTable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.jvm; - -import org.apache.skywalking.apm.collector.core.data.ColumnName; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; - -/** - * @author peng-yongsheng - */ -public interface GCMetricTable extends InstanceTable { - String TABLE = "gc_metric"; - - ColumnName PHRASE = new ColumnName("phrase", "p"); - - ColumnName COUNT = new ColumnName("count", "c"); - - ColumnName DURATION = new ColumnName("duration", "d"); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/MemoryMetric.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/MemoryMetric.java deleted file mode 100644 index 9c5e6ea18e78e19e88cc2137d105220ca192d9a8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/MemoryMetric.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.jvm; - -import org.apache.skywalking.apm.collector.core.data.StreamData; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; - -/** - * @author peng-yongsheng - */ -public class MemoryMetric extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(MemoryMetricTable.ID, new NonMergeOperation()), - new StringColumn(MemoryMetricTable.METRIC_ID, new NonMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(MemoryMetricTable.INIT, new MinMergeOperation()), - new LongColumn(MemoryMetricTable.MAX, new MaxMergeOperation()), - new LongColumn(MemoryMetricTable.USED, new AddMergeOperation()), - new LongColumn(MemoryMetricTable.COMMITTED, new AddMergeOperation()), - new LongColumn(MemoryMetricTable.TIMES, new AddMergeOperation()), - new LongColumn(MemoryMetricTable.TIME_BUCKET, new NonMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(MemoryMetricTable.INSTANCE_ID, new CoverMergeOperation()), - new IntegerColumn(MemoryMetricTable.IS_HEAP, new CoverMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public MemoryMetric() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getDataString(1); - } - - @Override public void setMetricId(String metricId) { - setDataString(1, metricId); - } - - public Long getInit() { - return getDataLong(0); - } - - public void setInit(Long init) { - setDataLong(0, init); - } - - public Long getMax() { - return getDataLong(1); - } - - public void setMax(Long max) { - setDataLong(1, max); - } - - public Long getUsed() { - return getDataLong(2); - } - - public void setUsed(Long used) { - setDataLong(2, used); - } - - public Long getCommitted() { - return getDataLong(3); - } - - public void setCommitted(Long committed) { - setDataLong(3, committed); - } - - public Long getTimes() { - return getDataLong(4); - } - - public void setTimes(Long times) { - setDataLong(4, times); - } - - public Long getTimeBucket() { - return getDataLong(5); - } - - public void setTimeBucket(Long timeBucket) { - setDataLong(5, timeBucket); - } - - public Integer getInstanceId() { - return getDataInteger(0); - } - - public void setInstanceId(Integer instanceId) { - setDataInteger(0, instanceId); - } - - public Integer getIsHeap() { - return getDataInteger(1); - } - - public void setIsHeap(Integer isHeap) { - setDataInteger(1, isHeap); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/MemoryMetricTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/MemoryMetricTable.java deleted file mode 100644 index 626c37be61796f45d115f47de875607d84290dfb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/MemoryMetricTable.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.jvm; - -import org.apache.skywalking.apm.collector.core.data.ColumnName; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; - -/** - * @author peng-yongsheng - */ -public interface MemoryMetricTable extends InstanceTable { - String TABLE = "memory_metric"; - - ColumnName IS_HEAP = new ColumnName("is_heap", "ih"); - - ColumnName INIT = new ColumnName("init", "init"); - - ColumnName MAX = new ColumnName("max", "max"); - - ColumnName USED = new ColumnName("used", "used"); - - ColumnName COMMITTED = new ColumnName("committed", "cd"); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/MemoryPoolMetric.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/MemoryPoolMetric.java deleted file mode 100644 index e9caf53d95b11e518a15cf7edc7fc7da93fcde77..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/MemoryPoolMetric.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.jvm; - -import org.apache.skywalking.apm.collector.core.data.StreamData; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolMetric extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(MemoryPoolMetricTable.ID, new NonMergeOperation()), - new StringColumn(MemoryPoolMetricTable.METRIC_ID, new NonMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(MemoryPoolMetricTable.INIT, new MinMergeOperation()), - new LongColumn(MemoryPoolMetricTable.MAX, new MaxMergeOperation()), - new LongColumn(MemoryPoolMetricTable.USED, new AddMergeOperation()), - new LongColumn(MemoryPoolMetricTable.COMMITTED, new AddMergeOperation()), - new LongColumn(MemoryPoolMetricTable.TIMES, new AddMergeOperation()), - new LongColumn(MemoryPoolMetricTable.TIME_BUCKET, new NonMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(MemoryPoolMetricTable.INSTANCE_ID, new NonMergeOperation()), - new IntegerColumn(MemoryPoolMetricTable.POOL_TYPE, new CoverMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public MemoryPoolMetric() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getDataString(1); - } - - @Override public void setMetricId(String metricId) { - setDataString(1, metricId); - } - - public Long getInit() { - return getDataLong(0); - } - - public void setInit(Long init) { - setDataLong(0, init); - } - - public Long getMax() { - return getDataLong(1); - } - - public void setMax(Long max) { - setDataLong(1, max); - } - - public Long getUsed() { - return getDataLong(2); - } - - public void setUsed(Long used) { - setDataLong(2, used); - } - - public Long getCommitted() { - return getDataLong(3); - } - - public void setCommitted(Long committed) { - setDataLong(3, committed); - } - - public Long getTimes() { - return getDataLong(4); - } - - public void setTimes(Long times) { - setDataLong(4, times); - } - - public Long getTimeBucket() { - return getDataLong(5); - } - - public void setTimeBucket(Long timeBucket) { - setDataLong(5, timeBucket); - } - - public Integer getInstanceId() { - return getDataInteger(0); - } - - public void setInstanceId(Integer instanceId) { - setDataInteger(0, instanceId); - } - - public Integer getPoolType() { - return getDataInteger(1); - } - - public void setPoolType(Integer poolType) { - setDataInteger(1, poolType); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/MemoryPoolMetricTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/MemoryPoolMetricTable.java deleted file mode 100644 index 9ab479ef6e1f31f0da9e37c04b181c01fb918e64..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/MemoryPoolMetricTable.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.jvm; - -import org.apache.skywalking.apm.collector.core.data.ColumnName; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; - -/** - * @author peng-yongsheng - */ -public interface MemoryPoolMetricTable extends InstanceTable { - String TABLE = "memory_pool_metric"; - - ColumnName POOL_TYPE = new ColumnName("pool_type", "pt"); - - ColumnName INIT = new ColumnName("init", "init"); - - ColumnName MAX = new ColumnName("max", "max"); - - ColumnName USED = new ColumnName("used", "used"); - - ColumnName COMMITTED = new ColumnName("committed", "cd"); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/Application.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/Application.java deleted file mode 100644 index 38728da33aff7f4e072459dcabad8ea2e41b99ad..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/Application.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.register; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class Application extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(ApplicationTable.ID, new NonMergeOperation()), - new StringColumn(ApplicationTable.APPLICATION_CODE, new CoverMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(ApplicationTable.APPLICATION_ID, new CoverMergeOperation()), - new IntegerColumn(ApplicationTable.ADDRESS_ID, new CoverMergeOperation()), - new IntegerColumn(ApplicationTable.IS_ADDRESS, new CoverMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public Application() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getId(); - } - - @Override public void setMetricId(String metricId) { - setId(metricId); - } - - public String getApplicationCode() { - return getDataString(1); - } - - public void setApplicationCode(String applicationCode) { - setDataString(1, applicationCode); - } - - public int getApplicationId() { - return getDataInteger(0); - } - - public void setApplicationId(int applicationId) { - setDataInteger(0, applicationId); - } - - public int getAddressId() { - return getDataInteger(1); - } - - public void setAddressId(int addressId) { - setDataInteger(1, addressId); - } - - public int getIsAddress() { - return getDataInteger(2); - } - - public void setIsAddress(int isAddress) { - setDataInteger(2, isAddress); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new Application(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/ApplicationTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/ApplicationTable.java deleted file mode 100644 index 70d89beabd013075663fb25f24d5cc49f38622ca..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/ApplicationTable.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.register; - -import org.apache.skywalking.apm.collector.core.data.ColumnName; -import org.apache.skywalking.apm.collector.core.data.CommonTable; - -/** - * @author peng-yongsheng - */ -public interface ApplicationTable extends CommonTable, RegisterColumns { - String TABLE = "application"; - - ColumnName APPLICATION_CODE = new ColumnName("application_code", "ac"); - - ColumnName IS_ADDRESS = new ColumnName("is_address", "ia"); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/Instance.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/Instance.java deleted file mode 100644 index 78f9a36b05137ef0f42e56154b99e75c778316e6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/Instance.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.register; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class Instance extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(InstanceTable.ID, new NonMergeOperation()), - new StringColumn(InstanceTable.AGENT_UUID, new CoverMergeOperation()), - new StringColumn(InstanceTable.OS_INFO, new CoverMergeOperation()), - new StringColumn(InstanceTable.APPLICATION_CODE, new CoverMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(InstanceTable.REGISTER_TIME, new CoverMergeOperation()), - new LongColumn(InstanceTable.HEARTBEAT_TIME, new MaxMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(InstanceTable.APPLICATION_ID, new CoverMergeOperation()), - new IntegerColumn(InstanceTable.INSTANCE_ID, new CoverMergeOperation()), - new IntegerColumn(InstanceTable.ADDRESS_ID, new CoverMergeOperation()), - new IntegerColumn(InstanceTable.IS_ADDRESS, new CoverMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public Instance() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getId(); - } - - @Override public void setMetricId(String metricId) { - setId(metricId); - } - - public int getApplicationId() { - return getDataInteger(0); - } - - public void setApplicationId(Integer applicationId) { - setDataInteger(0, applicationId); - } - - public String getAgentUUID() { - return getDataString(1); - } - - public void setAgentUUID(String agentUUID) { - setDataString(1, agentUUID); - } - - public long getRegisterTime() { - return getDataLong(0); - } - - public void setRegisterTime(Long registerTime) { - setDataLong(0, registerTime); - } - - public int getInstanceId() { - return getDataInteger(1); - } - - public void setInstanceId(Integer instanceId) { - setDataInteger(1, instanceId); - } - - public long getHeartBeatTime() { - return getDataLong(1); - } - - public void setHeartBeatTime(Long heartBeatTime) { - setDataLong(1, heartBeatTime); - } - - public String getOsInfo() { - return getDataString(2); - } - - public void setOsInfo(String osInfo) { - setDataString(2, osInfo); - } - - public String getApplicationCode() { - return getDataString(3); - } - - public void setApplicationCode(String applicationCode) { - setDataString(3, applicationCode); - } - - public int getAddressId() { - return getDataInteger(2); - } - - public void setAddressId(int addressId) { - setDataInteger(2, addressId); - } - - public int getIsAddress() { - return getDataInteger(3); - } - - public void setIsAddress(int isAddress) { - setDataInteger(3, isAddress); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new Instance(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/InstanceTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/InstanceTable.java deleted file mode 100644 index 059c4a6ccf90fd4cc8ddf09fda94c3222b8560d7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/InstanceTable.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.register; - -import org.apache.skywalking.apm.collector.core.data.ColumnName; -import org.apache.skywalking.apm.collector.core.data.CommonTable; - -/** - * @author peng-yongsheng - */ -public interface InstanceTable extends CommonTable, RegisterColumns { - String TABLE = "instance"; - - ColumnName APPLICATION_CODE = new ColumnName("application_code", "ac"); - - ColumnName AGENT_UUID = new ColumnName("agent_uuid", "iau"); - - ColumnName OS_INFO = new ColumnName("os_info", "ioi"); - - ColumnName IS_ADDRESS = new ColumnName("is_address", "iia"); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/NetworkAddress.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/NetworkAddress.java deleted file mode 100644 index 5e248b1d40d44503189fd6cf9ed4e542b4bef25c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/NetworkAddress.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.register; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class NetworkAddress extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(NetworkAddressTable.ID, new NonMergeOperation()), - new StringColumn(NetworkAddressTable.NETWORK_ADDRESS, new NonMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(NetworkAddressTable.ADDRESS_ID, new NonMergeOperation()), - new IntegerColumn(NetworkAddressTable.SRC_SPAN_LAYER, new CoverMergeOperation()), - new IntegerColumn(NetworkAddressTable.SERVER_TYPE, new CoverMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public NetworkAddress() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getId(); - } - - @Override public void setMetricId(String metricId) { - setId(metricId); - } - - public String getNetworkAddress() { - return getDataString(1); - } - - public void setNetworkAddress(String networkAddress) { - setDataString(1, networkAddress); - } - - public Integer getAddressId() { - return getDataInteger(0); - } - - public void setAddressId(Integer addressId) { - setDataInteger(0, addressId); - } - - public Integer getSrcSpanLayer() { - return getDataInteger(1); - } - - public void setSrcSpanLayer(Integer srcSpanLayer) { - setDataInteger(1, srcSpanLayer); - } - - public Integer getServerType() { - return getDataInteger(2); - } - - public void setServerType(Integer serverType) { - setDataInteger(2, serverType); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new NetworkAddress(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/NetworkAddressTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/NetworkAddressTable.java deleted file mode 100644 index 4154b706e1568050252c937afdc798b4d16b788f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/NetworkAddressTable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.register; - -import org.apache.skywalking.apm.collector.core.data.ColumnName; -import org.apache.skywalking.apm.collector.core.data.CommonTable; - -/** - * @author peng-yongsheng - */ -public interface NetworkAddressTable extends CommonTable, RegisterColumns { - String TABLE = "network_address"; - - ColumnName NETWORK_ADDRESS = new ColumnName("network_address", "na"); - - ColumnName SRC_SPAN_LAYER = new ColumnName("src_span_layer", "ssl"); - - ColumnName SERVER_TYPE = new ColumnName("server_type", "st"); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/RegisterColumns.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/RegisterColumns.java deleted file mode 100644 index be022d92fc7ec246eac3ec8453a0a9cc1c534f61..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/RegisterColumns.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.register; - -import org.apache.skywalking.apm.collector.core.data.ColumnName; - -/** - * @author peng-yongsheng - */ -public interface RegisterColumns { - ColumnName APPLICATION_ID = new ColumnName("application_id", "ai"); - - ColumnName INSTANCE_ID = new ColumnName("instance_id", "ii"); - - ColumnName SERVICE_ID = new ColumnName("service_id", "si"); - - ColumnName ADDRESS_ID = new ColumnName("address_id", "ni"); - - ColumnName REGISTER_TIME = new ColumnName("register_time", "rt"); - - ColumnName HEARTBEAT_TIME = new ColumnName("heartbeat_time", "ht"); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/ServiceName.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/ServiceName.java deleted file mode 100644 index 47c2c981eaf95a4444471742474ed7646c61b99b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/ServiceName.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.register; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; - -/** - * @author peng-yongsheng - */ -public class ServiceName extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(ServiceNameTable.ID, new NonMergeOperation()), - new StringColumn(ServiceNameTable.SERVICE_NAME, new CoverMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(ServiceNameTable.REGISTER_TIME, new NonMergeOperation()), - new LongColumn(ServiceNameTable.HEARTBEAT_TIME, new MaxMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(ServiceNameTable.APPLICATION_ID, new CoverMergeOperation()), - new IntegerColumn(ServiceNameTable.SERVICE_ID, new CoverMergeOperation()), - new IntegerColumn(ServiceNameTable.SRC_SPAN_TYPE, new CoverMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public ServiceName() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getId(); - } - - @Override public void setMetricId(String metricId) { - setId(metricId); - } - - public String getServiceName() { - return getDataString(1); - } - - public void setServiceName(String serviceName) { - setDataString(1, serviceName); - } - - public int getApplicationId() { - return getDataInteger(0); - } - - public void setApplicationId(int applicationId) { - setDataInteger(0, applicationId); - } - - public int getServiceId() { - return getDataInteger(1); - } - - public void setServiceId(int serviceId) { - setDataInteger(1, serviceId); - } - - public int getSrcSpanType() { - return getDataInteger(2); - } - - public void setSrcSpanType(int srcSpanType) { - setDataInteger(2, srcSpanType); - } - - public long getRegisterTime() { - return getDataLong(0); - } - - public void setRegisterTime(long registerTime) { - setDataLong(0, registerTime); - } - - public long getHeartBeatTime() { - return getDataLong(1); - } - - public void setHeartBeatTime(long heartBeatTime) { - setDataLong(1, heartBeatTime); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new ServiceName(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/ServiceNameTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/ServiceNameTable.java deleted file mode 100644 index 2b0b8219c423d043d649e2b60631b59eeed7ffa1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/ServiceNameTable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.register; - -import org.apache.skywalking.apm.collector.core.data.ColumnName; -import org.apache.skywalking.apm.collector.core.data.CommonTable; - -/** - * @author peng-yongsheng - */ -public interface ServiceNameTable extends CommonTable, RegisterColumns { - String TABLE = "service_name"; - - ColumnName SERVICE_NAME = new ColumnName("service_name", "sn"); - - ColumnName SERVICE_NAME_KEYWORD = new ColumnName("service_name_keyword", "snk"); - - ColumnName SRC_SPAN_TYPE = new ColumnName("src_span_type", "sst"); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/segment/Segment.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/segment/Segment.java deleted file mode 100644 index 81581c33e8a76ea922228403b2acd101d8105016..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/segment/Segment.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.segment; - -import org.apache.skywalking.apm.collector.core.data.StreamData; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; - -/** - * @author peng-yongsheng - */ -public class Segment extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(SegmentTable.ID, new NonMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(SegmentTable.TIME_BUCKET, new NonMergeOperation()), - }; - - private static final ByteColumn[] BYTE_COLUMNS = { - new ByteColumn(SegmentTable.DATA_BINARY, new CoverMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public Segment() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS, BYTE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getId(); - } - - @Override public void setMetricId(String metricId) { - setId(metricId); - } - - public byte[] getDataBinary() { - return getDataBytes(0); - } - - public void setDataBinary(byte[] dataBinary) { - setDataBytes(0, dataBinary); - } - - public long getTimeBucket() { - return getDataLong(0); - } - - public void setTimeBucket(long timeBucket) { - setDataLong(0, timeBucket); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/segment/SegmentDuration.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/segment/SegmentDuration.java deleted file mode 100644 index f3af6861b3b42fe2643c7cfbc74e655088cc6721..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/segment/SegmentDuration.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.segment; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; - -/** - * @author peng-yongsheng - */ -public class SegmentDuration extends StreamData { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(SegmentDurationTable.ID, new NonMergeOperation()), - new StringColumn(SegmentDurationTable.SEGMENT_ID, new CoverMergeOperation()), - new StringColumn(SegmentDurationTable.TRACE_ID, new CoverMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(SegmentDurationTable.DURATION, new CoverMergeOperation()), - new LongColumn(SegmentDurationTable.START_TIME, new CoverMergeOperation()), - new LongColumn(SegmentDurationTable.END_TIME, new CoverMergeOperation()), - new LongColumn(SegmentDurationTable.TIME_BUCKET, new CoverMergeOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(SegmentDurationTable.APPLICATION_ID, new CoverMergeOperation()), - new IntegerColumn(SegmentDurationTable.IS_ERROR, new CoverMergeOperation()), - }; - - private static final StringListColumn[] STRING_LIST_COLUMNS = { - new StringListColumn(SegmentDurationTable.SERVICE_NAME, new CoverMergeOperation()), - }; - - public SegmentDuration() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, new DoubleColumn[0], STRING_LIST_COLUMNS, new LongListColumn[0], new IntegerListColumn[0], new DoubleListColumn[0]); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getId(); - } - - @Override public void setMetricId(String metricId) { - setId(metricId); - } - - public String getSegmentId() { - return getDataString(1); - } - - public void setSegmentId(String segmentId) { - setDataString(1, segmentId); - } - - public String getTraceId() { - return getDataString(2); - } - - public void setTraceId(String traceId) { - setDataString(2, traceId); - } - - public StringLinkedList getServiceName() { - return getDataStringList(0); - } - - public Long getDuration() { - return getDataLong(0); - } - - public void setDuration(Long duration) { - setDataLong(0, duration); - } - - public Long getStartTime() { - return getDataLong(1); - } - - public void setStartTime(Long startTime) { - setDataLong(1, startTime); - } - - public Long getEndTime() { - return getDataLong(2); - } - - public void setEndTime(Long endTime) { - setDataLong(2, endTime); - } - - public Long getTimeBucket() { - return getDataLong(3); - } - - public void setTimeBucket(Long timeBucket) { - setDataLong(3, timeBucket); - } - - public Integer getApplicationId() { - return getDataInteger(0); - } - - public void setApplicationId(Integer applicationId) { - setDataInteger(0, applicationId); - } - - public Integer getIsError() { - return getDataInteger(1); - } - - public void setIsError(Integer isError) { - setDataInteger(1, isError); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/segment/SegmentDurationTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/segment/SegmentDurationTable.java deleted file mode 100644 index 5d65f734896460be8f9f5dca3ddff64cfe6eb6b5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/segment/SegmentDurationTable.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.segment; - -import org.apache.skywalking.apm.collector.core.data.ColumnName; -import org.apache.skywalking.apm.collector.core.data.CommonTable; -import org.apache.skywalking.apm.collector.storage.table.global.GlobalTraceTable; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceNameTable; - -/** - * @author peng-yongsheng - */ -public interface SegmentDurationTable extends CommonTable, SegmentTable, ServiceNameTable, GlobalTraceTable { - String TABLE = "segment_duration"; - - ColumnName START_TIME = new ColumnName("start_time", "dst"); - - ColumnName END_TIME = new ColumnName("end_time", "det"); - - ColumnName DURATION = new ColumnName("duration", "ddt"); - - ColumnName IS_ERROR = new ColumnName("is_error", "die"); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/segment/SegmentTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/segment/SegmentTable.java deleted file mode 100644 index 8d7d86d9a815281c5a76a6bd433dcecafa62f2a9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/segment/SegmentTable.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.segment; - -import org.apache.skywalking.apm.collector.core.data.ColumnName; -import org.apache.skywalking.apm.collector.core.data.CommonTable; - -/** - * @author peng-yongsheng - */ -public interface SegmentTable extends CommonTable { - String TABLE = "segment"; - - ColumnName DATA_BINARY = new ColumnName("data_binary", "sdb"); - - ColumnName SEGMENT_ID = new ColumnName("segment_id", "sgi"); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/service/ServiceMetric.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/service/ServiceMetric.java deleted file mode 100644 index e7fa9a2a17377b7648baac7f7dfd195855f91356..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/service/ServiceMetric.java +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.service; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; -import org.apache.skywalking.apm.collector.storage.table.Metric; - -/** - * @author peng-yongsheng - */ -public class ServiceMetric extends StreamData implements Metric { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(ServiceMetricTable.ID, new NonMergeOperation()), - new StringColumn(ServiceMetricTable.METRIC_ID, new NonMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(ServiceMetricTable.TIME_BUCKET, new NonMergeOperation()), - - new LongColumn(ServiceMetricTable.TRANSACTION_CALLS, new AddMergeOperation()), - new LongColumn(ServiceMetricTable.TRANSACTION_ERROR_CALLS, new AddMergeOperation()), - new LongColumn(ServiceMetricTable.TRANSACTION_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ServiceMetricTable.TRANSACTION_ERROR_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ServiceMetricTable.TRANSACTION_AVERAGE_DURATION, new NonMergeOperation(), new TransactionAverageDurationFormulaOperation()), - new LongColumn(ServiceMetricTable.BUSINESS_TRANSACTION_CALLS, new AddMergeOperation()), - new LongColumn(ServiceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, new AddMergeOperation()), - new LongColumn(ServiceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ServiceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ServiceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, new NonMergeOperation(), new BusinessTransactionAverageDurationFormulaOperation()), - new LongColumn(ServiceMetricTable.MQ_TRANSACTION_CALLS, new AddMergeOperation()), - new LongColumn(ServiceMetricTable.MQ_TRANSACTION_ERROR_CALLS, new AddMergeOperation()), - new LongColumn(ServiceMetricTable.MQ_TRANSACTION_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ServiceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ServiceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, new NonMergeOperation(), new MqTransactionAverageDurationFormulaOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(ServiceMetricTable.SOURCE_VALUE, new NonMergeOperation()), - new IntegerColumn(ServiceMetricTable.APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(ServiceMetricTable.INSTANCE_ID, new NonMergeOperation()), - new IntegerColumn(ServiceMetricTable.SERVICE_ID, new NonMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public ServiceMetric() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getDataString(1); - } - - @Override public void setMetricId(String metricId) { - setDataString(1, metricId); - } - - @Override - public Integer getSourceValue() { - return getDataInteger(0); - } - - @Override - public void setSourceValue(Integer sourceValue) { - setDataInteger(0, sourceValue); - } - - public Integer getApplicationId() { - return getDataInteger(1); - } - - public void setApplicationId(Integer applicationId) { - setDataInteger(1, applicationId); - } - - public Integer getInstanceId() { - return getDataInteger(2); - } - - public void setInstanceId(Integer instanceId) { - setDataInteger(2, instanceId); - } - - public Integer getServiceId() { - return getDataInteger(3); - } - - public void setServiceId(Integer serviceId) { - setDataInteger(3, serviceId); - } - - @Override - public Long getTimeBucket() { - return getDataLong(0); - } - - @Override - public void setTimeBucket(Long timeBucket) { - setDataLong(0, timeBucket); - } - - @Override - public Long getTransactionCalls() { - return getDataLong(1); - } - - @Override - public void setTransactionCalls(Long transactionCalls) { - setDataLong(1, transactionCalls); - } - - @Override - public Long getTransactionErrorCalls() { - return getDataLong(2); - } - - @Override - public void setTransactionErrorCalls(Long transactionErrorCalls) { - setDataLong(2, transactionErrorCalls); - } - - @Override - public Long getTransactionDurationSum() { - return getDataLong(3); - } - - @Override - public void setTransactionDurationSum(Long transactionDurationSum) { - setDataLong(3, transactionDurationSum); - } - - @Override - public Long getTransactionErrorDurationSum() { - return getDataLong(4); - } - - @Override - public void setTransactionErrorDurationSum(Long transactionErrorDurationSum) { - setDataLong(4, transactionErrorDurationSum); - } - - @Override public Long getTransactionAverageDuration() { - return getDataLong(5); - } - - @Override public void setTransactionAverageDuration(Long transactionAverageDuration) { - setDataLong(5, transactionAverageDuration); - } - - @Override - public Long getBusinessTransactionCalls() { - return getDataLong(6); - } - - @Override - public void setBusinessTransactionCalls(Long businessTransactionCalls) { - setDataLong(6, businessTransactionCalls); - } - - @Override - public Long getBusinessTransactionErrorCalls() { - return getDataLong(7); - } - - @Override - public void setBusinessTransactionErrorCalls(Long businessTransactionErrorCalls) { - setDataLong(7, businessTransactionErrorCalls); - } - - @Override - public Long getBusinessTransactionDurationSum() { - return getDataLong(8); - } - - @Override - public void setBusinessTransactionDurationSum(Long businessTransactionDurationSum) { - setDataLong(8, businessTransactionDurationSum); - } - - @Override - public Long getBusinessTransactionErrorDurationSum() { - return getDataLong(9); - } - - @Override - public void setBusinessTransactionErrorDurationSum(Long businessTransactionErrorDurationSum) { - setDataLong(9, businessTransactionErrorDurationSum); - } - - @Override public Long getBusinessTransactionAverageDuration() { - return getDataLong(10); - } - - @Override public void setBusinessTransactionAverageDuration(Long businessTransactionAverageDuration) { - setDataLong(10, businessTransactionAverageDuration); - } - - @Override - public Long getMqTransactionCalls() { - return getDataLong(11); - } - - @Override - public void setMqTransactionCalls(Long mqTransactionCalls) { - setDataLong(11, mqTransactionCalls); - } - - @Override - public Long getMqTransactionErrorCalls() { - return getDataLong(12); - } - - @Override - public void setMqTransactionErrorCalls(Long mqTransactionErrorCalls) { - setDataLong(12, mqTransactionErrorCalls); - } - - @Override - public Long getMqTransactionDurationSum() { - return getDataLong(13); - } - - @Override - public void setMqTransactionDurationSum(Long mqTransactionDurationSum) { - setDataLong(13, mqTransactionDurationSum); - } - - @Override - public Long getMqTransactionErrorDurationSum() { - return getDataLong(14); - } - - @Override - public void setMqTransactionErrorDurationSum(Long mqTransactionErrorDurationSum) { - setDataLong(14, mqTransactionErrorDurationSum); - } - - @Override public Long getMqTransactionAverageDuration() { - return getDataLong(15); - } - - @Override public void setMqTransactionAverageDuration(Long mqTransactionAverageDuration) { - setDataLong(15, mqTransactionAverageDuration); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new ServiceMetric(); - } - } - - private static class TransactionAverageDurationFormulaOperation implements FormulaOperation { - - @Override public Long operate(ServiceMetric data) { - return data.getTransactionCalls() == 0 ? 0 : data.getTransactionDurationSum() / data.getTransactionCalls(); - } - } - - private static class BusinessTransactionAverageDurationFormulaOperation implements FormulaOperation { - - @Override public Long operate(ServiceMetric data) { - return data.getBusinessTransactionCalls() == 0 ? 0 : data.getBusinessTransactionDurationSum() / data.getBusinessTransactionCalls(); - } - } - - private static class MqTransactionAverageDurationFormulaOperation implements FormulaOperation { - - @Override public Long operate(ServiceMetric data) { - return data.getMqTransactionCalls() == 0 ? 0 : data.getMqTransactionDurationSum() / data.getMqTransactionCalls(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/service/ServiceMetricTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/service/ServiceMetricTable.java deleted file mode 100644 index be22de886a580ed1ba2276d96cb489ab516231b8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/service/ServiceMetricTable.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.service; - -import org.apache.skywalking.apm.collector.storage.table.MetricColumns; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceNameTable; - -/** - * @author peng-yongsheng - */ -public interface ServiceMetricTable extends MetricColumns, ServiceNameTable, InstanceTable { - String TABLE = "service_metric"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/service/ServiceReferenceMetric.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/service/ServiceReferenceMetric.java deleted file mode 100644 index d51d32a9608bfeb950e246e16ce45eb59f7cc707..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/service/ServiceReferenceMetric.java +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.service; - -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.core.data.column.*; -import org.apache.skywalking.apm.collector.core.data.operator.*; -import org.apache.skywalking.apm.collector.remote.service.RemoteDataRegisterService; -import org.apache.skywalking.apm.collector.storage.table.Metric; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMetric extends StreamData implements Metric { - - private static final StringColumn[] STRING_COLUMNS = { - new StringColumn(ServiceReferenceMetricTable.ID, new NonMergeOperation()), - new StringColumn(ServiceReferenceMetricTable.METRIC_ID, new NonMergeOperation()), - }; - - private static final LongColumn[] LONG_COLUMNS = { - new LongColumn(ServiceReferenceMetricTable.TIME_BUCKET, new NonMergeOperation()), - - new LongColumn(ServiceReferenceMetricTable.TRANSACTION_CALLS, new AddMergeOperation()), - new LongColumn(ServiceReferenceMetricTable.TRANSACTION_ERROR_CALLS, new AddMergeOperation()), - new LongColumn(ServiceReferenceMetricTable.TRANSACTION_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ServiceReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ServiceReferenceMetricTable.TRANSACTION_AVERAGE_DURATION, new NonMergeOperation(), new TransactionAverageDurationFormulaOperation()), - new LongColumn(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_CALLS, new AddMergeOperation()), - new LongColumn(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, new AddMergeOperation()), - new LongColumn(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, new NonMergeOperation(), new BusinessTransactionAverageDurationFormulaOperation()), - new LongColumn(ServiceReferenceMetricTable.MQ_TRANSACTION_CALLS, new AddMergeOperation()), - new LongColumn(ServiceReferenceMetricTable.MQ_TRANSACTION_ERROR_CALLS, new AddMergeOperation()), - new LongColumn(ServiceReferenceMetricTable.MQ_TRANSACTION_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ServiceReferenceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, new AddMergeOperation()), - new LongColumn(ServiceReferenceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, new NonMergeOperation(), new MqTransactionAverageDurationFormulaOperation()), - }; - - private static final IntegerColumn[] INTEGER_COLUMNS = { - new IntegerColumn(ServiceReferenceMetricTable.SOURCE_VALUE, new NonMergeOperation()), - - new IntegerColumn(ServiceReferenceMetricTable.FRONT_SERVICE_ID, new NonMergeOperation()), - new IntegerColumn(ServiceReferenceMetricTable.BEHIND_SERVICE_ID, new NonMergeOperation()), - - new IntegerColumn(ServiceReferenceMetricTable.FRONT_INSTANCE_ID, new NonMergeOperation()), - new IntegerColumn(ServiceReferenceMetricTable.BEHIND_INSTANCE_ID, new NonMergeOperation()), - - new IntegerColumn(ServiceReferenceMetricTable.FRONT_APPLICATION_ID, new NonMergeOperation()), - new IntegerColumn(ServiceReferenceMetricTable.BEHIND_APPLICATION_ID, new NonMergeOperation()), - }; - - private static final DoubleColumn[] DOUBLE_COLUMNS = { - }; - - public ServiceReferenceMetric() { - super(STRING_COLUMNS, LONG_COLUMNS, INTEGER_COLUMNS, DOUBLE_COLUMNS); - } - - @Override public String getId() { - return getDataString(0); - } - - @Override public void setId(String id) { - setDataString(0, id); - } - - @Override public String getMetricId() { - return getDataString(1); - } - - @Override public void setMetricId(String metricId) { - setDataString(1, metricId); - } - - @Override - public Integer getSourceValue() { - return getDataInteger(0); - } - - @Override - public void setSourceValue(Integer sourceValue) { - setDataInteger(0, sourceValue); - } - - public Integer getFrontServiceId() { - return getDataInteger(1); - } - - public void setFrontServiceId(Integer frontServiceId) { - setDataInteger(1, frontServiceId); - } - - public Integer getBehindServiceId() { - return getDataInteger(2); - } - - public void setBehindServiceId(Integer behindServiceId) { - setDataInteger(2, behindServiceId); - } - - public Integer getFrontInstanceId() { - return getDataInteger(3); - } - - public void setFrontInstanceId(Integer frontInstanceId) { - setDataInteger(3, frontInstanceId); - } - - public Integer getBehindInstanceId() { - return getDataInteger(4); - } - - public void setBehindInstanceId(Integer behindInstanceId) { - setDataInteger(4, behindInstanceId); - } - - public Integer getFrontApplicationId() { - return getDataInteger(5); - } - - public void setFrontApplicationId(Integer frontApplicationId) { - setDataInteger(5, frontApplicationId); - } - - public Integer getBehindApplicationId() { - return getDataInteger(6); - } - - public void setBehindApplicationId(Integer behindApplicationId) { - setDataInteger(6, behindApplicationId); - } - - @Override - public Long getTimeBucket() { - return getDataLong(0); - } - - @Override - public void setTimeBucket(Long timeBucket) { - setDataLong(0, timeBucket); - } - - @Override - public Long getTransactionCalls() { - return getDataLong(1); - } - - @Override - public void setTransactionCalls(Long transactionCalls) { - setDataLong(1, transactionCalls); - } - - @Override - public Long getTransactionErrorCalls() { - return getDataLong(2); - } - - @Override - public void setTransactionErrorCalls(Long transactionErrorCalls) { - setDataLong(2, transactionErrorCalls); - } - - @Override - public Long getTransactionDurationSum() { - return getDataLong(3); - } - - @Override - public void setTransactionDurationSum(Long transactionDurationSum) { - setDataLong(3, transactionDurationSum); - } - - @Override - public Long getTransactionErrorDurationSum() { - return getDataLong(4); - } - - @Override - public void setTransactionErrorDurationSum(Long transactionErrorDurationSum) { - setDataLong(4, transactionErrorDurationSum); - } - - @Override public Long getTransactionAverageDuration() { - return getDataLong(5); - } - - @Override public void setTransactionAverageDuration(Long transactionAverageDuration) { - setDataLong(5, transactionAverageDuration); - } - - @Override - public Long getBusinessTransactionCalls() { - return getDataLong(6); - } - - @Override - public void setBusinessTransactionCalls(Long businessTransactionCalls) { - setDataLong(6, businessTransactionCalls); - } - - @Override - public Long getBusinessTransactionErrorCalls() { - return getDataLong(7); - } - - @Override - public void setBusinessTransactionErrorCalls(Long businessTransactionErrorCalls) { - setDataLong(7, businessTransactionErrorCalls); - } - - @Override - public Long getBusinessTransactionDurationSum() { - return getDataLong(8); - } - - @Override - public void setBusinessTransactionDurationSum(Long businessTransactionDurationSum) { - setDataLong(8, businessTransactionDurationSum); - } - - @Override - public Long getBusinessTransactionErrorDurationSum() { - return getDataLong(9); - } - - @Override - public void setBusinessTransactionErrorDurationSum(Long businessTransactionErrorDurationSum) { - setDataLong(9, businessTransactionErrorDurationSum); - } - - @Override public Long getBusinessTransactionAverageDuration() { - return getDataLong(10); - } - - @Override public void setBusinessTransactionAverageDuration(Long businessTransactionAverageDuration) { - setDataLong(10, businessTransactionAverageDuration); - } - - @Override - public Long getMqTransactionCalls() { - return getDataLong(11); - } - - @Override - public void setMqTransactionCalls(Long mqTransactionCalls) { - setDataLong(11, mqTransactionCalls); - } - - @Override - public Long getMqTransactionErrorCalls() { - return getDataLong(12); - } - - @Override - public void setMqTransactionErrorCalls(Long mqTransactionErrorCalls) { - setDataLong(12, mqTransactionErrorCalls); - } - - @Override - public Long getMqTransactionDurationSum() { - return getDataLong(13); - } - - @Override - public void setMqTransactionDurationSum(Long mqTransactionDurationSum) { - setDataLong(13, mqTransactionDurationSum); - } - - @Override - public Long getMqTransactionErrorDurationSum() { - return getDataLong(14); - } - - @Override - public void setMqTransactionErrorDurationSum(Long mqTransactionErrorDurationSum) { - setDataLong(14, mqTransactionErrorDurationSum); - } - - @Override public Long getMqTransactionAverageDuration() { - return getDataLong(15); - } - - @Override public void setMqTransactionAverageDuration(Long mqTransactionAverageDuration) { - setDataLong(15, mqTransactionAverageDuration); - } - - public static class InstanceCreator implements RemoteDataRegisterService.RemoteDataInstanceCreator { - @Override public RemoteData createInstance() { - return new ServiceReferenceMetric(); - } - } - - private static class TransactionAverageDurationFormulaOperation implements FormulaOperation { - - @Override public Long operate(ServiceReferenceMetric data) { - return data.getTransactionCalls() == 0 ? 0 : data.getTransactionDurationSum() / data.getTransactionCalls(); - } - } - - private static class BusinessTransactionAverageDurationFormulaOperation implements FormulaOperation { - - @Override public Long operate(ServiceReferenceMetric data) { - return data.getBusinessTransactionCalls() == 0 ? 0 : data.getBusinessTransactionDurationSum() / data.getBusinessTransactionCalls(); - } - } - - private static class MqTransactionAverageDurationFormulaOperation implements FormulaOperation { - - @Override public Long operate(ServiceReferenceMetric data) { - return data.getMqTransactionCalls() == 0 ? 0 : data.getMqTransactionDurationSum() / data.getMqTransactionCalls(); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/service/ServiceReferenceMetricTable.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/service/ServiceReferenceMetricTable.java deleted file mode 100644 index c1df53b9760c88668c5f4dfe4a104e5ea409a504..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/service/ServiceReferenceMetricTable.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.table.service; - -import org.apache.skywalking.apm.collector.storage.table.MetricColumns; -import org.apache.skywalking.apm.collector.storage.table.ReferenceColumns; - -/** - * @author peng-yongsheng - */ -public interface ServiceReferenceMetricTable extends MetricColumns, ReferenceColumns { - String TABLE = "service_reference_metric"; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ttl/ITTLConfigService.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ttl/ITTLConfigService.java deleted file mode 100644 index 98592cc9377460e533424199ad7a9106aad30ca0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ttl/ITTLConfigService.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ttl; - -import org.apache.skywalking.apm.collector.core.module.Service; - -/** - * @author peng-yongsheng - */ -public interface ITTLConfigService extends Service { - int traceDataTTL(); - - int minuteMetricDataTTL(); - - int hourMetricDataTTL(); - - int dayMetricDataTTL(); - - int monthMetricDataTTL(); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/Alarm.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/Alarm.java deleted file mode 100644 index d854554581c538d7b9381b877836df9aafab3e58..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/Alarm.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.alarm; - -import java.util.LinkedList; -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class Alarm { - private List items; - private int total; - - public Alarm() { - this.items = new LinkedList<>(); - } - - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/AlarmItem.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/AlarmItem.java deleted file mode 100644 index 23e4d3f0255e7fccd8d69d4863b0aac69040833a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/AlarmItem.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.alarm; - -/** - * @author peng-yongsheng - */ -public class AlarmItem { - private int id; - private String title; - private String content; - private String startTime; - private AlarmType alarmType; - private CauseType causeType; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public AlarmType getAlarmType() { - return alarmType; - } - - public void setAlarmType(AlarmType alarmType) { - this.alarmType = alarmType; - } - - public CauseType getCauseType() { - return causeType; - } - - public void setCauseType(CauseType causeType) { - this.causeType = causeType; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/AlarmType.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/AlarmType.java deleted file mode 100644 index 75986a5dabaf735927987488ba65d659e06de081..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/AlarmType.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.alarm; - -/** - * @author peng-yongsheng - */ -public enum AlarmType { - APPLICATION, - SERVER, - SERVICE -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/CauseType.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/CauseType.java deleted file mode 100644 index 908ff648221979e5f40190182576e67616130d7d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/alarm/CauseType.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.alarm; - -/** - * @author peng-yongsheng - */ -public enum CauseType { - LOW_SUCCESS_RATE, - SLOW_RESPONSE -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/Application.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/Application.java deleted file mode 100644 index 354efb2cfc72f75a735653cb82e7fc677d9d603f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/Application.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.application; - -/** - * @author peng-yongsheng - */ -public class Application { - private int id; - private String name; - private int numOfServer; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public int getNumOfServer() { - return numOfServer; - } - - public void setNumOfServer(int numOfServer) { - this.numOfServer = numOfServer; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ApplicationNode.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ApplicationNode.java deleted file mode 100644 index 4e434a96bbc57348c5050bfe41a71d59b78a7182..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ApplicationNode.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.application; - -import org.apache.skywalking.apm.collector.storage.ui.common.Node; - -/** - * @author peng-yongsheng - */ -public class ApplicationNode extends Node { - - private int sla; - private long cpm; - private long avgResponseTime; - private int apdex; - private boolean isAlarm; - private int numOfServer; - private int numOfServerAlarm; - private int numOfServiceAlarm; - - public int getSla() { - return sla; - } - - public void setSla(int sla) { - this.sla = sla; - } - - public long getCpm() { - return cpm; - } - - public void setCpm(long cpm) { - this.cpm = cpm; - } - - public long getAvgResponseTime() { - return avgResponseTime; - } - - public void setAvgResponseTime(long avgResponseTime) { - this.avgResponseTime = avgResponseTime; - } - - public int getApdex() { - return apdex; - } - - public void setApdex(int apdex) { - this.apdex = apdex; - } - - public boolean isAlarm() { - return isAlarm; - } - - public void setAlarm(boolean alarm) { - isAlarm = alarm; - } - - public int getNumOfServer() { - return numOfServer; - } - - public void setNumOfServer(int numOfServer) { - this.numOfServer = numOfServer; - } - - public int getNumOfServerAlarm() { - return numOfServerAlarm; - } - - public void setNumOfServerAlarm(int numOfServerAlarm) { - this.numOfServerAlarm = numOfServerAlarm; - } - - public int getNumOfServiceAlarm() { - return numOfServiceAlarm; - } - - public void setNumOfServiceAlarm(int numOfServiceAlarm) { - this.numOfServiceAlarm = numOfServiceAlarm; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ConjecturalNode.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ConjecturalNode.java deleted file mode 100644 index c77c36955e38b2743bb858dda7c05e6b69c88604..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/application/ConjecturalNode.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.application; - -import org.apache.skywalking.apm.collector.storage.ui.common.Node; - -/** - * @author peng-yongsheng - */ -public class ConjecturalNode extends Node { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Call.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Call.java deleted file mode 100644 index 8800b095487e21c2c03c47003b6ccb0bc9d361df..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Call.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.common; - -/** - * @author peng-yongsheng - */ -public class Call { - private int source; - private String sourceName; - private int target; - private String targetName; - private boolean isAlert; - private String callType; - private long cpm; - private long avgResponseTime; - - public int getSource() { - return source; - } - - public void setSource(int source) { - this.source = source; - } - - public String getSourceName() { - return sourceName; - } - - public void setSourceName(String sourceName) { - this.sourceName = sourceName; - } - - public int getTarget() { - return target; - } - - public void setTarget(int target) { - this.target = target; - } - - public String getTargetName() { - return targetName; - } - - public void setTargetName(String targetName) { - this.targetName = targetName; - } - - public boolean isAlert() { - return isAlert; - } - - public void setAlert(boolean alert) { - isAlert = alert; - } - - public String getCallType() { - return callType; - } - - public void setCallType(String callType) { - this.callType = callType; - } - - public long getCpm() { - return cpm; - } - - public void setCpm(long cpm) { - this.cpm = cpm; - } - - public long getAvgResponseTime() { - return avgResponseTime; - } - - public void setAvgResponseTime(long avgResponseTime) { - this.avgResponseTime = avgResponseTime; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Duration.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Duration.java deleted file mode 100644 index 88ef2fa7ffe4b4c022cc8517c4033abc130c6977..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Duration.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.common; - -/** - * @author peng-yongsheng - */ -public class Duration { - - private String start; - private String end; - private Step step; - - public String getStart() { - return start; - } - - public void setStart(String start) { - this.start = start; - } - - public String getEnd() { - return end; - } - - public void setEnd(String end) { - this.end = end; - } - - public Step getStep() { - return step; - } - - public void setStep(Step step) { - this.step = step; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Node.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Node.java deleted file mode 100644 index b4cf19254716977db2574852e97dd253123c4a58..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Node.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.common; - -/** - * @author peng-yongsheng - */ -public abstract class Node { - private int id; - private String name; - private String type; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Pagination.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Pagination.java deleted file mode 100644 index 77dbcd795ff9830b824927e16ed5dccbcbd46636..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Pagination.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.common; - -/** - * @author peng-yongsheng - */ -public class Pagination { - private int pageNum; - private int pageSize; - private boolean needTotal; - - public int getPageNum() { - return pageNum; - } - - public void setPageNum(int pageNum) { - this.pageNum = pageNum; - } - - public int getPageSize() { - return pageSize; - } - - public void setPageSize(int pageSize) { - this.pageSize = pageSize; - } - - public boolean isNeedTotal() { - return needTotal; - } - - public void setNeedTotal(boolean needTotal) { - this.needTotal = needTotal; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ResponseTimeTrend.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ResponseTimeTrend.java deleted file mode 100644 index dc08516c0ed875280e169eb5668cb9932f42a31c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ResponseTimeTrend.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.common; - -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeTrend { - private List trendList; - - public List getTrendList() { - return trendList; - } - - public void setTrendList(List trendList) { - this.trendList = trendList; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/SLATrend.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/SLATrend.java deleted file mode 100644 index ed75ddac81d68b01e40bf278527bcb2479885ba5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/SLATrend.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.common; - -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class SLATrend { - private List trendList; - - public List getTrendList() { - return trendList; - } - - public void setTrendList(List trendList) { - this.trendList = trendList; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Step.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Step.java deleted file mode 100644 index 6a4d83a0b2f21f2773eeadfbad09bcc86c8e7260..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Step.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.common; - -/** - * @author peng-yongsheng - */ -public enum Step { - MONTH, - DAY, - HOUR, - MINUTE, - SECOND -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ThroughputTrend.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ThroughputTrend.java deleted file mode 100644 index a407163600a9052eeaed8946ff3855244b24ae27..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ThroughputTrend.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.common; - -import java.util.LinkedList; -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class ThroughputTrend { - private List trendList; - - public ThroughputTrend() { - this.trendList = new LinkedList<>(); - } - - public List getTrendList() { - return trendList; - } - - public void setTrendList(List trendList) { - this.trendList = trendList; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Topology.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Topology.java deleted file mode 100644 index a019a97b7b2019fd721f28d273c3ac7e782603b1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/Topology.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.common; - -import java.util.LinkedList; -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class Topology { - - private List nodes; - private List calls; - - public Topology() { - this.nodes = new LinkedList<>(); - this.calls = new LinkedList<>(); - } - - public List getNodes() { - return nodes; - } - - public void setNodes(List nodes) { - this.nodes = nodes; - } - - public List getCalls() { - return calls; - } - - public void setCalls(List calls) { - this.calls = calls; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ValueType.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ValueType.java deleted file mode 100644 index a07ed67665eb8a9f775c14bed508f9c63db81d39..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ValueType.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.common; - -/** - * @author peng-yongsheng - */ -public enum ValueType { - ALL, - RIGHT, - WRONG -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/VisualUserNode.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/VisualUserNode.java deleted file mode 100644 index 8207acda224574a061b18675c52abce5d8aff278..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/VisualUserNode.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.common; - -/** - * @author peng-yongsheng - */ -public class VisualUserNode extends Node { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/AlarmThreshold.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/AlarmThreshold.java deleted file mode 100644 index e96d329ecb7a4776d943a6d3a7e4a2733d2e47c3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/AlarmThreshold.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.config; - -import org.apache.skywalking.apm.collector.storage.ui.alarm.AlarmType; -import org.apache.skywalking.apm.collector.storage.ui.alarm.CauseType; - -/** - * @author peng-yongsheng - */ -public class AlarmThreshold { - private AlarmType type; - private Integer threshold; - private CauseType causeType; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedAlarmThresholdItem.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedAlarmThresholdItem.java deleted file mode 100644 index e42e70d967822aacf120466390a8e8ecd4e2f6e1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedAlarmThresholdItem.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.config; - -import org.apache.skywalking.apm.collector.storage.ui.alarm.CauseType; - -/** - * @author peng-yongsheng - */ -public class ExistedAlarmThresholdItem { - private Integer threshold; - private CauseType causeType; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedAlarmThresholds.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedAlarmThresholds.java deleted file mode 100644 index f4d094547420e3cf134a0124364351f660f357bf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedAlarmThresholds.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.config; - -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class ExistedAlarmThresholds { - private List items; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedTTLConfigs.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedTTLConfigs.java deleted file mode 100644 index 32b29cbe2b16f3d697c0f15fc1850d44b1267eec..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/ExistedTTLConfigs.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.config; - -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class ExistedTTLConfigs { - private List ttl; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/TTL.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/TTL.java deleted file mode 100644 index 3da100ed4170222620ec726f5b26ceedb98371c2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/TTL.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.config; - -import org.apache.skywalking.apm.collector.storage.ui.common.Step; - -/** - * @author peng-yongsheng - */ -public class TTL { - private Step unit; - private Integer value; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/TTLConfigItem.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/TTLConfigItem.java deleted file mode 100644 index 8984f1616769cbdd5b931a8ccd4d4aaa6619ce12..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/config/TTLConfigItem.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.config; - -import org.apache.skywalking.apm.collector.storage.ui.common.Step; - -/** - * @author peng-yongsheng - */ -public class TTLConfigItem { - private Step unit; - private Integer value; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/AlarmTrend.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/AlarmTrend.java deleted file mode 100644 index d040f30e0f42be4b0cb75155697f6eed3a84d174..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/AlarmTrend.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.overview; - -import java.util.LinkedList; -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class AlarmTrend { - - private List numOfAlarmRate; - - public AlarmTrend() { - this.numOfAlarmRate = new LinkedList<>(); - } - - public List getNumOfAlarmRate() { - return numOfAlarmRate; - } - - public void setNumOfAlarmRate(List numOfAlarmRate) { - this.numOfAlarmRate = numOfAlarmRate; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ApplicationThroughput.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ApplicationThroughput.java deleted file mode 100644 index 65ba329c3227a8e003ab976063f858db2addcdab..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ApplicationThroughput.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.overview; - -/** - * @author peng-yongsheng - */ -public class ApplicationThroughput { - private int applicationId; - private String applicationCode; - private int cpm; - - public int getApplicationId() { - return applicationId; - } - - public void setApplicationId(int applicationId) { - this.applicationId = applicationId; - } - - public String getApplicationCode() { - return applicationCode; - } - - public void setApplicationCode(String applicationCode) { - this.applicationCode = applicationCode; - } - - public int getCpm() { - return cpm; - } - - public void setCpm(int cpm) { - this.cpm = cpm; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ClusterBrief.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ClusterBrief.java deleted file mode 100644 index 0dce69e8ce99832963556711e7647461996031d3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ClusterBrief.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.overview; - -/** - * @author peng-yongsheng - */ -public class ClusterBrief { - private int numOfApplication; - private int numOfService; - private int numOfDatabase; - private int numOfCache; - private int numOfMQ; - - public int getNumOfApplication() { - return numOfApplication; - } - - public void setNumOfApplication(int numOfApplication) { - this.numOfApplication = numOfApplication; - } - - public int getNumOfService() { - return numOfService; - } - - public void setNumOfService(int numOfService) { - this.numOfService = numOfService; - } - - public int getNumOfDatabase() { - return numOfDatabase; - } - - public void setNumOfDatabase(int numOfDatabase) { - this.numOfDatabase = numOfDatabase; - } - - public int getNumOfCache() { - return numOfCache; - } - - public void setNumOfCache(int numOfCache) { - this.numOfCache = numOfCache; - } - - public int getNumOfMQ() { - return numOfMQ; - } - - public void setNumOfMQ(int numOfMQ) { - this.numOfMQ = numOfMQ; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ConjecturalApp.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ConjecturalApp.java deleted file mode 100644 index e4a9ab64a1e56e48ab265309e3e1fb7296685a0b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ConjecturalApp.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.overview; - -/** - * @author peng-yongsheng - */ -public class ConjecturalApp { - private int id; - private String name; - private int num; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public int getNum() { - return num; - } - - public void setNum(int num) { - this.num = num; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ConjecturalAppBrief.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ConjecturalAppBrief.java deleted file mode 100644 index f425299c66ddcb452a7cb1a6bf626f051eca466c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ConjecturalAppBrief.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.overview; - -import java.util.LinkedList; -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class ConjecturalAppBrief { - private List apps; - - public ConjecturalAppBrief() { - this.apps = new LinkedList<>(); - } - - public List getApps() { - return apps; - } - - public void setApps(List apps) { - this.apps = apps; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/Thermodynamic.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/Thermodynamic.java deleted file mode 100644 index 55ee86ae9a04e5106ad08ae0813302a55c7f4e4b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/Thermodynamic.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.overview; - -import java.util.LinkedList; -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class Thermodynamic { - - private List> nodes; - private int responseTimeStep; - - public Thermodynamic() { - this.nodes = new LinkedList<>(); - } - - public List> getNodes() { - return nodes; - } - - public void setNodes(List> nodes) { - this.nodes = nodes; - } - - public int getResponseTimeStep() { - return responseTimeStep; - } - - public void setResponseTimeStep(int responseTimeStep) { - this.responseTimeStep = responseTimeStep; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/AppServerInfo.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/AppServerInfo.java deleted file mode 100644 index e3a3e3ed84c5843fdf43399650465eb38bb9d22e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/AppServerInfo.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.server; - -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class AppServerInfo { - - private int id; - private int applicationId; - private String applicationCode; - private String osInfo; - private String osName; - private int cpm; - private String host; - private int pid; - private List ipv4; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public int getApplicationId() { - return applicationId; - } - - public void setApplicationId(int applicationId) { - this.applicationId = applicationId; - } - - public String getApplicationCode() { - return applicationCode; - } - - public void setApplicationCode(String applicationCode) { - this.applicationCode = applicationCode; - } - - public String getOsInfo() { - return osInfo; - } - - public void setOsInfo(String osInfo) { - this.osInfo = osInfo; - } - - public String getOsName() { - return osName; - } - - public void setOsName(String osName) { - this.osName = osName; - } - - public int getCpm() { - return cpm; - } - - public void setCpm(int cpm) { - this.cpm = cpm; - } - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - - public int getPid() { - return pid; - } - - public void setPid(int pid) { - this.pid = pid; - } - - public List getIpv4() { - return ipv4; - } - - public void setIpv4(List ipv4) { - this.ipv4 = ipv4; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/CPUTrend.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/CPUTrend.java deleted file mode 100644 index 5f894f76cbd2292840216fd59fbbf3707ec3304c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/CPUTrend.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.server; - -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class CPUTrend { - private List cost; - - public List getCost() { - return cost; - } - - public void setCost(List cost) { - this.cost = cost; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/GCTrend.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/GCTrend.java deleted file mode 100644 index b905e0aefb1c2a370875eab84bdf16614bd1ffed..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/GCTrend.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.server; - -import java.util.*; - -/** - * @author peng-yongsheng - */ -public class GCTrend { - private List youngGCCount; - private List oldGCount; - private List youngGCTime; - private List oldGCTime; - - public GCTrend() { - this.youngGCCount = new LinkedList<>(); - this.oldGCount = new LinkedList<>(); - this.youngGCTime = new LinkedList<>(); - this.oldGCTime = new LinkedList<>(); - } - - public List getYoungGCCount() { - return youngGCCount; - } - - public void setYoungGCCount(List youngGCCount) { - this.youngGCCount = youngGCCount; - } - - public List getOldGCount() { - return oldGCount; - } - - public void setOldGCount(List oldGCount) { - this.oldGCount = oldGCount; - } - - public List getYoungGCTime() { - return youngGCTime; - } - - public void setYoungGCTime(List youngGCTime) { - this.youngGCTime = youngGCTime; - } - - public List getOldGCTime() { - return oldGCTime; - } - - public void setOldGCTime(List oldGCTime) { - this.oldGCTime = oldGCTime; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/MemoryTrend.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/MemoryTrend.java deleted file mode 100644 index 5b7027c02a7339b97e88e84e4276da8667a60de6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/MemoryTrend.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.server; - -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class MemoryTrend { - private List heap; - private List maxHeap; - private List noheap; - private List maxNoheap; - - public List getHeap() { - return heap; - } - - public void setHeap(List heap) { - this.heap = heap; - } - - public List getMaxHeap() { - return maxHeap; - } - - public void setMaxHeap(List maxHeap) { - this.maxHeap = maxHeap; - } - - public List getNoheap() { - return noheap; - } - - public void setNoheap(List noheap) { - this.noheap = noheap; - } - - public List getMaxNoheap() { - return maxNoheap; - } - - public void setMaxNoheap(List maxNoheap) { - this.maxNoheap = maxNoheap; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceInfo.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceInfo.java deleted file mode 100644 index 1a257280815c10e9751106cbb44276e3c19cda0d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceInfo.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.service; - -/** - * @author peng-yongsheng - */ -public class ServiceInfo { - private int id; - private String name; - private int applicationId; - private String applicationName; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public int getApplicationId() { - return applicationId; - } - - public void setApplicationId(int applicationId) { - this.applicationId = applicationId; - } - - public String getApplicationName() { - return applicationName; - } - - public void setApplicationName(String applicationName) { - this.applicationName = applicationName; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceMetric.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceMetric.java deleted file mode 100644 index caf75753d9dd4332b4dd3c4a616a8de183b17400..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceMetric.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.service; - -/** - * @author peng-yongsheng - */ -public class ServiceMetric { - private ServiceInfo service; - private long calls; - private int avgResponseTime; - private int cpm; - - public ServiceMetric() { - this.service = new ServiceInfo(); - } - - public ServiceInfo getService() { - return service; - } - - public void setService(ServiceInfo service) { - this.service = service; - } - - public int getAvgResponseTime() { - return avgResponseTime; - } - - public void setAvgResponseTime(int avgResponseTime) { - this.avgResponseTime = avgResponseTime; - } - - public int getCpm() { - return cpm; - } - - public void setCpm(int cpm) { - this.cpm = cpm; - } - - public long getCalls() { - return calls; - } - - public void setCalls(long calls) { - this.calls = calls; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceNode.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceNode.java deleted file mode 100644 index b935f925065d24a220f86c055ec75c05a5db0794..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceNode.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.service; - -import org.apache.skywalking.apm.collector.storage.ui.common.Node; - -/** - * @author peng-yongsheng - */ -public class ServiceNode extends Node { - private int sla; - private long calls; - private int numOfServiceAlarm; - private int applicationId; - - public int getSla() { - return sla; - } - - public void setSla(int sla) { - this.sla = sla; - } - - public long getCalls() { - return calls; - } - - public void setCalls(long calls) { - this.calls = calls; - } - - public int getNumOfServiceAlarm() { - return numOfServiceAlarm; - } - - public void setNumOfServiceAlarm(int numOfServiceAlarm) { - this.numOfServiceAlarm = numOfServiceAlarm; - } - - public int getApplicationId() { - return applicationId; - } - - public void setApplicationId(int applicationId) { - this.applicationId = applicationId; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/BasicTrace.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/BasicTrace.java deleted file mode 100644 index 4f99c6f7428ae58509441811b0160165db934127..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/BasicTrace.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.trace; - -import java.util.*; - -/** - * @author peng-yongsheng - */ -public class BasicTrace { - - private String segmentId; - private List operationNames; - private int duration; - private long start; - private Boolean isError; - private List traceIds; - - public BasicTrace() { - this.traceIds = new LinkedList<>(); - this.operationNames = new LinkedList<>(); - } - - public String getSegmentId() { - return segmentId; - } - - public void setSegmentId(String segmentId) { - this.segmentId = segmentId; - } - - public List getOperationName() { - return operationNames; - } - - public int getDuration() { - return duration; - } - - public void setDuration(int duration) { - this.duration = duration; - } - - public long getStart() { - return start; - } - - public void setStart(long start) { - this.start = start; - } - - public Boolean getError() { - return isError; - } - - public void setError(Boolean error) { - isError = error; - } - - public List getTraceIds() { - return traceIds; - } - - public void setTraceIds(List traceIds) { - this.traceIds = traceIds; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/KeyValue.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/KeyValue.java deleted file mode 100644 index deac45f07fa8e2a6780746a974eef8d0e83ef67f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/KeyValue.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.trace; - -/** - * @author peng-yongsheng - */ -public class KeyValue { - private String key; - private String value; - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/LogEntity.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/LogEntity.java deleted file mode 100644 index a7988702e4395c63525faaf0623a23c6e0374851..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/LogEntity.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.trace; - -import java.util.LinkedList; -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class LogEntity { - private long time; - private List data; - - public LogEntity() { - this.data = new LinkedList<>(); - } - - public long getTime() { - return time; - } - - public void setTime(long time) { - this.time = time; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/QueryOrder.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/QueryOrder.java deleted file mode 100644 index 2f0a5f9d1297981ccc8ab3959cc89afeef76b9f0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/QueryOrder.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.trace; - -public enum QueryOrder { - BY_START_TIME, - BY_DURATION -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Ref.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Ref.java deleted file mode 100644 index 7f189e765df2e564c7f96f0831ad2441f7cb220b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Ref.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.trace; - -/** - * @author peng-yongsheng - */ -public class Ref { - private String traceId; - private String parentSegmentId; - private Integer parentSpanId; - private RefType type; - - public String getTraceId() { - return traceId; - } - - public void setTraceId(String traceId) { - this.traceId = traceId; - } - - public String getParentSegmentId() { - return parentSegmentId; - } - - public void setParentSegmentId(String parentSegmentId) { - this.parentSegmentId = parentSegmentId; - } - - public Integer getParentSpanId() { - return parentSpanId; - } - - public void setParentSpanId(Integer parentSpanId) { - this.parentSpanId = parentSpanId; - } - - public RefType getType() { - return type; - } - - public void setType(RefType type) { - this.type = type; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/RefType.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/RefType.java deleted file mode 100644 index 00eca2080ff5d99f4bf6e0d15fe0d48e2e728313..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/RefType.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.trace; - -/** - * @author peng-yongsheng - */ -public enum RefType { - CROSS_PROCESS, - CROSS_THREAD -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Segment.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Segment.java deleted file mode 100644 index 62fc6ab3de5581c537367b0b6d32ce5339581131..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Segment.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.trace; - -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class Segment { - private int segmentId; - private String appName; - private Boolean isSizeLimited; - private List spans; -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Span.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Span.java deleted file mode 100644 index 9d56c39cebce6fa3b717467e5744fe7c8024efeb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Span.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.trace; - -import java.util.LinkedList; -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class Span { - private String traceId; - private String segmentId; - private int spanId; - private int parentSpanId; - private List refs; - private String applicationCode; - private long startTime; - private long endTime; - private String operationName; - private String type; - private String peer; - private String component; - private Boolean isError; - private String layer; - private List tags; - private List logs; - private boolean isRoot; - private String segmentSpanId; - private String segmentParentSpanId; - - public Span() { - this.refs = new LinkedList<>(); - this.tags = new LinkedList<>(); - this.logs = new LinkedList<>(); - } - - public String getTraceId() { - return traceId; - } - - public void setTraceId(String traceId) { - this.traceId = traceId; - } - - public String getSegmentId() { - return segmentId; - } - - public void setSegmentId(String segmentId) { - this.segmentId = segmentId; - } - - public int getSpanId() { - return spanId; - } - - public void setSpanId(int spanId) { - this.spanId = spanId; - } - - public int getParentSpanId() { - return parentSpanId; - } - - public void setParentSpanId(int parentSpanId) { - this.parentSpanId = parentSpanId; - } - - public List getRefs() { - return refs; - } - - public void setRefs(List refs) { - this.refs = refs; - } - - public String getApplicationCode() { - return applicationCode; - } - - public void setApplicationCode(String applicationCode) { - this.applicationCode = applicationCode; - } - - public long getStartTime() { - return startTime; - } - - public void setStartTime(long startTime) { - this.startTime = startTime; - } - - public long getEndTime() { - return endTime; - } - - public void setEndTime(long endTime) { - this.endTime = endTime; - } - - public String getOperationName() { - return operationName; - } - - public void setOperationName(String operationName) { - this.operationName = operationName; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getPeer() { - return peer; - } - - public void setPeer(String peer) { - this.peer = peer; - } - - public String getComponent() { - return component; - } - - public void setComponent(String component) { - this.component = component; - } - - public Boolean getError() { - return isError; - } - - public void setError(Boolean error) { - isError = error; - } - - public String getLayer() { - return layer; - } - - public void setLayer(String layer) { - this.layer = layer; - } - - public List getTags() { - return tags; - } - - public void setTags(List tags) { - this.tags = tags; - } - - public List getLogs() { - return logs; - } - - public void setLogs(List logs) { - this.logs = logs; - } - - public boolean isRoot() { - return isRoot; - } - - public void setRoot(boolean root) { - isRoot = root; - } - - public String getSegmentParentSpanId() { - return segmentParentSpanId; - } - - public void setSegmentParentSpanId(String segmentParentSpanId) { - this.segmentParentSpanId = segmentParentSpanId; - } - - public String getSegmentSpanId() { - return segmentSpanId; - } - - public void setSegmentSpanId(String segmentSpanId) { - this.segmentSpanId = segmentSpanId; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Trace.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Trace.java deleted file mode 100644 index a3524aa44dc5bcde6391a532cb544f12d1a782e8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/Trace.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.trace; - -import java.util.LinkedList; -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class Trace { - - private List spans; - - public Trace() { - this.spans = new LinkedList<>(); - } - - public List getSpans() { - return spans; - } - - public void setSpans(List spans) { - this.spans = spans; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceBrief.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceBrief.java deleted file mode 100644 index df1963487258855ee6b33ff2c0cf1b79602c0b90..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceBrief.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.trace; - -import java.util.LinkedList; -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class TraceBrief { - private List traces; - private int total; - - public TraceBrief() { - traces = new LinkedList<>(); - } - - public List getTraces() { - return traces; - } - - public void setTraces(List traces) { - this.traces = traces; - } - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceQueryCondition.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceQueryCondition.java deleted file mode 100644 index 103d700432f19388bac246844702ddf0642fbece..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceQueryCondition.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.trace; - -import org.apache.skywalking.apm.collector.storage.ui.common.Duration; -import org.apache.skywalking.apm.collector.storage.ui.common.Pagination; - -/** - * @author peng-yongsheng - */ -public class TraceQueryCondition { - private int applicationId; - private String traceId; - private String operationName; - private Duration queryDuration; - private int minTraceDuration; - private int maxTraceDuration; - private TraceState traceState; - private QueryOrder queryOrder; - - public TraceState getTraceState() { - return traceState; - } - - public void setTraceState(TraceState traceState) { - this.traceState = traceState; - } - - public QueryOrder getQueryOrder() { - return queryOrder; - } - - public void setQueryOrder(QueryOrder queryOrder) { - this.queryOrder = queryOrder; - } - - private Pagination paging; - - public int getApplicationId() { - return applicationId; - } - - public void setApplicationId(int applicationId) { - this.applicationId = applicationId; - } - - public String getTraceId() { - return traceId; - } - - public void setTraceId(String traceId) { - this.traceId = traceId; - } - - public String getOperationName() { - return operationName; - } - - public void setOperationName(String operationName) { - this.operationName = operationName; - } - - public Duration getQueryDuration() { - return queryDuration; - } - - public void setQueryDuration(Duration queryDuration) { - this.queryDuration = queryDuration; - } - - public int getMinTraceDuration() { - return minTraceDuration; - } - - public void setMinTraceDuration(int minTraceDuration) { - this.minTraceDuration = minTraceDuration; - } - - public int getMaxTraceDuration() { - return maxTraceDuration; - } - - public void setMaxTraceDuration(int maxTraceDuration) { - this.maxTraceDuration = maxTraceDuration; - } - - public Pagination getPaging() { - return paging; - } - - public void setPaging(Pagination paging) { - this.paging = paging; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceState.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceState.java deleted file mode 100644 index 71b52dd1453931cee1d73886334fe24f124a6a38..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceState.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.ui.trace; - -public enum TraceState { - ALL, - SUCCESS, - ERROR -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/utils/DurationPoint.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/utils/DurationPoint.java deleted file mode 100644 index d608dda82b3222c666da6f20502ea2489ec46876..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/utils/DurationPoint.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.utils; - -/** - * @author peng-yongsheng - */ -public class DurationPoint { - private long point; - private long secondsBetween; - private long minutesBetween; - - public DurationPoint(long point, long secondsBetween, long minutesBetween) { - this.point = point; - this.secondsBetween = secondsBetween; - this.minutesBetween = minutesBetween; - } - - public long getPoint() { - return point; - } - - public long getSecondsBetween() { - return secondsBetween; - } - - public long getMinutesBetween() { - return minutesBetween; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/utils/TimePyramidTableNameBuilder.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/utils/TimePyramidTableNameBuilder.java deleted file mode 100644 index 57acbcb1493b34e55b295edeb56669e4eb87c685..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/utils/TimePyramidTableNameBuilder.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.utils; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; - -/** - * @author peng-yongsheng - */ -public class TimePyramidTableNameBuilder { - - private TimePyramidTableNameBuilder() { - } - - public static String build(Step step, String tableName) { - switch (step) { - case MONTH: - tableName = tableName + Const.ID_SPLIT + TimePyramid.Month.getName(); - break; - case DAY: - tableName = tableName + Const.ID_SPLIT + TimePyramid.Day.getName(); - break; - case HOUR: - tableName = tableName + Const.ID_SPLIT + TimePyramid.Hour.getName(); - break; - case MINUTE: - tableName = tableName + Const.ID_SPLIT + TimePyramid.Minute.getName(); - break; - } - return tableName; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-storage/collector-storage-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine deleted file mode 100644 index e872625d20715b1121b8c15b74264b2cac5c321b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.storage.StorageModule \ No newline at end of file diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/pom.xml b/apm-collector/apm-collector-storage/collector-storage-es-provider/pom.xml deleted file mode 100644 index 1ad901561da3a1789a7d6d4d7236ddda0f30148b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - apm-collector-storage - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-storage-es-provider - jar - - - - org.apache.skywalking - collector-storage-define - ${project.version} - - - org.apache.skywalking - collector-cluster-define - ${project.version} - - - org.apache.skywalking - collector-configuration-define - ${project.version} - - - diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/DataTTLKeeperTimer.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/DataTTLKeeperTimer.java deleted file mode 100644 index cb6f00bdf742ae4938faabf318ef5a930b4fc397..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/DataTTLKeeperTimer.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es; - -import java.util.concurrent.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.*; -import org.apache.skywalking.apm.collector.storage.dao.acp.*; -import org.apache.skywalking.apm.collector.storage.dao.alarm.*; -import org.apache.skywalking.apm.collector.storage.dao.amp.*; -import org.apache.skywalking.apm.collector.storage.dao.ampp.*; -import org.apache.skywalking.apm.collector.storage.dao.armp.*; -import org.apache.skywalking.apm.collector.storage.dao.cpu.*; -import org.apache.skywalking.apm.collector.storage.dao.gc.*; -import org.apache.skywalking.apm.collector.storage.dao.imp.*; -import org.apache.skywalking.apm.collector.storage.dao.impp.*; -import org.apache.skywalking.apm.collector.storage.dao.irmp.*; -import org.apache.skywalking.apm.collector.storage.dao.memory.*; -import org.apache.skywalking.apm.collector.storage.dao.mpool.*; -import org.apache.skywalking.apm.collector.storage.dao.rtd.*; -import org.apache.skywalking.apm.collector.storage.dao.smp.*; -import org.apache.skywalking.apm.collector.storage.dao.srmp.*; -import org.apache.skywalking.apm.util.RunnableWithExceptionProtection; -import org.joda.time.DateTime; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -class DataTTLKeeperTimer { - private static final Logger logger = LoggerFactory.getLogger(StorageModuleEsProvider.class); - - private final ModuleManager moduleManager; - private final StorageModuleEsNamingListener namingListener; - private final String selfAddress; - private final StorageModuleEsConfig config; - - DataTTLKeeperTimer(ModuleManager moduleManager, - StorageModuleEsNamingListener namingListener, String selfAddress, StorageModuleEsConfig config) { - this.moduleManager = moduleManager; - this.namingListener = namingListener; - this.selfAddress = selfAddress; - this.config = config; - } - - void start() { - Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate( - new RunnableWithExceptionProtection(this::delete, - t -> logger.error("Remove data in background failure.", t)), 1, 5, TimeUnit.MINUTES); - } - - private void delete() { - String firstAddressInCluster = namingListener.getAddresses().iterator().next(); - if (!firstAddressInCluster.equals(selfAddress)) { - logger.info("Current address {} isn't same with the selected first address is {}. Skip.", selfAddress, firstAddressInCluster); - return; - } - - TimeBuckets timeBuckets = convertTimeBucket(new DateTime()); - logger.info("Beginning to remove expired metrics from the storage."); - logger.info("Metrics in minute dimension before {}, are going to be removed.", timeBuckets.minuteTimeBucketBefore); - logger.info("Metrics in hour dimension before {}, are going to be removed.", timeBuckets.hourTimeBucketBefore); - logger.info("Metrics in day dimension before {}, are going to be removed.", timeBuckets.dayTimeBucketBefore); - logger.info("Metrics in month dimension before {}, are going to be removed.", timeBuckets.monthTimeBucketBefore); - - deleteJVMRelatedData(timeBuckets); - deleteTraceRelatedData(timeBuckets); - deleteAlarmRelatedData(timeBuckets); - } - - TimeBuckets convertTimeBucket(DateTime currentTime) { - TimeBuckets timeBuckets = new TimeBuckets(); - - timeBuckets.traceDataBefore = Long.valueOf(currentTime.plusMinutes(0 - config.getTraceDataTTL()).toString("yyyyMMddHHmm")); - timeBuckets.minuteTimeBucketBefore = Long.valueOf(currentTime.plusMinutes(0 - config.getMinuteMetricDataTTL()).toString("yyyyMMddHHmm")); - timeBuckets.hourTimeBucketBefore = Long.valueOf(currentTime.plusHours(0 - config.getHourMetricDataTTL()).toString("yyyyMMddHH")); - timeBuckets.dayTimeBucketBefore = Long.valueOf(currentTime.plusDays(0 - config.getDayMetricDataTTL()).toString("yyyyMMdd")); - timeBuckets.monthTimeBucketBefore = Long.valueOf(currentTime.plusMonths(0 - config.getMonthMetricDataTTL()).toString("yyyyMM")); - - return timeBuckets; - } - - private void deleteAlarmRelatedData(TimeBuckets timeBuckets) { - moduleManager.find(StorageModule.NAME).getService(IApplicationAlarmPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IApplicationAlarmListMinutePersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IApplicationAlarmListHourPersistenceDAO.class).deleteHistory(timeBuckets.hourTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IApplicationAlarmListDayPersistenceDAO.class).deleteHistory(timeBuckets.dayTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IApplicationAlarmListMonthPersistenceDAO.class).deleteHistory(timeBuckets.monthTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IApplicationReferenceAlarmPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IApplicationReferenceAlarmListPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IInstanceAlarmPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IInstanceAlarmListPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IInstanceReferenceAlarmPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IInstanceReferenceAlarmListPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IServiceAlarmPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IServiceAlarmListPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IServiceReferenceAlarmPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IServiceReferenceAlarmListPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - } - - private void deleteJVMRelatedData(TimeBuckets timeBuckets) { - moduleManager.find(StorageModule.NAME).getService(ICpuMinuteMetricPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(ICpuHourMetricPersistenceDAO.class).deleteHistory(timeBuckets.hourTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(ICpuDayMetricPersistenceDAO.class).deleteHistory(timeBuckets.dayTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(ICpuMonthMetricPersistenceDAO.class).deleteHistory(timeBuckets.monthTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IGCMinuteMetricPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IGCHourMetricPersistenceDAO.class).deleteHistory(timeBuckets.hourTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IGCDayMetricPersistenceDAO.class).deleteHistory(timeBuckets.dayTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IGCMonthMetricPersistenceDAO.class).deleteHistory(timeBuckets.monthTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IMemoryMinuteMetricPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IMemoryHourMetricPersistenceDAO.class).deleteHistory(timeBuckets.hourTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IMemoryDayMetricPersistenceDAO.class).deleteHistory(timeBuckets.dayTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IMemoryMonthMetricPersistenceDAO.class).deleteHistory(timeBuckets.monthTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IMemoryPoolMinuteMetricPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IMemoryPoolHourMetricPersistenceDAO.class).deleteHistory(timeBuckets.hourTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IMemoryPoolDayMetricPersistenceDAO.class).deleteHistory(timeBuckets.dayTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IMemoryPoolMonthMetricPersistenceDAO.class).deleteHistory(timeBuckets.monthTimeBucketBefore); - } - - private void deleteTraceRelatedData(TimeBuckets timeBuckets) { - moduleManager.find(StorageModule.NAME).getService(IGlobalTracePersistenceDAO.class).deleteHistory(timeBuckets.traceDataBefore); - moduleManager.find(StorageModule.NAME).getService(ISegmentDurationPersistenceDAO.class).deleteHistory(timeBuckets.traceDataBefore); - moduleManager.find(StorageModule.NAME).getService(ISegmentPersistenceDAO.class).deleteHistory(timeBuckets.traceDataBefore); - - moduleManager.find(StorageModule.NAME).getService(IApplicationComponentMinutePersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IApplicationComponentHourPersistenceDAO.class).deleteHistory(timeBuckets.hourTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IApplicationComponentDayPersistenceDAO.class).deleteHistory(timeBuckets.dayTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IApplicationComponentMonthPersistenceDAO.class).deleteHistory(timeBuckets.monthTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IApplicationMinuteMetricPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IApplicationHourMetricPersistenceDAO.class).deleteHistory(timeBuckets.hourTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IApplicationDayMetricPersistenceDAO.class).deleteHistory(timeBuckets.dayTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IApplicationMonthMetricPersistenceDAO.class).deleteHistory(timeBuckets.monthTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IApplicationMappingMinutePersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IApplicationMappingHourPersistenceDAO.class).deleteHistory(timeBuckets.hourTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IApplicationMappingDayPersistenceDAO.class).deleteHistory(timeBuckets.dayTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IApplicationMappingMonthPersistenceDAO.class).deleteHistory(timeBuckets.monthTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IApplicationReferenceMinuteMetricPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IApplicationReferenceHourMetricPersistenceDAO.class).deleteHistory(timeBuckets.hourTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IApplicationReferenceDayMetricPersistenceDAO.class).deleteHistory(timeBuckets.dayTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IApplicationReferenceMonthMetricPersistenceDAO.class).deleteHistory(timeBuckets.monthTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IInstanceMinuteMetricPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IInstanceHourMetricPersistenceDAO.class).deleteHistory(timeBuckets.hourTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IInstanceDayMetricPersistenceDAO.class).deleteHistory(timeBuckets.dayTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IInstanceMonthMetricPersistenceDAO.class).deleteHistory(timeBuckets.monthTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IInstanceMappingMinutePersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IInstanceMappingHourPersistenceDAO.class).deleteHistory(timeBuckets.hourTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IInstanceMappingDayPersistenceDAO.class).deleteHistory(timeBuckets.dayTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IInstanceMappingMonthPersistenceDAO.class).deleteHistory(timeBuckets.monthTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IInstanceReferenceMinuteMetricPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IInstanceReferenceHourMetricPersistenceDAO.class).deleteHistory(timeBuckets.hourTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IInstanceReferenceDayMetricPersistenceDAO.class).deleteHistory(timeBuckets.dayTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IInstanceReferenceMonthMetricPersistenceDAO.class).deleteHistory(timeBuckets.monthTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IResponseTimeDistributionMinutePersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IResponseTimeDistributionHourPersistenceDAO.class).deleteHistory(timeBuckets.hourTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IResponseTimeDistributionDayPersistenceDAO.class).deleteHistory(timeBuckets.dayTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IResponseTimeDistributionMonthPersistenceDAO.class).deleteHistory(timeBuckets.monthTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IServiceMinuteMetricPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IServiceHourMetricPersistenceDAO.class).deleteHistory(timeBuckets.hourTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IServiceDayMetricPersistenceDAO.class).deleteHistory(timeBuckets.dayTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IServiceMonthMetricPersistenceDAO.class).deleteHistory(timeBuckets.monthTimeBucketBefore); - - moduleManager.find(StorageModule.NAME).getService(IServiceReferenceMinuteMetricPersistenceDAO.class).deleteHistory(timeBuckets.minuteTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IServiceReferenceHourMetricPersistenceDAO.class).deleteHistory(timeBuckets.hourTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IServiceReferenceDayMetricPersistenceDAO.class).deleteHistory(timeBuckets.dayTimeBucketBefore); - moduleManager.find(StorageModule.NAME).getService(IServiceReferenceMonthMetricPersistenceDAO.class).deleteHistory(timeBuckets.monthTimeBucketBefore); - } - - class TimeBuckets { - private long traceDataBefore; - private long minuteTimeBucketBefore; - private long hourTimeBucketBefore; - private long dayTimeBucketBefore; - private long monthTimeBucketBefore; - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/MetricTransformUtil.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/MetricTransformUtil.java deleted file mode 100644 index 95efd1556e008b8f772a286aca69f03bb8d31846..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/MetricTransformUtil.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.storage.table.*; -import org.elasticsearch.common.xcontent.XContentBuilder; - -/** - * @author peng-yongsheng - */ -public enum MetricTransformUtil { - INSTANCE; - - public void esDataToStreamData(Map source, Metric target) { - target.setSourceValue(((Number)source.get(MetricColumns.SOURCE_VALUE.getName())).intValue()); - target.setTimeBucket(((Number)source.get(MetricColumns.TIME_BUCKET.getName())).longValue()); - - target.setTransactionCalls(((Number)source.get(MetricColumns.TRANSACTION_CALLS.getName())).longValue()); - target.setTransactionErrorCalls(((Number)source.get(MetricColumns.TRANSACTION_ERROR_CALLS.getName())).longValue()); - target.setTransactionDurationSum(((Number)source.get(MetricColumns.TRANSACTION_DURATION_SUM.getName())).longValue()); - target.setTransactionErrorDurationSum(((Number)source.get(MetricColumns.TRANSACTION_ERROR_DURATION_SUM.getName())).longValue()); - target.setTransactionAverageDuration(((Number)source.get(MetricColumns.TRANSACTION_AVERAGE_DURATION.getName())).longValue()); - - target.setBusinessTransactionCalls(((Number)source.get(MetricColumns.BUSINESS_TRANSACTION_CALLS.getName())).longValue()); - target.setBusinessTransactionErrorCalls(((Number)source.get(MetricColumns.BUSINESS_TRANSACTION_ERROR_CALLS.getName())).longValue()); - target.setBusinessTransactionDurationSum(((Number)source.get(MetricColumns.BUSINESS_TRANSACTION_DURATION_SUM.getName())).longValue()); - target.setBusinessTransactionErrorDurationSum(((Number)source.get(MetricColumns.BUSINESS_TRANSACTION_ERROR_DURATION_SUM.getName())).longValue()); - target.setBusinessTransactionAverageDuration(((Number)source.get(MetricColumns.BUSINESS_TRANSACTION_AVERAGE_DURATION.getName())).longValue()); - - target.setMqTransactionCalls(((Number)source.get(MetricColumns.MQ_TRANSACTION_CALLS.getName())).longValue()); - target.setMqTransactionErrorCalls(((Number)source.get(MetricColumns.MQ_TRANSACTION_ERROR_CALLS.getName())).longValue()); - target.setMqTransactionDurationSum(((Number)source.get(MetricColumns.MQ_TRANSACTION_DURATION_SUM.getName())).longValue()); - target.setMqTransactionErrorDurationSum(((Number)source.get(MetricColumns.MQ_TRANSACTION_ERROR_DURATION_SUM.getName())).longValue()); - target.setMqTransactionAverageDuration(((Number)source.get(MetricColumns.MQ_TRANSACTION_AVERAGE_DURATION.getName())).longValue()); - } - - public void esStreamDataToEsData(Metric source, XContentBuilder target) throws IOException { - target.field(MetricColumns.TIME_BUCKET.getName(), source.getTimeBucket()); - target.field(MetricColumns.SOURCE_VALUE.getName(), source.getSourceValue()); - - target.field(MetricColumns.TRANSACTION_CALLS.getName(), source.getTransactionCalls()); - target.field(MetricColumns.TRANSACTION_ERROR_CALLS.getName(), source.getTransactionErrorCalls()); - target.field(MetricColumns.TRANSACTION_DURATION_SUM.getName(), source.getTransactionDurationSum()); - target.field(MetricColumns.TRANSACTION_ERROR_DURATION_SUM.getName(), source.getTransactionErrorDurationSum()); - target.field(MetricColumns.TRANSACTION_AVERAGE_DURATION.getName(), source.getTransactionAverageDuration()); - - target.field(MetricColumns.BUSINESS_TRANSACTION_CALLS.getName(), source.getBusinessTransactionCalls()); - target.field(MetricColumns.BUSINESS_TRANSACTION_ERROR_CALLS.getName(), source.getBusinessTransactionErrorCalls()); - target.field(MetricColumns.BUSINESS_TRANSACTION_DURATION_SUM.getName(), source.getBusinessTransactionDurationSum()); - target.field(MetricColumns.BUSINESS_TRANSACTION_ERROR_DURATION_SUM.getName(), source.getBusinessTransactionErrorDurationSum()); - target.field(MetricColumns.BUSINESS_TRANSACTION_AVERAGE_DURATION.getName(), source.getBusinessTransactionAverageDuration()); - - target.field(MetricColumns.MQ_TRANSACTION_CALLS.getName(), source.getMqTransactionCalls()); - target.field(MetricColumns.MQ_TRANSACTION_ERROR_CALLS.getName(), source.getMqTransactionErrorCalls()); - target.field(MetricColumns.MQ_TRANSACTION_DURATION_SUM.getName(), source.getMqTransactionDurationSum()); - target.field(MetricColumns.MQ_TRANSACTION_ERROR_DURATION_SUM.getName(), source.getMqTransactionErrorDurationSum()); - target.field(MetricColumns.MQ_TRANSACTION_AVERAGE_DURATION.getName(), source.getMqTransactionAverageDuration()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/StorageModuleEsConfig.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/StorageModuleEsConfig.java deleted file mode 100644 index cdde0866e77fa39b49e37957413cb5a98f182b67..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/StorageModuleEsConfig.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClientConfig; - -/** - * @author peng-yongsheng - */ -public class StorageModuleEsConfig extends ElasticSearchClientConfig { - - private int indexShardsNumber; - private int indexReplicasNumber; - private boolean highPerformanceMode; - private int traceDataTTL = 90; - private int minuteMetricDataTTL = 90; - private int hourMetricDataTTL = 36; - private int dayMetricDataTTL = 45; - private int monthMetricDataTTL = 18; - private int bulkActions = 2000; - private int bulkSize = 20; - private int flushInterval = 10; - private int concurrentRequests = 2; - - int getIndexShardsNumber() { - return indexShardsNumber; - } - - void setIndexShardsNumber(int indexShardsNumber) { - this.indexShardsNumber = indexShardsNumber; - } - - int getIndexReplicasNumber() { - return indexReplicasNumber; - } - - void setIndexReplicasNumber(int indexReplicasNumber) { - this.indexReplicasNumber = indexReplicasNumber; - } - - boolean isHighPerformanceMode() { - return highPerformanceMode; - } - - void setHighPerformanceMode(boolean highPerformanceMode) { - this.highPerformanceMode = highPerformanceMode; - } - - public int getTraceDataTTL() { - return traceDataTTL; - } - - void setTraceDataTTL(int traceDataTTL) { - this.traceDataTTL = traceDataTTL == 0 ? 90 : traceDataTTL; - } - - public int getMinuteMetricDataTTL() { - return minuteMetricDataTTL; - } - - void setMinuteMetricDataTTL(int minuteMetricDataTTL) { - this.minuteMetricDataTTL = minuteMetricDataTTL == 0 ? 90 : minuteMetricDataTTL; - } - - public int getHourMetricDataTTL() { - return hourMetricDataTTL; - } - - void setHourMetricDataTTL(int hourMetricDataTTL) { - this.hourMetricDataTTL = hourMetricDataTTL == 0 ? 36 : hourMetricDataTTL; - } - - public int getDayMetricDataTTL() { - return dayMetricDataTTL; - } - - void setDayMetricDataTTL(int dayMetricDataTTL) { - this.dayMetricDataTTL = dayMetricDataTTL == 0 ? 45 : dayMetricDataTTL; - } - - public int getMonthMetricDataTTL() { - return monthMetricDataTTL; - } - - void setMonthMetricDataTTL(int monthMetricDataTTL) { - this.monthMetricDataTTL = monthMetricDataTTL == 0 ? 18 : monthMetricDataTTL; - } - - public int getBulkActions() { - return bulkActions; - } - - public void setBulkActions(int bulkActions) { - this.bulkActions = bulkActions == 0 ? 2000 : bulkActions; - } - - public int getBulkSize() { - return bulkSize; - } - - public void setBulkSize(int bulkSize) { - this.bulkSize = bulkSize == 0 ? 20 : bulkSize; - } - - public int getFlushInterval() { - return flushInterval; - } - - public void setFlushInterval(int flushInterval) { - this.flushInterval = flushInterval == 0 ? 10 : flushInterval; - } - - public int getConcurrentRequests() { - return concurrentRequests; - } - - public void setConcurrentRequests(int concurrentRequests) { - this.concurrentRequests = concurrentRequests == 0 ? 2 : concurrentRequests; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/StorageModuleEsNamingListener.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/StorageModuleEsNamingListener.java deleted file mode 100644 index a4e689c4e3290fb515ec2d7e39ec2142fbbd469a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/StorageModuleEsNamingListener.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es; - -import org.apache.skywalking.apm.collector.cluster.ClusterModuleListener; -import org.apache.skywalking.apm.collector.storage.StorageModule; - -/** - * @author peng-yongsheng - */ -public class StorageModuleEsNamingListener extends ClusterModuleListener { - - private static final String PATH = "/" + StorageModule.NAME + "/" + StorageModuleEsProvider.NAME; - - @Override public String path() { - return PATH; - } - - @Override public void serverJoinNotify(String serverAddress) { - - } - - @Override public void serverQuitNotify(String serverAddress) { - - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/StorageModuleEsProvider.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/StorageModuleEsProvider.java deleted file mode 100644 index b33000abf82080faab3fc6058a56c7596945698d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/StorageModuleEsProvider.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es; - -import java.util.UUID; -import org.apache.skywalking.apm.collector.client.*; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.cluster.ClusterModule; -import org.apache.skywalking.apm.collector.cluster.service.*; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.ICollectorConfig; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.storage.*; -import org.apache.skywalking.apm.collector.storage.base.dao.IBatchDAO; -import org.apache.skywalking.apm.collector.storage.dao.*; -import org.apache.skywalking.apm.collector.storage.dao.acp.*; -import org.apache.skywalking.apm.collector.storage.dao.alarm.*; -import org.apache.skywalking.apm.collector.storage.dao.amp.*; -import org.apache.skywalking.apm.collector.storage.dao.ampp.*; -import org.apache.skywalking.apm.collector.storage.dao.armp.*; -import org.apache.skywalking.apm.collector.storage.dao.cache.*; -import org.apache.skywalking.apm.collector.storage.dao.cpu.*; -import org.apache.skywalking.apm.collector.storage.dao.gc.*; -import org.apache.skywalking.apm.collector.storage.dao.imp.*; -import org.apache.skywalking.apm.collector.storage.dao.impp.*; -import org.apache.skywalking.apm.collector.storage.dao.irmp.*; -import org.apache.skywalking.apm.collector.storage.dao.memory.*; -import org.apache.skywalking.apm.collector.storage.dao.mpool.*; -import org.apache.skywalking.apm.collector.storage.dao.register.*; -import org.apache.skywalking.apm.collector.storage.dao.rtd.*; -import org.apache.skywalking.apm.collector.storage.dao.smp.*; -import org.apache.skywalking.apm.collector.storage.dao.srmp.*; -import org.apache.skywalking.apm.collector.storage.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.es.base.dao.BatchProcessEsDAO; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchStorageInstaller; -import org.apache.skywalking.apm.collector.storage.es.dao.*; -import org.apache.skywalking.apm.collector.storage.es.dao.acp.*; -import org.apache.skywalking.apm.collector.storage.es.dao.alarm.*; -import org.apache.skywalking.apm.collector.storage.es.dao.amp.*; -import org.apache.skywalking.apm.collector.storage.es.dao.ampp.*; -import org.apache.skywalking.apm.collector.storage.es.dao.armp.*; -import org.apache.skywalking.apm.collector.storage.es.dao.cache.*; -import org.apache.skywalking.apm.collector.storage.es.dao.cpu.*; -import org.apache.skywalking.apm.collector.storage.es.dao.gc.*; -import org.apache.skywalking.apm.collector.storage.es.dao.imp.*; -import org.apache.skywalking.apm.collector.storage.es.dao.impp.*; -import org.apache.skywalking.apm.collector.storage.es.dao.irmp.*; -import org.apache.skywalking.apm.collector.storage.es.dao.memory.*; -import org.apache.skywalking.apm.collector.storage.es.dao.mpool.*; -import org.apache.skywalking.apm.collector.storage.es.dao.register.*; -import org.apache.skywalking.apm.collector.storage.es.dao.rtd.*; -import org.apache.skywalking.apm.collector.storage.es.dao.smp.*; -import org.apache.skywalking.apm.collector.storage.es.dao.srmp.*; -import org.apache.skywalking.apm.collector.storage.es.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.es.ttl.TTLConfigService; -import org.apache.skywalking.apm.collector.storage.ttl.ITTLConfigService; - -/** - * @author peng-yongsheng - */ -public class StorageModuleEsProvider extends ModuleProvider { - - static final String NAME = "elasticsearch"; - private final StorageModuleEsConfig config; - private final NameSpace nameSpace; - private ElasticSearchClient elasticSearchClient; - private DataTTLKeeperTimer deleteTimer; - - public StorageModuleEsProvider() { - super(); - this.config = new StorageModuleEsConfig(); - this.nameSpace = new NameSpace(); - } - - @Override public String name() { - return NAME; - } - - @Override public Class module() { - return StorageModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() throws ServiceNotProvidedException { - elasticSearchClient = new ElasticSearchClient(config.getClusterName(), config.getClusterTransportSniffer(), config.getClusterNodes(), nameSpace); - - this.registerServiceImplementation(ITTLConfigService.class, new TTLConfigService(config)); - this.registerServiceImplementation(IBatchDAO.class, new BatchProcessEsDAO(elasticSearchClient, config.getBulkActions(), config.getBulkSize(), config.getFlushInterval(), config.getConcurrentRequests())); - - registerCacheDAO(); - registerRegisterDAO(); - registerPersistenceDAO(); - registerUiDAO(); - registerAlarmDAO(); - } - - @Override - public void start() throws ModuleStartException { - try { - String namespace = getManager().find(ConfigurationModule.NAME).getService(ICollectorConfig.class).getNamespace(); - nameSpace.setNameSpace(namespace); - elasticSearchClient.initialize(); - - ElasticSearchStorageInstaller installer = new ElasticSearchStorageInstaller(config.getIndexShardsNumber(), config.getIndexReplicasNumber(), config.isHighPerformanceMode()); - installer.install(elasticSearchClient); - } catch (ClientException | StorageException e) { - throw new ModuleStartException(e.getMessage(), e); - } - - ModuleRegisterService moduleRegisterService = getManager().find(ClusterModule.NAME).getService(ModuleRegisterService.class); - - StorageModuleEsRegistration esRegistration = new StorageModuleEsRegistration(UUID.randomUUID().toString(), 0); - moduleRegisterService.register(StorageModule.NAME, this.name(), esRegistration); - - StorageModuleEsNamingListener namingListener = new StorageModuleEsNamingListener(); - ModuleListenerService moduleListenerService = getManager().find(ClusterModule.NAME).getService(ModuleListenerService.class); - moduleListenerService.addListener(namingListener); - - deleteTimer = new DataTTLKeeperTimer(getManager(), namingListener, esRegistration.buildValue().getHostPort(), config); - } - - @Override - public void notifyAfterCompleted() { - deleteTimer.start(); - } - - @Override - public String[] requiredModules() { - return new String[] {ClusterModule.NAME, ConfigurationModule.NAME, RemoteModule.NAME}; - } - - private void registerCacheDAO() throws ServiceNotProvidedException { - this.registerServiceImplementation(IApplicationCacheDAO.class, new ApplicationEsCacheDAO(elasticSearchClient)); - this.registerServiceImplementation(IInstanceCacheDAO.class, new InstanceEsCacheDAO(elasticSearchClient)); - this.registerServiceImplementation(IServiceNameCacheDAO.class, new ServiceNameEsCacheDAO(elasticSearchClient)); - this.registerServiceImplementation(INetworkAddressCacheDAO.class, new NetworkAddressEsCacheDAO(elasticSearchClient)); - } - - private void registerRegisterDAO() throws ServiceNotProvidedException { - this.registerServiceImplementation(INetworkAddressRegisterDAO.class, new NetworkAddressRegisterEsDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationRegisterDAO.class, new ApplicationRegisterEsDAO(elasticSearchClient)); - this.registerServiceImplementation(IInstanceRegisterDAO.class, new InstanceRegisterEsDAO(elasticSearchClient)); - this.registerServiceImplementation(IServiceNameRegisterDAO.class, new ServiceNameRegisterEsDAO(elasticSearchClient)); - } - - private void registerPersistenceDAO() throws ServiceNotProvidedException { - this.registerServiceImplementation(ICpuMinuteMetricPersistenceDAO.class, new CpuMinuteMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(ICpuHourMetricPersistenceDAO.class, new CpuHourMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(ICpuDayMetricPersistenceDAO.class, new CpuDayMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(ICpuMonthMetricPersistenceDAO.class, new CpuMonthMetricEsPersistenceDAO(elasticSearchClient)); - - this.registerServiceImplementation(IGCMinuteMetricPersistenceDAO.class, new GCMinuteMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IGCHourMetricPersistenceDAO.class, new GCHourMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IGCDayMetricPersistenceDAO.class, new GCDayMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IGCMonthMetricPersistenceDAO.class, new GCMonthMetricEsPersistenceDAO(elasticSearchClient)); - - this.registerServiceImplementation(IMemoryMinuteMetricPersistenceDAO.class, new MemoryMinuteMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IMemoryHourMetricPersistenceDAO.class, new MemoryHourMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IMemoryDayMetricPersistenceDAO.class, new MemoryDayMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IMemoryMonthMetricPersistenceDAO.class, new MemoryMonthMetricEsPersistenceDAO(elasticSearchClient)); - - this.registerServiceImplementation(IMemoryPoolMinuteMetricPersistenceDAO.class, new MemoryPoolMinuteMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IMemoryPoolHourMetricPersistenceDAO.class, new MemoryPoolHourMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IMemoryPoolDayMetricPersistenceDAO.class, new MemoryPoolDayMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IMemoryPoolMonthMetricPersistenceDAO.class, new MemoryPoolMonthMetricEsPersistenceDAO(elasticSearchClient)); - - this.registerServiceImplementation(IApplicationComponentMinutePersistenceDAO.class, new ApplicationComponentMinuteEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationComponentHourPersistenceDAO.class, new ApplicationComponentHourEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationComponentDayPersistenceDAO.class, new ApplicationComponentDayEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationComponentMonthPersistenceDAO.class, new ApplicationComponentMonthEsPersistenceDAO(elasticSearchClient)); - - this.registerServiceImplementation(IApplicationMappingMinutePersistenceDAO.class, new ApplicationMappingMinuteEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationMappingHourPersistenceDAO.class, new ApplicationMappingHourEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationMappingDayPersistenceDAO.class, new ApplicationMappingDayEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationMappingMonthPersistenceDAO.class, new ApplicationMappingMonthEsPersistenceDAO(elasticSearchClient)); - - this.registerServiceImplementation(IInstanceMappingMinutePersistenceDAO.class, new InstanceMappingMinuteEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IInstanceMappingHourPersistenceDAO.class, new InstanceMappingHourEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IInstanceMappingDayPersistenceDAO.class, new InstanceMappingDayEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IInstanceMappingMonthPersistenceDAO.class, new InstanceMappingMonthEsPersistenceDAO(elasticSearchClient)); - - this.registerServiceImplementation(IGlobalTracePersistenceDAO.class, new GlobalTraceEsPersistenceDAO(elasticSearchClient)); - - this.registerServiceImplementation(IResponseTimeDistributionMinutePersistenceDAO.class, new ResponseTimeDistributionMinuteEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IResponseTimeDistributionHourPersistenceDAO.class, new ResponseTimeDistributionHourEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IResponseTimeDistributionDayPersistenceDAO.class, new ResponseTimeDistributionDayEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IResponseTimeDistributionMonthPersistenceDAO.class, new ResponseTimeDistributionMonthEsPersistenceDAO(elasticSearchClient)); - - this.registerServiceImplementation(IApplicationMinuteMetricPersistenceDAO.class, new ApplicationMinuteMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationHourMetricPersistenceDAO.class, new ApplicationHourMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationDayMetricPersistenceDAO.class, new ApplicationDayMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationMonthMetricPersistenceDAO.class, new ApplicationMonthMetricEsPersistenceDAO(elasticSearchClient)); - - this.registerServiceImplementation(IApplicationReferenceMinuteMetricPersistenceDAO.class, new ApplicationReferenceMinuteMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationReferenceHourMetricPersistenceDAO.class, new ApplicationReferenceHourMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationReferenceDayMetricPersistenceDAO.class, new ApplicationReferenceDayMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationReferenceMonthMetricPersistenceDAO.class, new ApplicationReferenceMonthMetricEsPersistenceDAO(elasticSearchClient)); - - this.registerServiceImplementation(ISegmentDurationPersistenceDAO.class, new SegmentDurationEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(ISegmentPersistenceDAO.class, new SegmentEsPersistenceDAO(elasticSearchClient)); - - this.registerServiceImplementation(IServiceMinuteMetricPersistenceDAO.class, new ServiceMinuteMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IServiceHourMetricPersistenceDAO.class, new ServiceHourMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IServiceDayMetricPersistenceDAO.class, new ServiceDayMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IServiceMonthMetricPersistenceDAO.class, new ServiceMonthMetricEsPersistenceDAO(elasticSearchClient)); - - this.registerServiceImplementation(IServiceReferenceMinuteMetricPersistenceDAO.class, new ServiceReferenceMinuteMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IServiceReferenceHourMetricPersistenceDAO.class, new ServiceReferenceHourMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IServiceReferenceDayMetricPersistenceDAO.class, new ServiceReferenceDayMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IServiceReferenceMonthMetricPersistenceDAO.class, new ServiceReferenceMonthMetricEsPersistenceDAO(elasticSearchClient)); - - this.registerServiceImplementation(IInstanceMinuteMetricPersistenceDAO.class, new InstanceMinuteMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IInstanceHourMetricPersistenceDAO.class, new InstanceHourMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IInstanceDayMetricPersistenceDAO.class, new InstanceDayMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IInstanceMonthMetricPersistenceDAO.class, new InstanceMonthMetricEsPersistenceDAO(elasticSearchClient)); - - this.registerServiceImplementation(IInstanceReferenceMinuteMetricPersistenceDAO.class, new InstanceReferenceMinuteMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IInstanceReferenceHourMetricPersistenceDAO.class, new InstanceReferenceHourMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IInstanceReferenceDayMetricPersistenceDAO.class, new InstanceReferenceDayMetricEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IInstanceReferenceMonthMetricPersistenceDAO.class, new InstanceReferenceMonthMetricEsPersistenceDAO(elasticSearchClient)); - - this.registerServiceImplementation(IInstanceHeartBeatPersistenceDAO.class, new InstanceHeartBeatEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IServiceNameHeartBeatPersistenceDAO.class, new ServiceNameHeartBeatEsPersistenceDAO(elasticSearchClient)); - } - - private void registerUiDAO() throws ServiceNotProvidedException { - this.registerServiceImplementation(IInstanceUIDAO.class, new InstanceEsUIDAO(elasticSearchClient)); - this.registerServiceImplementation(INetworkAddressUIDAO.class, new NetworkAddressEsUIDAO(elasticSearchClient)); - this.registerServiceImplementation(IServiceNameServiceUIDAO.class, new ServiceNameServiceEsUIDAO(elasticSearchClient)); - this.registerServiceImplementation(IServiceMetricUIDAO.class, new ServiceMetricEsUIDAO(elasticSearchClient)); - - this.registerServiceImplementation(ICpuMetricUIDAO.class, new CpuMetricEsUIDAO(elasticSearchClient)); - this.registerServiceImplementation(IGCMetricUIDAO.class, new GCMetricEsUIDAO(elasticSearchClient)); - this.registerServiceImplementation(IMemoryMetricUIDAO.class, new MemoryMetricEsUIDAO(elasticSearchClient)); - - this.registerServiceImplementation(IGlobalTraceUIDAO.class, new GlobalTraceEsUIDAO(elasticSearchClient)); - this.registerServiceImplementation(IInstanceMetricUIDAO.class, new InstanceMetricEsUIDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationComponentUIDAO.class, new ApplicationComponentEsUIDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationMappingUIDAO.class, new ApplicationMappingEsUIDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationMetricUIDAO.class, new ApplicationMetricEsUIDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationReferenceMetricUIDAO.class, new ApplicationReferenceMetricEsUIDAO(elasticSearchClient)); - this.registerServiceImplementation(ISegmentDurationUIDAO.class, new SegmentDurationEsUIDAO(elasticSearchClient)); - this.registerServiceImplementation(ISegmentUIDAO.class, new SegmentEsUIDAO(elasticSearchClient)); - this.registerServiceImplementation(IServiceReferenceMetricUIDAO.class, new ServiceReferenceEsMetricUIDAO(elasticSearchClient)); - - this.registerServiceImplementation(IApplicationAlarmUIDAO.class, new ApplicationAlarmEsUIDAO(elasticSearchClient)); - this.registerServiceImplementation(IInstanceAlarmUIDAO.class, new InstanceAlarmEsUIDAO(elasticSearchClient)); - this.registerServiceImplementation(IServiceAlarmUIDAO.class, new ServiceAlarmEsUIDAO(elasticSearchClient)); - - this.registerServiceImplementation(IApplicationAlarmListUIDAO.class, new ApplicationAlarmListEsUIDAO(elasticSearchClient)); - this.registerServiceImplementation(IResponseTimeDistributionUIDAO.class, new ResponseTimeDistributionEsUIDAO(elasticSearchClient)); - } - - private void registerAlarmDAO() throws ServiceNotProvidedException { - this.registerServiceImplementation(IServiceReferenceAlarmPersistenceDAO.class, new ServiceReferenceAlarmEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IServiceReferenceAlarmListPersistenceDAO.class, new ServiceReferenceAlarmListEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IInstanceReferenceAlarmPersistenceDAO.class, new InstanceReferenceAlarmEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IInstanceReferenceAlarmListPersistenceDAO.class, new InstanceReferenceAlarmListEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationReferenceAlarmPersistenceDAO.class, new ApplicationReferenceAlarmEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationReferenceAlarmListPersistenceDAO.class, new ApplicationReferenceAlarmListEsPersistenceDAO(elasticSearchClient)); - - this.registerServiceImplementation(IServiceAlarmPersistenceDAO.class, new ServiceAlarmEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IServiceAlarmListPersistenceDAO.class, new ServiceAlarmListEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IInstanceAlarmPersistenceDAO.class, new InstanceAlarmEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IInstanceAlarmListPersistenceDAO.class, new InstanceAlarmListEsPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationAlarmPersistenceDAO.class, new ApplicationAlarmEsPersistenceDAO(elasticSearchClient)); - - this.registerServiceImplementation(IApplicationAlarmListMinutePersistenceDAO.class, new ApplicationAlarmListEsMinutePersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationAlarmListHourPersistenceDAO.class, new ApplicationAlarmListEsHourPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationAlarmListDayPersistenceDAO.class, new ApplicationAlarmListEsDayPersistenceDAO(elasticSearchClient)); - this.registerServiceImplementation(IApplicationAlarmListMonthPersistenceDAO.class, new ApplicationAlarmListEsMonthPersistenceDAO(elasticSearchClient)); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/StorageModuleEsRegistration.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/StorageModuleEsRegistration.java deleted file mode 100644 index 97c822e5e41247f860116e0efdcc6e180ce42b3e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/StorageModuleEsRegistration.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es; - -import org.apache.skywalking.apm.collector.cluster.ModuleRegistration; -import org.apache.skywalking.apm.collector.core.util.Const; - -/** - * @author peng-yongsheng - */ -public class StorageModuleEsRegistration extends ModuleRegistration { - - private final String virtualHost; - private final int virtualPort; - - StorageModuleEsRegistration(String virtualHost, int virtualPort) { - this.virtualHost = virtualHost; - this.virtualPort = virtualPort; - } - - @Override public Value buildValue() { - return new Value(this.virtualHost, virtualPort, Const.EMPTY_STRING); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/base/dao/AbstractPersistenceEsDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/base/dao/AbstractPersistenceEsDAO.java deleted file mode 100644 index 307cc8171a58db799e5e59094b373b73b8b1e458..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/base/dao/AbstractPersistenceEsDAO.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.base.dao; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.data.StreamData; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.elasticsearch.action.get.GetResponse; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.index.reindex.BulkByScrollResponse; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractPersistenceEsDAO extends EsDAO implements IPersistenceDAO { - - private final Logger logger = LoggerFactory.getLogger(AbstractPersistenceEsDAO.class); - - protected AbstractPersistenceEsDAO(ElasticSearchClient client) { - super(client); - } - - protected abstract STREAM_DATA esDataToStreamData(Map source); - - protected abstract String tableName(); - - @Override - public STREAM_DATA get(String id) { - GetResponse getResponse = getClient().prepareGet(tableName(), id).get(); - if (getResponse.isExists()) { - STREAM_DATA streamData = esDataToStreamData(getResponse.getSource()); - streamData.setId(id); - return streamData; - } else { - return null; - } - } - - protected abstract XContentBuilder esStreamDataToEsData(STREAM_DATA streamData) throws IOException; - - @Override - public final IndexRequestBuilder prepareBatchInsert(STREAM_DATA streamData) throws IOException { - XContentBuilder source = esStreamDataToEsData(streamData); - return getClient().prepareIndex(tableName(), streamData.getId()).setSource(source); - } - - @Override - public final UpdateRequestBuilder prepareBatchUpdate(STREAM_DATA streamData) throws IOException { - XContentBuilder source = esStreamDataToEsData(streamData); - return getClient().prepareUpdate(tableName(), streamData.getId()).setDoc(source); - } - - protected abstract String timeBucketColumnNameForDelete(); - - @Override - public final void deleteHistory(Long timeBucketBefore) { - BulkByScrollResponse response = getClient().prepareDelete( - QueryBuilders.rangeQuery(timeBucketColumnNameForDelete()).lte(timeBucketBefore), - tableName()) - .get(); - - long deleted = response.getDeleted(); - logger.info("Delete {} rows history from {} index.", deleted, tableName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/base/dao/BatchProcessEsDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/base/dao/BatchProcessEsDAO.java deleted file mode 100644 index d3af889912bb9b12e34423b0243e65b6907fce70..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/base/dao/BatchProcessEsDAO.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.base.dao; - -import java.lang.reflect.Field; -import java.util.List; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.UnexpectedException; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.util.CollectionUtils; -import org.apache.skywalking.apm.collector.storage.base.dao.IBatchDAO; -import org.elasticsearch.action.bulk.*; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.client.Client; -import org.elasticsearch.common.unit.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class BatchProcessEsDAO extends EsDAO implements IBatchDAO { - - private static final Logger logger = LoggerFactory.getLogger(BatchProcessEsDAO.class); - - private BulkProcessor bulkProcessor; - private final int bulkActions; - private final int bulkSize; - private final int flushInterval; - private final int concurrentRequests; - - public BatchProcessEsDAO(ElasticSearchClient client, int bulkActions, int bulkSize, int flushInterval, - int concurrentRequests) { - super(client); - this.bulkActions = bulkActions; - this.bulkSize = bulkSize; - this.flushInterval = flushInterval; - this.concurrentRequests = concurrentRequests; - } - - @GraphComputingMetric(name = "/persistence/batchPersistence/") - @Override public void batchPersistence(List batchCollection) { - if (bulkProcessor == null) { - this.bulkProcessor = createBulkProcessor(); - } - - if (logger.isDebugEnabled()) { - logger.debug("bulk data size: {}", batchCollection.size()); - } - - if (CollectionUtils.isNotEmpty(batchCollection)) { - batchCollection.forEach(builder -> { - if (builder instanceof IndexRequestBuilder) { - this.bulkProcessor.add(((IndexRequestBuilder)builder).request()); - } - if (builder instanceof UpdateRequestBuilder) { - this.bulkProcessor.add(((UpdateRequestBuilder)builder).request()); - } - }); - } - } - - private BulkProcessor createBulkProcessor() { - ElasticSearchClient elasticSearchClient = getClient(); - - Client client; - try { - Field field = elasticSearchClient.getClass().getDeclaredField("client"); - field.setAccessible(true); - client = (Client)field.get(elasticSearchClient); - } catch (Exception e) { - logger.error(e.getMessage(), e); - throw new UnexpectedException(e.getMessage()); - } - - return BulkProcessor.builder( - client, - new BulkProcessor.Listener() { - @Override - public void beforeBulk(long executionId, - BulkRequest request) { - } - - @Override - public void afterBulk(long executionId, - BulkRequest request, - BulkResponse response) { - } - - @Override - public void afterBulk(long executionId, - BulkRequest request, - Throwable failure) { - logger.error("{} data bulk failed, reason: {}", request.numberOfActions(), failure); - } - }) - .setBulkActions(bulkActions) - .setBulkSize(new ByteSizeValue(bulkSize, ByteSizeUnit.MB)) - .setFlushInterval(TimeValue.timeValueSeconds(flushInterval)) - .setConcurrentRequests(concurrentRequests) - .setBackoffPolicy(BackoffPolicy.exponentialBackoff(TimeValue.timeValueMillis(100), 3)) - .build(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/base/dao/EsDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/base/dao/EsDAO.java deleted file mode 100644 index 0b10629e6eb6e910f73d826911be31f95b568a53..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/base/dao/EsDAO.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.base.dao; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.storage.base.dao.AbstractDAO; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.search.aggregations.AggregationBuilders; -import org.elasticsearch.search.aggregations.metrics.max.Max; -import org.elasticsearch.search.aggregations.metrics.max.MaxAggregationBuilder; -import org.elasticsearch.search.aggregations.metrics.min.Min; -import org.elasticsearch.search.aggregations.metrics.min.MinAggregationBuilder; - -/** - * @author peng-yongsheng - */ -public abstract class EsDAO extends AbstractDAO { - - public EsDAO(ElasticSearchClient client) { - super(client); - } - - protected final int getMaxId(String indexName, String columnName) { - ElasticSearchClient client = getClient(); - SearchRequestBuilder searchRequestBuilder = client.prepareSearch(indexName); - searchRequestBuilder.setTypes("type"); - searchRequestBuilder.setSize(0); - MaxAggregationBuilder aggregation = AggregationBuilders.max("agg").field(columnName); - searchRequestBuilder.addAggregation(aggregation); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - Max agg = searchResponse.getAggregations().get("agg"); - - int id = (int)agg.getValue(); - if (id == Integer.MAX_VALUE || id == Integer.MIN_VALUE) { - return 0; - } else { - return id; - } - } - - protected final int getMinId(String indexName, String columnName) { - ElasticSearchClient client = getClient(); - SearchRequestBuilder searchRequestBuilder = client.prepareSearch(indexName); - searchRequestBuilder.setTypes("type"); - searchRequestBuilder.setSize(0); - MinAggregationBuilder aggregation = AggregationBuilders.min("agg").field(columnName); - searchRequestBuilder.addAggregation(aggregation); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - Min agg = searchResponse.getAggregations().get("agg"); - - int id = (int)agg.getValue(); - if (id == Integer.MAX_VALUE || id == Integer.MIN_VALUE) { - return 0; - } else { - return id; - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/base/define/ElasticSearchColumnDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/base/define/ElasticSearchColumnDefine.java deleted file mode 100644 index a0e796df7e0b1065a4f5c481d5afe2fbcd4a3b3b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/base/define/ElasticSearchColumnDefine.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.base.define; - -import org.apache.skywalking.apm.collector.core.data.ColumnDefine; -import org.apache.skywalking.apm.collector.core.data.ColumnName; - -/** - * @author peng-yongsheng - */ -public class ElasticSearchColumnDefine extends ColumnDefine { - - public ElasticSearchColumnDefine(ColumnName columnName, String type) { - super(columnName, type); - } - - public enum Type { - Binary, Keyword, Long, Integer, Double, Text - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/base/define/ElasticSearchStorageInstaller.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/base/define/ElasticSearchStorageInstaller.java deleted file mode 100644 index 438d6e2765c78ecb7c2adc416c9c265ff10b5f9c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/base/define/ElasticSearchStorageInstaller.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.base.define; - -import java.io.IOException; -import java.util.*; -import org.apache.skywalking.apm.collector.client.Client; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.data.*; -import org.apache.skywalking.apm.collector.storage.*; -import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsResponse; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class ElasticSearchStorageInstaller extends StorageInstaller { - - private final Logger logger = LoggerFactory.getLogger(ElasticSearchStorageInstaller.class); - - private final int indexShardsNumber; - private final int indexReplicasNumber; - - public ElasticSearchStorageInstaller(int indexShardsNumber, int indexReplicasNumber, - boolean isHighPerformanceMode) { - super(isHighPerformanceMode); - this.indexShardsNumber = indexShardsNumber; - this.indexReplicasNumber = indexReplicasNumber; - } - - @Override protected void defineFilter(List tableDefines) { - int size = tableDefines.size(); - for (int i = size - 1; i >= 0; i--) { - if (!(tableDefines.get(i) instanceof ElasticSearchTableDefine)) { - tableDefines.remove(i); - } - } - } - - @Override protected void columnCheck(Client client, TableDefine tableDefine) throws StorageException { - ElasticSearchClient esClient = (ElasticSearchClient)client; - ElasticSearchTableDefine esTableDefine = (ElasticSearchTableDefine)tableDefine; - - for (ColumnDefine columnDefine : tableDefine.getColumnDefines()) { - GetFieldMappingsResponse.FieldMappingMetaData metaData = esClient.prepareGetMappings(esTableDefine.getName(), columnDefine.getColumnName().getName()); - - if (Objects.nonNull(metaData)) { - Map field = (Map)metaData.sourceAsMap().get(columnDefine.getColumnName().getName()); - if (!columnDefine.getType().toLowerCase().equals(field.get("type"))) { - throw new StorageInstallException("Field named " + columnDefine.getColumnName().getName() + "'s type not match the definition. Expect: " - + columnDefine.getType().toLowerCase() + ", actual: " + field.get("type")); - } - } else { - throw new StorageInstallException("Field named " + columnDefine.getColumnName().getName() + " in " + tableDefine.getName() + " index not found."); - } - } - } - - @Override protected void createTable(Client client, TableDefine tableDefine) throws StorageException { - ElasticSearchClient esClient = (ElasticSearchClient)client; - ElasticSearchTableDefine esTableDefine = (ElasticSearchTableDefine)tableDefine; - - // mapping - XContentBuilder mappingBuilder = null; - - Settings settings = createSettingBuilder(esTableDefine); - try { - mappingBuilder = createMappingBuilder(esTableDefine); - logger.info("mapping builder str: {}", mappingBuilder.string()); - } catch (Exception e) { - logger.error("create {} index mapping builder error", esTableDefine.getName()); - } - - boolean isAcknowledged = esClient.createIndex(esTableDefine.getName(), esTableDefine.type(), settings, mappingBuilder); - logger.info("create {} index with type of {} finished, isAcknowledged: {}", esTableDefine.getName(), esTableDefine.type(), isAcknowledged); - - if (!isAcknowledged) { - throw new StorageInstallException("create " + esTableDefine.getName() + " index failure, "); - } - } - - private Settings createSettingBuilder(ElasticSearchTableDefine tableDefine) { - return Settings.builder() - .put("index.number_of_shards", indexShardsNumber) - .put("index.number_of_replicas", indexReplicasNumber) - .put("index.refresh_interval", String.valueOf(tableDefine.refreshInterval()) + "s") - .put("analysis.analyzer.collector_analyzer.type", "stop") - .build(); - } - - private XContentBuilder createMappingBuilder(ElasticSearchTableDefine tableDefine) throws IOException { - XContentBuilder mappingBuilder = XContentFactory.jsonBuilder() - .startObject() - .startObject("_all") - .field("enabled", false) - .endObject() - .startObject("properties"); - - for (ColumnDefine columnDefine : tableDefine.getColumnDefines()) { - ElasticSearchColumnDefine elasticSearchColumnDefine = (ElasticSearchColumnDefine)columnDefine; - - if (ElasticSearchColumnDefine.Type.Text.name().toLowerCase().equals(elasticSearchColumnDefine.getType().toLowerCase())) { - mappingBuilder - .startObject(elasticSearchColumnDefine.getColumnName().getName()) - .field("type", elasticSearchColumnDefine.getType().toLowerCase()) - .field("analyzer", "collector_analyzer") - .endObject(); - } else { - mappingBuilder - .startObject(elasticSearchColumnDefine.getColumnName().getName()) - .field("type", elasticSearchColumnDefine.getType().toLowerCase()) - .endObject(); - } - } - - mappingBuilder - .endObject() - .endObject(); - logger.debug("create elasticsearch index: {}", mappingBuilder.string()); - return mappingBuilder; - } - - @Override protected void deleteTable(Client client, TableDefine tableDefine) throws StorageException { - ElasticSearchClient esClient = (ElasticSearchClient)client; - - if (!esClient.deleteIndex(tableDefine.getName())) { - throw new StorageInstallException(tableDefine.getName() + " index delete failure."); - } - } - - @Override protected boolean isExists(Client client, TableDefine tableDefine) { - ElasticSearchClient esClient = (ElasticSearchClient)client; - return esClient.isExistsIndex(tableDefine.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/base/define/ElasticSearchTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/base/define/ElasticSearchTableDefine.java deleted file mode 100644 index e687e198b8dbbd3364fe8e4b43354dce94fb7805..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/base/define/ElasticSearchTableDefine.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.base.define; - -import org.apache.skywalking.apm.collector.core.data.TableDefine; - -/** - * @author peng-yongsheng - */ -public abstract class ElasticSearchTableDefine extends TableDefine { - - public ElasticSearchTableDefine(String name) { - super(name); - } - - public final String type() { - return "type"; - } - - public abstract int refreshInterval(); -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/GlobalTraceEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/GlobalTraceEsPersistenceDAO.java deleted file mode 100644 index 4dc84281dca6ec8b56c6d86caf656cd8f3ecc23b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/GlobalTraceEsPersistenceDAO.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.IGlobalTracePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.global.*; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public class GlobalTraceEsPersistenceDAO extends AbstractPersistenceEsDAO implements IGlobalTracePersistenceDAO { - - public GlobalTraceEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return GlobalTraceTable.TABLE; - } - - @Override protected GlobalTrace esDataToStreamData(Map source) { - GlobalTrace globalTrace = new GlobalTrace(); - globalTrace.setSegmentId((String)source.get(GlobalTraceTable.SEGMENT_ID.getName())); - globalTrace.setTraceId((String)source.get(GlobalTraceTable.TRACE_ID.getName())); - globalTrace.setTimeBucket(((Number)source.get(GlobalTraceTable.TIME_BUCKET.getName())).longValue()); - return globalTrace; - } - - @Override protected XContentBuilder esStreamDataToEsData(GlobalTrace streamData) throws IOException { - return XContentFactory.jsonBuilder() - .startObject() - .field(GlobalTraceTable.SEGMENT_ID.getName(), streamData.getSegmentId()) - .field(GlobalTraceTable.TRACE_ID.getName(), streamData.getTraceId()) - .field(GlobalTraceTable.TIME_BUCKET.getName(), streamData.getTimeBucket()) - .endObject(); - } - - @Override protected String timeBucketColumnNameForDelete() { - return GlobalTraceTable.TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + GlobalTraceTable.TABLE) - @Override public GlobalTrace get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceHeartBeatEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceHeartBeatEsPersistenceDAO.java deleted file mode 100644 index 83f3452729d1b6a0aa61d1723a68bf0558a6bbc8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/InstanceHeartBeatEsPersistenceDAO.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.UnexpectedException; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.IInstanceHeartBeatPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.register.*; -import org.elasticsearch.action.get.GetResponse; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.common.xcontent.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class InstanceHeartBeatEsPersistenceDAO extends EsDAO implements IInstanceHeartBeatPersistenceDAO { - - private static final Logger logger = LoggerFactory.getLogger(InstanceHeartBeatEsPersistenceDAO.class); - - public InstanceHeartBeatEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @GraphComputingMetric(name = "/persistence/get/" + InstanceTable.TABLE + "/heartbeat") - @Override public Instance get(String id) { - GetResponse getResponse = getClient().prepareGet(InstanceTable.TABLE, id).get(); - if (getResponse.isExists()) { - Map source = getResponse.getSource(); - - Instance instance = new Instance(); - instance.setId(id); - instance.setInstanceId(((Number)source.get(InstanceTable.INSTANCE_ID.getName())).intValue()); - instance.setHeartBeatTime(((Number)source.get(InstanceTable.HEARTBEAT_TIME.getName())).longValue()); - logger.debug("instance id: {} exists", id); - return instance; - } else { - logger.debug("instance id: {} not exists", id); - return null; - } - } - - @Override public IndexRequestBuilder prepareBatchInsert(Instance data) { - throw new UnexpectedException("Received an instance heart beat message under instance id= " + data.getId() + " , which doesn't exist."); - } - - @Override public UpdateRequestBuilder prepareBatchUpdate(Instance data) throws IOException { - XContentBuilder source = XContentFactory.jsonBuilder().startObject() - .field(InstanceTable.HEARTBEAT_TIME.getName(), data.getHeartBeatTime()) - .endObject(); - - return getClient().prepareUpdate(InstanceTable.TABLE, data.getId()).setDoc(source); - } - - @Override public void deleteHistory(Long timeBucketBefore) { - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/SegmentDurationEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/SegmentDurationEsPersistenceDAO.java deleted file mode 100644 index 5d8d12b0a6fc95d4575d95ef05b4eb10473bf56e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/SegmentDurationEsPersistenceDAO.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao; - -import java.io.IOException; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.storage.dao.ISegmentDurationPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.segment.*; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.common.xcontent.*; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.index.reindex.BulkByScrollResponse; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class SegmentDurationEsPersistenceDAO extends EsDAO implements ISegmentDurationPersistenceDAO { - - private static final Logger logger = LoggerFactory.getLogger(SegmentDurationEsPersistenceDAO.class); - - public SegmentDurationEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override - public SegmentDuration get(String id) { - return null; - } - - @Override - public UpdateRequestBuilder prepareBatchUpdate(SegmentDuration data) { - return null; - } - - @Override - public IndexRequestBuilder prepareBatchInsert(SegmentDuration data) throws IOException { - XContentBuilder target = XContentFactory.jsonBuilder().startObject() - .field(SegmentDurationTable.SEGMENT_ID.getName(), data.getSegmentId()) - .field(SegmentDurationTable.APPLICATION_ID.getName(), data.getApplicationId()) - .field(SegmentDurationTable.SERVICE_NAME.getName(), data.getServiceName()) - .field(SegmentDurationTable.DURATION.getName(), data.getDuration()) - .field(SegmentDurationTable.START_TIME.getName(), data.getStartTime()) - .field(SegmentDurationTable.END_TIME.getName(), data.getEndTime()) - .field(SegmentDurationTable.IS_ERROR.getName(), data.getIsError()) - .field(SegmentDurationTable.TIME_BUCKET.getName(), data.getTimeBucket()) - .endObject(); - - return getClient().prepareIndex(SegmentDurationTable.TABLE, data.getId()).setSource(target); - } - - @Override public void deleteHistory(Long timeBucketBefore) { - BulkByScrollResponse response = getClient().prepareDelete( - QueryBuilders.rangeQuery(SegmentDurationTable.TIME_BUCKET.getName()).lte(timeBucketBefore * 100), - SegmentDurationTable.TABLE) - .get(); - - long deleted = response.getDeleted(); - logger.info("Delete {} rows history from {} index.", deleted, SegmentDurationTable.TABLE); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/SegmentEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/SegmentEsPersistenceDAO.java deleted file mode 100644 index 6662607778a8275e363cb639c6d192f85f75eb13..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/SegmentEsPersistenceDAO.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao; - -import java.io.IOException; -import java.util.*; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.ISegmentPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.segment.*; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public class SegmentEsPersistenceDAO extends AbstractPersistenceEsDAO implements ISegmentPersistenceDAO { - - public SegmentEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return SegmentTable.TABLE; - } - - @Override protected Segment esDataToStreamData(Map source) { - Segment segment = new Segment(); - segment.setDataBinary(Base64.getDecoder().decode((String)source.get(SegmentTable.DATA_BINARY.getName()))); - segment.setTimeBucket(((Number)source.get(SegmentTable.TIME_BUCKET.getName())).longValue()); - return segment; - } - - @Override protected XContentBuilder esStreamDataToEsData(Segment streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(SegmentTable.DATA_BINARY.getName(), new String(Base64.getEncoder().encode(streamData.getDataBinary()))) - .field(SegmentTable.TIME_BUCKET.getName(), streamData.getTimeBucket()) - .endObject(); - } - - @Override protected String timeBucketColumnNameForDelete() { - return SegmentTable.TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + SegmentTable.TABLE) - @Override public Segment get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ServiceNameHeartBeatEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ServiceNameHeartBeatEsPersistenceDAO.java deleted file mode 100644 index c3d0525938aed2edf5110571de65c4177e259a62..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ServiceNameHeartBeatEsPersistenceDAO.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.UnexpectedException; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.IServiceNameHeartBeatPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.register.*; -import org.elasticsearch.action.get.GetResponse; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.common.xcontent.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class ServiceNameHeartBeatEsPersistenceDAO extends EsDAO implements IServiceNameHeartBeatPersistenceDAO { - - private static final Logger logger = LoggerFactory.getLogger(ServiceNameHeartBeatEsPersistenceDAO.class); - - public ServiceNameHeartBeatEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @GraphComputingMetric(name = "/persistence/get/" + ServiceNameTable.TABLE + "/heartbeat") - @Override public ServiceName get(String id) { - String[] includeSources = {ServiceNameTable.HEARTBEAT_TIME.getName()}; - GetResponse getResponse = getClient().prepareGet(ServiceNameTable.TABLE, id).setFetchSource(includeSources, null).get(); - if (getResponse.isExists()) { - Map source = getResponse.getSource(); - - ServiceName serviceName = new ServiceName(); - serviceName.setId(id); - serviceName.setServiceId(Integer.valueOf(id)); - serviceName.setHeartBeatTime(((Number)source.get(ServiceNameTable.HEARTBEAT_TIME.getName())).longValue()); - - if (logger.isDebugEnabled()) { - logger.debug("service id: {} is exists", id); - } - return serviceName; - } else { - if (logger.isDebugEnabled()) { - logger.debug("service id: {} is not exists", id); - } - return null; - } - } - - @Override public IndexRequestBuilder prepareBatchInsert(ServiceName data) { - throw new UnexpectedException("Received an service name heart beat message under service id= " + data.getId() + " , which doesn't exist."); - } - - @Override public UpdateRequestBuilder prepareBatchUpdate(ServiceName data) throws IOException { - if (logger.isDebugEnabled()) { - logger.debug("service name heart beat, service id: {}, heart beat time: {}", data.getId(), data.getHeartBeatTime()); - } - - XContentBuilder source = XContentFactory.jsonBuilder().startObject() - .field(ServiceNameTable.HEARTBEAT_TIME.getName(), data.getHeartBeatTime()) - .endObject(); - - return getClient().prepareUpdate(ServiceNameTable.TABLE, data.getId()).setDoc(source); - } - - @Override public void deleteHistory(Long timeBucketBefore) { - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/AbstractApplicationComponentEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/AbstractApplicationComponentEsPersistenceDAO.java deleted file mode 100644 index 45fa5f9c44fcf02ce8d64a3b02b4180ac2c8bb05..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/AbstractApplicationComponentEsPersistenceDAO.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.acp; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.application.*; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationComponentEsPersistenceDAO extends AbstractPersistenceEsDAO { - - AbstractApplicationComponentEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return ApplicationComponentTable.TIME_BUCKET.getName(); - } - - @Override protected final ApplicationComponent esDataToStreamData(Map source) { - ApplicationComponent applicationComponent = new ApplicationComponent(); - applicationComponent.setMetricId((String)source.get(ApplicationComponentTable.METRIC_ID.getName())); - - applicationComponent.setComponentId(((Number)source.get(ApplicationComponentTable.COMPONENT_ID.getName())).intValue()); - applicationComponent.setApplicationId(((Number)source.get(ApplicationComponentTable.APPLICATION_ID.getName())).intValue()); - applicationComponent.setTimeBucket(((Number)source.get(ApplicationComponentTable.TIME_BUCKET.getName())).longValue()); - return applicationComponent; - } - - @Override protected final XContentBuilder esStreamDataToEsData(ApplicationComponent streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(ApplicationComponentTable.METRIC_ID.getName(), streamData.getMetricId()) - - .field(ApplicationComponentTable.COMPONENT_ID.getName(), streamData.getComponentId()) - .field(ApplicationComponentTable.APPLICATION_ID.getName(), streamData.getApplicationId()) - .field(ApplicationComponentTable.TIME_BUCKET.getName(), streamData.getTimeBucket()) - .endObject(); - } - - @GraphComputingMetric(name = "/persistence/get/" + ApplicationComponentTable.TABLE) - @Override public final ApplicationComponent get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/ApplicationComponentDayEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/ApplicationComponentDayEsPersistenceDAO.java deleted file mode 100644 index 487e4fb065f12f70c935048b82e36a45e60a60d5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/ApplicationComponentDayEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.acp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentDayEsPersistenceDAO extends AbstractApplicationComponentEsPersistenceDAO implements IApplicationComponentDayPersistenceDAO { - - public ApplicationComponentDayEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/ApplicationComponentHourEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/ApplicationComponentHourEsPersistenceDAO.java deleted file mode 100644 index a6be4e9599862a45a7947dee3ed9a19a81cb069e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/ApplicationComponentHourEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.acp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentHourEsPersistenceDAO extends AbstractApplicationComponentEsPersistenceDAO implements IApplicationComponentHourPersistenceDAO { - - public ApplicationComponentHourEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/ApplicationComponentMinuteEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/ApplicationComponentMinuteEsPersistenceDAO.java deleted file mode 100644 index 0b0bc83ebe5294309a309a59aab881d64547ca90..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/ApplicationComponentMinuteEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.acp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentMinuteEsPersistenceDAO extends AbstractApplicationComponentEsPersistenceDAO implements IApplicationComponentMinutePersistenceDAO { - - public ApplicationComponentMinuteEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/ApplicationComponentMonthEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/ApplicationComponentMonthEsPersistenceDAO.java deleted file mode 100644 index 2ee5eb3ff503bde4156f0f9a5f914c89a1663fcb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/acp/ApplicationComponentMonthEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.acp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentMonthEsPersistenceDAO extends AbstractApplicationComponentEsPersistenceDAO implements IApplicationComponentMonthPersistenceDAO { - - public ApplicationComponentMonthEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/AbstractApplicationAlarmListEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/AbstractApplicationAlarmListEsPersistenceDAO.java deleted file mode 100644 index 958f7d73e1e63da5bbfaec753d77f9356b8fdd73..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/AbstractApplicationAlarmListEsPersistenceDAO.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.alarm; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.*; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationAlarmListEsPersistenceDAO extends AbstractPersistenceEsDAO { - - AbstractApplicationAlarmListEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return ApplicationAlarmListTable.TIME_BUCKET.getName(); - } - - @Override protected final ApplicationAlarmList esDataToStreamData(Map source) { - ApplicationAlarmList applicationAlarmList = new ApplicationAlarmList(); - applicationAlarmList.setMetricId((String)source.get(ApplicationAlarmListTable.METRIC_ID.getName())); - applicationAlarmList.setApplicationId(((Number)source.get(ApplicationAlarmListTable.APPLICATION_ID.getName())).intValue()); - applicationAlarmList.setSourceValue(((Number)source.get(ApplicationAlarmListTable.SOURCE_VALUE.getName())).intValue()); - - applicationAlarmList.setAlarmType(((Number)source.get(ApplicationAlarmListTable.ALARM_TYPE.getName())).intValue()); - applicationAlarmList.setAlarmContent((String)source.get(ApplicationAlarmListTable.ALARM_CONTENT.getName())); - - applicationAlarmList.setTimeBucket(((Number)source.get(ApplicationAlarmListTable.TIME_BUCKET.getName())).longValue()); - return applicationAlarmList; - } - - @Override protected final XContentBuilder esStreamDataToEsData(ApplicationAlarmList streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(ApplicationAlarmListTable.METRIC_ID.getName(), streamData.getMetricId()) - .field(ApplicationAlarmListTable.APPLICATION_ID.getName(), streamData.getApplicationId()) - .field(ApplicationAlarmListTable.SOURCE_VALUE.getName(), streamData.getSourceValue()) - - .field(ApplicationAlarmListTable.ALARM_TYPE.getName(), streamData.getAlarmType()) - .field(ApplicationAlarmListTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()) - - .field(ApplicationAlarmListTable.TIME_BUCKET.getName(), streamData.getTimeBucket()) - .endObject(); - } - - @GraphComputingMetric(name = "/persistence/get/" + ApplicationAlarmListTable.TABLE) - @Override public final ApplicationAlarmList get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationAlarmEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationAlarmEsPersistenceDAO.java deleted file mode 100644 index 15a4b32ad4a8fa42364ba2f9eecf14a7bffd8ae3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationAlarmEsPersistenceDAO.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.alarm; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.*; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmEsPersistenceDAO extends AbstractPersistenceEsDAO implements IApplicationAlarmPersistenceDAO { - - public ApplicationAlarmEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationAlarmTable.TABLE; - } - - @Override protected ApplicationAlarm esDataToStreamData(Map source) { - ApplicationAlarm instanceAlarm = new ApplicationAlarm(); - instanceAlarm.setApplicationId(((Number)source.get(ApplicationAlarmTable.APPLICATION_ID.getName())).intValue()); - instanceAlarm.setSourceValue(((Number)source.get(ApplicationAlarmTable.SOURCE_VALUE.getName())).intValue()); - - instanceAlarm.setAlarmType(((Number)source.get(ApplicationAlarmTable.ALARM_TYPE.getName())).intValue()); - instanceAlarm.setAlarmContent((String)source.get(ApplicationAlarmTable.ALARM_CONTENT.getName())); - - instanceAlarm.setLastTimeBucket(((Number)source.get(ApplicationAlarmTable.LAST_TIME_BUCKET.getName())).longValue()); - return instanceAlarm; - } - - @Override protected XContentBuilder esStreamDataToEsData(ApplicationAlarm streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(ApplicationAlarmTable.APPLICATION_ID.getName(), streamData.getApplicationId()) - .field(ApplicationAlarmTable.SOURCE_VALUE.getName(), streamData.getSourceValue()) - - .field(ApplicationAlarmTable.ALARM_TYPE.getName(), streamData.getAlarmType()) - .field(ApplicationAlarmTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()) - - .field(ApplicationAlarmTable.LAST_TIME_BUCKET.getName(), streamData.getLastTimeBucket()) - .endObject(); - } - - @Override protected String timeBucketColumnNameForDelete() { - return ApplicationAlarmTable.LAST_TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + ApplicationAlarmTable.TABLE) - @Override public ApplicationAlarm get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationAlarmListEsDayPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationAlarmListEsDayPersistenceDAO.java deleted file mode 100644 index 5c129768dea882b39c2fa568b4ad2963999761a9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationAlarmListEsDayPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.alarm; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmListEsDayPersistenceDAO extends AbstractApplicationAlarmListEsPersistenceDAO implements IApplicationAlarmListDayPersistenceDAO { - - public ApplicationAlarmListEsDayPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationAlarmListEsHourPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationAlarmListEsHourPersistenceDAO.java deleted file mode 100644 index 3ffd72f32b40c57117ae1ae61944ebc5536be7f2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationAlarmListEsHourPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.alarm; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmListEsHourPersistenceDAO extends AbstractApplicationAlarmListEsPersistenceDAO implements IApplicationAlarmListHourPersistenceDAO { - - public ApplicationAlarmListEsHourPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationAlarmListEsMinutePersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationAlarmListEsMinutePersistenceDAO.java deleted file mode 100644 index a2ada3eb64bbc9039ca3088bc7dbc46620e3f4c4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationAlarmListEsMinutePersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.alarm; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmListEsMinutePersistenceDAO extends AbstractApplicationAlarmListEsPersistenceDAO implements IApplicationAlarmListMinutePersistenceDAO { - - public ApplicationAlarmListEsMinutePersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationAlarmListEsMonthPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationAlarmListEsMonthPersistenceDAO.java deleted file mode 100644 index 1599a8f0856f01e1f200d8ce98e4dc2736b0132d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationAlarmListEsMonthPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.alarm; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmListEsMonthPersistenceDAO extends AbstractApplicationAlarmListEsPersistenceDAO implements IApplicationAlarmListMonthPersistenceDAO { - - public ApplicationAlarmListEsMonthPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationReferenceAlarmEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationReferenceAlarmEsPersistenceDAO.java deleted file mode 100644 index a723f71cb0cd838cffa35f35b9b8d6d87c6ee814..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationReferenceAlarmEsPersistenceDAO.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.alarm; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationReferenceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.*; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceAlarmEsPersistenceDAO extends AbstractPersistenceEsDAO implements IApplicationReferenceAlarmPersistenceDAO { - - public ApplicationReferenceAlarmEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationReferenceAlarmTable.TABLE; - } - - @Override protected ApplicationReferenceAlarm esDataToStreamData(Map source) { - ApplicationReferenceAlarm applicationReferenceAlarm = new ApplicationReferenceAlarm(); - applicationReferenceAlarm.setFrontApplicationId(((Number)source.get(ApplicationReferenceAlarmTable.FRONT_APPLICATION_ID.getName())).intValue()); - applicationReferenceAlarm.setBehindApplicationId(((Number)source.get(ApplicationReferenceAlarmTable.BEHIND_APPLICATION_ID.getName())).intValue()); - applicationReferenceAlarm.setSourceValue(((Number)source.get(ApplicationReferenceAlarmTable.SOURCE_VALUE.getName())).intValue()); - - applicationReferenceAlarm.setAlarmType(((Number)source.get(ApplicationReferenceAlarmTable.ALARM_TYPE.getName())).intValue()); - applicationReferenceAlarm.setAlarmContent((String)source.get(ApplicationReferenceAlarmTable.ALARM_CONTENT.getName())); - - applicationReferenceAlarm.setLastTimeBucket(((Number)source.get(ApplicationReferenceAlarmTable.LAST_TIME_BUCKET.getName())).longValue()); - return applicationReferenceAlarm; - } - - @Override protected XContentBuilder esStreamDataToEsData(ApplicationReferenceAlarm streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(ApplicationReferenceAlarmTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()) - .field(ApplicationReferenceAlarmTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()) - .field(ApplicationReferenceAlarmTable.SOURCE_VALUE.getName(), streamData.getSourceValue()) - - .field(ApplicationReferenceAlarmTable.ALARM_TYPE.getName(), streamData.getAlarmType()) - .field(ApplicationReferenceAlarmTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()) - - .field(ApplicationReferenceAlarmTable.LAST_TIME_BUCKET.getName(), streamData.getLastTimeBucket()) - .endObject(); - } - - @Override protected String timeBucketColumnNameForDelete() { - return ApplicationReferenceAlarmTable.LAST_TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + ApplicationReferenceAlarmTable.TABLE) - @Override public final ApplicationReferenceAlarm get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationReferenceAlarmListEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationReferenceAlarmListEsPersistenceDAO.java deleted file mode 100644 index 894509101c6b4cf5e2f7a8579c4402b5be68439d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ApplicationReferenceAlarmListEsPersistenceDAO.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.alarm; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationReferenceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.*; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceAlarmListEsPersistenceDAO extends AbstractPersistenceEsDAO implements IApplicationReferenceAlarmListPersistenceDAO { - - public ApplicationReferenceAlarmListEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationReferenceAlarmListTable.TABLE; - } - - @Override protected ApplicationReferenceAlarmList esDataToStreamData(Map source) { - ApplicationReferenceAlarmList applicationReferenceAlarmList = new ApplicationReferenceAlarmList(); - applicationReferenceAlarmList.setFrontApplicationId(((Number)source.get(ApplicationReferenceAlarmListTable.FRONT_APPLICATION_ID.getName())).intValue()); - applicationReferenceAlarmList.setBehindApplicationId(((Number)source.get(ApplicationReferenceAlarmListTable.BEHIND_APPLICATION_ID.getName())).intValue()); - applicationReferenceAlarmList.setSourceValue(((Number)source.get(ApplicationReferenceAlarmListTable.SOURCE_VALUE.getName())).intValue()); - - applicationReferenceAlarmList.setAlarmType(((Number)source.get(ApplicationReferenceAlarmListTable.ALARM_TYPE.getName())).intValue()); - applicationReferenceAlarmList.setAlarmContent((String)source.get(ApplicationReferenceAlarmListTable.ALARM_CONTENT.getName())); - - applicationReferenceAlarmList.setTimeBucket(((Number)source.get(ApplicationReferenceAlarmListTable.TIME_BUCKET.getName())).longValue()); - return applicationReferenceAlarmList; - } - - @Override - protected XContentBuilder esStreamDataToEsData(ApplicationReferenceAlarmList streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(ApplicationReferenceAlarmListTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()) - .field(ApplicationReferenceAlarmListTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()) - .field(ApplicationReferenceAlarmListTable.SOURCE_VALUE.getName(), streamData.getSourceValue()) - - .field(ApplicationReferenceAlarmListTable.ALARM_TYPE.getName(), streamData.getAlarmType()) - .field(ApplicationReferenceAlarmListTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()) - - .field(ApplicationReferenceAlarmListTable.TIME_BUCKET.getName(), streamData.getTimeBucket()) - .endObject(); - } - - @Override protected String timeBucketColumnNameForDelete() { - return ApplicationReferenceAlarmListTable.TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + ApplicationReferenceAlarmListTable.TABLE) - @Override public ApplicationReferenceAlarmList get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/InstanceAlarmEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/InstanceAlarmEsPersistenceDAO.java deleted file mode 100644 index c19f52851143dd0bad67b452d8ba7d2f63247794..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/InstanceAlarmEsPersistenceDAO.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.alarm; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.*; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public class InstanceAlarmEsPersistenceDAO extends AbstractPersistenceEsDAO implements IInstanceAlarmPersistenceDAO { - - public InstanceAlarmEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceAlarmTable.TABLE; - } - - @Override protected InstanceAlarm esDataToStreamData(Map source) { - InstanceAlarm instanceAlarm = new InstanceAlarm(); - instanceAlarm.setApplicationId(((Number)source.get(InstanceAlarmTable.APPLICATION_ID.getName())).intValue()); - instanceAlarm.setInstanceId(((Number)source.get(InstanceAlarmTable.INSTANCE_ID.getName())).intValue()); - instanceAlarm.setSourceValue(((Number)source.get(InstanceAlarmTable.SOURCE_VALUE.getName())).intValue()); - - instanceAlarm.setAlarmType(((Number)source.get(InstanceAlarmTable.ALARM_TYPE.getName())).intValue()); - instanceAlarm.setAlarmContent((String)source.get(InstanceAlarmTable.ALARM_CONTENT.getName())); - - instanceAlarm.setLastTimeBucket(((Number)source.get(InstanceAlarmTable.LAST_TIME_BUCKET.getName())).longValue()); - return instanceAlarm; - } - - @Override protected XContentBuilder esStreamDataToEsData(InstanceAlarm streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(InstanceAlarmTable.APPLICATION_ID.getName(), streamData.getApplicationId()) - .field(InstanceAlarmTable.INSTANCE_ID.getName(), streamData.getInstanceId()) - .field(InstanceAlarmTable.SOURCE_VALUE.getName(), streamData.getSourceValue()) - - .field(InstanceAlarmTable.ALARM_TYPE.getName(), streamData.getAlarmType()) - .field(InstanceAlarmTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()) - - .field(InstanceAlarmTable.LAST_TIME_BUCKET.getName(), streamData.getLastTimeBucket()) - .endObject(); - } - - @Override protected String timeBucketColumnNameForDelete() { - return InstanceAlarmTable.LAST_TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + InstanceAlarmTable.TABLE) - @Override public InstanceAlarm get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/InstanceAlarmListEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/InstanceAlarmListEsPersistenceDAO.java deleted file mode 100644 index 5f5ffa7958ee177f69da13e1351d6d1cc074ee89..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/InstanceAlarmListEsPersistenceDAO.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.alarm; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.*; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public class InstanceAlarmListEsPersistenceDAO extends AbstractPersistenceEsDAO implements IInstanceAlarmListPersistenceDAO { - - public InstanceAlarmListEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceAlarmListTable.TABLE; - } - - @Override protected InstanceAlarmList esDataToStreamData(Map source) { - InstanceAlarmList instanceAlarmList = new InstanceAlarmList(); - instanceAlarmList.setApplicationId(((Number)source.get(InstanceAlarmListTable.APPLICATION_ID.getName())).intValue()); - instanceAlarmList.setInstanceId(((Number)source.get(InstanceAlarmListTable.INSTANCE_ID.getName())).intValue()); - instanceAlarmList.setSourceValue(((Number)source.get(InstanceAlarmListTable.SOURCE_VALUE.getName())).intValue()); - - instanceAlarmList.setAlarmType(((Number)source.get(InstanceAlarmListTable.ALARM_TYPE.getName())).intValue()); - instanceAlarmList.setAlarmContent((String)source.get(InstanceAlarmListTable.ALARM_CONTENT.getName())); - - instanceAlarmList.setTimeBucket(((Number)source.get(InstanceAlarmListTable.TIME_BUCKET.getName())).longValue()); - return instanceAlarmList; - } - - @Override protected XContentBuilder esStreamDataToEsData(InstanceAlarmList streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(InstanceAlarmListTable.APPLICATION_ID.getName(), streamData.getApplicationId()) - .field(InstanceAlarmListTable.INSTANCE_ID.getName(), streamData.getInstanceId()) - .field(InstanceAlarmListTable.SOURCE_VALUE.getName(), streamData.getSourceValue()) - - .field(InstanceAlarmListTable.ALARM_TYPE.getName(), streamData.getAlarmType()) - .field(InstanceAlarmListTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()) - - .field(InstanceAlarmListTable.TIME_BUCKET.getName(), streamData.getTimeBucket()) - .endObject(); - } - - @Override protected String timeBucketColumnNameForDelete() { - return InstanceAlarmListTable.TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + InstanceAlarmListTable.TABLE) - @Override public InstanceAlarmList get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/InstanceReferenceAlarmEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/InstanceReferenceAlarmEsPersistenceDAO.java deleted file mode 100644 index 7c7679146e6307ff515906e04d9b0e19529a5c31..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/InstanceReferenceAlarmEsPersistenceDAO.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.alarm; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceReferenceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.*; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceAlarmEsPersistenceDAO extends AbstractPersistenceEsDAO implements IInstanceReferenceAlarmPersistenceDAO { - - public InstanceReferenceAlarmEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceReferenceAlarmTable.TABLE; - } - - @Override protected InstanceReferenceAlarm esDataToStreamData(Map source) { - InstanceReferenceAlarm instanceReferenceAlarm = new InstanceReferenceAlarm(); - instanceReferenceAlarm.setFrontApplicationId(((Number)source.get(InstanceReferenceAlarmTable.FRONT_APPLICATION_ID.getName())).intValue()); - instanceReferenceAlarm.setBehindApplicationId(((Number)source.get(InstanceReferenceAlarmTable.BEHIND_APPLICATION_ID.getName())).intValue()); - instanceReferenceAlarm.setFrontInstanceId(((Number)source.get(InstanceReferenceAlarmTable.FRONT_INSTANCE_ID.getName())).intValue()); - instanceReferenceAlarm.setBehindInstanceId(((Number)source.get(InstanceReferenceAlarmTable.BEHIND_INSTANCE_ID.getName())).intValue()); - instanceReferenceAlarm.setSourceValue(((Number)source.get(InstanceReferenceAlarmTable.SOURCE_VALUE.getName())).intValue()); - - instanceReferenceAlarm.setAlarmType(((Number)source.get(InstanceReferenceAlarmTable.ALARM_TYPE.getName())).intValue()); - instanceReferenceAlarm.setAlarmContent((String)source.get(InstanceReferenceAlarmTable.ALARM_CONTENT.getName())); - - instanceReferenceAlarm.setLastTimeBucket(((Number)source.get(InstanceReferenceAlarmTable.LAST_TIME_BUCKET.getName())).longValue()); - return instanceReferenceAlarm; - } - - @Override protected XContentBuilder esStreamDataToEsData(InstanceReferenceAlarm streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(InstanceReferenceAlarmTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()) - .field(InstanceReferenceAlarmTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()) - .field(InstanceReferenceAlarmTable.FRONT_INSTANCE_ID.getName(), streamData.getFrontInstanceId()) - .field(InstanceReferenceAlarmTable.BEHIND_INSTANCE_ID.getName(), streamData.getBehindInstanceId()) - .field(InstanceReferenceAlarmTable.SOURCE_VALUE.getName(), streamData.getSourceValue()) - - .field(InstanceReferenceAlarmTable.ALARM_TYPE.getName(), streamData.getAlarmType()) - .field(InstanceReferenceAlarmTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()) - - .field(InstanceReferenceAlarmTable.LAST_TIME_BUCKET.getName(), streamData.getLastTimeBucket()) - .endObject(); - } - - @Override protected String timeBucketColumnNameForDelete() { - return InstanceReferenceAlarmTable.LAST_TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + InstanceReferenceAlarmTable.TABLE) - @Override public InstanceReferenceAlarm get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/InstanceReferenceAlarmListEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/InstanceReferenceAlarmListEsPersistenceDAO.java deleted file mode 100644 index f90943a6bb9ff3f7e4bc191b68a7052405bfaa9b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/InstanceReferenceAlarmListEsPersistenceDAO.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.alarm; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceReferenceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.*; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceAlarmListEsPersistenceDAO extends AbstractPersistenceEsDAO implements IInstanceReferenceAlarmListPersistenceDAO { - - public InstanceReferenceAlarmListEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceReferenceAlarmListTable.TABLE; - } - - @Override protected InstanceReferenceAlarmList esDataToStreamData(Map source) { - InstanceReferenceAlarmList serviceReferenceAlarmList = new InstanceReferenceAlarmList(); - serviceReferenceAlarmList.setFrontApplicationId(((Number)source.get(InstanceReferenceAlarmListTable.FRONT_APPLICATION_ID.getName())).intValue()); - serviceReferenceAlarmList.setBehindApplicationId(((Number)source.get(InstanceReferenceAlarmListTable.BEHIND_APPLICATION_ID.getName())).intValue()); - serviceReferenceAlarmList.setFrontInstanceId(((Number)source.get(InstanceReferenceAlarmListTable.FRONT_INSTANCE_ID.getName())).intValue()); - serviceReferenceAlarmList.setBehindInstanceId(((Number)source.get(InstanceReferenceAlarmListTable.BEHIND_INSTANCE_ID.getName())).intValue()); - serviceReferenceAlarmList.setSourceValue(((Number)source.get(InstanceReferenceAlarmListTable.SOURCE_VALUE.getName())).intValue()); - - serviceReferenceAlarmList.setAlarmType(((Number)source.get(InstanceReferenceAlarmListTable.ALARM_TYPE.getName())).intValue()); - serviceReferenceAlarmList.setAlarmContent((String)source.get(InstanceReferenceAlarmListTable.ALARM_CONTENT.getName())); - - serviceReferenceAlarmList.setTimeBucket(((Number)source.get(InstanceReferenceAlarmListTable.TIME_BUCKET.getName())).longValue()); - return serviceReferenceAlarmList; - } - - @Override protected XContentBuilder esStreamDataToEsData(InstanceReferenceAlarmList streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(InstanceReferenceAlarmListTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()) - .field(InstanceReferenceAlarmListTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()) - .field(InstanceReferenceAlarmListTable.FRONT_INSTANCE_ID.getName(), streamData.getFrontInstanceId()) - .field(InstanceReferenceAlarmListTable.BEHIND_INSTANCE_ID.getName(), streamData.getBehindInstanceId()) - .field(InstanceReferenceAlarmListTable.SOURCE_VALUE.getName(), streamData.getSourceValue()) - - .field(InstanceReferenceAlarmListTable.ALARM_TYPE.getName(), streamData.getAlarmType()) - .field(InstanceReferenceAlarmListTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()) - - .field(InstanceReferenceAlarmListTable.TIME_BUCKET.getName(), streamData.getTimeBucket()) - .endObject(); - } - - @Override protected String timeBucketColumnNameForDelete() { - return InstanceReferenceAlarmListTable.TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + InstanceReferenceAlarmListTable.TABLE) - @Override public InstanceReferenceAlarmList get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ServiceAlarmEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ServiceAlarmEsPersistenceDAO.java deleted file mode 100644 index 8a330ee1c7a02c031a022c3e61883692be09b504..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ServiceAlarmEsPersistenceDAO.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.alarm; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.*; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public class ServiceAlarmEsPersistenceDAO extends AbstractPersistenceEsDAO implements IServiceAlarmPersistenceDAO { - - public ServiceAlarmEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceAlarmTable.TABLE; - } - - @Override protected ServiceAlarm esDataToStreamData(Map source) { - ServiceAlarm serviceAlarm = new ServiceAlarm(); - serviceAlarm.setApplicationId(((Number)source.get(ServiceAlarmTable.APPLICATION_ID.getName())).intValue()); - serviceAlarm.setInstanceId(((Number)source.get(ServiceAlarmTable.INSTANCE_ID.getName())).intValue()); - serviceAlarm.setServiceId(((Number)source.get(ServiceAlarmTable.SERVICE_ID.getName())).intValue()); - serviceAlarm.setSourceValue(((Number)source.get(ServiceAlarmTable.SOURCE_VALUE.getName())).intValue()); - - serviceAlarm.setAlarmType(((Number)source.get(ServiceAlarmTable.ALARM_TYPE.getName())).intValue()); - serviceAlarm.setAlarmContent((String)source.get(ServiceAlarmTable.ALARM_CONTENT.getName())); - - serviceAlarm.setLastTimeBucket(((Number)source.get(ServiceAlarmTable.LAST_TIME_BUCKET.getName())).longValue()); - return serviceAlarm; - } - - @Override protected XContentBuilder esStreamDataToEsData(ServiceAlarm streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(ServiceAlarmTable.APPLICATION_ID.getName(), streamData.getApplicationId()) - .field(ServiceAlarmTable.INSTANCE_ID.getName(), streamData.getInstanceId()) - .field(ServiceAlarmTable.SERVICE_ID.getName(), streamData.getServiceId()) - .field(ServiceAlarmTable.SOURCE_VALUE.getName(), streamData.getSourceValue()) - - .field(ServiceAlarmTable.ALARM_TYPE.getName(), streamData.getAlarmType()) - .field(ServiceAlarmTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()) - - .field(ServiceAlarmTable.LAST_TIME_BUCKET.getName(), streamData.getLastTimeBucket()) - .endObject(); - } - - @Override protected String timeBucketColumnNameForDelete() { - return ServiceAlarmTable.LAST_TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + ServiceAlarmTable.TABLE) - @Override public ServiceAlarm get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ServiceAlarmListEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ServiceAlarmListEsPersistenceDAO.java deleted file mode 100644 index 33078a91a2689d8f46e8e4eefd2de40c892733f8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ServiceAlarmListEsPersistenceDAO.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.alarm; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.*; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public class ServiceAlarmListEsPersistenceDAO extends AbstractPersistenceEsDAO implements IServiceAlarmListPersistenceDAO { - - public ServiceAlarmListEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceAlarmListTable.TABLE; - } - - @Override protected ServiceAlarmList esDataToStreamData(Map source) { - ServiceAlarmList serviceAlarmList = new ServiceAlarmList(); - serviceAlarmList.setApplicationId(((Number)source.get(ServiceAlarmListTable.APPLICATION_ID.getName())).intValue()); - serviceAlarmList.setInstanceId(((Number)source.get(ServiceAlarmListTable.INSTANCE_ID.getName())).intValue()); - serviceAlarmList.setServiceId(((Number)source.get(ServiceAlarmListTable.SERVICE_ID.getName())).intValue()); - serviceAlarmList.setSourceValue(((Number)source.get(ServiceAlarmListTable.SOURCE_VALUE.getName())).intValue()); - - serviceAlarmList.setAlarmType(((Number)source.get(ServiceAlarmListTable.ALARM_TYPE.getName())).intValue()); - serviceAlarmList.setAlarmContent((String)source.get(ServiceAlarmListTable.ALARM_CONTENT.getName())); - - serviceAlarmList.setTimeBucket(((Number)source.get(ServiceAlarmListTable.TIME_BUCKET.getName())).longValue()); - return serviceAlarmList; - } - - @Override protected XContentBuilder esStreamDataToEsData(ServiceAlarmList streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(ServiceAlarmListTable.APPLICATION_ID.getName(), streamData.getApplicationId()) - .field(ServiceAlarmListTable.INSTANCE_ID.getName(), streamData.getInstanceId()) - .field(ServiceAlarmListTable.SERVICE_ID.getName(), streamData.getServiceId()) - .field(ServiceAlarmListTable.SOURCE_VALUE.getName(), streamData.getSourceValue()) - - .field(ServiceAlarmListTable.ALARM_TYPE.getName(), streamData.getAlarmType()) - .field(ServiceAlarmListTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()) - - .field(ServiceAlarmListTable.TIME_BUCKET.getName(), streamData.getTimeBucket()) - .endObject(); - } - - @Override protected String timeBucketColumnNameForDelete() { - return ServiceAlarmListTable.TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + ServiceAlarmListTable.TABLE) - @Override public ServiceAlarmList get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ServiceReferenceAlarmEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ServiceReferenceAlarmEsPersistenceDAO.java deleted file mode 100644 index 25f819d4c8c1697e5bd8d4517e66991f7dc806f3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ServiceReferenceAlarmEsPersistenceDAO.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.alarm; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceReferenceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.*; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceAlarmEsPersistenceDAO extends AbstractPersistenceEsDAO implements IServiceReferenceAlarmPersistenceDAO { - - public ServiceReferenceAlarmEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceReferenceAlarmTable.TABLE; - } - - @Override protected ServiceReferenceAlarm esDataToStreamData(Map source) { - ServiceReferenceAlarm serviceReferenceAlarm = new ServiceReferenceAlarm(); - serviceReferenceAlarm.setFrontApplicationId(((Number)source.get(ServiceReferenceAlarmTable.FRONT_APPLICATION_ID.getName())).intValue()); - serviceReferenceAlarm.setBehindApplicationId(((Number)source.get(ServiceReferenceAlarmTable.BEHIND_APPLICATION_ID.getName())).intValue()); - serviceReferenceAlarm.setFrontInstanceId(((Number)source.get(ServiceReferenceAlarmTable.FRONT_INSTANCE_ID.getName())).intValue()); - serviceReferenceAlarm.setBehindInstanceId(((Number)source.get(ServiceReferenceAlarmTable.BEHIND_INSTANCE_ID.getName())).intValue()); - serviceReferenceAlarm.setFrontServiceId(((Number)source.get(ServiceReferenceAlarmTable.FRONT_SERVICE_ID.getName())).intValue()); - serviceReferenceAlarm.setBehindServiceId(((Number)source.get(ServiceReferenceAlarmTable.BEHIND_SERVICE_ID.getName())).intValue()); - serviceReferenceAlarm.setSourceValue(((Number)source.get(ServiceReferenceAlarmTable.SOURCE_VALUE.getName())).intValue()); - - serviceReferenceAlarm.setAlarmType(((Number)source.get(ServiceReferenceAlarmTable.ALARM_TYPE.getName())).intValue()); - serviceReferenceAlarm.setAlarmContent((String)source.get(ServiceReferenceAlarmTable.ALARM_CONTENT.getName())); - - serviceReferenceAlarm.setLastTimeBucket(((Number)source.get(ServiceReferenceAlarmTable.LAST_TIME_BUCKET.getName())).longValue()); - return serviceReferenceAlarm; - } - - @Override protected XContentBuilder esStreamDataToEsData(ServiceReferenceAlarm streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(ServiceReferenceAlarmTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()) - .field(ServiceReferenceAlarmTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()) - .field(ServiceReferenceAlarmTable.FRONT_INSTANCE_ID.getName(), streamData.getFrontInstanceId()) - .field(ServiceReferenceAlarmTable.BEHIND_INSTANCE_ID.getName(), streamData.getBehindInstanceId()) - .field(ServiceReferenceAlarmTable.FRONT_SERVICE_ID.getName(), streamData.getFrontServiceId()) - .field(ServiceReferenceAlarmTable.BEHIND_SERVICE_ID.getName(), streamData.getBehindServiceId()) - .field(ServiceReferenceAlarmTable.SOURCE_VALUE.getName(), streamData.getSourceValue()) - - .field(ServiceReferenceAlarmTable.ALARM_TYPE.getName(), streamData.getAlarmType()) - .field(ServiceReferenceAlarmTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()) - - .field(ServiceReferenceAlarmTable.LAST_TIME_BUCKET.getName(), streamData.getLastTimeBucket()) - .endObject(); - } - - @Override protected String timeBucketColumnNameForDelete() { - return ServiceReferenceAlarmTable.LAST_TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + ServiceReferenceAlarmTable.TABLE) - @Override public ServiceReferenceAlarm get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ServiceReferenceAlarmListEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ServiceReferenceAlarmListEsPersistenceDAO.java deleted file mode 100644 index d1de511780e11373c5b0ffd49ca7b7dfba3d7509..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/alarm/ServiceReferenceAlarmListEsPersistenceDAO.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.alarm; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceReferenceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.*; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceAlarmListEsPersistenceDAO extends AbstractPersistenceEsDAO implements IServiceReferenceAlarmListPersistenceDAO { - - public ServiceReferenceAlarmListEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceReferenceAlarmListTable.TABLE; - } - - @Override protected ServiceReferenceAlarmList esDataToStreamData(Map source) { - ServiceReferenceAlarmList serviceReferenceAlarmList = new ServiceReferenceAlarmList(); - serviceReferenceAlarmList.setFrontApplicationId(((Number)source.get(ServiceReferenceAlarmListTable.FRONT_APPLICATION_ID.getName())).intValue()); - serviceReferenceAlarmList.setBehindApplicationId(((Number)source.get(ServiceReferenceAlarmListTable.BEHIND_APPLICATION_ID.getName())).intValue()); - serviceReferenceAlarmList.setFrontInstanceId(((Number)source.get(ServiceReferenceAlarmListTable.FRONT_INSTANCE_ID.getName())).intValue()); - serviceReferenceAlarmList.setBehindInstanceId(((Number)source.get(ServiceReferenceAlarmListTable.BEHIND_INSTANCE_ID.getName())).intValue()); - serviceReferenceAlarmList.setFrontServiceId(((Number)source.get(ServiceReferenceAlarmListTable.FRONT_SERVICE_ID.getName())).intValue()); - serviceReferenceAlarmList.setBehindServiceId(((Number)source.get(ServiceReferenceAlarmListTable.BEHIND_SERVICE_ID.getName())).intValue()); - serviceReferenceAlarmList.setSourceValue(((Number)source.get(ServiceReferenceAlarmListTable.SOURCE_VALUE.getName())).intValue()); - - serviceReferenceAlarmList.setAlarmType(((Number)source.get(ServiceReferenceAlarmListTable.ALARM_TYPE.getName())).intValue()); - serviceReferenceAlarmList.setAlarmContent((String)source.get(ServiceReferenceAlarmListTable.ALARM_CONTENT.getName())); - - serviceReferenceAlarmList.setTimeBucket(((Number)source.get(ServiceReferenceAlarmListTable.TIME_BUCKET.getName())).longValue()); - return serviceReferenceAlarmList; - } - - @Override protected XContentBuilder esStreamDataToEsData(ServiceReferenceAlarmList streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(ServiceReferenceAlarmListTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()) - .field(ServiceReferenceAlarmListTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()) - .field(ServiceReferenceAlarmListTable.FRONT_INSTANCE_ID.getName(), streamData.getFrontInstanceId()) - .field(ServiceReferenceAlarmListTable.BEHIND_INSTANCE_ID.getName(), streamData.getBehindInstanceId()) - .field(ServiceReferenceAlarmListTable.FRONT_SERVICE_ID.getName(), streamData.getFrontServiceId()) - .field(ServiceReferenceAlarmListTable.BEHIND_SERVICE_ID.getName(), streamData.getBehindServiceId()) - .field(ServiceReferenceAlarmListTable.SOURCE_VALUE.getName(), streamData.getSourceValue()) - - .field(ServiceReferenceAlarmListTable.ALARM_TYPE.getName(), streamData.getAlarmType()) - .field(ServiceReferenceAlarmListTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()) - - .field(ServiceReferenceAlarmListTable.TIME_BUCKET.getName(), streamData.getTimeBucket()) - .endObject(); - } - - @Override protected String timeBucketColumnNameForDelete() { - return ServiceReferenceAlarmListTable.TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + ServiceReferenceAlarmListTable.TABLE) - @Override public ServiceReferenceAlarmList get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/amp/AbstractApplicationMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/amp/AbstractApplicationMetricEsPersistenceDAO.java deleted file mode 100644 index 2dbfadd31df411819da087827eb32bd17b8b03dd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/amp/AbstractApplicationMetricEsPersistenceDAO.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.amp; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.es.MetricTransformUtil; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.application.*; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationMetricEsPersistenceDAO extends AbstractPersistenceEsDAO { - - AbstractApplicationMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return ApplicationMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final ApplicationMetric esDataToStreamData(Map source) { - ApplicationMetric applicationMetric = new ApplicationMetric(); - applicationMetric.setMetricId((String)source.get(ApplicationMetricTable.METRIC_ID.getName())); - - applicationMetric.setApplicationId(((Number)source.get(ApplicationMetricTable.APPLICATION_ID.getName())).intValue()); - - MetricTransformUtil.INSTANCE.esDataToStreamData(source, applicationMetric); - - applicationMetric.setSatisfiedCount(((Number)source.get(ApplicationMetricTable.SATISFIED_COUNT.getName())).longValue()); - applicationMetric.setToleratingCount(((Number)source.get(ApplicationMetricTable.TOLERATING_COUNT.getName())).longValue()); - applicationMetric.setFrustratedCount(((Number)source.get(ApplicationMetricTable.FRUSTRATED_COUNT.getName())).longValue()); - - return applicationMetric; - } - - @Override protected final XContentBuilder esStreamDataToEsData(ApplicationMetric streamData) throws IOException { - XContentBuilder target = XContentFactory.jsonBuilder().startObject() - .field(ApplicationMetricTable.METRIC_ID.getName(), streamData.getMetricId()) - - .field(ApplicationMetricTable.APPLICATION_ID.getName(), streamData.getApplicationId()) - - .field(ApplicationMetricTable.SATISFIED_COUNT.getName(), streamData.getSatisfiedCount()) - .field(ApplicationMetricTable.TOLERATING_COUNT.getName(), streamData.getToleratingCount()) - .field(ApplicationMetricTable.FRUSTRATED_COUNT.getName(), streamData.getFrustratedCount()); - - MetricTransformUtil.INSTANCE.esStreamDataToEsData(streamData, target); - - target.endObject(); - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + ApplicationMetricTable.TABLE) - @Override public final ApplicationMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/amp/ApplicationDayMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/amp/ApplicationDayMetricEsPersistenceDAO.java deleted file mode 100644 index 8d77c13e1e90dd481c9539de4ddbd580b90d8400..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/amp/ApplicationDayMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.amp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationDayMetricEsPersistenceDAO extends AbstractApplicationMetricEsPersistenceDAO implements IApplicationDayMetricPersistenceDAO { - - public ApplicationDayMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/amp/ApplicationHourMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/amp/ApplicationHourMetricEsPersistenceDAO.java deleted file mode 100644 index c7a21b61747506ab91e48510b7e9bf04f9df4db9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/amp/ApplicationHourMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.amp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationHourMetricEsPersistenceDAO extends AbstractApplicationMetricEsPersistenceDAO implements IApplicationHourMetricPersistenceDAO { - - public ApplicationHourMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/amp/ApplicationMinuteMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/amp/ApplicationMinuteMetricEsPersistenceDAO.java deleted file mode 100644 index 8008e316b8e3f75c35dd64f42b17a9f5af76b8ac..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/amp/ApplicationMinuteMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.amp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationMinuteMetricEsPersistenceDAO extends AbstractApplicationMetricEsPersistenceDAO implements IApplicationMinuteMetricPersistenceDAO { - - public ApplicationMinuteMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/amp/ApplicationMonthMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/amp/ApplicationMonthMetricEsPersistenceDAO.java deleted file mode 100644 index b644d3b407e73839ae4c8b43612ea8de694176b7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/amp/ApplicationMonthMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.amp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationMonthMetricEsPersistenceDAO extends AbstractApplicationMetricEsPersistenceDAO implements IApplicationMonthMetricPersistenceDAO { - - public ApplicationMonthMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/AbstractApplicationMappingEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/AbstractApplicationMappingEsPersistenceDAO.java deleted file mode 100644 index 182be94e1406d05c4f5fbd21a6e7a7d055a996d3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/AbstractApplicationMappingEsPersistenceDAO.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ampp; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.application.*; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationMappingEsPersistenceDAO extends AbstractPersistenceEsDAO { - - AbstractApplicationMappingEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return ApplicationMappingTable.TIME_BUCKET.getName(); - } - - @Override protected final ApplicationMapping esDataToStreamData(Map source) { - ApplicationMapping applicationMapping = new ApplicationMapping(); - applicationMapping.setMetricId((String)source.get(ApplicationMappingTable.METRIC_ID.getName())); - - applicationMapping.setApplicationId(((Number)source.get(ApplicationMappingTable.APPLICATION_ID.getName())).intValue()); - applicationMapping.setMappingApplicationId(((Number)source.get(ApplicationMappingTable.MAPPING_APPLICATION_ID.getName())).intValue()); - applicationMapping.setTimeBucket(((Number)source.get(ApplicationMappingTable.TIME_BUCKET.getName())).longValue()); - return applicationMapping; - } - - @Override protected final XContentBuilder esStreamDataToEsData(ApplicationMapping streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(ApplicationMappingTable.METRIC_ID.getName(), streamData.getMetricId()) - - .field(ApplicationMappingTable.APPLICATION_ID.getName(), streamData.getApplicationId()) - .field(ApplicationMappingTable.MAPPING_APPLICATION_ID.getName(), streamData.getMappingApplicationId()) - .field(ApplicationMappingTable.TIME_BUCKET.getName(), streamData.getTimeBucket()) - .endObject(); - } - - @GraphComputingMetric(name = "/persistence/get/" + ApplicationMappingTable.TABLE) - @Override public final ApplicationMapping get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingDayEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingDayEsPersistenceDAO.java deleted file mode 100644 index 9d6e2b8278f3162564b48e881c8c27a71c979c69..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingDayEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ampp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingDayEsPersistenceDAO extends AbstractApplicationMappingEsPersistenceDAO implements IApplicationMappingDayPersistenceDAO { - - public ApplicationMappingDayEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingHourEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingHourEsPersistenceDAO.java deleted file mode 100644 index 1d349ee20b784c16c22eeec96c2ac4e8787909d3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingHourEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ampp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingHourEsPersistenceDAO extends AbstractApplicationMappingEsPersistenceDAO implements IApplicationMappingHourPersistenceDAO { - - public ApplicationMappingHourEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingMinuteEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingMinuteEsPersistenceDAO.java deleted file mode 100644 index 41a950a5ac906a66df22622de20e78c9ff13b633..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingMinuteEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ampp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingMinuteEsPersistenceDAO extends AbstractApplicationMappingEsPersistenceDAO implements IApplicationMappingMinutePersistenceDAO { - - public ApplicationMappingMinuteEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingMonthEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingMonthEsPersistenceDAO.java deleted file mode 100644 index 27855d35306f9f282ebb30cd12b06057aa50c728..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ampp/ApplicationMappingMonthEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ampp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingMonthEsPersistenceDAO extends AbstractApplicationMappingEsPersistenceDAO implements IApplicationMappingMonthPersistenceDAO { - - public ApplicationMappingMonthEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/armp/AbstractApplicationReferenceMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/armp/AbstractApplicationReferenceMetricEsPersistenceDAO.java deleted file mode 100644 index 6246199f25c279af1a89b4eb022d19de5c602bc8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/armp/AbstractApplicationReferenceMetricEsPersistenceDAO.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.armp; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.es.MetricTransformUtil; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.application.*; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationReferenceMetricEsPersistenceDAO extends AbstractPersistenceEsDAO { - - AbstractApplicationReferenceMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return ApplicationReferenceMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final ApplicationReferenceMetric esDataToStreamData(Map source) { - ApplicationReferenceMetric applicationReferenceMetric = new ApplicationReferenceMetric(); - applicationReferenceMetric.setMetricId((String)source.get(ApplicationReferenceMetricTable.METRIC_ID.getName())); - - applicationReferenceMetric.setFrontApplicationId(((Number)source.get(ApplicationReferenceMetricTable.FRONT_APPLICATION_ID.getName())).intValue()); - applicationReferenceMetric.setBehindApplicationId(((Number)source.get(ApplicationReferenceMetricTable.BEHIND_APPLICATION_ID.getName())).intValue()); - - MetricTransformUtil.INSTANCE.esDataToStreamData(source, applicationReferenceMetric); - - applicationReferenceMetric.setSatisfiedCount(((Number)source.get(ApplicationReferenceMetricTable.SATISFIED_COUNT.getName())).longValue()); - applicationReferenceMetric.setToleratingCount(((Number)source.get(ApplicationReferenceMetricTable.TOLERATING_COUNT.getName())).longValue()); - applicationReferenceMetric.setFrustratedCount(((Number)source.get(ApplicationReferenceMetricTable.FRUSTRATED_COUNT.getName())).longValue()); - - return applicationReferenceMetric; - } - - @Override - protected final XContentBuilder esStreamDataToEsData(ApplicationReferenceMetric streamData) throws IOException { - XContentBuilder target = XContentFactory.jsonBuilder().startObject() - .field(ApplicationReferenceMetricTable.METRIC_ID.getName(), streamData.getMetricId()) - - .field(ApplicationReferenceMetricTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()) - .field(ApplicationReferenceMetricTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()) - - .field(ApplicationReferenceMetricTable.SATISFIED_COUNT.getName(), streamData.getSatisfiedCount()) - .field(ApplicationReferenceMetricTable.TOLERATING_COUNT.getName(), streamData.getToleratingCount()) - .field(ApplicationReferenceMetricTable.FRUSTRATED_COUNT.getName(), streamData.getFrustratedCount()); - - MetricTransformUtil.INSTANCE.esStreamDataToEsData(streamData, target); - - target.endObject(); - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + ApplicationReferenceMetricTable.TABLE) - @Override public final ApplicationReferenceMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/armp/ApplicationReferenceDayMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/armp/ApplicationReferenceDayMetricEsPersistenceDAO.java deleted file mode 100644 index 457d53d576fef464084a375fd5e54b3097da4ff1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/armp/ApplicationReferenceDayMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.armp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceDayMetricEsPersistenceDAO extends AbstractApplicationReferenceMetricEsPersistenceDAO implements IApplicationReferenceDayMetricPersistenceDAO { - - public ApplicationReferenceDayMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/armp/ApplicationReferenceHourMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/armp/ApplicationReferenceHourMetricEsPersistenceDAO.java deleted file mode 100644 index ca99be26ab20b19d39a3214dcf671e643b2b216e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/armp/ApplicationReferenceHourMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.armp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceHourMetricEsPersistenceDAO extends AbstractApplicationReferenceMetricEsPersistenceDAO implements IApplicationReferenceHourMetricPersistenceDAO { - - public ApplicationReferenceHourMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/armp/ApplicationReferenceMinuteMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/armp/ApplicationReferenceMinuteMetricEsPersistenceDAO.java deleted file mode 100644 index 39036c4aa1e8c0ba9ced0b1ba66bd4c9e64d7ae2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/armp/ApplicationReferenceMinuteMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.armp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMinuteMetricEsPersistenceDAO extends AbstractApplicationReferenceMetricEsPersistenceDAO implements IApplicationReferenceMinuteMetricPersistenceDAO { - - public ApplicationReferenceMinuteMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/armp/ApplicationReferenceMonthMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/armp/ApplicationReferenceMonthMetricEsPersistenceDAO.java deleted file mode 100644 index 46c1d0598ed0923d950ae1b46505464bfbdd001a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/armp/ApplicationReferenceMonthMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.armp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMonthMetricEsPersistenceDAO extends AbstractApplicationReferenceMetricEsPersistenceDAO implements IApplicationReferenceMonthMetricPersistenceDAO { - - public ApplicationReferenceMonthMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cache/ApplicationEsCacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cache/ApplicationEsCacheDAO.java deleted file mode 100644 index e01e60fc53180c3e96c56b3af074ddaf91c38fb1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cache/ApplicationEsCacheDAO.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.cache; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.util.BooleanUtils; -import org.apache.skywalking.apm.collector.storage.dao.cache.IApplicationCacheDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.register.Application; -import org.apache.skywalking.apm.collector.storage.table.register.ApplicationTable; -import org.elasticsearch.action.get.GetRequestBuilder; -import org.elasticsearch.action.get.GetResponse; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.search.SearchType; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.SearchHit; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class ApplicationEsCacheDAO extends EsDAO implements IApplicationCacheDAO { - - private final Logger logger = LoggerFactory.getLogger(ApplicationEsCacheDAO.class); - - public ApplicationEsCacheDAO(ElasticSearchClient client) { - super(client); - } - - @Override public int getApplicationIdByCode(String applicationCode) { - ElasticSearchClient client = getClient(); - - SearchRequestBuilder searchRequestBuilder = client.prepareSearch(ApplicationTable.TABLE); - searchRequestBuilder.setTypes(ApplicationTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.QUERY_THEN_FETCH); - - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - boolQueryBuilder.must().add(QueryBuilders.termQuery(ApplicationTable.APPLICATION_CODE.getName(), applicationCode)); - boolQueryBuilder.must().add(QueryBuilders.termQuery(ApplicationTable.IS_ADDRESS.getName(), BooleanUtils.FALSE)); - - searchRequestBuilder.setQuery(boolQueryBuilder); - searchRequestBuilder.setSize(1); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - if (searchResponse.getHits().totalHits > 0) { - SearchHit searchHit = searchResponse.getHits().iterator().next(); - return (int)searchHit.getSource().get(ApplicationTable.APPLICATION_ID.getName()); - } - return 0; - } - - @Override public Application getApplication(int applicationId) { - logger.debug("get application code, applicationId: {}", applicationId); - ElasticSearchClient client = getClient(); - GetRequestBuilder getRequestBuilder = client.prepareGet(ApplicationTable.TABLE, String.valueOf(applicationId)); - - GetResponse getResponse = getRequestBuilder.get(); - if (getResponse.isExists()) { - Application application = new Application(); - application.setApplicationId(applicationId); - application.setApplicationCode((String)getResponse.getSource().get(ApplicationTable.APPLICATION_CODE.getName())); - application.setIsAddress(((Number)getResponse.getSource().get(ApplicationTable.IS_ADDRESS.getName())).intValue()); - return application; - } - return null; - } - - @Override public int getApplicationIdByAddressId(int addressId) { - ElasticSearchClient client = getClient(); - - SearchRequestBuilder searchRequestBuilder = client.prepareSearch(ApplicationTable.TABLE); - searchRequestBuilder.setTypes(ApplicationTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.QUERY_THEN_FETCH); - - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - boolQueryBuilder.must().add(QueryBuilders.termQuery(ApplicationTable.ADDRESS_ID.getName(), addressId)); - boolQueryBuilder.must().add(QueryBuilders.termQuery(ApplicationTable.IS_ADDRESS.getName(), BooleanUtils.TRUE)); - - searchRequestBuilder.setQuery(boolQueryBuilder); - searchRequestBuilder.setSize(1); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - if (searchResponse.getHits().totalHits > 0) { - SearchHit searchHit = searchResponse.getHits().iterator().next(); - return (int)searchHit.getSource().get(ApplicationTable.APPLICATION_ID.getName()); - } - return 0; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cache/InstanceEsCacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cache/InstanceEsCacheDAO.java deleted file mode 100644 index c3dd88c9c09e1031a3201741dc7e1092af43b949..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cache/InstanceEsCacheDAO.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.cache; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.util.BooleanUtils; -import org.apache.skywalking.apm.collector.storage.dao.cache.IInstanceCacheDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; -import org.elasticsearch.action.get.GetResponse; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.search.SearchType; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.SearchHit; - -/** - * @author peng-yongsheng - */ -public class InstanceEsCacheDAO extends EsDAO implements IInstanceCacheDAO { - - public InstanceEsCacheDAO(ElasticSearchClient client) { - super(client); - } - - @Override public int getApplicationId(int instanceId) { - GetResponse response = getClient().prepareGet(InstanceTable.TABLE, String.valueOf(instanceId)).get(); - if (response.isExists()) { - return (int)response.getSource().get(InstanceTable.APPLICATION_ID.getName()); - } else { - return 0; - } - } - - @Override public int getInstanceIdByAgentUUID(int applicationId, String agentUUID) { - ElasticSearchClient client = getClient(); - - SearchRequestBuilder searchRequestBuilder = client.prepareSearch(InstanceTable.TABLE); - searchRequestBuilder.setTypes(InstanceTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.QUERY_THEN_FETCH); - BoolQueryBuilder builder = QueryBuilders.boolQuery(); - builder.must().add(QueryBuilders.termQuery(InstanceTable.APPLICATION_ID.getName(), applicationId)); - builder.must().add(QueryBuilders.termQuery(InstanceTable.AGENT_UUID.getName(), agentUUID)); - builder.must().add(QueryBuilders.termQuery(InstanceTable.IS_ADDRESS.getName(), BooleanUtils.FALSE)); - searchRequestBuilder.setQuery(builder); - searchRequestBuilder.setSize(1); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - if (searchResponse.getHits().totalHits > 0) { - SearchHit searchHit = searchResponse.getHits().iterator().next(); - return (int)searchHit.getSource().get(InstanceTable.INSTANCE_ID.getName()); - } - return 0; - } - - @Override public int getInstanceIdByAddressId(int applicationId, int addressId) { - ElasticSearchClient client = getClient(); - - SearchRequestBuilder searchRequestBuilder = client.prepareSearch(InstanceTable.TABLE); - searchRequestBuilder.setTypes(InstanceTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.QUERY_THEN_FETCH); - BoolQueryBuilder builder = QueryBuilders.boolQuery(); - builder.must().add(QueryBuilders.termQuery(InstanceTable.APPLICATION_ID.getName(), applicationId)); - builder.must().add(QueryBuilders.termQuery(InstanceTable.ADDRESS_ID.getName(), addressId)); - builder.must().add(QueryBuilders.termQuery(InstanceTable.IS_ADDRESS.getName(), BooleanUtils.TRUE)); - searchRequestBuilder.setQuery(builder); - searchRequestBuilder.setSize(1); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - if (searchResponse.getHits().totalHits > 0) { - SearchHit searchHit = searchResponse.getHits().iterator().next(); - return (int)searchHit.getSource().get(InstanceTable.INSTANCE_ID.getName()); - } - return 0; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cache/NetworkAddressEsCacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cache/NetworkAddressEsCacheDAO.java deleted file mode 100644 index 3af92cfd0a29d906e6e76bb43d06f668d99f8d2e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cache/NetworkAddressEsCacheDAO.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.cache; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.cache.INetworkAddressCacheDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddress; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddressTable; -import org.elasticsearch.action.get.GetRequestBuilder; -import org.elasticsearch.action.get.GetResponse; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.search.SearchType; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.SearchHit; - -/** - * @author peng-yongsheng - */ -public class NetworkAddressEsCacheDAO extends EsDAO implements INetworkAddressCacheDAO { - - public NetworkAddressEsCacheDAO(ElasticSearchClient client) { - super(client); - } - - @Override public int getAddressId(String networkAddress) { - ElasticSearchClient client = getClient(); - - SearchRequestBuilder searchRequestBuilder = client.prepareSearch(NetworkAddressTable.TABLE); - searchRequestBuilder.setTypes(NetworkAddressTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.QUERY_THEN_FETCH); - searchRequestBuilder.setQuery(QueryBuilders.termQuery(NetworkAddressTable.NETWORK_ADDRESS.getName(), networkAddress)); - searchRequestBuilder.setSize(1); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - if (searchResponse.getHits().totalHits > 0) { - SearchHit searchHit = searchResponse.getHits().iterator().next(); - return ((Number)searchHit.getSource().get(NetworkAddressTable.ADDRESS_ID.getName())).intValue(); - } - return Const.NONE; - } - - @Override public NetworkAddress getAddressById(int addressId) { - ElasticSearchClient client = getClient(); - GetRequestBuilder getRequestBuilder = client.prepareGet(NetworkAddressTable.TABLE, String.valueOf(addressId)); - - GetResponse getResponse = getRequestBuilder.get(); - if (getResponse.isExists()) { - NetworkAddress address = new NetworkAddress(); - address.setId((String)getResponse.getSource().get(NetworkAddressTable.ID.getName())); - address.setAddressId(((Number)getResponse.getSource().get(NetworkAddressTable.ADDRESS_ID.getName())).intValue()); - address.setSrcSpanLayer(((Number)getResponse.getSource().get(NetworkAddressTable.SRC_SPAN_LAYER.getName())).intValue()); - address.setServerType(((Number)getResponse.getSource().get(NetworkAddressTable.SERVER_TYPE.getName())).intValue()); - address.setNetworkAddress((String)getResponse.getSource().get(NetworkAddressTable.NETWORK_ADDRESS.getName())); - return address; - } - return null; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cache/ServiceNameEsCacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cache/ServiceNameEsCacheDAO.java deleted file mode 100644 index c6b1f23f5e6a95466c9ee18b4cd14e1b3ef8f14a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cache/ServiceNameEsCacheDAO.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.cache; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.storage.dao.cache.IServiceNameCacheDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceNameTable; -import org.elasticsearch.action.get.GetRequestBuilder; -import org.elasticsearch.action.get.GetResponse; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.search.SearchType; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.SearchHit; - -/** - * @author peng-yongsheng - */ -public class ServiceNameEsCacheDAO extends EsDAO implements IServiceNameCacheDAO { - - public ServiceNameEsCacheDAO(ElasticSearchClient client) { - super(client); - } - - @Override public ServiceName get(int serviceId) { - GetRequestBuilder getRequestBuilder = getClient().prepareGet(ServiceNameTable.TABLE, String.valueOf(serviceId)); - - GetResponse getResponse = getRequestBuilder.get(); - - if (getResponse.isExists()) { - ServiceName serviceName = new ServiceName(); - serviceName.setApplicationId(((Number)getResponse.getSource().get(ServiceNameTable.APPLICATION_ID.getName())).intValue()); - serviceName.setServiceId(serviceId); - serviceName.setServiceName((String)getResponse.getSource().get(ServiceNameTable.SERVICE_NAME.getName())); - return serviceName; - } - return null; - } - - @Override public int getServiceId(int applicationId, int srcSpanType, String serviceName) { - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(ServiceNameTable.TABLE); - searchRequestBuilder.setTypes(ServiceNameTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - - BoolQueryBuilder boolQuery = QueryBuilders.boolQuery(); - boolQuery.must().add(QueryBuilders.termQuery(ServiceNameTable.APPLICATION_ID.getName(), applicationId)); - boolQuery.must().add(QueryBuilders.termQuery(ServiceNameTable.SRC_SPAN_TYPE.getName(), srcSpanType)); - boolQuery.must().add(QueryBuilders.termQuery(ServiceNameTable.SERVICE_NAME_KEYWORD.getName(), serviceName)); - searchRequestBuilder.setQuery(boolQuery); - searchRequestBuilder.setSize(1); - - SearchResponse searchResponse = searchRequestBuilder.get(); - if (searchResponse.getHits().totalHits > 0) { - SearchHit searchHit = searchResponse.getHits().iterator().next(); - return (int)searchHit.getSource().get(ServiceNameTable.SERVICE_ID.getName()); - } - return 0; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cpu/AbstractCpuMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cpu/AbstractCpuMetricEsPersistenceDAO.java deleted file mode 100644 index 6ffafd62ab9dfab24ebbc63c5b33643f69e1e962..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cpu/AbstractCpuMetricEsPersistenceDAO.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.cpu; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.*; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractCpuMetricEsPersistenceDAO extends AbstractPersistenceEsDAO { - - AbstractCpuMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return CpuMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final CpuMetric esDataToStreamData(Map source) { - CpuMetric cpuMetric = new CpuMetric(); - cpuMetric.setMetricId((String)source.get(CpuMetricTable.METRIC_ID.getName())); - - cpuMetric.setInstanceId(((Number)source.get(CpuMetricTable.INSTANCE_ID.getName())).intValue()); - - cpuMetric.setUsagePercent(((Number)source.get(CpuMetricTable.USAGE_PERCENT.getName())).doubleValue()); - cpuMetric.setTimes(((Number)source.get(CpuMetricTable.TIMES.getName())).longValue()); - cpuMetric.setTimeBucket(((Number)source.get(CpuMetricTable.TIME_BUCKET.getName())).longValue()); - - return cpuMetric; - } - - @Override protected final XContentBuilder esStreamDataToEsData(CpuMetric streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(CpuMetricTable.METRIC_ID.getName(), streamData.getMetricId()) - - .field(CpuMetricTable.INSTANCE_ID.getName(), streamData.getInstanceId()) - .field(CpuMetricTable.USAGE_PERCENT.getName(), streamData.getUsagePercent()) - .field(CpuMetricTable.TIMES.getName(), streamData.getTimes()) - .field(CpuMetricTable.TIME_BUCKET.getName(), streamData.getTimeBucket()) - .endObject(); - } - - @GraphComputingMetric(name = "/persistence/get/" + CpuMetricTable.TABLE) - @Override public final CpuMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cpu/CpuDayMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cpu/CpuDayMetricEsPersistenceDAO.java deleted file mode 100644 index e020b7230a37126ce2ced3d162a296c5f346c60f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cpu/CpuDayMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.cpu; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class CpuDayMetricEsPersistenceDAO extends AbstractCpuMetricEsPersistenceDAO implements ICpuDayMetricPersistenceDAO { - - public CpuDayMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cpu/CpuHourMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cpu/CpuHourMetricEsPersistenceDAO.java deleted file mode 100644 index df273f5059559e7feb582bea7aef281ec14a37ad..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cpu/CpuHourMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.cpu; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class CpuHourMetricEsPersistenceDAO extends AbstractCpuMetricEsPersistenceDAO implements ICpuHourMetricPersistenceDAO { - - public CpuHourMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cpu/CpuMinuteMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cpu/CpuMinuteMetricEsPersistenceDAO.java deleted file mode 100644 index 8d0e2b8357cd002ed10dfa8698143909c3f5f09e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cpu/CpuMinuteMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.cpu; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class CpuMinuteMetricEsPersistenceDAO extends AbstractCpuMetricEsPersistenceDAO implements ICpuMinuteMetricPersistenceDAO { - - public CpuMinuteMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cpu/CpuMonthMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cpu/CpuMonthMetricEsPersistenceDAO.java deleted file mode 100644 index 6240f3f0d68edf4309599812cfdfba9044d1534e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cpu/CpuMonthMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.cpu; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class CpuMonthMetricEsPersistenceDAO extends AbstractCpuMetricEsPersistenceDAO implements ICpuMonthMetricPersistenceDAO { - - public CpuMonthMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/gc/AbstractGCMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/gc/AbstractGCMetricEsPersistenceDAO.java deleted file mode 100644 index bd1fc53832f611ad47e26eb9d99f994772f3e64b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/gc/AbstractGCMetricEsPersistenceDAO.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.gc; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.*; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractGCMetricEsPersistenceDAO extends AbstractPersistenceEsDAO { - - AbstractGCMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return GCMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final GCMetric esDataToStreamData(Map source) { - GCMetric gcMetric = new GCMetric(); - gcMetric.setMetricId((String)source.get(GCMetricTable.METRIC_ID.getName())); - - gcMetric.setInstanceId(((Number)source.get(GCMetricTable.INSTANCE_ID.getName())).intValue()); - gcMetric.setPhrase(((Number)source.get(GCMetricTable.PHRASE.getName())).intValue()); - - gcMetric.setCount(((Number)source.get(GCMetricTable.COUNT.getName())).longValue()); - gcMetric.setTimes(((Number)source.get(GCMetricTable.TIMES.getName())).longValue()); - gcMetric.setDuration(((Number)source.get(GCMetricTable.DURATION.getName())).longValue()); - - gcMetric.setTimeBucket(((Number)source.get(GCMetricTable.TIME_BUCKET.getName())).longValue()); - - return gcMetric; - } - - @Override protected final XContentBuilder esStreamDataToEsData(GCMetric streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(GCMetricTable.METRIC_ID.getName(), streamData.getMetricId()) - - .field(GCMetricTable.INSTANCE_ID.getName(), streamData.getInstanceId()) - .field(GCMetricTable.PHRASE.getName(), streamData.getPhrase()) - .field(GCMetricTable.COUNT.getName(), streamData.getCount()) - .field(GCMetricTable.TIMES.getName(), streamData.getTimes()) - .field(GCMetricTable.TIME_BUCKET.getName(), streamData.getTimeBucket()) - .field(GCMetricTable.DURATION.getName(), streamData.getDuration()) - .endObject(); - } - - @GraphComputingMetric(name = "/persistence/get/" + GCMetricTable.TABLE) - @Override public final GCMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/gc/GCDayMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/gc/GCDayMetricEsPersistenceDAO.java deleted file mode 100644 index ec2306b0ab5ec038b7f9a67416a30e30343609d7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/gc/GCDayMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.gc; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class GCDayMetricEsPersistenceDAO extends AbstractGCMetricEsPersistenceDAO implements IGCDayMetricPersistenceDAO { - - public GCDayMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/gc/GCHourMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/gc/GCHourMetricEsPersistenceDAO.java deleted file mode 100644 index 613726aa2e226e1287ab9eff2cea3baf8ad1c33f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/gc/GCHourMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.gc; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class GCHourMetricEsPersistenceDAO extends AbstractGCMetricEsPersistenceDAO implements IGCHourMetricPersistenceDAO { - - public GCHourMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/gc/GCMinuteMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/gc/GCMinuteMetricEsPersistenceDAO.java deleted file mode 100644 index 556e65a63068c2f90ccf80d21e5788875cdad1bc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/gc/GCMinuteMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.gc; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class GCMinuteMetricEsPersistenceDAO extends AbstractGCMetricEsPersistenceDAO implements IGCMinuteMetricPersistenceDAO { - - public GCMinuteMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/gc/GCMonthMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/gc/GCMonthMetricEsPersistenceDAO.java deleted file mode 100644 index 45391ff026bd243b5ddc35edf8989b0e3fcdce8b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/gc/GCMonthMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.gc; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class GCMonthMetricEsPersistenceDAO extends AbstractGCMetricEsPersistenceDAO implements IGCMonthMetricPersistenceDAO { - - public GCMonthMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/imp/AbstractInstanceMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/imp/AbstractInstanceMetricEsPersistenceDAO.java deleted file mode 100644 index 0abc207d018f3468d9083de9705989d4e0590c8f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/imp/AbstractInstanceMetricEsPersistenceDAO.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.imp; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.es.MetricTransformUtil; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.*; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractInstanceMetricEsPersistenceDAO extends AbstractPersistenceEsDAO { - - AbstractInstanceMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return InstanceMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final InstanceMetric esDataToStreamData(Map source) { - InstanceMetric instanceMetric = new InstanceMetric(); - - instanceMetric.setMetricId((String)source.get(InstanceMetricTable.METRIC_ID.getName())); - instanceMetric.setApplicationId((Integer)source.get(InstanceMetricTable.APPLICATION_ID.getName())); - instanceMetric.setInstanceId((Integer)source.get(InstanceMetricTable.INSTANCE_ID.getName())); - - MetricTransformUtil.INSTANCE.esDataToStreamData(source, instanceMetric); - - return instanceMetric; - } - - @Override protected final XContentBuilder esStreamDataToEsData(InstanceMetric streamData) throws IOException { - XContentBuilder target = XContentFactory.jsonBuilder().startObject() - .field(InstanceMetricTable.METRIC_ID.getName(), streamData.getMetricId()) - .field(InstanceMetricTable.APPLICATION_ID.getName(), streamData.getApplicationId()) - .field(InstanceMetricTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - - MetricTransformUtil.INSTANCE.esStreamDataToEsData(streamData, target); - - target.endObject(); - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + InstanceMetricTable.TABLE) - @Override public final InstanceMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/imp/InstanceDayMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/imp/InstanceDayMetricEsPersistenceDAO.java deleted file mode 100644 index ae46e6e56c0f0a058620c070a0c9891951b2161a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/imp/InstanceDayMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.imp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class InstanceDayMetricEsPersistenceDAO extends AbstractInstanceMetricEsPersistenceDAO implements IInstanceDayMetricPersistenceDAO { - - public InstanceDayMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/imp/InstanceHourMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/imp/InstanceHourMetricEsPersistenceDAO.java deleted file mode 100644 index 22146814c70dc77d7a9c07a32bb9e052cf1999a4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/imp/InstanceHourMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.imp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class InstanceHourMetricEsPersistenceDAO extends AbstractInstanceMetricEsPersistenceDAO implements IInstanceHourMetricPersistenceDAO { - - public InstanceHourMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/imp/InstanceMinuteMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/imp/InstanceMinuteMetricEsPersistenceDAO.java deleted file mode 100644 index 6f3027678f6047a38f7e27055891db5fd02fdce4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/imp/InstanceMinuteMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.imp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class InstanceMinuteMetricEsPersistenceDAO extends AbstractInstanceMetricEsPersistenceDAO implements IInstanceMinuteMetricPersistenceDAO { - - public InstanceMinuteMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/imp/InstanceMonthMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/imp/InstanceMonthMetricEsPersistenceDAO.java deleted file mode 100644 index d34e7ea03e939aa8e30c185816bc0d43e17e0dbd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/imp/InstanceMonthMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.imp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class InstanceMonthMetricEsPersistenceDAO extends AbstractInstanceMetricEsPersistenceDAO implements IInstanceMonthMetricPersistenceDAO { - - public InstanceMonthMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/impp/AbstractInstanceMappingEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/impp/AbstractInstanceMappingEsPersistenceDAO.java deleted file mode 100644 index 6543832f34afb9d4581fdf38bde81fbbc6a7955e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/impp/AbstractInstanceMappingEsPersistenceDAO.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.impp; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.*; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractInstanceMappingEsPersistenceDAO extends AbstractPersistenceEsDAO { - - AbstractInstanceMappingEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return InstanceMappingTable.TIME_BUCKET.getName(); - } - - @Override protected final InstanceMapping esDataToStreamData(Map source) { - InstanceMapping instanceMapping = new InstanceMapping(); - instanceMapping.setMetricId((String)source.get(InstanceMappingTable.METRIC_ID.getName())); - - instanceMapping.setApplicationId(((Number)source.get(InstanceMappingTable.APPLICATION_ID.getName())).intValue()); - instanceMapping.setInstanceId(((Number)source.get(InstanceMappingTable.INSTANCE_ID.getName())).intValue()); - instanceMapping.setAddressId(((Number)source.get(InstanceMappingTable.ADDRESS_ID.getName())).intValue()); - instanceMapping.setTimeBucket(((Number)source.get(InstanceMappingTable.TIME_BUCKET.getName())).longValue()); - return instanceMapping; - } - - @Override protected final XContentBuilder esStreamDataToEsData(InstanceMapping streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(InstanceMappingTable.METRIC_ID.getName(), streamData.getMetricId()) - - .field(InstanceMappingTable.APPLICATION_ID.getName(), streamData.getApplicationId()) - .field(InstanceMappingTable.INSTANCE_ID.getName(), streamData.getInstanceId()) - .field(InstanceMappingTable.ADDRESS_ID.getName(), streamData.getAddressId()) - .field(InstanceMappingTable.TIME_BUCKET.getName(), streamData.getTimeBucket()) - .endObject(); - } - - @GraphComputingMetric(name = "/persistence/get/" + InstanceMappingTable.TABLE) - @Override public final InstanceMapping get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/impp/InstanceMappingDayEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/impp/InstanceMappingDayEsPersistenceDAO.java deleted file mode 100644 index e1d7dcf92f5bc0ff2d3eb2c185ad146271991640..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/impp/InstanceMappingDayEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.impp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingDayEsPersistenceDAO extends AbstractInstanceMappingEsPersistenceDAO implements IInstanceMappingDayPersistenceDAO { - - public InstanceMappingDayEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/impp/InstanceMappingHourEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/impp/InstanceMappingHourEsPersistenceDAO.java deleted file mode 100644 index 0a17c6491359f270be13944f8559a9de679f04c9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/impp/InstanceMappingHourEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.impp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingHourEsPersistenceDAO extends AbstractInstanceMappingEsPersistenceDAO implements IInstanceMappingHourPersistenceDAO { - - public InstanceMappingHourEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/impp/InstanceMappingMinuteEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/impp/InstanceMappingMinuteEsPersistenceDAO.java deleted file mode 100644 index 613a9b0a594a344c45bd4fc36e6a2e7134c8440a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/impp/InstanceMappingMinuteEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.impp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingMinuteEsPersistenceDAO extends AbstractInstanceMappingEsPersistenceDAO implements IInstanceMappingMinutePersistenceDAO { - - public InstanceMappingMinuteEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/impp/InstanceMappingMonthEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/impp/InstanceMappingMonthEsPersistenceDAO.java deleted file mode 100644 index 04d0bd1aaae011811b735d28f89ad3224455ed42..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/impp/InstanceMappingMonthEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.impp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingMonthEsPersistenceDAO extends AbstractInstanceMappingEsPersistenceDAO implements IInstanceMappingMonthPersistenceDAO { - - public InstanceMappingMonthEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/irmp/AbstractInstanceReferenceMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/irmp/AbstractInstanceReferenceMetricEsPersistenceDAO.java deleted file mode 100644 index 9ae8c87af83ce834272a38adb58108bcb1aa5e89..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/irmp/AbstractInstanceReferenceMetricEsPersistenceDAO.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.irmp; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.es.MetricTransformUtil; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.*; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractInstanceReferenceMetricEsPersistenceDAO extends AbstractPersistenceEsDAO { - - AbstractInstanceReferenceMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return InstanceReferenceMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final InstanceReferenceMetric esDataToStreamData(Map source) { - InstanceReferenceMetric instanceReferenceMetric = new InstanceReferenceMetric(); - instanceReferenceMetric.setMetricId((String)source.get(InstanceReferenceMetricTable.METRIC_ID.getName())); - - instanceReferenceMetric.setFrontApplicationId((Integer)source.get(InstanceReferenceMetricTable.FRONT_APPLICATION_ID.getName())); - instanceReferenceMetric.setBehindApplicationId((Integer)source.get(InstanceReferenceMetricTable.BEHIND_APPLICATION_ID.getName())); - instanceReferenceMetric.setFrontInstanceId((Integer)source.get(InstanceReferenceMetricTable.FRONT_INSTANCE_ID.getName())); - instanceReferenceMetric.setBehindInstanceId((Integer)source.get(InstanceReferenceMetricTable.BEHIND_INSTANCE_ID.getName())); - - MetricTransformUtil.INSTANCE.esDataToStreamData(source, instanceReferenceMetric); - - return instanceReferenceMetric; - } - - @Override - protected final XContentBuilder esStreamDataToEsData(InstanceReferenceMetric streamData) throws IOException { - XContentBuilder target = XContentFactory.jsonBuilder().startObject() - .field(InstanceReferenceMetricTable.METRIC_ID.getName(), streamData.getMetricId()) - .field(InstanceReferenceMetricTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()) - .field(InstanceReferenceMetricTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()) - .field(InstanceReferenceMetricTable.FRONT_INSTANCE_ID.getName(), streamData.getFrontInstanceId()) - .field(InstanceReferenceMetricTable.BEHIND_INSTANCE_ID.getName(), streamData.getBehindInstanceId()); - - MetricTransformUtil.INSTANCE.esStreamDataToEsData(streamData, target); - - target.endObject(); - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + InstanceReferenceMetricTable.TABLE) - @Override public final InstanceReferenceMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/irmp/InstanceReferenceDayMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/irmp/InstanceReferenceDayMetricEsPersistenceDAO.java deleted file mode 100644 index f7a2fdcd5c3243a801f94028f86305818a902904..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/irmp/InstanceReferenceDayMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.irmp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceDayMetricEsPersistenceDAO extends AbstractInstanceReferenceMetricEsPersistenceDAO implements IInstanceReferenceDayMetricPersistenceDAO { - - public InstanceReferenceDayMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/irmp/InstanceReferenceHourMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/irmp/InstanceReferenceHourMetricEsPersistenceDAO.java deleted file mode 100644 index 030cae5dcf81e9dea85616c18f0d01c34585da99..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/irmp/InstanceReferenceHourMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.irmp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceHourMetricEsPersistenceDAO extends AbstractInstanceReferenceMetricEsPersistenceDAO implements IInstanceReferenceHourMetricPersistenceDAO { - - public InstanceReferenceHourMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/irmp/InstanceReferenceMinuteMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/irmp/InstanceReferenceMinuteMetricEsPersistenceDAO.java deleted file mode 100644 index 85d43c2afd764889bec06259808bfd9d9ce3def8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/irmp/InstanceReferenceMinuteMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.irmp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMinuteMetricEsPersistenceDAO extends AbstractInstanceReferenceMetricEsPersistenceDAO implements IInstanceReferenceMinuteMetricPersistenceDAO { - - public InstanceReferenceMinuteMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/irmp/InstanceReferenceMonthMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/irmp/InstanceReferenceMonthMetricEsPersistenceDAO.java deleted file mode 100644 index e6dd62c0c1269efaec34047ef7c2957925e0f40f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/irmp/InstanceReferenceMonthMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.irmp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMonthMetricEsPersistenceDAO extends AbstractInstanceReferenceMetricEsPersistenceDAO implements IInstanceReferenceMonthMetricPersistenceDAO { - - public InstanceReferenceMonthMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/memory/AbstractMemoryMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/memory/AbstractMemoryMetricEsPersistenceDAO.java deleted file mode 100644 index df85e52edc108fc87b4bf93f2fdf69c0a4a1b63c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/memory/AbstractMemoryMetricEsPersistenceDAO.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.memory; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.*; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractMemoryMetricEsPersistenceDAO extends AbstractPersistenceEsDAO { - - AbstractMemoryMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return MemoryMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final MemoryMetric esDataToStreamData(Map source) { - MemoryMetric memoryMetric = new MemoryMetric(); - memoryMetric.setMetricId((String)source.get(MemoryMetricTable.METRIC_ID.getName())); - - memoryMetric.setInstanceId(((Number)source.get(MemoryMetricTable.INSTANCE_ID.getName())).intValue()); - memoryMetric.setIsHeap(((Number)source.get(MemoryMetricTable.IS_HEAP.getName())).intValue()); - - memoryMetric.setInit(((Number)source.get(MemoryMetricTable.INIT.getName())).longValue()); - memoryMetric.setMax(((Number)source.get(MemoryMetricTable.MAX.getName())).longValue()); - memoryMetric.setUsed(((Number)source.get(MemoryMetricTable.USED.getName())).longValue()); - memoryMetric.setCommitted(((Number)source.get(MemoryMetricTable.COMMITTED.getName())).longValue()); - memoryMetric.setTimes(((Number)source.get(MemoryMetricTable.TIMES.getName())).longValue()); - - memoryMetric.setTimeBucket(((Number)source.get(MemoryMetricTable.TIME_BUCKET.getName())).longValue()); - return memoryMetric; - } - - @Override protected final XContentBuilder esStreamDataToEsData(MemoryMetric streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(MemoryMetricTable.METRIC_ID.getName(), streamData.getMetricId()) - - .field(MemoryMetricTable.INSTANCE_ID.getName(), streamData.getInstanceId()) - .field(MemoryMetricTable.IS_HEAP.getName(), streamData.getIsHeap()) - .field(MemoryMetricTable.INIT.getName(), streamData.getInit()) - .field(MemoryMetricTable.MAX.getName(), streamData.getMax()) - .field(MemoryMetricTable.USED.getName(), streamData.getUsed()) - .field(MemoryMetricTable.COMMITTED.getName(), streamData.getCommitted()) - .field(MemoryMetricTable.TIMES.getName(), streamData.getTimes()) - .field(MemoryMetricTable.TIME_BUCKET.getName(), streamData.getTimeBucket()) - .endObject(); - } - - @GraphComputingMetric(name = "/persistence/get/" + MemoryMetricTable.TABLE) - @Override public final MemoryMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/memory/MemoryDayMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/memory/MemoryDayMetricEsPersistenceDAO.java deleted file mode 100644 index cd1f110fdd3551ea8f81040e9c3dd057eda7242f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/memory/MemoryDayMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.memory; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class MemoryDayMetricEsPersistenceDAO extends AbstractMemoryMetricEsPersistenceDAO implements IMemoryDayMetricPersistenceDAO { - - public MemoryDayMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/memory/MemoryHourMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/memory/MemoryHourMetricEsPersistenceDAO.java deleted file mode 100644 index 2a8c96708e31290b4c61fc57ecd561960efeba6a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/memory/MemoryHourMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.memory; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class MemoryHourMetricEsPersistenceDAO extends AbstractMemoryMetricEsPersistenceDAO implements IMemoryHourMetricPersistenceDAO { - - public MemoryHourMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/memory/MemoryMinuteMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/memory/MemoryMinuteMetricEsPersistenceDAO.java deleted file mode 100644 index f48f0e4da87076b67401b38498db9b533bf89608..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/memory/MemoryMinuteMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.memory; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class MemoryMinuteMetricEsPersistenceDAO extends AbstractMemoryMetricEsPersistenceDAO implements IMemoryMinuteMetricPersistenceDAO { - - public MemoryMinuteMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/memory/MemoryMonthMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/memory/MemoryMonthMetricEsPersistenceDAO.java deleted file mode 100644 index 8bd53db3b991fdfcce958e2dfb3b25302159e6ac..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/memory/MemoryMonthMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.memory; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class MemoryMonthMetricEsPersistenceDAO extends AbstractMemoryMetricEsPersistenceDAO implements IMemoryMonthMetricPersistenceDAO { - - public MemoryMonthMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/mpool/AbstractMemoryPoolMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/mpool/AbstractMemoryPoolMetricEsPersistenceDAO.java deleted file mode 100644 index 20dd4e9815478c45fb53ba09f2d04014b9bf36c5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/mpool/AbstractMemoryPoolMetricEsPersistenceDAO.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.mpool; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.*; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractMemoryPoolMetricEsPersistenceDAO extends AbstractPersistenceEsDAO { - - AbstractMemoryPoolMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override - protected final String timeBucketColumnNameForDelete() { - return MemoryPoolMetricTable.TIME_BUCKET.getName(); - } - - @Override - protected final MemoryPoolMetric esDataToStreamData(Map source) { - MemoryPoolMetric memoryPoolMetric = new MemoryPoolMetric(); - memoryPoolMetric.setMetricId((String)source.get(MemoryPoolMetricTable.METRIC_ID.getName())); - - memoryPoolMetric.setInstanceId(((Number)source.get(MemoryPoolMetricTable.INSTANCE_ID.getName())).intValue()); - memoryPoolMetric.setPoolType(((Number)source.get(MemoryPoolMetricTable.POOL_TYPE.getName())).intValue()); - - memoryPoolMetric.setInit(((Number)source.get(MemoryPoolMetricTable.INIT.getName())).longValue()); - memoryPoolMetric.setMax(((Number)source.get(MemoryPoolMetricTable.MAX.getName())).longValue()); - memoryPoolMetric.setUsed(((Number)source.get(MemoryPoolMetricTable.USED.getName())).longValue()); - memoryPoolMetric.setCommitted(((Number)source.get(MemoryPoolMetricTable.COMMITTED.getName())).longValue()); - memoryPoolMetric.setTimes(((Number)source.get(MemoryPoolMetricTable.TIMES.getName())).longValue()); - - memoryPoolMetric.setTimeBucket(((Number)source.get(MemoryPoolMetricTable.TIME_BUCKET.getName())).longValue()); - return memoryPoolMetric; - } - - @Override - protected final XContentBuilder esStreamDataToEsData(MemoryPoolMetric streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(MemoryPoolMetricTable.METRIC_ID.getName(), streamData.getMetricId()) - .field(MemoryPoolMetricTable.INSTANCE_ID.getName(), streamData.getInstanceId()) - .field(MemoryPoolMetricTable.POOL_TYPE.getName(), streamData.getPoolType()) - .field(MemoryPoolMetricTable.INIT.getName(), streamData.getInit()) - .field(MemoryPoolMetricTable.MAX.getName(), streamData.getMax()) - .field(MemoryPoolMetricTable.USED.getName(), streamData.getUsed()) - .field(MemoryPoolMetricTable.COMMITTED.getName(), streamData.getCommitted()) - .field(MemoryPoolMetricTable.TIMES.getName(), streamData.getTimes()) - .field(MemoryPoolMetricTable.TIME_BUCKET.getName(), streamData.getTimeBucket()) - .endObject(); - } - - @GraphComputingMetric(name = "/persistence/get/" + MemoryPoolMetricTable.TABLE) - @Override public final MemoryPoolMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/mpool/MemoryPoolDayMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/mpool/MemoryPoolDayMetricEsPersistenceDAO.java deleted file mode 100644 index 30c68c81372068456de44510387ec852a1cfdb0a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/mpool/MemoryPoolDayMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.mpool; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolDayMetricEsPersistenceDAO extends AbstractMemoryPoolMetricEsPersistenceDAO implements IMemoryPoolDayMetricPersistenceDAO { - - public MemoryPoolDayMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/mpool/MemoryPoolHourMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/mpool/MemoryPoolHourMetricEsPersistenceDAO.java deleted file mode 100644 index 430aa05570af090d6427bc6a182555e8c5fb5fc0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/mpool/MemoryPoolHourMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.mpool; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolHourMetricEsPersistenceDAO extends AbstractMemoryPoolMetricEsPersistenceDAO implements IMemoryPoolHourMetricPersistenceDAO { - - public MemoryPoolHourMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/mpool/MemoryPoolMinuteMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/mpool/MemoryPoolMinuteMetricEsPersistenceDAO.java deleted file mode 100644 index 62a8953312c45beb28a7824979b78f9dd6d00956..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/mpool/MemoryPoolMinuteMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.mpool; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolMinuteMetricEsPersistenceDAO extends AbstractMemoryPoolMetricEsPersistenceDAO implements IMemoryPoolMinuteMetricPersistenceDAO { - - public MemoryPoolMinuteMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/mpool/MemoryPoolMonthMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/mpool/MemoryPoolMonthMetricEsPersistenceDAO.java deleted file mode 100644 index d4b5d392942356d9b42d4c491f4a1d232b347fa4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/mpool/MemoryPoolMonthMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.mpool; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolMonthMetricEsPersistenceDAO extends AbstractMemoryPoolMetricEsPersistenceDAO implements IMemoryPoolMonthMetricPersistenceDAO { - - public MemoryPoolMonthMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/register/ApplicationRegisterEsDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/register/ApplicationRegisterEsDAO.java deleted file mode 100644 index 279b8a10193b64634aa382253672197964d1950c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/register/ApplicationRegisterEsDAO.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.register; - -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.storage.dao.register.IApplicationRegisterDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.register.Application; -import org.apache.skywalking.apm.collector.storage.table.register.ApplicationTable; -import org.elasticsearch.action.index.IndexResponse; -import org.elasticsearch.action.support.WriteRequest; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class ApplicationRegisterEsDAO extends EsDAO implements IApplicationRegisterDAO { - - private final Logger logger = LoggerFactory.getLogger(ApplicationRegisterEsDAO.class); - - public ApplicationRegisterEsDAO(ElasticSearchClient client) { - super(client); - } - - @Override public int getMaxApplicationId() { - return getMaxId(ApplicationTable.TABLE, ApplicationTable.APPLICATION_ID.getName()); - } - - @Override public int getMinApplicationId() { - return getMinId(ApplicationTable.TABLE, ApplicationTable.APPLICATION_ID.getName()); - } - - @Override public void save(Application application) { - logger.debug("save application register info, application getApplicationId: {}, application code: {}", application.getId(), application.getApplicationCode()); - ElasticSearchClient client = getClient(); - Map target = new HashMap<>(); - target.put(ApplicationTable.APPLICATION_CODE.getName(), application.getApplicationCode()); - target.put(ApplicationTable.APPLICATION_ID.getName(), application.getApplicationId()); - target.put(ApplicationTable.ADDRESS_ID.getName(), application.getAddressId()); - target.put(ApplicationTable.IS_ADDRESS.getName(), application.getIsAddress()); - - IndexResponse response = client.prepareIndex(ApplicationTable.TABLE, application.getId()).setSource(target).setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE).get(); - logger.debug("save application register info, application getApplicationId: {}, application code: {}, status: {}", application.getApplicationId(), application.getApplicationCode(), response.status().name()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/register/InstanceRegisterEsDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/register/InstanceRegisterEsDAO.java deleted file mode 100644 index 3919fbee8c89b6980802655cc7c414fa9eb6bf64..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/register/InstanceRegisterEsDAO.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.register; - -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.dao.register.IInstanceRegisterDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.register.Instance; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; -import org.elasticsearch.action.index.IndexResponse; -import org.elasticsearch.action.support.WriteRequest; -import org.elasticsearch.action.update.UpdateRequestBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class InstanceRegisterEsDAO extends EsDAO implements IInstanceRegisterDAO { - - private final Logger logger = LoggerFactory.getLogger(InstanceRegisterEsDAO.class); - - public InstanceRegisterEsDAO(ElasticSearchClient client) { - super(client); - } - - @Override - public int getMaxInstanceId() { - return getMaxId(InstanceTable.TABLE, InstanceTable.INSTANCE_ID.getName()); - } - - @Override - public int getMinInstanceId() { - return getMinId(InstanceTable.TABLE, InstanceTable.INSTANCE_ID.getName()); - } - - @Override - public void save(Instance instance) { - logger.debug("save instance register info, application getApplicationId: {}, agentUUID: {}", instance.getApplicationId(), instance.getAgentUUID()); - ElasticSearchClient client = getClient(); - Map target = new HashMap<>(); - target.put(InstanceTable.INSTANCE_ID.getName(), instance.getInstanceId()); - target.put(InstanceTable.APPLICATION_ID.getName(), instance.getApplicationId()); - target.put(InstanceTable.APPLICATION_CODE.getName(), instance.getApplicationCode()); - target.put(InstanceTable.AGENT_UUID.getName(), instance.getAgentUUID()); - target.put(InstanceTable.REGISTER_TIME.getName(), TimeBucketUtils.INSTANCE.getSecondTimeBucket(instance.getRegisterTime())); - target.put(InstanceTable.HEARTBEAT_TIME.getName(), TimeBucketUtils.INSTANCE.getSecondTimeBucket(instance.getHeartBeatTime())); - target.put(InstanceTable.OS_INFO.getName(), instance.getOsInfo()); - target.put(InstanceTable.ADDRESS_ID.getName(), instance.getAddressId()); - target.put(InstanceTable.IS_ADDRESS.getName(), instance.getIsAddress()); - - IndexResponse response = client.prepareIndex(InstanceTable.TABLE, instance.getId()).setSource(target).setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE).get(); - logger.debug("save instance register info, application getApplicationId: {}, agentUUID: {}, status: {}", instance.getApplicationId(), instance.getAgentUUID(), response.status().name()); - } - - @Override - public void updateHeartbeatTime(int instanceId, long heartbeatTime) { - UpdateRequestBuilder updateRequestBuilder = getClient().prepareUpdate(InstanceTable.TABLE, String.valueOf(instanceId)); - updateRequestBuilder.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE); - Map target = new HashMap<>(); - target.put(InstanceTable.HEARTBEAT_TIME.getName(), TimeBucketUtils.INSTANCE.getSecondTimeBucket(heartbeatTime)); - updateRequestBuilder.setDoc(target); - - updateRequestBuilder.get(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/register/NetworkAddressRegisterEsDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/register/NetworkAddressRegisterEsDAO.java deleted file mode 100644 index c2b51639f07fe9e28224053d87c71718d96392ba..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/register/NetworkAddressRegisterEsDAO.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.register; - -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.storage.dao.register.INetworkAddressRegisterDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddress; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddressTable; -import org.elasticsearch.action.index.IndexResponse; -import org.elasticsearch.action.support.WriteRequest; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class NetworkAddressRegisterEsDAO extends EsDAO implements INetworkAddressRegisterDAO { - - private final Logger logger = LoggerFactory.getLogger(NetworkAddressRegisterEsDAO.class); - - public NetworkAddressRegisterEsDAO(ElasticSearchClient client) { - super(client); - } - - @Override public int getMaxNetworkAddressId() { - return getMaxId(NetworkAddressTable.TABLE, NetworkAddressTable.ADDRESS_ID.getName()); - } - - @Override public int getMinNetworkAddressId() { - return getMinId(NetworkAddressTable.TABLE, NetworkAddressTable.ADDRESS_ID.getName()); - } - - @Override public void save(NetworkAddress networkAddress) { - logger.debug("save network address register info, address getApplicationId: {}, network address code: {}", networkAddress.getId(), networkAddress.getNetworkAddress()); - ElasticSearchClient client = getClient(); - Map target = new HashMap<>(); - target.put(NetworkAddressTable.NETWORK_ADDRESS.getName(), networkAddress.getNetworkAddress()); - target.put(NetworkAddressTable.ADDRESS_ID.getName(), networkAddress.getAddressId()); - target.put(NetworkAddressTable.SRC_SPAN_LAYER.getName(), networkAddress.getSrcSpanLayer()); - target.put(NetworkAddressTable.SERVER_TYPE.getName(), networkAddress.getServerType()); - - IndexResponse response = client.prepareIndex(NetworkAddressTable.TABLE, networkAddress.getId()).setSource(target).setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE).get(); - logger.debug("save network address register info, address getApplicationId: {}, network address code: {}, status: {}", networkAddress.getAddressId(), networkAddress.getNetworkAddress(), response.status().name()); - } - - @Override public void update(String id, int spanLayer, int serverType) { - ElasticSearchClient client = getClient(); - - Map target = new HashMap<>(); - target.put(NetworkAddressTable.SRC_SPAN_LAYER.getName(), spanLayer); - target.put(NetworkAddressTable.SERVER_TYPE.getName(), serverType); - client.prepareUpdate(NetworkAddressTable.TABLE, id).setDoc(target).setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE).get(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/register/ServiceNameRegisterEsDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/register/ServiceNameRegisterEsDAO.java deleted file mode 100644 index 4dcde30337a7825c6f732cac3385782c14bfbb2f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/register/ServiceNameRegisterEsDAO.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.register; - -import java.util.*; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.storage.dao.register.IServiceNameRegisterDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.register.*; -import org.elasticsearch.action.index.IndexResponse; -import org.elasticsearch.action.support.WriteRequest; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class ServiceNameRegisterEsDAO extends EsDAO implements IServiceNameRegisterDAO { - - private final Logger logger = LoggerFactory.getLogger(ServiceNameRegisterEsDAO.class); - - public ServiceNameRegisterEsDAO(ElasticSearchClient client) { - super(client); - } - - @Override public int getMaxServiceId() { - return getMaxId(ServiceNameTable.TABLE, ServiceNameTable.SERVICE_ID.getName()); - } - - @Override public int getMinServiceId() { - return getMinId(ServiceNameTable.TABLE, ServiceNameTable.SERVICE_ID.getName()); - } - - @Override public void save(ServiceName serviceName) { - logger.debug("save service name register info, application getApplicationId: {}, service name: {}", serviceName.getId(), serviceName.getServiceName()); - ElasticSearchClient client = getClient(); - Map target = new HashMap<>(); - target.put(ServiceNameTable.SERVICE_ID.getName(), serviceName.getServiceId()); - target.put(ServiceNameTable.APPLICATION_ID.getName(), serviceName.getApplicationId()); - target.put(ServiceNameTable.SERVICE_NAME.getName(), serviceName.getServiceName()); - target.put(ServiceNameTable.SERVICE_NAME_KEYWORD.getName(), serviceName.getServiceName()); - target.put(ServiceNameTable.SRC_SPAN_TYPE.getName(), serviceName.getSrcSpanType()); - target.put(ServiceNameTable.REGISTER_TIME.getName(), serviceName.getRegisterTime()); - target.put(ServiceNameTable.HEARTBEAT_TIME.getName(), serviceName.getHeartBeatTime()); - - IndexResponse response = client.prepareIndex(ServiceNameTable.TABLE, serviceName.getId()).setSource(target).setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE).get(); - logger.debug("save service name register info, application getApplicationId: {}, service name: {}, status: {}", serviceName.getId(), serviceName.getServiceName(), response.status().name()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/rtd/AbstractResponseTimeDistributionEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/rtd/AbstractResponseTimeDistributionEsPersistenceDAO.java deleted file mode 100644 index a37a76d3ec15c61e1e5bd33ee640b8568e6e245c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/rtd/AbstractResponseTimeDistributionEsPersistenceDAO.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.rtd; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.global.*; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractResponseTimeDistributionEsPersistenceDAO extends AbstractPersistenceEsDAO { - - AbstractResponseTimeDistributionEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return ResponseTimeDistributionTable.TIME_BUCKET.getName(); - } - - @Override protected final ResponseTimeDistribution esDataToStreamData(Map source) { - ResponseTimeDistribution responseTimeDistribution = new ResponseTimeDistribution(); - responseTimeDistribution.setMetricId((String)source.get(ResponseTimeDistributionTable.METRIC_ID.getName())); - - responseTimeDistribution.setStep(((Number)source.get(ResponseTimeDistributionTable.STEP.getName())).intValue()); - - responseTimeDistribution.setCalls(((Number)source.get(ResponseTimeDistributionTable.CALLS.getName())).longValue()); - responseTimeDistribution.setErrorCalls(((Number)source.get(ResponseTimeDistributionTable.ERROR_CALLS.getName())).longValue()); - responseTimeDistribution.setSuccessCalls(((Number)source.get(ResponseTimeDistributionTable.SUCCESS_CALLS.getName())).longValue()); - - responseTimeDistribution.setTimeBucket(((Number)source.get(ResponseTimeDistributionTable.TIME_BUCKET.getName())).longValue()); - return responseTimeDistribution; - } - - @Override - protected final XContentBuilder esStreamDataToEsData(ResponseTimeDistribution streamData) throws IOException { - return XContentFactory.jsonBuilder().startObject() - .field(ResponseTimeDistributionTable.METRIC_ID.getName(), streamData.getMetricId()) - - .field(ResponseTimeDistributionTable.STEP.getName(), streamData.getStep()) - - .field(ResponseTimeDistributionTable.CALLS.getName(), streamData.getCalls()) - .field(ResponseTimeDistributionTable.ERROR_CALLS.getName(), streamData.getErrorCalls()) - .field(ResponseTimeDistributionTable.SUCCESS_CALLS.getName(), streamData.getSuccessCalls()) - - .field(ResponseTimeDistributionTable.TIME_BUCKET.getName(), streamData.getTimeBucket()) - .endObject(); - } - - @GraphComputingMetric(name = "/persistence/get/" + ResponseTimeDistributionTable.TABLE) - @Override public final ResponseTimeDistribution get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/rtd/ResponseTimeDistributionDayEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/rtd/ResponseTimeDistributionDayEsPersistenceDAO.java deleted file mode 100644 index d491b4881b725ee5da6e76912b4f3925b60c4b57..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/rtd/ResponseTimeDistributionDayEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.rtd; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionDayEsPersistenceDAO extends AbstractResponseTimeDistributionEsPersistenceDAO implements IResponseTimeDistributionDayPersistenceDAO { - - public ResponseTimeDistributionDayEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/rtd/ResponseTimeDistributionHourEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/rtd/ResponseTimeDistributionHourEsPersistenceDAO.java deleted file mode 100644 index 6a4d3924a1dde146a3d21178eb4af2a23c1d0e7f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/rtd/ResponseTimeDistributionHourEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.rtd; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionHourEsPersistenceDAO extends AbstractResponseTimeDistributionEsPersistenceDAO implements IResponseTimeDistributionHourPersistenceDAO { - - public ResponseTimeDistributionHourEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/rtd/ResponseTimeDistributionMinuteEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/rtd/ResponseTimeDistributionMinuteEsPersistenceDAO.java deleted file mode 100644 index 19f4678d773c2b119533e149f2a3ab63abfdca2f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/rtd/ResponseTimeDistributionMinuteEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.rtd; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionMinuteEsPersistenceDAO extends AbstractResponseTimeDistributionEsPersistenceDAO implements IResponseTimeDistributionMinutePersistenceDAO { - - public ResponseTimeDistributionMinuteEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/rtd/ResponseTimeDistributionMonthEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/rtd/ResponseTimeDistributionMonthEsPersistenceDAO.java deleted file mode 100644 index 335d6c9690cfaa57b08c2ee5391d62371ab58330..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/rtd/ResponseTimeDistributionMonthEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.rtd; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionMonthEsPersistenceDAO extends AbstractResponseTimeDistributionEsPersistenceDAO implements IResponseTimeDistributionMonthPersistenceDAO { - - public ResponseTimeDistributionMonthEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/smp/AbstractServiceMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/smp/AbstractServiceMetricEsPersistenceDAO.java deleted file mode 100644 index b07f6a5e840944196d16f4e55346de92749020b5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/smp/AbstractServiceMetricEsPersistenceDAO.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.smp; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.es.MetricTransformUtil; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.service.*; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractServiceMetricEsPersistenceDAO extends AbstractPersistenceEsDAO { - - AbstractServiceMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return ServiceMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final ServiceMetric esDataToStreamData(Map source) { - ServiceMetric serviceMetric = new ServiceMetric(); - serviceMetric.setMetricId((String)source.get(ServiceMetricTable.METRIC_ID.getName())); - - serviceMetric.setApplicationId(((Number)source.get(ServiceMetricTable.APPLICATION_ID.getName())).intValue()); - serviceMetric.setInstanceId(((Number)source.get(ServiceMetricTable.INSTANCE_ID.getName())).intValue()); - serviceMetric.setServiceId(((Number)source.get(ServiceMetricTable.SERVICE_ID.getName())).intValue()); - - MetricTransformUtil.INSTANCE.esDataToStreamData(source, serviceMetric); - - return serviceMetric; - } - - @Override protected final XContentBuilder esStreamDataToEsData(ServiceMetric streamData) throws IOException { - XContentBuilder target = XContentFactory.jsonBuilder().startObject() - .field(ServiceMetricTable.METRIC_ID.getName(), streamData.getMetricId()) - - .field(ServiceMetricTable.APPLICATION_ID.getName(), streamData.getApplicationId()) - .field(ServiceMetricTable.INSTANCE_ID.getName(), streamData.getInstanceId()) - .field(ServiceMetricTable.SERVICE_ID.getName(), streamData.getServiceId()); - - MetricTransformUtil.INSTANCE.esStreamDataToEsData(streamData, target); - - target.endObject(); - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + ServiceMetricTable.TABLE) - @Override public final ServiceMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/smp/ServiceDayMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/smp/ServiceDayMetricEsPersistenceDAO.java deleted file mode 100644 index 65213117e0a406c2f37e461730072b3adc628247..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/smp/ServiceDayMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.smp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ServiceDayMetricEsPersistenceDAO extends AbstractServiceMetricEsPersistenceDAO implements IServiceDayMetricPersistenceDAO { - - public ServiceDayMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/smp/ServiceHourMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/smp/ServiceHourMetricEsPersistenceDAO.java deleted file mode 100644 index 8ad29c970d0582d72a37fb7d99447b585039a2ca..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/smp/ServiceHourMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.smp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ServiceHourMetricEsPersistenceDAO extends AbstractServiceMetricEsPersistenceDAO implements IServiceHourMetricPersistenceDAO { - - public ServiceHourMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/smp/ServiceMinuteMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/smp/ServiceMinuteMetricEsPersistenceDAO.java deleted file mode 100644 index 13b3079d0d240983e52b31bd2dfed181c7c04998..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/smp/ServiceMinuteMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.smp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ServiceMinuteMetricEsPersistenceDAO extends AbstractServiceMetricEsPersistenceDAO implements IServiceMinuteMetricPersistenceDAO { - - public ServiceMinuteMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/smp/ServiceMonthMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/smp/ServiceMonthMetricEsPersistenceDAO.java deleted file mode 100644 index d94cce29d8193ebe379f8629547ba6e11edeaae2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/smp/ServiceMonthMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.smp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ServiceMonthMetricEsPersistenceDAO extends AbstractServiceMetricEsPersistenceDAO implements IServiceMonthMetricPersistenceDAO { - - public ServiceMonthMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/srmp/AbstractServiceReferenceMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/srmp/AbstractServiceReferenceMetricEsPersistenceDAO.java deleted file mode 100644 index 1d9078a70081dbd768c35242e6174361e5d19a9b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/srmp/AbstractServiceReferenceMetricEsPersistenceDAO.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.srmp; - -import java.io.IOException; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.es.MetricTransformUtil; -import org.apache.skywalking.apm.collector.storage.es.base.dao.AbstractPersistenceEsDAO; -import org.apache.skywalking.apm.collector.storage.table.service.*; -import org.elasticsearch.common.xcontent.*; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractServiceReferenceMetricEsPersistenceDAO extends AbstractPersistenceEsDAO { - - AbstractServiceReferenceMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return ServiceReferenceMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final ServiceReferenceMetric esDataToStreamData(Map source) { - ServiceReferenceMetric serviceReferenceMetric = new ServiceReferenceMetric(); - serviceReferenceMetric.setMetricId((String)source.get(ServiceReferenceMetricTable.METRIC_ID.getName())); - - serviceReferenceMetric.setFrontApplicationId(((Number)source.get(ServiceReferenceMetricTable.FRONT_APPLICATION_ID.getName())).intValue()); - serviceReferenceMetric.setBehindApplicationId(((Number)source.get(ServiceReferenceMetricTable.BEHIND_APPLICATION_ID.getName())).intValue()); - serviceReferenceMetric.setFrontInstanceId(((Number)source.get(ServiceReferenceMetricTable.FRONT_INSTANCE_ID.getName())).intValue()); - serviceReferenceMetric.setBehindInstanceId(((Number)source.get(ServiceReferenceMetricTable.BEHIND_INSTANCE_ID.getName())).intValue()); - serviceReferenceMetric.setFrontServiceId(((Number)source.get(ServiceReferenceMetricTable.FRONT_SERVICE_ID.getName())).intValue()); - serviceReferenceMetric.setBehindServiceId(((Number)source.get(ServiceReferenceMetricTable.BEHIND_SERVICE_ID.getName())).intValue()); - - MetricTransformUtil.INSTANCE.esDataToStreamData(source, serviceReferenceMetric); - - return serviceReferenceMetric; - } - - @Override - protected final XContentBuilder esStreamDataToEsData(ServiceReferenceMetric streamData) throws IOException { - XContentBuilder target = XContentFactory.jsonBuilder().startObject() - .field(ServiceReferenceMetricTable.METRIC_ID.getName(), streamData.getMetricId()) - .field(ServiceReferenceMetricTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()) - .field(ServiceReferenceMetricTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()) - .field(ServiceReferenceMetricTable.FRONT_INSTANCE_ID.getName(), streamData.getFrontInstanceId()) - .field(ServiceReferenceMetricTable.BEHIND_INSTANCE_ID.getName(), streamData.getBehindInstanceId()) - .field(ServiceReferenceMetricTable.FRONT_SERVICE_ID.getName(), streamData.getFrontServiceId()) - .field(ServiceReferenceMetricTable.BEHIND_SERVICE_ID.getName(), streamData.getBehindServiceId()); - - MetricTransformUtil.INSTANCE.esStreamDataToEsData(streamData, target); - - target.endObject(); - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + ServiceReferenceMetricTable.TABLE) - @Override public final ServiceReferenceMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/srmp/ServiceReferenceDayMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/srmp/ServiceReferenceDayMetricEsPersistenceDAO.java deleted file mode 100644 index 262d362a5bf862a38e28156ec579d2c1db1cc798..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/srmp/ServiceReferenceDayMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.srmp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceDayMetricEsPersistenceDAO extends AbstractServiceReferenceMetricEsPersistenceDAO implements IServiceReferenceDayMetricPersistenceDAO { - - public ServiceReferenceDayMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override public String tableName() { - return ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/srmp/ServiceReferenceHourMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/srmp/ServiceReferenceHourMetricEsPersistenceDAO.java deleted file mode 100644 index 2a71ca02e70b23c7d431029cdafc1ebd7365bc6d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/srmp/ServiceReferenceHourMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.srmp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceHourMetricEsPersistenceDAO extends AbstractServiceReferenceMetricEsPersistenceDAO implements IServiceReferenceHourMetricPersistenceDAO { - - public ServiceReferenceHourMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override public String tableName() { - return ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/srmp/ServiceReferenceMinuteMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/srmp/ServiceReferenceMinuteMetricEsPersistenceDAO.java deleted file mode 100644 index f0de6b14c52a3130b58cc1da79b97fce6ba77dbe..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/srmp/ServiceReferenceMinuteMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.srmp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMinuteMetricEsPersistenceDAO extends AbstractServiceReferenceMetricEsPersistenceDAO implements IServiceReferenceMinuteMetricPersistenceDAO { - - public ServiceReferenceMinuteMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override public String tableName() { - return ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/srmp/ServiceReferenceMonthMetricEsPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/srmp/ServiceReferenceMonthMetricEsPersistenceDAO.java deleted file mode 100644 index 74d64a6836339a0ba55d166c663db4177aca7938..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/srmp/ServiceReferenceMonthMetricEsPersistenceDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.srmp; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; -import org.elasticsearch.action.index.IndexRequestBuilder; -import org.elasticsearch.action.update.UpdateRequestBuilder; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMonthMetricEsPersistenceDAO extends AbstractServiceReferenceMetricEsPersistenceDAO implements IServiceReferenceMonthMetricPersistenceDAO { - - public ServiceReferenceMonthMetricEsPersistenceDAO(ElasticSearchClient client) { - super(client); - } - - @Override public String tableName() { - return ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationAlarmEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationAlarmEsUIDAO.java deleted file mode 100644 index 46632cf528137ece55ecb9cff863ef71f5ae472f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationAlarmEsUIDAO.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import java.text.ParseException; -import java.util.List; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.util.*; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationAlarmUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmTable; -import org.apache.skywalking.apm.collector.storage.ui.alarm.*; -import org.elasticsearch.action.search.*; -import org.elasticsearch.index.query.*; -import org.elasticsearch.search.SearchHit; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmEsUIDAO extends EsDAO implements IApplicationAlarmUIDAO { - - public ApplicationAlarmEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override - public Alarm loadAlarmList(String keyword, List applicationIds, long startTimeBucket, long endTimeBucket, - int limit, int from) throws ParseException { - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(ApplicationAlarmTable.TABLE); - searchRequestBuilder.setTypes(ApplicationAlarmTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - boolQueryBuilder.must().add(QueryBuilders.rangeQuery(ApplicationAlarmTable.LAST_TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket)); - if (StringUtils.isNotEmpty(keyword)) { - boolQueryBuilder.must().add(QueryBuilders.matchQuery(ApplicationAlarmTable.ALARM_CONTENT.getName(), keyword)); - } - if (CollectionUtils.isNotEmpty(applicationIds)) { - boolQueryBuilder.must().add(QueryBuilders.termsQuery(ApplicationAlarmTable.APPLICATION_ID.getName(), applicationIds)); - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - searchRequestBuilder.setSize(limit); - searchRequestBuilder.setFrom(from); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - SearchHit[] searchHits = searchResponse.getHits().getHits(); - - Alarm alarm = new Alarm(); - alarm.setTotal((int)searchResponse.getHits().getTotalHits()); - for (SearchHit searchHit : searchHits) { - AlarmItem alarmItem = new AlarmItem(); - alarmItem.setId(((Number)searchHit.getSource().get(ApplicationAlarmTable.APPLICATION_ID.getName())).intValue()); - alarmItem.setContent((String)searchHit.getSource().get(ApplicationAlarmTable.ALARM_CONTENT.getName())); - - long lastTimeBucket = ((Number)searchHit.getSource().get(ApplicationAlarmTable.LAST_TIME_BUCKET.getName())).longValue(); - alarmItem.setStartTime(TimeBucketUtils.INSTANCE.formatMinuteTimeBucket(lastTimeBucket)); - alarmItem.setAlarmType(AlarmType.APPLICATION); - - int alarmType = ((Number)searchHit.getSource().get(ApplicationAlarmTable.ALARM_TYPE.getName())).intValue(); - if (org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType.SLOW_RTT.getValue() == alarmType) { - alarmItem.setCauseType(CauseType.SLOW_RESPONSE); - } else if (org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType.ERROR_RATE.getValue() == alarmType) { - alarmItem.setCauseType(CauseType.LOW_SUCCESS_RATE); - } - - alarm.getItems().add(alarmItem); - } - return alarm; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationAlarmListEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationAlarmListEsUIDAO.java deleted file mode 100644 index befba896a309d411f9cd81b0416f72b7e642991b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationAlarmListEsUIDAO.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import java.util.LinkedList; -import java.util.List; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationAlarmListUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.search.SearchType; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.aggregations.AggregationBuilders; -import org.elasticsearch.search.aggregations.bucket.terms.Terms; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmListEsUIDAO extends EsDAO implements IApplicationAlarmListUIDAO { - - public ApplicationAlarmListEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override public List getAlarmedApplicationNum(Step step, long startTimeBucket, long endTimeBucket) { - String tableName = TimePyramidTableNameBuilder.build(step, ApplicationAlarmListTable.TABLE); - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(tableName); - searchRequestBuilder.setTypes(ApplicationAlarmListTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - searchRequestBuilder.setQuery(QueryBuilders.rangeQuery(ApplicationAlarmListTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket)); - searchRequestBuilder.setSize(0); - - searchRequestBuilder.addAggregation(AggregationBuilders.terms(ApplicationAlarmListTable.TIME_BUCKET.getName()).field(ApplicationAlarmListTable.TIME_BUCKET.getName()).size(100) - .subAggregation(AggregationBuilders.terms(ApplicationAlarmListTable.APPLICATION_ID.getName()).field(ApplicationAlarmListTable.APPLICATION_ID.getName()).size(100))); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - - Terms timeBucketTerms = searchResponse.getAggregations().get(ApplicationAlarmListTable.TIME_BUCKET.getName()); - - List alarmTrends = new LinkedList<>(); - for (Terms.Bucket timeBucketBucket : timeBucketTerms.getBuckets()) { - Terms applicationBucketTerms = timeBucketBucket.getAggregations().get(ApplicationAlarmListTable.APPLICATION_ID.getName()); - - AlarmTrend alarmTrend = new AlarmTrend(); - alarmTrend.setNumberOfApplication(applicationBucketTerms.getBuckets().size()); - alarmTrend.setTimeBucket(timeBucketBucket.getKeyAsNumber().longValue()); - alarmTrends.add(alarmTrend); - } - - return alarmTrends; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationComponentEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationComponentEsUIDAO.java deleted file mode 100644 index 93ee0425c2fb95c2896eefea06d01844e54daa96..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationComponentEsUIDAO.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import java.util.LinkedList; -import java.util.List; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationComponentUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.search.SearchType; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.aggregations.AggregationBuilders; -import org.elasticsearch.search.aggregations.bucket.terms.Terms; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentEsUIDAO extends EsDAO implements IApplicationComponentUIDAO { - - private final Logger logger = LoggerFactory.getLogger(ApplicationComponentEsUIDAO.class); - - public ApplicationComponentEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override public List load(Step step, long startTimeBucket, long endTimeBucket) { - logger.debug("application component load, start time: {}, end time: {}", startTimeBucket, endTimeBucket); - String tableName = TimePyramidTableNameBuilder.build(step, ApplicationComponentTable.TABLE); - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(tableName); - searchRequestBuilder.setTypes(ApplicationComponentTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - searchRequestBuilder.setQuery(QueryBuilders.rangeQuery(ApplicationComponentTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket)); - searchRequestBuilder.setSize(0); - - searchRequestBuilder.addAggregation(AggregationBuilders.terms(ApplicationComponentTable.COMPONENT_ID.getName()).field(ApplicationComponentTable.COMPONENT_ID.getName()).size(100) - .subAggregation(AggregationBuilders.terms(ApplicationComponentTable.APPLICATION_ID.getName()).field(ApplicationComponentTable.APPLICATION_ID.getName()).size(100))); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - - Terms componentIdTerms = searchResponse.getAggregations().get(ApplicationComponentTable.COMPONENT_ID.getName()); - - List applicationComponents = new LinkedList<>(); - for (Terms.Bucket componentIdBucket : componentIdTerms.getBuckets()) { - int componentId = componentIdBucket.getKeyAsNumber().intValue(); - buildApplicationComponents(componentIdBucket, componentId, applicationComponents); - } - - return applicationComponents; - } - - private void buildApplicationComponents(Terms.Bucket componentBucket, int componentId, - List applicationComponents) { - Terms peerIdTerms = componentBucket.getAggregations().get(ApplicationComponentTable.APPLICATION_ID.getName()); - for (Terms.Bucket peerIdBucket : peerIdTerms.getBuckets()) { - int applicationId = peerIdBucket.getKeyAsNumber().intValue(); - - ApplicationComponent applicationComponent = new ApplicationComponent(); - applicationComponent.setComponentId(componentId); - applicationComponent.setApplicationId(applicationId); - applicationComponents.add(applicationComponent); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationMappingEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationMappingEsUIDAO.java deleted file mode 100644 index 4164474588ba8f917d507aa8ad5c9d74d6a739dc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationMappingEsUIDAO.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import java.util.LinkedList; -import java.util.List; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMappingUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.search.SearchType; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.aggregations.AggregationBuilders; -import org.elasticsearch.search.aggregations.bucket.terms.Terms; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingEsUIDAO extends EsDAO implements IApplicationMappingUIDAO { - - private final Logger logger = LoggerFactory.getLogger(ApplicationMappingEsUIDAO.class); - - public ApplicationMappingEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override public List load(Step step, long startTimeBucket, long endTimeBucket) { - String tableName = TimePyramidTableNameBuilder.build(step, ApplicationMappingTable.TABLE); - - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(tableName); - searchRequestBuilder.setTypes(ApplicationMappingTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - searchRequestBuilder.setQuery(QueryBuilders.rangeQuery(ApplicationMappingTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket)); - searchRequestBuilder.setSize(0); - - searchRequestBuilder.addAggregation( - AggregationBuilders.terms(ApplicationMappingTable.APPLICATION_ID.getName()).field(ApplicationMappingTable.APPLICATION_ID.getName()).size(100) - .subAggregation(AggregationBuilders.terms(ApplicationMappingTable.MAPPING_APPLICATION_ID.getName()).field(ApplicationMappingTable.MAPPING_APPLICATION_ID.getName()).size(100))); - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - - Terms applicationIdTerms = searchResponse.getAggregations().get(ApplicationMappingTable.APPLICATION_ID.getName()); - - List applicationMappings = new LinkedList<>(); - for (Terms.Bucket applicationIdBucket : applicationIdTerms.getBuckets()) { - int applicationId = applicationIdBucket.getKeyAsNumber().intValue(); - Terms mappingApplicationIdTerms = applicationIdBucket.getAggregations().get(ApplicationMappingTable.MAPPING_APPLICATION_ID.getName()); - for (Terms.Bucket mappingApplicationIdBucket : mappingApplicationIdTerms.getBuckets()) { - int mappingApplicationId = mappingApplicationIdBucket.getKeyAsNumber().intValue(); - - ApplicationMapping applicationMapping = new ApplicationMapping(); - applicationMapping.setApplicationId(applicationId); - applicationMapping.setMappingApplicationId(mappingApplicationId); - applicationMappings.add(applicationMapping); - } - } - logger.debug("application mapping data: {}", applicationMappings.toString()); - return applicationMappings; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationMetricEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationMetricEsUIDAO.java deleted file mode 100644 index 8eb4418f05992d299f1896ace85f54b8f1a69766..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationMetricEsUIDAO.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import java.util.*; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.ui.overview.ApplicationThroughput; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.elasticsearch.action.search.*; -import org.elasticsearch.index.query.*; -import org.elasticsearch.search.aggregations.AggregationBuilders; -import org.elasticsearch.search.aggregations.bucket.terms.*; -import org.elasticsearch.search.aggregations.metrics.sum.Sum; - -/** - * @author peng-yongsheng - */ -public class ApplicationMetricEsUIDAO extends EsDAO implements IApplicationMetricUIDAO { - - public ApplicationMetricEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override - public List getTopNApplicationThroughput(Step step, long startTimeBucket, long endTimeBucket, - int minutesBetween, int topN, MetricSource metricSource) { - String tableName = TimePyramidTableNameBuilder.build(step, ApplicationMetricTable.TABLE); - - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(tableName); - searchRequestBuilder.setTypes(ApplicationMetricTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - - BoolQueryBuilder boolQuery = QueryBuilders.boolQuery(); - boolQuery.must().add(QueryBuilders.rangeQuery(ApplicationMetricTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket)); - boolQuery.must().add(QueryBuilders.termQuery(ApplicationMetricTable.SOURCE_VALUE.getName(), metricSource.getValue())); - - searchRequestBuilder.setQuery(boolQuery); - searchRequestBuilder.setSize(0); - - TermsAggregationBuilder aggregationBuilder = AggregationBuilders.terms(ApplicationMetricTable.APPLICATION_ID.getName()).field(ApplicationMetricTable.APPLICATION_ID.getName()).size(2000); - aggregationBuilder.subAggregation(AggregationBuilders.sum(ApplicationMetricTable.TRANSACTION_CALLS.getName()).field(ApplicationMetricTable.TRANSACTION_CALLS.getName())); - searchRequestBuilder.addAggregation(aggregationBuilder); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - - List applicationThroughputList = new LinkedList<>(); - Terms applicationIdTerms = searchResponse.getAggregations().get(ApplicationMetricTable.APPLICATION_ID.getName()); - applicationIdTerms.getBuckets().forEach(applicationIdTerm -> { - int applicationId = applicationIdTerm.getKeyAsNumber().intValue(); - Sum callSum = applicationIdTerm.getAggregations().get(ApplicationMetricTable.TRANSACTION_CALLS.getName()); - long calls = (long)callSum.getValue(); - int callsPerMinute = (int)(minutesBetween == 0 ? 0 : calls / minutesBetween); - - ApplicationThroughput applicationThroughput = new ApplicationThroughput(); - applicationThroughput.setApplicationId(applicationId); - applicationThroughput.setCpm(callsPerMinute); - applicationThroughputList.add(applicationThroughput); - }); - - applicationThroughputList.sort((first, second) -> Integer.compare(second.getCpm(), first.getCpm())); - - if (applicationThroughputList.size() <= topN) { - return applicationThroughputList; - } else { - List newCollection = new LinkedList<>(); - for (int i = 0; i < topN; i++) { - newCollection.add(applicationThroughputList.get(i)); - } - return newCollection; - } - } - - @Override - public List getApplications(Step step, long startTimeBucket, long endTimeBucket, - MetricSource metricSource) { - String tableName = TimePyramidTableNameBuilder.build(step, ApplicationMetricTable.TABLE); - - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(tableName); - searchRequestBuilder.setTypes(ApplicationMetricTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - - BoolQueryBuilder boolQuery = QueryBuilders.boolQuery(); - boolQuery.filter().add(QueryBuilders.rangeQuery(ApplicationMetricTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket)); - boolQuery.filter().add(QueryBuilders.termQuery(ApplicationMetricTable.SOURCE_VALUE.getName(), metricSource.getValue())); - - searchRequestBuilder.setQuery(boolQuery); - searchRequestBuilder.setSize(0); - - TermsAggregationBuilder aggregationBuilder = AggregationBuilders.terms(ApplicationMetricTable.APPLICATION_ID.getName()).field(ApplicationMetricTable.APPLICATION_ID.getName()).size(100); - aggregationBuilder.subAggregation(AggregationBuilders.sum(ApplicationMetricTable.TRANSACTION_CALLS.getName()).field(ApplicationMetricTable.TRANSACTION_CALLS.getName())); - aggregationBuilder.subAggregation(AggregationBuilders.sum(ApplicationMetricTable.TRANSACTION_ERROR_CALLS.getName()).field(ApplicationMetricTable.TRANSACTION_ERROR_CALLS.getName())); - aggregationBuilder.subAggregation(AggregationBuilders.sum(ApplicationMetricTable.TRANSACTION_DURATION_SUM.getName()).field(ApplicationMetricTable.TRANSACTION_DURATION_SUM.getName())); - aggregationBuilder.subAggregation(AggregationBuilders.sum(ApplicationMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName()).field(ApplicationMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName())); - aggregationBuilder.subAggregation(AggregationBuilders.sum(ApplicationMetricTable.SATISFIED_COUNT.getName()).field(ApplicationMetricTable.SATISFIED_COUNT.getName())); - aggregationBuilder.subAggregation(AggregationBuilders.sum(ApplicationMetricTable.TOLERATING_COUNT.getName()).field(ApplicationMetricTable.TOLERATING_COUNT.getName())); - aggregationBuilder.subAggregation(AggregationBuilders.sum(ApplicationMetricTable.FRUSTRATED_COUNT.getName()).field(ApplicationMetricTable.FRUSTRATED_COUNT.getName())); - - searchRequestBuilder.addAggregation(aggregationBuilder); - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - - List applicationMetrics = new LinkedList<>(); - Terms applicationIdTerms = searchResponse.getAggregations().get(ApplicationMetricTable.APPLICATION_ID.getName()); - applicationIdTerms.getBuckets().forEach(applicationIdTerm -> { - int applicationId = applicationIdTerm.getKeyAsNumber().intValue(); - - Sum calls = applicationIdTerm.getAggregations().get(ApplicationMetricTable.TRANSACTION_CALLS.getName()); - Sum errorCalls = applicationIdTerm.getAggregations().get(ApplicationMetricTable.TRANSACTION_ERROR_CALLS.getName()); - Sum durations = applicationIdTerm.getAggregations().get(ApplicationMetricTable.TRANSACTION_DURATION_SUM.getName()); - Sum errorDurations = applicationIdTerm.getAggregations().get(ApplicationMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName()); - Sum satisfiedCount = applicationIdTerm.getAggregations().get(ApplicationMetricTable.SATISFIED_COUNT.getName()); - Sum toleratingCount = applicationIdTerm.getAggregations().get(ApplicationMetricTable.TOLERATING_COUNT.getName()); - Sum frustratedCount = applicationIdTerm.getAggregations().get(ApplicationMetricTable.FRUSTRATED_COUNT.getName()); - - ApplicationMetric applicationMetric = new ApplicationMetric(); - applicationMetric.setId(applicationId); - applicationMetric.setCalls((long)calls.getValue()); - applicationMetric.setErrorCalls((long)errorCalls.getValue()); - applicationMetric.setDurations((long)durations.getValue()); - applicationMetric.setErrorDurations((long)errorDurations.getValue()); - applicationMetric.setSatisfiedCount((long)satisfiedCount.getValue()); - applicationMetric.setToleratingCount((long)toleratingCount.getValue()); - applicationMetric.setToleratingCount((long)frustratedCount.getValue()); - applicationMetrics.add(applicationMetric); - }); - return applicationMetrics; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationReferenceMetricEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationReferenceMetricEsUIDAO.java deleted file mode 100644 index 545ca0ac53329cc6bb4f1f8caebc99c9110911da..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationReferenceMetricEsUIDAO.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import java.util.LinkedList; -import java.util.List; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.util.CollectionUtils; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationReferenceMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.search.SearchType; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.aggregations.AggregationBuilders; -import org.elasticsearch.search.aggregations.bucket.terms.Terms; -import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; -import org.elasticsearch.search.aggregations.metrics.sum.Sum; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMetricEsUIDAO extends EsDAO implements IApplicationReferenceMetricUIDAO { - - public ApplicationReferenceMetricEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override public List getReferences(Step step, long startTimeBucket, long endTimeBucket, - MetricSource metricSource, Integer... applicationIds) { - String tableName = TimePyramidTableNameBuilder.build(step, ApplicationReferenceMetricTable.TABLE); - - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(tableName); - searchRequestBuilder.setTypes(ApplicationReferenceMetricTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - - BoolQueryBuilder boolQuery = QueryBuilders.boolQuery(); - boolQuery.filter().add(QueryBuilders.rangeQuery(ApplicationReferenceMetricTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket)); - boolQuery.filter().add(QueryBuilders.termQuery(ApplicationReferenceMetricTable.SOURCE_VALUE.getName(), metricSource.getValue())); - - if (CollectionUtils.isNotEmpty(applicationIds)) { - BoolQueryBuilder applicationBoolQuery = QueryBuilders.boolQuery(); - int[] ids = new int[applicationIds.length]; - for (int i = 0; i < applicationIds.length; i++) { - ids[i] = applicationIds[i]; - } - - applicationBoolQuery.should().add(QueryBuilders.termsQuery(ApplicationReferenceMetricTable.FRONT_APPLICATION_ID.getName(), ids)); - applicationBoolQuery.should().add(QueryBuilders.termsQuery(ApplicationReferenceMetricTable.BEHIND_APPLICATION_ID.getName(), ids)); - boolQuery.must().add(applicationBoolQuery); - } - - searchRequestBuilder.setQuery(boolQuery); - searchRequestBuilder.setSize(0); - - return buildMetrics(searchRequestBuilder); - } - - private List buildMetrics(SearchRequestBuilder searchRequestBuilder) { - TermsAggregationBuilder frontAggregationBuilder = AggregationBuilders.terms(ApplicationReferenceMetricTable.FRONT_APPLICATION_ID.getName()).field(ApplicationReferenceMetricTable.FRONT_APPLICATION_ID.getName()).size(100); - TermsAggregationBuilder behindAggregationBuilder = AggregationBuilders.terms(ApplicationReferenceMetricTable.BEHIND_APPLICATION_ID.getName()).field(ApplicationReferenceMetricTable.BEHIND_APPLICATION_ID.getName()).size(100); - frontAggregationBuilder.subAggregation(behindAggregationBuilder); - - behindAggregationBuilder.subAggregation(AggregationBuilders.sum(ApplicationReferenceMetricTable.TRANSACTION_CALLS.getName()).field(ApplicationReferenceMetricTable.TRANSACTION_CALLS.getName())); - behindAggregationBuilder.subAggregation(AggregationBuilders.sum(ApplicationReferenceMetricTable.TRANSACTION_ERROR_CALLS.getName()).field(ApplicationReferenceMetricTable.TRANSACTION_ERROR_CALLS.getName())); - behindAggregationBuilder.subAggregation(AggregationBuilders.sum(ApplicationReferenceMetricTable.TRANSACTION_DURATION_SUM.getName()).field(ApplicationReferenceMetricTable.TRANSACTION_DURATION_SUM.getName())); - behindAggregationBuilder.subAggregation(AggregationBuilders.sum(ApplicationReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName()).field(ApplicationReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName())); - - searchRequestBuilder.addAggregation(frontAggregationBuilder); - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - List referenceMetrics = new LinkedList<>(); - Terms sourceApplicationIdTerms = searchResponse.getAggregations().get(ApplicationReferenceMetricTable.FRONT_APPLICATION_ID.getName()); - for (Terms.Bucket sourceApplicationIdBucket : sourceApplicationIdTerms.getBuckets()) { - int sourceApplicationId = sourceApplicationIdBucket.getKeyAsNumber().intValue(); - - Terms targetApplicationIdTerms = sourceApplicationIdBucket.getAggregations().get(ApplicationReferenceMetricTable.BEHIND_APPLICATION_ID.getName()); - for (Terms.Bucket targetApplicationIdBucket : targetApplicationIdTerms.getBuckets()) { - int targetApplicationId = targetApplicationIdBucket.getKeyAsNumber().intValue(); - - Sum calls = targetApplicationIdBucket.getAggregations().get(ApplicationReferenceMetricTable.TRANSACTION_CALLS.getName()); - Sum errorCalls = targetApplicationIdBucket.getAggregations().get(ApplicationReferenceMetricTable.TRANSACTION_ERROR_CALLS.getName()); - Sum durations = targetApplicationIdBucket.getAggregations().get(ApplicationReferenceMetricTable.TRANSACTION_DURATION_SUM.getName()); - Sum errorDurations = targetApplicationIdBucket.getAggregations().get(ApplicationReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName()); - - ApplicationReferenceMetric referenceMetric = new ApplicationReferenceMetric(); - referenceMetric.setSource(sourceApplicationId); - referenceMetric.setTarget(targetApplicationId); - referenceMetric.setCalls((long)calls.getValue()); - referenceMetric.setErrorCalls((long)errorCalls.getValue()); - referenceMetric.setDurations((long)durations.getValue()); - referenceMetric.setErrorDurations((long)errorDurations.getValue()); - referenceMetrics.add(referenceMetric); - } - } - - return referenceMetrics; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/CpuMetricEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/CpuMetricEsUIDAO.java deleted file mode 100644 index 84b6ad057ce5e7dfb805fd8b4448b562b35b9aa2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/CpuMetricEsUIDAO.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.ui.ICpuMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.elasticsearch.action.get.MultiGetItemResponse; -import org.elasticsearch.action.get.MultiGetRequestBuilder; -import org.elasticsearch.action.get.MultiGetResponse; - -import java.util.LinkedList; -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class CpuMetricEsUIDAO extends EsDAO implements ICpuMetricUIDAO { - - public CpuMetricEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override - public List getCPUTrend(int instanceId, Step step, List durationPoints) { - String tableName = TimePyramidTableNameBuilder.build(step, CpuMetricTable.TABLE); - - MultiGetRequestBuilder prepareMultiGet = getClient().prepareMultiGet(durationPoints, new ElasticSearchClient.MultiGetRowHandler() { - @Override - public void accept(DurationPoint durationPoint) { - String id = durationPoint.getPoint() + Const.ID_SPLIT + instanceId; - this.add(tableName, CpuMetricTable.TABLE_TYPE, id); - } - }); - - - List cpuTrends = new LinkedList<>(); - MultiGetResponse multiGetResponse = prepareMultiGet.get(); - for (MultiGetItemResponse response : multiGetResponse.getResponses()) { - if (response.getResponse().isExists()) { - double cpuUsed = ((Number) response.getResponse().getSource().get(CpuMetricTable.USAGE_PERCENT.getName())).doubleValue(); - long times = ((Number) response.getResponse().getSource().get(CpuMetricTable.TIMES.getName())).longValue(); - cpuTrends.add((int) ((cpuUsed / times) * 100)); - } else { - cpuTrends.add(0); - } - } - return cpuTrends; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/GCMetricEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/GCMetricEsUIDAO.java deleted file mode 100644 index 64a72ee53b927527b4ecc6d24dafd8740e193eb0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/GCMetricEsUIDAO.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import java.util.*; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.ui.IGCMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.*; -import org.apache.skywalking.apm.network.language.agent.GCPhrase; -import org.elasticsearch.action.get.*; - -/** - * @author peng-yongsheng - */ -public class GCMetricEsUIDAO extends EsDAO implements IGCMetricUIDAO { - - public GCMetricEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override - public List getYoungGCTrend(int instanceId, Step step, List durationPoints) { - return getGCTrend(instanceId, step, durationPoints, GCPhrase.NEW_VALUE); - } - - @Override - public List getOldGCTrend(int instanceId, Step step, List durationPoints) { - return getGCTrend(instanceId, step, durationPoints, GCPhrase.OLD_VALUE); - } - - private List getGCTrend(int instanceId, Step step, List durationPoints, int gcPhrase) { - String tableName = TimePyramidTableNameBuilder.build(step, GCMetricTable.TABLE); - - MultiGetRequestBuilder youngPrepareMultiGet = getClient().prepareMultiGet(durationPoints, new ElasticSearchClient.MultiGetRowHandler() { - @Override - public void accept(DurationPoint durationPoint) { - String id = durationPoint.getPoint() + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + gcPhrase; - add(tableName, GCMetricTable.TABLE_TYPE, id); - } - }); - - List gcTrends = new LinkedList<>(); - MultiGetResponse multiGetResponse = youngPrepareMultiGet.get(); - for (MultiGetItemResponse itemResponse : multiGetResponse.getResponses()) { - if (itemResponse.getResponse().isExists()) { - long count = ((Number)itemResponse.getResponse().getSource().get(GCMetricTable.COUNT.getName())).longValue(); - long duration = ((Number)itemResponse.getResponse().getSource().get(GCMetricTable.DURATION.getName())).longValue(); - long times = ((Number)itemResponse.getResponse().getSource().get(GCMetricTable.TIMES.getName())).intValue(); - gcTrends.add(new Trend((int)count, (int)(duration / times))); - } else { - gcTrends.add(new Trend(0, 0)); - } - } - - return gcTrends; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/GlobalTraceEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/GlobalTraceEsUIDAO.java deleted file mode 100644 index 81b980e13416bab4d6d4dda2b9d987307ffc0dcb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/GlobalTraceEsUIDAO.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import java.util.ArrayList; -import java.util.List; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.storage.dao.ui.IGlobalTraceUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.global.GlobalTraceTable; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.search.SearchType; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.SearchHit; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class GlobalTraceEsUIDAO extends EsDAO implements IGlobalTraceUIDAO { - - private final Logger logger = LoggerFactory.getLogger(GlobalTraceEsUIDAO.class); - - public GlobalTraceEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override public List getGlobalTraceId(String segmentId) { - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(GlobalTraceTable.TABLE); - searchRequestBuilder.setTypes(GlobalTraceTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - searchRequestBuilder.setQuery(QueryBuilders.termQuery(GlobalTraceTable.SEGMENT_ID.getName(), segmentId)); - searchRequestBuilder.setSize(10); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - - List globalTraceIds = new ArrayList<>(); - SearchHit[] searchHits = searchResponse.getHits().getHits(); - for (SearchHit searchHit : searchHits) { - String globalTraceId = (String)searchHit.getSource().get(GlobalTraceTable.TRACE_ID.getName()); - logger.debug("segmentId: {}, global trace id: {}", segmentId, globalTraceId); - globalTraceIds.add(globalTraceId); - } - return globalTraceIds; - } - - @Override public List getSegmentIds(String globalTraceId) { - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(GlobalTraceTable.TABLE); - searchRequestBuilder.setTypes(GlobalTraceTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - searchRequestBuilder.setQuery(QueryBuilders.termQuery(GlobalTraceTable.TRACE_ID.getName(), globalTraceId)); - searchRequestBuilder.setSize(10); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - - List segmentIds = new ArrayList<>(); - SearchHit[] searchHits = searchResponse.getHits().getHits(); - for (SearchHit searchHit : searchHits) { - String segmentId = (String)searchHit.getSource().get(GlobalTraceTable.SEGMENT_ID.getName()); - logger.debug("segmentId: {}, global trace id: {}", segmentId, globalTraceId); - segmentIds.add(segmentId); - } - return segmentIds; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/InstanceAlarmEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/InstanceAlarmEsUIDAO.java deleted file mode 100644 index 4febd9daf24669445f06ab6bbc7824ffa63036e0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/InstanceAlarmEsUIDAO.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import java.text.ParseException; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.util.StringUtils; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceAlarmUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmTable; -import org.apache.skywalking.apm.collector.storage.ui.alarm.Alarm; -import org.apache.skywalking.apm.collector.storage.ui.alarm.AlarmItem; -import org.apache.skywalking.apm.collector.storage.ui.alarm.AlarmType; -import org.apache.skywalking.apm.collector.storage.ui.alarm.CauseType; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.search.SearchType; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.SearchHit; - -/** - * @author peng-yongsheng - */ -public class InstanceAlarmEsUIDAO extends EsDAO implements IInstanceAlarmUIDAO { - - public InstanceAlarmEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override - public Alarm loadAlarmList(String keyword, long startTimeBucket, long endTimeBucket, int limit, - int from) throws ParseException { - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(InstanceAlarmTable.TABLE); - searchRequestBuilder.setTypes(InstanceAlarmTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - boolQueryBuilder.must().add(QueryBuilders.rangeQuery(InstanceAlarmTable.LAST_TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket)); - if (StringUtils.isNotEmpty(keyword)) { - boolQueryBuilder.must().add(QueryBuilders.matchQuery(InstanceAlarmTable.ALARM_CONTENT.getName(), keyword)); - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - searchRequestBuilder.setSize(limit); - searchRequestBuilder.setFrom(from); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - SearchHit[] searchHits = searchResponse.getHits().getHits(); - - Alarm alarm = new Alarm(); - alarm.setTotal((int)searchResponse.getHits().getTotalHits()); - for (SearchHit searchHit : searchHits) { - AlarmItem alarmItem = new AlarmItem(); - alarmItem.setId(((Number)searchHit.getSource().get(InstanceAlarmTable.INSTANCE_ID.getName())).intValue()); - alarmItem.setTitle((String)searchHit.getSource().get(InstanceAlarmTable.ALARM_CONTENT.getName())); - alarmItem.setContent((String)searchHit.getSource().get(InstanceAlarmTable.ALARM_CONTENT.getName())); - - long lastTimeBucket = ((Number)searchHit.getSource().get(InstanceAlarmTable.LAST_TIME_BUCKET.getName())).longValue(); - alarmItem.setStartTime(TimeBucketUtils.INSTANCE.formatMinuteTimeBucket(lastTimeBucket)); - alarmItem.setAlarmType(AlarmType.SERVER); - - int alarmType = ((Number)searchHit.getSource().get(InstanceAlarmTable.ALARM_TYPE.getName())).intValue(); - if (org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType.SLOW_RTT.getValue() == alarmType) { - alarmItem.setCauseType(CauseType.SLOW_RESPONSE); - } else if (org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType.ERROR_RATE.getValue() == alarmType) { - alarmItem.setCauseType(CauseType.LOW_SUCCESS_RATE); - } - - alarm.getItems().add(alarmItem); - } - return alarm; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/InstanceEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/InstanceEsUIDAO.java deleted file mode 100644 index e3672548ee00fd6d7f21f73a9d9b072ccd33a97c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/InstanceEsUIDAO.java +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import java.util.*; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.util.*; -import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.register.*; -import org.apache.skywalking.apm.collector.storage.ui.application.Application; -import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo; -import org.elasticsearch.action.get.*; -import org.elasticsearch.action.search.*; -import org.elasticsearch.index.query.*; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.aggregations.AggregationBuilders; -import org.elasticsearch.search.aggregations.bucket.terms.Terms; -import org.elasticsearch.search.aggregations.metrics.valuecount.ValueCount; -import org.elasticsearch.search.sort.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class InstanceEsUIDAO extends EsDAO implements IInstanceUIDAO { - - private final Logger logger = LoggerFactory.getLogger(InstanceEsUIDAO.class); - - public InstanceEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override public List getApplications(long startSecondTimeBucket, long endSecondTimeBucket, - int... applicationIds) { - logger.debug("application list get, start time: {}, end time: {}", startSecondTimeBucket, endSecondTimeBucket); - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(InstanceTable.TABLE); - searchRequestBuilder.setTypes(InstanceTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - - BoolQueryBuilder boolQuery1 = QueryBuilders.boolQuery(); - boolQuery1.must().add(QueryBuilders.rangeQuery(InstanceTable.HEARTBEAT_TIME.getName()).gte(endSecondTimeBucket)); - boolQuery1.must().add(QueryBuilders.rangeQuery(InstanceTable.REGISTER_TIME.getName()).lte(endSecondTimeBucket)); - - BoolQueryBuilder boolQuery2 = QueryBuilders.boolQuery(); - boolQuery2.must().add(QueryBuilders.rangeQuery(InstanceTable.REGISTER_TIME.getName()).lte(endSecondTimeBucket)); - boolQuery2.must().add(QueryBuilders.rangeQuery(InstanceTable.HEARTBEAT_TIME.getName()).gte(startSecondTimeBucket)); - - BoolQueryBuilder timeBoolQuery = QueryBuilders.boolQuery(); - timeBoolQuery.should().add(boolQuery1); - timeBoolQuery.should().add(boolQuery2); - - boolQueryBuilder.must().add(timeBoolQuery); - - boolQueryBuilder.must().add(QueryBuilders.termQuery(InstanceTable.IS_ADDRESS.getName(), BooleanUtils.FALSE)); - if (applicationIds.length > 0) { - boolQueryBuilder.must().add(QueryBuilders.termsQuery(InstanceTable.APPLICATION_ID.getName(), applicationIds)); - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - searchRequestBuilder.setSize(0); - searchRequestBuilder.addAggregation(AggregationBuilders.terms(InstanceTable.APPLICATION_ID.getName()).field(InstanceTable.APPLICATION_ID.getName()).size(100) - .subAggregation(AggregationBuilders.count(InstanceTable.INSTANCE_ID.getName()).field(InstanceTable.INSTANCE_ID.getName()))); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - Terms genders = searchResponse.getAggregations().get(InstanceTable.APPLICATION_ID.getName()); - - List applications = new LinkedList<>(); - for (Terms.Bucket applicationsBucket : genders.getBuckets()) { - Integer applicationId = applicationsBucket.getKeyAsNumber().intValue(); - logger.debug("applicationId: {}", applicationId); - - ValueCount instanceCount = applicationsBucket.getAggregations().get(InstanceTable.INSTANCE_ID.getName()); - - Application application = new Application(); - application.setId(applicationId); - application.setNumOfServer((int)instanceCount.getValue()); - applications.add(application); - } - return applications; - } - - @Override public Instance getInstance(int instanceId) { - logger.debug("get instance info, instance id: {}", instanceId); - GetRequestBuilder requestBuilder = getClient().prepareGet(InstanceTable.TABLE, String.valueOf(instanceId)); - GetResponse getResponse = requestBuilder.get(); - if (getResponse.isExists()) { - Instance instance = new Instance(); - instance.setId(getResponse.getId()); - instance.setApplicationId(((Number)getResponse.getSource().get(InstanceTable.APPLICATION_ID.getName())).intValue()); - instance.setAgentUUID((String)getResponse.getSource().get(InstanceTable.AGENT_UUID.getName())); - instance.setRegisterTime(((Number)getResponse.getSource().get(InstanceTable.REGISTER_TIME.getName())).longValue()); - instance.setHeartBeatTime(((Number)getResponse.getSource().get(InstanceTable.HEARTBEAT_TIME.getName())).longValue()); - instance.setOsInfo((String)getResponse.getSource().get(InstanceTable.OS_INFO.getName())); - return instance; - } - return null; - } - - @Override - public List searchServer(String keyword, long startSecondTimeBucket, long endSecondTimeBucket) { - logger.debug("get instances info, keyword: {}, startSecondTimeBucket: {}, endSecondTimeBucket: {}", keyword, startSecondTimeBucket, endSecondTimeBucket); - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(InstanceTable.TABLE); - searchRequestBuilder.setTypes(InstanceTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - searchRequestBuilder.setSize(1000); - - BoolQueryBuilder boolQuery = QueryBuilders.boolQuery(); - if (StringUtils.isNotEmpty(keyword)) { - boolQuery.must().add(QueryBuilders.queryStringQuery(keyword)); - } - boolQuery.must().add(QueryBuilders.termQuery(InstanceTable.IS_ADDRESS.getName(), BooleanUtils.FALSE)); - - BoolQueryBuilder boolQuery1 = QueryBuilders.boolQuery(); - boolQuery1.must().add(QueryBuilders.rangeQuery(InstanceTable.HEARTBEAT_TIME.getName()).gte(endSecondTimeBucket)); - boolQuery1.must().add(QueryBuilders.rangeQuery(InstanceTable.REGISTER_TIME.getName()).lte(endSecondTimeBucket)); - - BoolQueryBuilder boolQuery2 = QueryBuilders.boolQuery(); - boolQuery2.must().add(QueryBuilders.rangeQuery(InstanceTable.REGISTER_TIME.getName()).lte(endSecondTimeBucket)); - boolQuery2.must().add(QueryBuilders.rangeQuery(InstanceTable.HEARTBEAT_TIME.getName()).gte(startSecondTimeBucket)); - - BoolQueryBuilder timeBoolQuery = QueryBuilders.boolQuery(); - timeBoolQuery.should().add(boolQuery1); - timeBoolQuery.should().add(boolQuery2); - - boolQuery.must().add(timeBoolQuery); - - searchRequestBuilder.setQuery(boolQuery); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - SearchHit[] searchHits = searchResponse.getHits().getHits(); - - return buildAppServerInfo(searchHits); - } - - @Override - public List getAllServer(int applicationId, long startSecondTimeBucket, long endSecondTimeBucket) { - logger.debug("get instances info, applicationId: {}, start: {}, end: {}", applicationId, startSecondTimeBucket, endSecondTimeBucket); - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(InstanceTable.TABLE); - searchRequestBuilder.setTypes(InstanceTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - searchRequestBuilder.setSize(1000); - - BoolQueryBuilder boolQuery = QueryBuilders.boolQuery(); - boolQuery.filter().add(QueryBuilders.termQuery(InstanceTable.APPLICATION_ID.getName(), applicationId)); - boolQuery.filter().add(QueryBuilders.termQuery(InstanceTable.IS_ADDRESS.getName(), BooleanUtils.FALSE)); - - BoolQueryBuilder boolQuery1 = QueryBuilders.boolQuery(); - boolQuery1.filter().add(QueryBuilders.rangeQuery(InstanceTable.HEARTBEAT_TIME.getName()).gte(endSecondTimeBucket)); - boolQuery1.filter().add(QueryBuilders.rangeQuery(InstanceTable.REGISTER_TIME.getName()).lte(endSecondTimeBucket)); - - BoolQueryBuilder boolQuery2 = QueryBuilders.boolQuery(); - boolQuery2.filter().add(QueryBuilders.rangeQuery(InstanceTable.REGISTER_TIME.getName()).lte(endSecondTimeBucket)); - boolQuery2.filter().add(QueryBuilders.rangeQuery(InstanceTable.HEARTBEAT_TIME.getName()).gte(startSecondTimeBucket)); - - BoolQueryBuilder timeBoolQuery = QueryBuilders.boolQuery(); - timeBoolQuery.should().add(boolQuery1); - timeBoolQuery.should().add(boolQuery2); - - boolQuery.must().add(timeBoolQuery); - searchRequestBuilder.setQuery(boolQuery); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - SearchHit[] searchHits = searchResponse.getHits().getHits(); - - return buildAppServerInfo(searchHits); - } - - @Override public long getEarliestRegisterTime(int applicationId) { - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(InstanceTable.TABLE); - searchRequestBuilder.setTypes(InstanceTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - searchRequestBuilder.setSize(1); - - searchRequestBuilder.setQuery(QueryBuilders.termQuery(InstanceTable.APPLICATION_ID.getName(), applicationId)); - searchRequestBuilder.addSort(SortBuilders.fieldSort(InstanceTable.REGISTER_TIME.getName()).order(SortOrder.ASC)); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - - SearchHit[] searchHits = searchResponse.getHits().getHits(); - - if (searchHits.length > 0) { - return ((Number)searchHits[0].getSource().get(InstanceTable.REGISTER_TIME.getName())).longValue(); - } - - return Long.MIN_VALUE; - } - - @Override public long getLatestHeartBeatTime(int applicationId) { - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(InstanceTable.TABLE); - searchRequestBuilder.setTypes(InstanceTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - searchRequestBuilder.setSize(1); - - searchRequestBuilder.setQuery(QueryBuilders.termQuery(InstanceTable.APPLICATION_ID.getName(), applicationId)); - searchRequestBuilder.addSort(SortBuilders.fieldSort(InstanceTable.HEARTBEAT_TIME.getName()).order(SortOrder.DESC)); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - - SearchHit[] searchHits = searchResponse.getHits().getHits(); - - if (searchHits.length > 0) { - return ((Number)searchHits[0].getSource().get(InstanceTable.HEARTBEAT_TIME.getName())).longValue(); - } - - return Long.MAX_VALUE; - } - - private List buildAppServerInfo(SearchHit[] searchHits) { - List appServerInfos = new LinkedList<>(); - for (SearchHit searchHit : searchHits) { - AppServerInfo appServerInfo = new AppServerInfo(); - appServerInfo.setId(((Number)searchHit.getSource().get(InstanceTable.INSTANCE_ID.getName())).intValue()); - appServerInfo.setApplicationId(((Number)searchHit.getSource().get(InstanceTable.APPLICATION_ID.getName())).intValue()); - appServerInfo.setOsInfo((String)searchHit.getSource().get(InstanceTable.OS_INFO.getName())); - appServerInfos.add(appServerInfo); - } - return appServerInfos; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/InstanceMetricEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/InstanceMetricEsUIDAO.java deleted file mode 100644 index 7cee039b63fa87614c077076c5b7f792642aa370..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/InstanceMetricEsUIDAO.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import java.util.*; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo; -import org.apache.skywalking.apm.collector.storage.utils.*; -import org.elasticsearch.action.get.*; -import org.elasticsearch.action.search.*; -import org.elasticsearch.index.query.*; -import org.elasticsearch.search.aggregations.AggregationBuilders; -import org.elasticsearch.search.aggregations.bucket.terms.*; -import org.elasticsearch.search.aggregations.metrics.sum.Sum; - -/** - * @author peng-yongsheng - */ -public class InstanceMetricEsUIDAO extends EsDAO implements IInstanceMetricUIDAO { - - public InstanceMetricEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override - public List getServerThroughput(int applicationId, Step step, long startTimeBucket, - long endTimeBucket, int minutesBetween, int topN, MetricSource metricSource) { - String tableName = TimePyramidTableNameBuilder.build(step, InstanceMetricTable.TABLE); - - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(tableName); - searchRequestBuilder.setTypes(InstanceMetricTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - - BoolQueryBuilder boolQuery = QueryBuilders.boolQuery(); - boolQuery.must().add(QueryBuilders.rangeQuery(InstanceMetricTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket)); - if (applicationId != 0) { - boolQuery.must().add(QueryBuilders.termQuery(InstanceMetricTable.APPLICATION_ID.getName(), applicationId)); - } - boolQuery.must().add(QueryBuilders.termQuery(InstanceMetricTable.SOURCE_VALUE.getName(), metricSource.getValue())); - - searchRequestBuilder.setQuery(boolQuery); - searchRequestBuilder.setSize(0); - - TermsAggregationBuilder aggregationBuilder = AggregationBuilders.terms(InstanceMetricTable.INSTANCE_ID.getName()).field(InstanceMetricTable.INSTANCE_ID.getName()).size(2000); - aggregationBuilder.subAggregation(AggregationBuilders.sum(InstanceMetricTable.TRANSACTION_CALLS.getName()).field(InstanceMetricTable.TRANSACTION_CALLS.getName())); - - searchRequestBuilder.addAggregation(aggregationBuilder); - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - - List appServerInfoList = new LinkedList<>(); - Terms instanceIdTerms = searchResponse.getAggregations().get(InstanceMetricTable.INSTANCE_ID.getName()); - instanceIdTerms.getBuckets().forEach(instanceIdTerm -> { - int instanceId = instanceIdTerm.getKeyAsNumber().intValue(); - Sum callSum = instanceIdTerm.getAggregations().get(ApplicationMetricTable.TRANSACTION_CALLS.getName()); - long calls = (long)callSum.getValue(); - int callsPerMinute = (int)(minutesBetween == 0 ? 0 : calls / minutesBetween); - - AppServerInfo appServerInfo = new AppServerInfo(); - appServerInfo.setId(instanceId); - appServerInfo.setCpm(callsPerMinute); - appServerInfoList.add(appServerInfo); - }); - - appServerInfoList.sort((first, second) -> Integer.compare(second.getCpm(), first.getCpm())); - if (appServerInfoList.size() <= topN) { - return appServerInfoList; - } else { - List newCollection = new LinkedList<>(); - for (int i = 0; i < topN; i++) { - newCollection.add(appServerInfoList.get(i)); - } - return newCollection; - } - } - - @Override - public List getServerThroughputTrend(int instanceId, Step step, List durationPoints) { - String tableName = TimePyramidTableNameBuilder.build(step, InstanceMetricTable.TABLE); - MultiGetRequestBuilder prepareMultiGet = getClient().prepareMultiGet(durationPoints, new ElasticSearchClient.MultiGetRowHandler() { - @Override - public void accept(DurationPoint durationPoint) { - String id = durationPoint.getPoint() + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + MetricSource.Callee.getValue(); - add(tableName, InstanceMetricTable.TABLE_TYPE, id); - } - }); - - List throughputTrend = new LinkedList<>(); - MultiGetResponse multiGetResponse = prepareMultiGet.get(); - - for (int i = 0; i < multiGetResponse.getResponses().length; i++) { - MultiGetItemResponse response = multiGetResponse.getResponses()[i]; - if (response.getResponse().isExists()) { - long callTimes = ((Number)response.getResponse().getSource().get(InstanceMetricTable.TRANSACTION_CALLS.getName())).longValue(); - throughputTrend.add((int)(callTimes / durationPoints.get(i).getMinutesBetween())); - } else { - throughputTrend.add(0); - } - } - return throughputTrend; - } - - @Override - public List getResponseTimeTrend(int instanceId, Step step, List durationPoints) { - String tableName = TimePyramidTableNameBuilder.build(step, InstanceMetricTable.TABLE); - MultiGetRequestBuilder prepareMultiGet = getClient().prepareMultiGet(durationPoints, new ElasticSearchClient.MultiGetRowHandler() { - @Override - public void accept(DurationPoint durationPoint) { - String id = durationPoint.getPoint() + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + MetricSource.Callee.getValue(); - add(tableName, InstanceMetricTable.TABLE_TYPE, id); - } - - }); - - List responseTimeTrends = new LinkedList<>(); - MultiGetResponse multiGetResponse = prepareMultiGet.get(); - for (MultiGetItemResponse response : multiGetResponse.getResponses()) { - if (response.getResponse().isExists()) { - long callTimes = ((Number)response.getResponse().getSource().get(InstanceMetricTable.TRANSACTION_CALLS.getName())).longValue(); - long durationSum = ((Number)response.getResponse().getSource().get(InstanceMetricTable.TRANSACTION_DURATION_SUM.getName())).longValue(); - responseTimeTrends.add((int)(durationSum / callTimes)); - } else { - responseTimeTrends.add(0); - } - } - return responseTimeTrends; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/MemoryMetricEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/MemoryMetricEsUIDAO.java deleted file mode 100644 index d1a45ab10cf27253afb765df7c3b7ccd4958f106..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/MemoryMetricEsUIDAO.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.util.BooleanUtils; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.ui.IMemoryMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.elasticsearch.action.get.MultiGetItemResponse; -import org.elasticsearch.action.get.MultiGetRequestBuilder; -import org.elasticsearch.action.get.MultiGetResponse; - -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class MemoryMetricEsUIDAO extends EsDAO implements IMemoryMetricUIDAO { - - public MemoryMetricEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override - public Trend getHeapMemoryTrend(int instanceId, Step step, List durationPoints) { - return getMemoryTrend(instanceId, step, durationPoints, true); - } - - @Override - public Trend getNoHeapMemoryTrend(int instanceId, Step step, List durationPoints) { - return getMemoryTrend(instanceId, step, durationPoints, false); - } - - private Trend getMemoryTrend(int instanceId, Step step, List durationPoints, - boolean isHeap) { - String tableName = TimePyramidTableNameBuilder.build(step, MemoryMetricTable.TABLE); - MultiGetRequestBuilder prepareMultiGet = getClient().prepareMultiGet(durationPoints, new ElasticSearchClient.MultiGetRowHandler() { - @Override - public void accept(DurationPoint durationPoint) { - String id = durationPoint.getPoint() + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + BooleanUtils.booleanToValue(isHeap); - add(tableName, MemoryMetricTable.TABLE_TYPE, id); - } - - }); - - Trend trend = new Trend(); - MultiGetResponse multiGetResponse = prepareMultiGet.get(); - for (MultiGetItemResponse response : multiGetResponse.getResponses()) { - if (response.getResponse().isExists()) { - long max = ((Number) response.getResponse().getSource().get(MemoryMetricTable.MAX.getName())).longValue(); - long used = ((Number) response.getResponse().getSource().get(MemoryMetricTable.USED.getName())).longValue(); - long times = ((Number) response.getResponse().getSource().get(MemoryMetricTable.TIMES.getName())).longValue(); - - trend.getMetrics().add((int) (used / times)); - - if (max < 0) { - trend.getMaxMetrics().add((int) (used / times)); - } else { - trend.getMaxMetrics().add((int) (max / times)); - } - } else { - trend.getMetrics().add(0); - trend.getMaxMetrics().add(0); - } - } - - return trend; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/NetworkAddressEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/NetworkAddressEsUIDAO.java deleted file mode 100644 index 22af24122216e75c802eb5762e0036a27c1c0573..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/NetworkAddressEsUIDAO.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import java.util.LinkedList; -import java.util.List; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.storage.dao.ui.INetworkAddressUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddressTable; -import org.apache.skywalking.apm.collector.storage.ui.overview.ConjecturalApp; -import org.apache.skywalking.apm.network.language.agent.SpanLayer; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.search.SearchType; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.aggregations.AggregationBuilders; -import org.elasticsearch.search.aggregations.bucket.terms.Terms; -import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; - -/** - * @author peng-yongsheng - */ -public class NetworkAddressEsUIDAO extends EsDAO implements INetworkAddressUIDAO { - - public NetworkAddressEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override public int getNumOfSpanLayer(int srcSpanLayer) { - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(NetworkAddressTable.TABLE); - searchRequestBuilder.setTypes(NetworkAddressTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - searchRequestBuilder.setQuery(QueryBuilders.termQuery(NetworkAddressTable.SRC_SPAN_LAYER.getName(), srcSpanLayer)); - searchRequestBuilder.setSize(0); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return (int)searchResponse.getHits().getTotalHits(); - } - - @Override public List getConjecturalApps() { - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(NetworkAddressTable.TABLE); - searchRequestBuilder.setTypes(NetworkAddressTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - - int[] spanLayers = new int[] {SpanLayer.Database_VALUE, SpanLayer.Cache_VALUE, SpanLayer.MQ_VALUE}; - searchRequestBuilder.setQuery(QueryBuilders.termsQuery(NetworkAddressTable.SRC_SPAN_LAYER.getName(), spanLayers)); - searchRequestBuilder.setSize(0); - - TermsAggregationBuilder aggregationBuilder = AggregationBuilders.terms(NetworkAddressTable.SERVER_TYPE.getName()).field(NetworkAddressTable.SERVER_TYPE.getName()).size(100); - - searchRequestBuilder.addAggregation(aggregationBuilder); - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - - List conjecturalApps = new LinkedList<>(); - Terms serverTypeTerms = searchResponse.getAggregations().get(NetworkAddressTable.SERVER_TYPE.getName()); - serverTypeTerms.getBuckets().forEach(serverTypeTerm -> { - int serverType = serverTypeTerm.getKeyAsNumber().intValue(); - - ConjecturalApp conjecturalApp = new ConjecturalApp(); - conjecturalApp.setId(serverType); - conjecturalApp.setNum((int)serverTypeTerm.getDocCount()); - conjecturalApps.add(conjecturalApp); - }); - return conjecturalApps; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ResponseTimeDistributionEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ResponseTimeDistributionEsUIDAO.java deleted file mode 100644 index 37776335aeb365e93aa6c53e685188da967f1d48..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ResponseTimeDistributionEsUIDAO.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.ui.IResponseTimeDistributionUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.elasticsearch.action.get.MultiGetItemResponse; -import org.elasticsearch.action.get.MultiGetRequestBuilder; -import org.elasticsearch.action.get.MultiGetResponse; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionEsUIDAO extends EsDAO implements IResponseTimeDistributionUIDAO { - - public ResponseTimeDistributionEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override - public void loadMetrics(Step step, List responseTimeSteps) { - String tableName = TimePyramidTableNameBuilder.build(step, ResponseTimeDistributionTable.TABLE); - - MultiGetRequestBuilder prepareMultiGet = getClient().prepareMultiGet(responseTimeSteps, new ElasticSearchClient.MultiGetRowHandler() { - @Override - public void accept(ResponseTimeStep responseTimeStep) { - String id = String.valueOf(responseTimeStep.getDurationPoint()) + Const.ID_SPLIT + String.valueOf(responseTimeStep.getStep()); - this.add(tableName, ResponseTimeDistributionTable.TABLE_TYPE, id); - } - }); - - MultiGetResponse multiGetResponse = prepareMultiGet.get(); - for (int i = 0; i < multiGetResponse.getResponses().length; i++) { - MultiGetItemResponse response = multiGetResponse.getResponses()[i]; - if (response.getResponse().isExists()) { - long calls = ((Number)response.getResponse().getSource().get(ResponseTimeDistributionTable.CALLS.getName())).longValue(); - long errorCalls = ((Number)response.getResponse().getSource().get(ResponseTimeDistributionTable.ERROR_CALLS.getName())).longValue(); - long successCalls = ((Number)response.getResponse().getSource().get(ResponseTimeDistributionTable.SUCCESS_CALLS.getName())).longValue(); - - responseTimeSteps.get(i).setCalls(calls); - responseTimeSteps.get(i).setErrorCalls(errorCalls); - responseTimeSteps.get(i).setSuccessCalls(successCalls); - } else { - responseTimeSteps.get(i).setCalls(0); - responseTimeSteps.get(i).setErrorCalls(0); - responseTimeSteps.get(i).setSuccessCalls(0); - } - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/SegmentDurationEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/SegmentDurationEsUIDAO.java deleted file mode 100644 index 62d9b62899bdb89157b85b0caa68615dfc76aecf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/SegmentDurationEsUIDAO.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.util.*; -import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentDurationUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentDurationTable; -import org.apache.skywalking.apm.collector.storage.ui.trace.*; -import org.elasticsearch.action.search.*; -import org.elasticsearch.index.query.*; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; - -/** - * @author peng-yongsheng - */ -public class SegmentDurationEsUIDAO extends EsDAO implements ISegmentDurationUIDAO { - - public SegmentDurationEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override - public TraceBrief loadTop(long startSecondTimeBucket, long endSecondTimeBucket, long minDuration, long maxDuration, - String operationName, int applicationId, int limit, int from, TraceState traceState, QueryOrder queryOrder, - String... segmentIds) { - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(SegmentDurationTable.TABLE); - searchRequestBuilder.setTypes(SegmentDurationTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - searchRequestBuilder.setQuery(boolQueryBuilder); - List mustQueryList = boolQueryBuilder.must(); - - if (startSecondTimeBucket != 0 && endSecondTimeBucket != 0) { - mustQueryList.add(QueryBuilders.rangeQuery(SegmentDurationTable.TIME_BUCKET.getName()).gte(startSecondTimeBucket).lte(endSecondTimeBucket)); - } - - if (minDuration != 0 || maxDuration != 0) { - RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery(SegmentDurationTable.DURATION.getName()); - if (minDuration != 0) { - rangeQueryBuilder.gte(minDuration); - } - if (maxDuration != 0) { - rangeQueryBuilder.lte(maxDuration); - } - boolQueryBuilder.must().add(rangeQueryBuilder); - } - if (StringUtils.isNotEmpty(operationName)) { - mustQueryList.add(QueryBuilders.matchPhraseQuery(SegmentDurationTable.SERVICE_NAME.getName(), operationName)); - } - if (CollectionUtils.isNotEmpty(segmentIds)) { - boolQueryBuilder.must().add(QueryBuilders.termsQuery(SegmentDurationTable.SEGMENT_ID.getName(), segmentIds)); - } - if (applicationId != 0) { - boolQueryBuilder.must().add(QueryBuilders.termQuery(SegmentDurationTable.APPLICATION_ID.getName(), applicationId)); - } - switch (traceState) { - case ERROR: - mustQueryList.add(QueryBuilders.matchQuery(SegmentDurationTable.IS_ERROR.getName(), BooleanUtils.TRUE)); - break; - case SUCCESS: - mustQueryList.add(QueryBuilders.matchQuery(SegmentDurationTable.IS_ERROR.getName(), BooleanUtils.FALSE)); - break; - } - switch (queryOrder) { - case BY_START_TIME: - searchRequestBuilder.addSort(SegmentDurationTable.START_TIME.getName(), SortOrder.DESC); - break; - case BY_DURATION: - searchRequestBuilder.addSort(SegmentDurationTable.DURATION.getName(), SortOrder.DESC); - break; - } - searchRequestBuilder.setSize(limit); - searchRequestBuilder.setFrom(from); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - - TraceBrief traceBrief = new TraceBrief(); - traceBrief.setTotal((int)searchResponse.getHits().totalHits); - - for (SearchHit searchHit : searchResponse.getHits().getHits()) { - BasicTrace basicTrace = new BasicTrace(); - - basicTrace.setSegmentId((String)searchHit.getSource().get(SegmentDurationTable.SEGMENT_ID.getName())); - basicTrace.setStart(((Number)searchHit.getSource().get(SegmentDurationTable.START_TIME.getName())).longValue()); - basicTrace.getOperationName().addAll((List)searchHit.getSource().get(SegmentDurationTable.SERVICE_NAME.getName())); - basicTrace.setDuration(((Number)searchHit.getSource().get(SegmentDurationTable.DURATION.getName())).intValue()); - basicTrace.setError(BooleanUtils.valueToBoolean(((Number)searchHit.getSource().get(SegmentDurationTable.IS_ERROR.getName())).intValue())); - traceBrief.getTraces().add(basicTrace); - } - - return traceBrief; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/SegmentEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/SegmentEsUIDAO.java deleted file mode 100644 index 344d9322d97affcd8ab7e0edd174d66ffa66f58f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/SegmentEsUIDAO.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import com.google.protobuf.InvalidProtocolBufferException; -import java.util.Base64; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.util.StringUtils; -import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentTable; -import org.apache.skywalking.apm.network.language.agent.TraceSegmentObject; -import org.elasticsearch.action.get.GetResponse; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class SegmentEsUIDAO extends EsDAO implements ISegmentUIDAO { - - private final Logger logger = LoggerFactory.getLogger(SegmentEsUIDAO.class); - - public SegmentEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override public TraceSegmentObject load(String segmentId) { - GetResponse response = getClient().prepareGet(SegmentTable.TABLE, segmentId).get(); - Map source = response.getSource(); - String dataBinaryBase64 = (String)source.get(SegmentTable.DATA_BINARY.getName()); - if (StringUtils.isNotEmpty(dataBinaryBase64)) { - byte[] dataBinary = Base64.getDecoder().decode(dataBinaryBase64); - try { - return TraceSegmentObject.parseFrom(dataBinary); - } catch (InvalidProtocolBufferException e) { - logger.error(e.getMessage(), e); - } - } - return null; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ServiceAlarmEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ServiceAlarmEsUIDAO.java deleted file mode 100644 index 77034ef2739de277062ecc56775fd66ee636ff48..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ServiceAlarmEsUIDAO.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import java.text.ParseException; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.util.StringUtils; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceAlarmUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmTable; -import org.apache.skywalking.apm.collector.storage.ui.alarm.Alarm; -import org.apache.skywalking.apm.collector.storage.ui.alarm.AlarmItem; -import org.apache.skywalking.apm.collector.storage.ui.alarm.AlarmType; -import org.apache.skywalking.apm.collector.storage.ui.alarm.CauseType; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.search.SearchType; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.SearchHit; - -/** - * @author peng-yongsheng - */ -public class ServiceAlarmEsUIDAO extends EsDAO implements IServiceAlarmUIDAO { - - public ServiceAlarmEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override - public Alarm loadAlarmList(String keyword, long startTimeBucket, long endTimeBucket, int limit, - int from) throws ParseException { - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(ServiceAlarmTable.TABLE); - searchRequestBuilder.setTypes(ServiceAlarmTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - - BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - boolQueryBuilder.must().add(QueryBuilders.rangeQuery(ServiceAlarmTable.LAST_TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket)); - if (StringUtils.isNotEmpty(keyword)) { - boolQueryBuilder.must().add(QueryBuilders.matchQuery(ServiceAlarmTable.ALARM_CONTENT.getName(), keyword)); - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - searchRequestBuilder.setSize(limit); - searchRequestBuilder.setFrom(from); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - SearchHit[] searchHits = searchResponse.getHits().getHits(); - - Alarm alarm = new Alarm(); - alarm.setTotal((int)searchResponse.getHits().getTotalHits()); - for (SearchHit searchHit : searchHits) { - AlarmItem alarmItem = new AlarmItem(); - alarmItem.setId(((Number)searchHit.getSource().get(ServiceAlarmTable.SERVICE_ID.getName())).intValue()); - alarmItem.setTitle((String)searchHit.getSource().get(ServiceAlarmTable.ALARM_CONTENT.getName())); - alarmItem.setContent((String)searchHit.getSource().get(ServiceAlarmTable.ALARM_CONTENT.getName())); - - long lastTimeBucket = ((Number)searchHit.getSource().get(ServiceAlarmTable.LAST_TIME_BUCKET.getName())).longValue(); - alarmItem.setStartTime(TimeBucketUtils.INSTANCE.formatMinuteTimeBucket(lastTimeBucket)); - alarmItem.setAlarmType(AlarmType.SERVICE); - - int alarmType = ((Number)searchHit.getSource().get(ServiceAlarmTable.ALARM_TYPE.getName())).intValue(); - if (org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType.SLOW_RTT.getValue() == alarmType) { - alarmItem.setCauseType(CauseType.SLOW_RESPONSE); - } else if (org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType.ERROR_RATE.getValue() == alarmType) { - alarmItem.setCauseType(CauseType.LOW_SUCCESS_RATE); - } - - alarm.getItems().add(alarmItem); - } - return alarm; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ServiceMetricEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ServiceMetricEsUIDAO.java deleted file mode 100644 index 3ff8597487e2ae1598bdc6fa5f6e2a739a3ef614..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ServiceMetricEsUIDAO.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import java.util.Collection; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Node; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.ui.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.ui.service.ServiceNode; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.elasticsearch.action.get.MultiGetItemResponse; -import org.elasticsearch.action.get.MultiGetRequestBuilder; -import org.elasticsearch.action.get.MultiGetResponse; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.search.SearchType; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.aggregations.AggregationBuilders; -import org.elasticsearch.search.aggregations.bucket.terms.Terms; -import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; -import org.elasticsearch.search.aggregations.metrics.sum.Sum; -import org.elasticsearch.search.sort.SortBuilders; -import org.elasticsearch.search.sort.SortOrder; - -/** - * @author peng-yongsheng - */ -public class ServiceMetricEsUIDAO extends EsDAO implements IServiceMetricUIDAO { - - public ServiceMetricEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override - public List getServiceResponseTimeTrend(int serviceId, Step step, List durationPoints) { - String tableName = TimePyramidTableNameBuilder.build(step, ServiceMetricTable.TABLE); - MultiGetRequestBuilder prepareMultiGet = getClient().prepareMultiGet(durationPoints, new ElasticSearchClient.MultiGetRowHandler() { - @Override - public void accept(DurationPoint durationPoint) { - String id = durationPoint.getPoint() + Const.ID_SPLIT + serviceId + Const.ID_SPLIT + MetricSource.Callee.getValue(); - add(tableName, ServiceMetricTable.TABLE_TYPE, id); - } - }); - - List trends = new LinkedList<>(); - MultiGetResponse multiGetResponse = prepareMultiGet.get(); - for (MultiGetItemResponse response : multiGetResponse.getResponses()) { - if (response.getResponse().isExists()) { - long calls = ((Number)response.getResponse().getSource().get(ServiceMetricTable.TRANSACTION_CALLS.getName())).longValue(); - long durationSum = ((Number)response.getResponse().getSource().get(ServiceMetricTable.TRANSACTION_DURATION_SUM.getName())).longValue(); - trends.add((int)(durationSum / calls)); - } else { - trends.add(0); - } - } - return trends; - } - - @Override - public List getServiceThroughputTrend(int serviceId, Step step, List durationPoints) { - String tableName = TimePyramidTableNameBuilder.build(step, ServiceMetricTable.TABLE); - MultiGetRequestBuilder prepareMultiGet = getClient().prepareMultiGet(durationPoints, new ElasticSearchClient.MultiGetRowHandler() { - @Override - public void accept(DurationPoint durationPoint) { - String id = durationPoint.getPoint() + Const.ID_SPLIT + serviceId + Const.ID_SPLIT + MetricSource.Callee.getValue(); - add(tableName, ServiceMetricTable.TABLE_TYPE, id); - } - }); - - List trends = new LinkedList<>(); - MultiGetResponse multiGetResponse = prepareMultiGet.get(); - - int index = 0; - for (MultiGetItemResponse response : multiGetResponse.getResponses()) { - if (response.getResponse().isExists()) { - long calls = ((Number)response.getResponse().getSource().get(ServiceMetricTable.TRANSACTION_CALLS.getName())).longValue(); - long minutesBetween = durationPoints.get(index).getMinutesBetween(); - trends.add((int)(calls / minutesBetween)); - } else { - trends.add(0); - } - index++; - } - return trends; - } - - @Override - public List getServiceSLATrend(int serviceId, Step step, List durationPoints) { - String tableName = TimePyramidTableNameBuilder.build(step, ServiceMetricTable.TABLE); - MultiGetRequestBuilder prepareMultiGet = getClient().prepareMultiGet(durationPoints, new ElasticSearchClient.MultiGetRowHandler() { - @Override - public void accept(DurationPoint durationPoint) { - String id = durationPoint.getPoint() + Const.ID_SPLIT + serviceId + Const.ID_SPLIT + MetricSource.Callee.getValue(); - add(tableName, ServiceMetricTable.TABLE_TYPE, id); - } - }); - - List trends = new LinkedList<>(); - MultiGetResponse multiGetResponse = prepareMultiGet.get(); - for (MultiGetItemResponse response : multiGetResponse.getResponses()) { - if (response.getResponse().isExists()) { - long calls = ((Number)response.getResponse().getSource().get(ServiceMetricTable.TRANSACTION_CALLS.getName())).longValue(); - long errorCalls = ((Number)response.getResponse().getSource().get(ServiceMetricTable.TRANSACTION_ERROR_CALLS.getName())).longValue(); - trends.add((int)(((calls - errorCalls) / calls)) * 10000); - } else { - trends.add(10000); - } - } - return trends; - } - - @Override - public List getServicesMetric(Step step, long startTimeBucket, long endTimeBucket, MetricSource metricSource, - Collection serviceIds) { - String tableName = TimePyramidTableNameBuilder.build(step, ServiceMetricTable.TABLE); - - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(tableName); - searchRequestBuilder.setTypes(ServiceMetricTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - - BoolQueryBuilder boolQuery = QueryBuilders.boolQuery(); - boolQuery.must().add(QueryBuilders.rangeQuery(ServiceMetricTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket)); - boolQuery.must().add(QueryBuilders.termsQuery(ServiceMetricTable.SERVICE_ID.getName(), serviceIds)); - boolQuery.must().add(QueryBuilders.termQuery(ServiceMetricTable.SOURCE_VALUE.getName(), metricSource.getValue())); - - searchRequestBuilder.setQuery(boolQuery); - searchRequestBuilder.setSize(0); - - TermsAggregationBuilder aggregationBuilder = AggregationBuilders.terms(ServiceMetricTable.SERVICE_ID.getName()).field(ServiceMetricTable.SERVICE_ID.getName()).size(100); - aggregationBuilder.subAggregation(AggregationBuilders.sum(ServiceMetricTable.TRANSACTION_CALLS.getName()).field(ServiceMetricTable.TRANSACTION_CALLS.getName())); - aggregationBuilder.subAggregation(AggregationBuilders.sum(ServiceMetricTable.TRANSACTION_ERROR_CALLS.getName()).field(ServiceMetricTable.TRANSACTION_ERROR_CALLS.getName())); - - searchRequestBuilder.addAggregation(aggregationBuilder); - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - - List nodes = new LinkedList<>(); - Terms serviceIdTerms = searchResponse.getAggregations().get(ServiceMetricTable.SERVICE_ID.getName()); - serviceIdTerms.getBuckets().forEach(serviceIdBucket -> { - int serviceId = serviceIdBucket.getKeyAsNumber().intValue(); - - Sum callsSum = serviceIdBucket.getAggregations().get(ServiceMetricTable.TRANSACTION_CALLS.getName()); - Sum errorCallsSum = serviceIdBucket.getAggregations().get(ServiceMetricTable.TRANSACTION_ERROR_CALLS.getName()); - - ServiceNode serviceNode = new ServiceNode(); - serviceNode.setId(serviceId); - serviceNode.setCalls((long)callsSum.getValue()); - serviceNode.setSla((int)(((callsSum.getValue() - errorCallsSum.getValue()) / callsSum.getValue()) * 10000)); - nodes.add(serviceNode); - }); - return nodes; - } - - @Override - public List getSlowService(int applicationId, Step step, long startTimeBucket, long endTimeBucket, - Integer topN, MetricSource metricSource) { - String tableName = TimePyramidTableNameBuilder.build(step, ServiceMetricTable.TABLE); - - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(tableName); - searchRequestBuilder.setTypes(ServiceMetricTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - - BoolQueryBuilder boolQuery = QueryBuilders.boolQuery(); - boolQuery.must().add(QueryBuilders.rangeQuery(ServiceMetricTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket)); - if (applicationId != 0) { - boolQuery.must().add(QueryBuilders.termQuery(ServiceMetricTable.APPLICATION_ID.getName(), applicationId)); - } - boolQuery.must().add(QueryBuilders.termQuery(ServiceMetricTable.SOURCE_VALUE.getName(), metricSource.getValue())); - - searchRequestBuilder.setQuery(boolQuery); - searchRequestBuilder.setSize(topN * 60); - searchRequestBuilder.addSort(SortBuilders.fieldSort(ServiceMetricTable.TRANSACTION_AVERAGE_DURATION.getName()).order(SortOrder.DESC)); - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - - SearchHit[] searchHits = searchResponse.getHits().getHits(); - - Set serviceIds = new HashSet<>(); - List serviceMetrics = new LinkedList<>(); - for (SearchHit searchHit : searchHits) { - int serviceId = ((Number)searchHit.getSource().get(ServiceMetricTable.SERVICE_ID.getName())).intValue(); - if (!serviceIds.contains(serviceId)) { - ServiceMetric serviceMetric = new ServiceMetric(); - serviceMetric.getService().setId(serviceId); - serviceMetric.getService().setApplicationId(serviceId); - serviceMetric.setCalls(((Number)searchHit.getSource().get(ServiceMetricTable.TRANSACTION_CALLS.getName())).longValue()); - serviceMetric.setAvgResponseTime(((Number)searchHit.getSource().get(ServiceMetricTable.TRANSACTION_AVERAGE_DURATION.getName())).intValue()); - serviceMetrics.add(serviceMetric); - - serviceIds.add(serviceId); - } - if (topN == serviceIds.size()) { - break; - } - } - - return serviceMetrics; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ServiceNameServiceEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ServiceNameServiceEsUIDAO.java deleted file mode 100644 index 249a90547c336190e3e5b9d250532069e970cb9f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ServiceNameServiceEsUIDAO.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import java.util.*; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.core.util.*; -import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceNameServiceUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceNameTable; -import org.apache.skywalking.apm.collector.storage.ui.service.ServiceInfo; -import org.apache.skywalking.apm.network.language.agent.SpanType; -import org.elasticsearch.action.search.*; -import org.elasticsearch.index.query.*; -import org.elasticsearch.search.SearchHit; - -/** - * @author peng-yongsheng - */ -public class ServiceNameServiceEsUIDAO extends EsDAO implements IServiceNameServiceUIDAO { - - public ServiceNameServiceEsUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override public int getCount(long startTimeMillis) { - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(ServiceNameTable.TABLE); - searchRequestBuilder.setTypes(ServiceNameTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - - BoolQueryBuilder boolQuery = QueryBuilders.boolQuery(); - boolQuery.must().add(QueryBuilders.termQuery(ServiceNameTable.SRC_SPAN_TYPE.getName(), SpanType.Entry_VALUE)); - boolQuery.must().add(QueryBuilders.rangeQuery(ServiceNameTable.HEARTBEAT_TIME.getName()).gte(startTimeMillis)); - searchRequestBuilder.setQuery(boolQuery); - - searchRequestBuilder.setSize(0); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return (int)searchResponse.getHits().getTotalHits(); - } - - @Override - public List searchService(String keyword, int applicationId, long startTimeMillis, int topN) { - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(ServiceNameTable.TABLE); - searchRequestBuilder.setTypes(ServiceNameTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - searchRequestBuilder.setSize(topN); - - BoolQueryBuilder boolQuery = QueryBuilders.boolQuery(); - boolQuery.must().add(QueryBuilders.termQuery(ServiceNameTable.SRC_SPAN_TYPE.getName(), SpanType.Entry_VALUE)); - boolQuery.must().add(QueryBuilders.rangeQuery(ServiceNameTable.HEARTBEAT_TIME.getName()).gte(startTimeMillis)); - - if (applicationId != Const.NONE) { - boolQuery.must().add(QueryBuilders.termQuery(ServiceNameTable.APPLICATION_ID.getName(), applicationId)); - } - - if (StringUtils.isNotEmpty(keyword)) { - boolQuery.must().add(QueryBuilders.matchQuery(ServiceNameTable.SERVICE_NAME.getName(), keyword)); - } - searchRequestBuilder.setQuery(boolQuery); - - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - SearchHit[] searchHits = searchResponse.getHits().getHits(); - - List serviceInfos = new LinkedList<>(); - for (SearchHit searchHit : searchHits) { - ServiceInfo serviceInfo = new ServiceInfo(); - serviceInfo.setId(((Number)searchHit.getSource().get(ServiceNameTable.SERVICE_ID.getName())).intValue()); - serviceInfo.setName((String)searchHit.getSource().get(ServiceNameTable.SERVICE_NAME.getName())); - serviceInfo.setApplicationId(((Number)searchHit.getSource().get(ServiceNameTable.APPLICATION_ID.getName())).intValue()); - serviceInfos.add(serviceInfo); - } - return serviceInfos; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ServiceReferenceEsMetricUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ServiceReferenceEsMetricUIDAO.java deleted file mode 100644 index 7cf186179cb731a5bb9d51dd88b2c496e2eb96d1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ServiceReferenceEsMetricUIDAO.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.dao.ui; - -import java.util.LinkedList; -import java.util.List; -import org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient; -import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceReferenceMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.action.search.SearchType; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.aggregations.AggregationBuilders; -import org.elasticsearch.search.aggregations.bucket.terms.Terms; -import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; -import org.elasticsearch.search.aggregations.metrics.sum.Sum; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceEsMetricUIDAO extends EsDAO implements IServiceReferenceMetricUIDAO { - - public ServiceReferenceEsMetricUIDAO(ElasticSearchClient client) { - super(client); - } - - @Override public List getFrontServices(Step step, long startTimeBucket, long endTimeBucket, - MetricSource metricSource, - int behindServiceId) { - String tableName = TimePyramidTableNameBuilder.build(step, ServiceReferenceMetricTable.TABLE); - - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(tableName); - searchRequestBuilder.setTypes(ServiceReferenceMetricTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - - BoolQueryBuilder boolQuery = QueryBuilders.boolQuery(); - boolQuery.must().add(QueryBuilders.rangeQuery(ServiceReferenceMetricTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket)); - boolQuery.must().add(QueryBuilders.termQuery(ServiceReferenceMetricTable.BEHIND_SERVICE_ID.getName(), behindServiceId)); - boolQuery.must().add(QueryBuilders.termQuery(ServiceReferenceMetricTable.SOURCE_VALUE.getName(), metricSource.getValue())); - - searchRequestBuilder.setQuery(boolQuery); - searchRequestBuilder.setSize(0); - - TermsAggregationBuilder aggregationBuilder = AggregationBuilders.terms(ServiceReferenceMetricTable.FRONT_SERVICE_ID.getName()).field(ServiceReferenceMetricTable.FRONT_SERVICE_ID.getName()).size(100); - aggregationBuilder.subAggregation(AggregationBuilders.sum(ServiceReferenceMetricTable.TRANSACTION_CALLS.getName()).field(ServiceReferenceMetricTable.TRANSACTION_CALLS.getName())); - aggregationBuilder.subAggregation(AggregationBuilders.sum(ServiceReferenceMetricTable.TRANSACTION_ERROR_CALLS.getName()).field(ServiceReferenceMetricTable.TRANSACTION_ERROR_CALLS.getName())); - aggregationBuilder.subAggregation(AggregationBuilders.sum(ServiceReferenceMetricTable.TRANSACTION_DURATION_SUM.getName()).field(ServiceReferenceMetricTable.TRANSACTION_DURATION_SUM.getName())); - aggregationBuilder.subAggregation(AggregationBuilders.sum(ServiceReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName()).field(ServiceReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName())); - - searchRequestBuilder.addAggregation(aggregationBuilder); - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - - List referenceMetrics = new LinkedList<>(); - Terms frontServiceIdTerms = searchResponse.getAggregations().get(ServiceReferenceMetricTable.FRONT_SERVICE_ID.getName()); - buildNodeByBehindServiceId(referenceMetrics, frontServiceIdTerms, behindServiceId); - - return referenceMetrics; - } - - @Override public List getBehindServices(Step step, long startTimeBucket, long endTimeBucket, - MetricSource metricSource, - int frontServiceId) { - String tableName = TimePyramidTableNameBuilder.build(step, ServiceReferenceMetricTable.TABLE); - - SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(tableName); - searchRequestBuilder.setTypes(ServiceReferenceMetricTable.TABLE_TYPE); - searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); - - BoolQueryBuilder boolQuery = QueryBuilders.boolQuery(); - boolQuery.must().add(QueryBuilders.rangeQuery(ServiceReferenceMetricTable.TIME_BUCKET.getName()).gte(startTimeBucket).lte(endTimeBucket)); - boolQuery.must().add(QueryBuilders.termQuery(ServiceReferenceMetricTable.FRONT_SERVICE_ID.getName(), frontServiceId)); - boolQuery.must().add(QueryBuilders.termQuery(ServiceReferenceMetricTable.SOURCE_VALUE.getName(), metricSource.getValue())); - - searchRequestBuilder.setQuery(boolQuery); - searchRequestBuilder.setSize(0); - - TermsAggregationBuilder aggregationBuilder = AggregationBuilders.terms(ServiceReferenceMetricTable.BEHIND_SERVICE_ID.getName()).field(ServiceReferenceMetricTable.BEHIND_SERVICE_ID.getName()).size(100); - aggregationBuilder.subAggregation(AggregationBuilders.sum(ServiceReferenceMetricTable.TRANSACTION_CALLS.getName()).field(ServiceReferenceMetricTable.TRANSACTION_CALLS.getName())); - aggregationBuilder.subAggregation(AggregationBuilders.sum(ServiceReferenceMetricTable.TRANSACTION_ERROR_CALLS.getName()).field(ServiceReferenceMetricTable.TRANSACTION_ERROR_CALLS.getName())); - aggregationBuilder.subAggregation(AggregationBuilders.sum(ServiceReferenceMetricTable.TRANSACTION_DURATION_SUM.getName()).field(ServiceReferenceMetricTable.TRANSACTION_DURATION_SUM.getName())); - aggregationBuilder.subAggregation(AggregationBuilders.sum(ServiceReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName()).field(ServiceReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName())); - - searchRequestBuilder.addAggregation(aggregationBuilder); - SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - - List referenceMetrics = new LinkedList<>(); - Terms behindServiceIdTerms = searchResponse.getAggregations().get(ServiceReferenceMetricTable.BEHIND_SERVICE_ID.getName()); - buildNodeByFrontServiceId(referenceMetrics, behindServiceIdTerms, frontServiceId); - - return referenceMetrics; - } - - private void buildNodeByFrontServiceId(List referenceMetrics, Terms behindServiceIdTerms, - int frontServiceId) { - behindServiceIdTerms.getBuckets().forEach(behindServiceIdBucket -> { - int behindServiceId = behindServiceIdBucket.getKeyAsNumber().intValue(); - - Sum callsSum = behindServiceIdBucket.getAggregations().get(ServiceReferenceMetricTable.TRANSACTION_CALLS.getName()); - Sum errorCallsSum = behindServiceIdBucket.getAggregations().get(ServiceReferenceMetricTable.TRANSACTION_ERROR_CALLS.getName()); - Sum durationSum = behindServiceIdBucket.getAggregations().get(ServiceReferenceMetricTable.TRANSACTION_DURATION_SUM.getName()); - Sum errorDurationSum = behindServiceIdBucket.getAggregations().get(ServiceReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName()); - - ServiceReferenceMetric referenceMetric = new ServiceReferenceMetric(); - referenceMetric.setSource(frontServiceId); - referenceMetric.setTarget(behindServiceId); - referenceMetric.setCalls((long)callsSum.getValue()); - referenceMetric.setErrorCalls((long)errorCallsSum.getValue()); - referenceMetric.setDurations((long)durationSum.getValue()); - referenceMetric.setErrorDurations((long)errorDurationSum.getValue()); - referenceMetrics.add(referenceMetric); - }); - } - - private void buildNodeByBehindServiceId(List referenceMetrics, Terms frontServiceIdTerms, - int behindServiceId) { - frontServiceIdTerms.getBuckets().forEach(frontServiceIdBucket -> { - int frontServiceId = frontServiceIdBucket.getKeyAsNumber().intValue(); - - Sum callsSum = frontServiceIdBucket.getAggregations().get(ServiceReferenceMetricTable.TRANSACTION_CALLS.getName()); - Sum errorCallsSum = frontServiceIdBucket.getAggregations().get(ServiceReferenceMetricTable.TRANSACTION_ERROR_CALLS.getName()); - Sum durationSum = frontServiceIdBucket.getAggregations().get(ServiceReferenceMetricTable.TRANSACTION_DURATION_SUM.getName()); - Sum errorDurationSum = frontServiceIdBucket.getAggregations().get(ServiceReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName()); - - ServiceReferenceMetric referenceMetric = new ServiceReferenceMetric(); - referenceMetric.setTarget(behindServiceId); - referenceMetric.setSource(frontServiceId); - referenceMetric.setCalls((long)callsSum.getValue()); - referenceMetric.setErrorCalls((long)errorCallsSum.getValue()); - referenceMetric.setDurations((long)durationSum.getValue()); - referenceMetric.setErrorDurations((long)errorDurationSum.getValue()); - referenceMetrics.add(referenceMetric); - }); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/GlobalTraceEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/GlobalTraceEsTableDefine.java deleted file mode 100644 index 2821c82c9d4a2bbae63c9d4c266fcb6562558102..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/GlobalTraceEsTableDefine.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.global.GlobalTraceTable; - -/** - * @author peng-yongsheng - */ -public class GlobalTraceEsTableDefine extends ElasticSearchTableDefine { - - public GlobalTraceEsTableDefine() { - super(GlobalTraceTable.TABLE); - } - - @Override public int refreshInterval() { - return 10; - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(GlobalTraceTable.SEGMENT_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(GlobalTraceTable.TRACE_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(GlobalTraceTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/SegmentDurationEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/SegmentDurationEsTableDefine.java deleted file mode 100644 index c6d9b2694823990c1781ea119f75d4d34c8a7f05..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/SegmentDurationEsTableDefine.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentDurationTable; - -/** - * @author peng-yongsheng - */ -public class SegmentDurationEsTableDefine extends ElasticSearchTableDefine { - - public SegmentDurationEsTableDefine() { - super(SegmentDurationTable.TABLE); - } - - @Override public int refreshInterval() { - return 10; - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(SegmentDurationTable.SEGMENT_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(SegmentDurationTable.APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(SegmentDurationTable.SERVICE_NAME, ElasticSearchColumnDefine.Type.Text.name())); - addColumn(new ElasticSearchColumnDefine(SegmentDurationTable.TRACE_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(SegmentDurationTable.DURATION, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(SegmentDurationTable.START_TIME, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(SegmentDurationTable.END_TIME, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(SegmentDurationTable.IS_ERROR, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(SegmentDurationTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/SegmentEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/SegmentEsTableDefine.java deleted file mode 100644 index 002962092f318beb5f159bf2ba54493a4932d317..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/SegmentEsTableDefine.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define; - -import org.apache.skywalking.apm.collector.storage.es.base.define.*; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentTable; - -/** - * @author peng-yongsheng - */ -public class SegmentEsTableDefine extends ElasticSearchTableDefine { - - public SegmentEsTableDefine() { - super(SegmentTable.TABLE); - } - - @Override public int refreshInterval() { - return 10; - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(SegmentTable.DATA_BINARY, ElasticSearchColumnDefine.Type.Binary.name())); - addColumn(new ElasticSearchColumnDefine(SegmentTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/acp/AbstractApplicationComponentEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/acp/AbstractApplicationComponentEsTableDefine.java deleted file mode 100644 index 364e1ad061cf5171eb66a2966b69843a3bc29b74..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/acp/AbstractApplicationComponentEsTableDefine.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.acp; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationComponentEsTableDefine extends ElasticSearchTableDefine { - - AbstractApplicationComponentEsTableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new ElasticSearchColumnDefine(ApplicationComponentTable.METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationComponentTable.COMPONENT_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationComponentTable.APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationComponentTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/acp/ApplicationComponentDayEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/acp/ApplicationComponentDayEsTableDefine.java deleted file mode 100644 index 3ea4819fa4b7553fd0d0ab84628067a7b31b3314..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/acp/ApplicationComponentDayEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.acp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentDayEsTableDefine extends AbstractApplicationComponentEsTableDefine { - - public ApplicationComponentDayEsTableDefine() { - super(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/acp/ApplicationComponentHourEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/acp/ApplicationComponentHourEsTableDefine.java deleted file mode 100644 index 93eda61bded776a85ac57d22ce50a64261066ef4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/acp/ApplicationComponentHourEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.acp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentHourEsTableDefine extends AbstractApplicationComponentEsTableDefine { - - public ApplicationComponentHourEsTableDefine() { - super(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/acp/ApplicationComponentMinuteEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/acp/ApplicationComponentMinuteEsTableDefine.java deleted file mode 100644 index 53319963ff6c9c8160e6992d38e1f92ce1195e0b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/acp/ApplicationComponentMinuteEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.acp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentMinuteEsTableDefine extends AbstractApplicationComponentEsTableDefine { - - public ApplicationComponentMinuteEsTableDefine() { - super(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/acp/ApplicationComponentMonthEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/acp/ApplicationComponentMonthEsTableDefine.java deleted file mode 100644 index de551be83c69a9b4fdb7f91f216c3900870c2ed0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/acp/ApplicationComponentMonthEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.acp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentMonthEsTableDefine extends AbstractApplicationComponentEsTableDefine { - - public ApplicationComponentMonthEsTableDefine() { - super(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/AbstractApplicationAlarmListEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/AbstractApplicationAlarmListEsTableDefine.java deleted file mode 100644 index f690062f43eed6ece170f0a6363789139ba45959..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/AbstractApplicationAlarmListEsTableDefine.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.alarm; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationAlarmListEsTableDefine extends ElasticSearchTableDefine { - - AbstractApplicationAlarmListEsTableDefine(String name) { - super(name); - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(ApplicationAlarmListTable.METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationAlarmListTable.ALARM_CONTENT, ElasticSearchColumnDefine.Type.Text.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationAlarmListTable.APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationAlarmListTable.SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationAlarmListTable.ALARM_TYPE, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationAlarmListTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationAlarmEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationAlarmEsTableDefine.java deleted file mode 100644 index 0d31cbcf8b59aa217a95b3cf5bd1d3e8f2dbed0e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationAlarmEsTableDefine.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.alarm; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmEsTableDefine extends ElasticSearchTableDefine { - - public ApplicationAlarmEsTableDefine() { - super(ApplicationAlarmTable.TABLE); - } - - @Override public int refreshInterval() { - return 2; - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(ApplicationAlarmTable.APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(ApplicationAlarmTable.SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationAlarmTable.ALARM_TYPE, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(ApplicationAlarmTable.ALARM_CONTENT, ElasticSearchColumnDefine.Type.Text.name())); - - addColumn(new ElasticSearchColumnDefine(ApplicationAlarmTable.LAST_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationAlarmListDayEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationAlarmListDayEsTableDefine.java deleted file mode 100644 index b27c60f88ee645a6a56b72410cfef41fb2d42d5a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationAlarmListDayEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.alarm; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmListDayEsTableDefine extends AbstractApplicationAlarmListEsTableDefine { - - public ApplicationAlarmListDayEsTableDefine() { - super(ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationAlarmListHourEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationAlarmListHourEsTableDefine.java deleted file mode 100644 index d5b20981ad14779c48da8c6415b9727573fc3b80..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationAlarmListHourEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.alarm; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmListHourEsTableDefine extends AbstractApplicationAlarmListEsTableDefine { - - public ApplicationAlarmListHourEsTableDefine() { - super(ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationAlarmListMinuteEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationAlarmListMinuteEsTableDefine.java deleted file mode 100644 index 6eb65ebabea79a0ec3c38bfaf2dfce4904e44aac..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationAlarmListMinuteEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.alarm; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmListMinuteEsTableDefine extends AbstractApplicationAlarmListEsTableDefine { - - public ApplicationAlarmListMinuteEsTableDefine() { - super(ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationAlarmListMonthEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationAlarmListMonthEsTableDefine.java deleted file mode 100644 index 8d84017fb6e093e22e2d3ecfafed9d5ab8bb55e7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationAlarmListMonthEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.alarm; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmListMonthEsTableDefine extends AbstractApplicationAlarmListEsTableDefine { - - public ApplicationAlarmListMonthEsTableDefine() { - super(ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationReferenceAlarmEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationReferenceAlarmEsTableDefine.java deleted file mode 100644 index b866131390522ad04c6b547b9dd97b589b92607b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationReferenceAlarmEsTableDefine.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.alarm; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceAlarmEsTableDefine extends ElasticSearchTableDefine { - - public ApplicationReferenceAlarmEsTableDefine() { - super(ApplicationReferenceAlarmTable.TABLE); - } - - @Override public int refreshInterval() { - return 2; - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceAlarmTable.FRONT_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceAlarmTable.BEHIND_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceAlarmTable.SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceAlarmTable.ALARM_TYPE, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceAlarmTable.ALARM_CONTENT, ElasticSearchColumnDefine.Type.Text.name())); - - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceAlarmTable.LAST_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationReferenceAlarmListEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationReferenceAlarmListEsTableDefine.java deleted file mode 100644 index c1d041837df070f298d2bf61baaf0acd154770a0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationReferenceAlarmListEsTableDefine.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.alarm; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceAlarmListEsTableDefine extends ElasticSearchTableDefine { - - public ApplicationReferenceAlarmListEsTableDefine() { - super(ApplicationReferenceAlarmListTable.TABLE); - } - - @Override public int refreshInterval() { - return 2; - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceAlarmListTable.FRONT_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceAlarmListTable.BEHIND_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceAlarmListTable.SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceAlarmListTable.ALARM_TYPE, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceAlarmListTable.ALARM_CONTENT, ElasticSearchColumnDefine.Type.Text.name())); - - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceAlarmListTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/InstanceAlarmEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/InstanceAlarmEsTableDefine.java deleted file mode 100644 index bc876c8ce5843180818b11ce71456c4f47a6e367..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/InstanceAlarmEsTableDefine.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.alarm; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmTable; - -/** - * @author peng-yongsheng - */ -public class InstanceAlarmEsTableDefine extends ElasticSearchTableDefine { - - public InstanceAlarmEsTableDefine() { - super(InstanceAlarmTable.TABLE); - } - - @Override public int refreshInterval() { - return 2; - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(InstanceAlarmTable.APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceAlarmTable.INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceAlarmTable.SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceAlarmTable.ALARM_TYPE, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceAlarmTable.ALARM_CONTENT, ElasticSearchColumnDefine.Type.Text.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceAlarmTable.LAST_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/InstanceAlarmListEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/InstanceAlarmListEsTableDefine.java deleted file mode 100644 index c25977c73c404eaf42ebeb3027b1fac59b6eeea1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/InstanceAlarmListEsTableDefine.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.alarm; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class InstanceAlarmListEsTableDefine extends ElasticSearchTableDefine { - - public InstanceAlarmListEsTableDefine() { - super(InstanceAlarmListTable.TABLE); - } - - @Override public int refreshInterval() { - return 2; - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(InstanceAlarmListTable.APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceAlarmListTable.INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceAlarmListTable.SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceAlarmListTable.ALARM_TYPE, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceAlarmListTable.ALARM_CONTENT, ElasticSearchColumnDefine.Type.Text.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceAlarmListTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/InstanceReferenceAlarmEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/InstanceReferenceAlarmEsTableDefine.java deleted file mode 100644 index b65e1d72470161f2bc24663aaae5060b4b207343..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/InstanceReferenceAlarmEsTableDefine.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.alarm; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceAlarmEsTableDefine extends ElasticSearchTableDefine { - - public InstanceReferenceAlarmEsTableDefine() { - super(InstanceReferenceAlarmTable.TABLE); - } - - @Override public int refreshInterval() { - return 2; - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(InstanceReferenceAlarmTable.FRONT_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceAlarmTable.BEHIND_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceAlarmTable.FRONT_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceAlarmTable.BEHIND_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceReferenceAlarmTable.SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceAlarmTable.ALARM_TYPE, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceReferenceAlarmTable.ALARM_CONTENT, ElasticSearchColumnDefine.Type.Text.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceReferenceAlarmTable.LAST_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/InstanceReferenceAlarmListEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/InstanceReferenceAlarmListEsTableDefine.java deleted file mode 100644 index 5e5fd158b9270b44708c4b5b69ec13627589d3eb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/InstanceReferenceAlarmListEsTableDefine.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.alarm; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceAlarmListEsTableDefine extends ElasticSearchTableDefine { - - public InstanceReferenceAlarmListEsTableDefine() { - super(InstanceReferenceAlarmListTable.TABLE); - } - - @Override public int refreshInterval() { - return 2; - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(InstanceReferenceAlarmListTable.FRONT_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceAlarmListTable.BEHIND_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceAlarmListTable.FRONT_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceAlarmListTable.BEHIND_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceReferenceAlarmListTable.SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceAlarmListTable.ALARM_TYPE, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceReferenceAlarmListTable.ALARM_CONTENT, ElasticSearchColumnDefine.Type.Text.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceReferenceAlarmListTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ServiceAlarmEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ServiceAlarmEsTableDefine.java deleted file mode 100644 index 09c0e03ef4ac4bfa3cc25e1ab3ae4e64df5a3e16..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ServiceAlarmEsTableDefine.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.alarm; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmTable; - -/** - * @author peng-yongsheng - */ -public class ServiceAlarmEsTableDefine extends ElasticSearchTableDefine { - - public ServiceAlarmEsTableDefine() { - super(ServiceAlarmTable.TABLE); - } - - @Override public int refreshInterval() { - return 2; - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(ServiceAlarmTable.APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceAlarmTable.INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceAlarmTable.SERVICE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceAlarmTable.SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceAlarmTable.ALARM_TYPE, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceAlarmTable.ALARM_CONTENT, ElasticSearchColumnDefine.Type.Text.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceAlarmTable.LAST_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ServiceAlarmListEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ServiceAlarmListEsTableDefine.java deleted file mode 100644 index 44c80c8ba51b1e58c95b4e8662f8570a15ab2886..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ServiceAlarmListEsTableDefine.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.alarm; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ServiceAlarmListEsTableDefine extends ElasticSearchTableDefine { - - public ServiceAlarmListEsTableDefine() { - super(ServiceAlarmListTable.TABLE); - } - - @Override public int refreshInterval() { - return 2; - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(ServiceAlarmListTable.APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceAlarmListTable.INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceAlarmListTable.SERVICE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceAlarmListTable.SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceAlarmListTable.ALARM_TYPE, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceAlarmListTable.ALARM_CONTENT, ElasticSearchColumnDefine.Type.Text.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceAlarmListTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ServiceReferenceAlarmEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ServiceReferenceAlarmEsTableDefine.java deleted file mode 100644 index 02f43bf56255cd5fa19d039068e909ef7030ad3b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ServiceReferenceAlarmEsTableDefine.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.alarm; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceAlarmEsTableDefine extends ElasticSearchTableDefine { - - public ServiceReferenceAlarmEsTableDefine() { - super(ServiceReferenceAlarmTable.TABLE); - } - - @Override public int refreshInterval() { - return 2; - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmTable.FRONT_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmTable.BEHIND_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmTable.FRONT_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmTable.BEHIND_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmTable.FRONT_SERVICE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmTable.BEHIND_SERVICE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmTable.SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmTable.ALARM_TYPE, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmTable.ALARM_CONTENT, ElasticSearchColumnDefine.Type.Text.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmTable.LAST_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ServiceReferenceAlarmListEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ServiceReferenceAlarmListEsTableDefine.java deleted file mode 100644 index 50f43835a1bfa98b3cff507269f94cac1bb8dcb9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ServiceReferenceAlarmListEsTableDefine.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.alarm; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceAlarmListEsTableDefine extends ElasticSearchTableDefine { - - public ServiceReferenceAlarmListEsTableDefine() { - super(ServiceReferenceAlarmListTable.TABLE); - } - - @Override public int refreshInterval() { - return 2; - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmListTable.FRONT_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmListTable.BEHIND_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmListTable.FRONT_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmListTable.BEHIND_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmListTable.FRONT_SERVICE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmListTable.BEHIND_SERVICE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmListTable.SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmListTable.ALARM_TYPE, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmListTable.ALARM_CONTENT, ElasticSearchColumnDefine.Type.Text.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceReferenceAlarmListTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/amp/AbstractApplicationMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/amp/AbstractApplicationMetricEsTableDefine.java deleted file mode 100644 index 435f4d5bb9caa999b7d493ea63ef0d50815b5b26..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/amp/AbstractApplicationMetricEsTableDefine.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.amp; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationMetricEsTableDefine extends ElasticSearchTableDefine { - - AbstractApplicationMetricEsTableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.TRANSACTION_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.TRANSACTION_ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.TRANSACTION_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.TRANSACTION_ERROR_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.TRANSACTION_AVERAGE_DURATION, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.BUSINESS_TRANSACTION_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.MQ_TRANSACTION_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.MQ_TRANSACTION_ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.MQ_TRANSACTION_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.SATISFIED_COUNT, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.TOLERATING_COUNT, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.FRUSTRATED_COUNT, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(ApplicationMetricTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/amp/ApplicationDayMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/amp/ApplicationDayMetricEsTableDefine.java deleted file mode 100644 index 6885f6dad5c77c5c7d488db9ea24afc1a0800d21..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/amp/ApplicationDayMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.amp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationDayMetricEsTableDefine extends AbstractApplicationMetricEsTableDefine { - - public ApplicationDayMetricEsTableDefine() { - super(ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/amp/ApplicationHourMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/amp/ApplicationHourMetricEsTableDefine.java deleted file mode 100644 index 9f073c7c203cc6c53be83846ff9e03fb439c0946..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/amp/ApplicationHourMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.amp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationHourMetricEsTableDefine extends AbstractApplicationMetricEsTableDefine { - - public ApplicationHourMetricEsTableDefine() { - super(ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/amp/ApplicationMinuteMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/amp/ApplicationMinuteMetricEsTableDefine.java deleted file mode 100644 index f877ad9d42519df6cc60cbe986284a8aeb510ed1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/amp/ApplicationMinuteMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.amp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMinuteMetricEsTableDefine extends AbstractApplicationMetricEsTableDefine { - - public ApplicationMinuteMetricEsTableDefine() { - super(ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/amp/ApplicationMonthMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/amp/ApplicationMonthMetricEsTableDefine.java deleted file mode 100644 index 2c348fec8452c87f4a6ad8de72b70063900ec13b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/amp/ApplicationMonthMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.amp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMonthMetricEsTableDefine extends AbstractApplicationMetricEsTableDefine { - - public ApplicationMonthMetricEsTableDefine() { - super(ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/ampp/AbstractApplicationMappingEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/ampp/AbstractApplicationMappingEsTableDefine.java deleted file mode 100644 index a2d18240d08df70b879efde7fc901bf91fd5c0e6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/ampp/AbstractApplicationMappingEsTableDefine.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.ampp; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationMappingEsTableDefine extends ElasticSearchTableDefine { - - AbstractApplicationMappingEsTableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new ElasticSearchColumnDefine(ApplicationMappingTable.METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMappingTable.APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMappingTable.MAPPING_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationMappingTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/ampp/ApplicationMappingDayEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/ampp/ApplicationMappingDayEsTableDefine.java deleted file mode 100644 index 6bc1d745452f5c4a067bb033441442f3c69a676a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/ampp/ApplicationMappingDayEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.ampp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingDayEsTableDefine extends AbstractApplicationMappingEsTableDefine { - - public ApplicationMappingDayEsTableDefine() { - super(ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/ampp/ApplicationMappingHourEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/ampp/ApplicationMappingHourEsTableDefine.java deleted file mode 100644 index 4d0f0500223bad135752c33e08d58ac804635375..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/ampp/ApplicationMappingHourEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.ampp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingHourEsTableDefine extends AbstractApplicationMappingEsTableDefine { - - public ApplicationMappingHourEsTableDefine() { - super(ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/ampp/ApplicationMappingMinuteEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/ampp/ApplicationMappingMinuteEsTableDefine.java deleted file mode 100644 index 0db6860b69468fda446837bec6a26f37f27382aa..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/ampp/ApplicationMappingMinuteEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.ampp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingMinuteEsTableDefine extends AbstractApplicationMappingEsTableDefine { - - public ApplicationMappingMinuteEsTableDefine() { - super(ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/ampp/ApplicationMappingMonthEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/ampp/ApplicationMappingMonthEsTableDefine.java deleted file mode 100644 index e6aed5b2d9fd12bd0ee7b5f5651c4c9b48f81716..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/ampp/ApplicationMappingMonthEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.ampp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingMonthEsTableDefine extends AbstractApplicationMappingEsTableDefine { - - public ApplicationMappingMonthEsTableDefine() { - super(ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/armp/AbstractApplicationReferenceMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/armp/AbstractApplicationReferenceMetricEsTableDefine.java deleted file mode 100644 index f348d9ddf884f6b1336b78fa9edec2d7f2fa2fad..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/armp/AbstractApplicationReferenceMetricEsTableDefine.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.armp; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationReferenceMetricEsTableDefine extends ElasticSearchTableDefine { - - AbstractApplicationReferenceMetricEsTableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.FRONT_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.BEHIND_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.TRANSACTION_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.TRANSACTION_ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.TRANSACTION_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.TRANSACTION_AVERAGE_DURATION, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.MQ_TRANSACTION_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.MQ_TRANSACTION_ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.MQ_TRANSACTION_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.SATISFIED_COUNT, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.TOLERATING_COUNT, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.FRUSTRATED_COUNT, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationReferenceMetricTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/armp/ApplicationReferenceDayMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/armp/ApplicationReferenceDayMetricEsTableDefine.java deleted file mode 100644 index 3f297578a2bbb5280a3f4415455e890550ea1741..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/armp/ApplicationReferenceDayMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.armp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceDayMetricEsTableDefine extends AbstractApplicationReferenceMetricEsTableDefine { - - public ApplicationReferenceDayMetricEsTableDefine() { - super(ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/armp/ApplicationReferenceHourMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/armp/ApplicationReferenceHourMetricEsTableDefine.java deleted file mode 100644 index 6fde37dca8675c9ec6ca7c69fac1d7c43f9c7d27..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/armp/ApplicationReferenceHourMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.armp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceHourMetricEsTableDefine extends AbstractApplicationReferenceMetricEsTableDefine { - - public ApplicationReferenceHourMetricEsTableDefine() { - super(ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/armp/ApplicationReferenceMinuteMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/armp/ApplicationReferenceMinuteMetricEsTableDefine.java deleted file mode 100644 index a55ba6a262747749a67a0dbe543fb51ddd1c1c90..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/armp/ApplicationReferenceMinuteMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.armp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMinuteMetricEsTableDefine extends AbstractApplicationReferenceMetricEsTableDefine { - - public ApplicationReferenceMinuteMetricEsTableDefine() { - super(ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/armp/ApplicationReferenceMonthMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/armp/ApplicationReferenceMonthMetricEsTableDefine.java deleted file mode 100644 index 7b241a931b670adc67eb2454ac8674dc7813f3c7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/armp/ApplicationReferenceMonthMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.armp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMonthMetricEsTableDefine extends AbstractApplicationReferenceMetricEsTableDefine { - - public ApplicationReferenceMonthMetricEsTableDefine() { - super(ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/AbstractCpuMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/AbstractCpuMetricEsTableDefine.java deleted file mode 100644 index 8c28c04e5fde0cfe69ff42611664b6199e928e5b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/AbstractCpuMetricEsTableDefine.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.cpu; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractCpuMetricEsTableDefine extends ElasticSearchTableDefine { - - AbstractCpuMetricEsTableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new ElasticSearchColumnDefine(CpuMetricTable.ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(CpuMetricTable.METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(CpuMetricTable.INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(CpuMetricTable.USAGE_PERCENT, ElasticSearchColumnDefine.Type.Double.name())); - addColumn(new ElasticSearchColumnDefine(CpuMetricTable.TIMES, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(CpuMetricTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuDayMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuDayMetricEsTableDefine.java deleted file mode 100644 index 65b3115b638f7596f38df37d47e812b4c348803a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuDayMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.cpu; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author peng-yongsheng - */ -public class CpuDayMetricEsTableDefine extends AbstractCpuMetricEsTableDefine { - - public CpuDayMetricEsTableDefine() { - super(CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuHourMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuHourMetricEsTableDefine.java deleted file mode 100644 index 4fd55b564ae4a1fdf010fee385e90a58b01cf1de..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuHourMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.cpu; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author peng-yongsheng - */ -public class CpuHourMetricEsTableDefine extends AbstractCpuMetricEsTableDefine { - - public CpuHourMetricEsTableDefine() { - super(CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuMinuteMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuMinuteMetricEsTableDefine.java deleted file mode 100644 index ecc168d1bafcd894219bca455dbc1c5ec8f8bdf8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuMinuteMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.cpu; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author peng-yongsheng - */ -public class CpuMinuteMetricEsTableDefine extends AbstractCpuMetricEsTableDefine { - - public CpuMinuteMetricEsTableDefine() { - super(CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuMonthMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuMonthMetricEsTableDefine.java deleted file mode 100644 index a4e941b692b489d5dcdc28b91dd44faf0de9319d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuMonthMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.cpu; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author peng-yongsheng - */ -public class CpuMonthMetricEsTableDefine extends AbstractCpuMetricEsTableDefine { - - public CpuMonthMetricEsTableDefine() { - super(CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/gc/AbstractGCMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/gc/AbstractGCMetricEsTableDefine.java deleted file mode 100644 index 05a9d92b1a3e8ef91d479be44212a3102aaf96f8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/gc/AbstractGCMetricEsTableDefine.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.gc; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractGCMetricEsTableDefine extends ElasticSearchTableDefine { - - AbstractGCMetricEsTableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new ElasticSearchColumnDefine(GCMetricTable.ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(GCMetricTable.METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(GCMetricTable.INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(GCMetricTable.PHRASE, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(GCMetricTable.COUNT, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(GCMetricTable.DURATION, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(GCMetricTable.TIMES, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(GCMetricTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/gc/GCDayMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/gc/GCDayMetricEsTableDefine.java deleted file mode 100644 index 11fe38b42db44f613f5f7e94c92723bb3f652dcb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/gc/GCDayMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.gc; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author peng-yongsheng - */ -public class GCDayMetricEsTableDefine extends AbstractGCMetricEsTableDefine { - - public GCDayMetricEsTableDefine() { - super(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/gc/GCHourMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/gc/GCHourMetricEsTableDefine.java deleted file mode 100644 index 3fd42492a86d79ea9800072c9d705ef829bb031f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/gc/GCHourMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.gc; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author peng-yongsheng - */ -public class GCHourMetricEsTableDefine extends AbstractGCMetricEsTableDefine { - - public GCHourMetricEsTableDefine() { - super(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/gc/GCMinuteMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/gc/GCMinuteMetricEsTableDefine.java deleted file mode 100644 index de3403c769de279a609816074ff0a5978c4c2b71..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/gc/GCMinuteMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.gc; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author peng-yongsheng - */ -public class GCMinuteMetricEsTableDefine extends AbstractGCMetricEsTableDefine { - - public GCMinuteMetricEsTableDefine() { - super(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/gc/GCMonthMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/gc/GCMonthMetricEsTableDefine.java deleted file mode 100644 index 54e8619ecc29f1d941ee1a63f6e4480538ceb6e9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/gc/GCMonthMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.gc; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author peng-yongsheng - */ -public class GCMonthMetricEsTableDefine extends AbstractGCMetricEsTableDefine { - - public GCMonthMetricEsTableDefine() { - super(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/imp/AbstractInstanceMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/imp/AbstractInstanceMetricEsTableDefine.java deleted file mode 100644 index c2e39d33788a6fc82e2ca9b1feb6270fa12eb51d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/imp/AbstractInstanceMetricEsTableDefine.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.imp; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractInstanceMetricEsTableDefine extends ElasticSearchTableDefine { - - AbstractInstanceMetricEsTableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.TRANSACTION_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.TRANSACTION_ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.TRANSACTION_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.TRANSACTION_ERROR_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.TRANSACTION_AVERAGE_DURATION, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.BUSINESS_TRANSACTION_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.MQ_TRANSACTION_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.MQ_TRANSACTION_ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.MQ_TRANSACTION_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceMetricTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/imp/InstanceDayMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/imp/InstanceDayMetricEsTableDefine.java deleted file mode 100644 index ae9a8995bf79bc000e8ffb968be08b07b28e47c5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/imp/InstanceDayMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.imp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceDayMetricEsTableDefine extends AbstractInstanceMetricEsTableDefine { - - public InstanceDayMetricEsTableDefine() { - super(InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/imp/InstanceHourMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/imp/InstanceHourMetricEsTableDefine.java deleted file mode 100644 index 51a48c0c7a6233d89ac823a8c6cefd5e9fc2b75a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/imp/InstanceHourMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.imp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceHourMetricEsTableDefine extends AbstractInstanceMetricEsTableDefine { - - public InstanceHourMetricEsTableDefine() { - super(InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/imp/InstanceMinuteMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/imp/InstanceMinuteMetricEsTableDefine.java deleted file mode 100644 index ce0dce50c8d188e552a16c51f385a69fd34f65fb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/imp/InstanceMinuteMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.imp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMinuteMetricEsTableDefine extends AbstractInstanceMetricEsTableDefine { - - public InstanceMinuteMetricEsTableDefine() { - super(InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/imp/InstanceMonthMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/imp/InstanceMonthMetricEsTableDefine.java deleted file mode 100644 index da37fb58b0d99d5819aca0aec192b32e73a703d8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/imp/InstanceMonthMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.imp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMonthMetricEsTableDefine extends AbstractInstanceMetricEsTableDefine { - - public InstanceMonthMetricEsTableDefine() { - super(InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/impp/AbstractInstanceMappingEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/impp/AbstractInstanceMappingEsTableDefine.java deleted file mode 100644 index c52e30e17c2630fb1269b53d8d481691d46b9172..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/impp/AbstractInstanceMappingEsTableDefine.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.impp; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractInstanceMappingEsTableDefine extends ElasticSearchTableDefine { - - AbstractInstanceMappingEsTableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new ElasticSearchColumnDefine(InstanceMappingTable.ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMappingTable.METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMappingTable.APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMappingTable.INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMappingTable.ADDRESS_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceMappingTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/impp/InstanceMappingDayEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/impp/InstanceMappingDayEsTableDefine.java deleted file mode 100644 index 0353eac1e97de1082c5e363c0981c4e7da6537de..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/impp/InstanceMappingDayEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.impp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingDayEsTableDefine extends AbstractInstanceMappingEsTableDefine { - - public InstanceMappingDayEsTableDefine() { - super(InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/impp/InstanceMappingHourEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/impp/InstanceMappingHourEsTableDefine.java deleted file mode 100644 index 30d969fe0554ad963e033001b91780d4c975ba76..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/impp/InstanceMappingHourEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.impp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingHourEsTableDefine extends AbstractInstanceMappingEsTableDefine { - - public InstanceMappingHourEsTableDefine() { - super(InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/impp/InstanceMappingMinuteEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/impp/InstanceMappingMinuteEsTableDefine.java deleted file mode 100644 index 1dfd567a5047b73e2c083b5d7452301678c70f8f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/impp/InstanceMappingMinuteEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.impp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingMinuteEsTableDefine extends AbstractInstanceMappingEsTableDefine { - - public InstanceMappingMinuteEsTableDefine() { - super(InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/impp/InstanceMappingMonthEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/impp/InstanceMappingMonthEsTableDefine.java deleted file mode 100644 index 2f6e57ed683e5ea7b80c7299ccf50c729a586166..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/impp/InstanceMappingMonthEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.impp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingMonthEsTableDefine extends AbstractInstanceMappingEsTableDefine { - - public InstanceMappingMonthEsTableDefine() { - super(InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/irmp/AbstractInstanceReferenceMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/irmp/AbstractInstanceReferenceMetricEsTableDefine.java deleted file mode 100644 index da021abd47fb02f217454dda366fb29c228eb82c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/irmp/AbstractInstanceReferenceMetricEsTableDefine.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.irmp; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractInstanceReferenceMetricEsTableDefine extends ElasticSearchTableDefine { - - AbstractInstanceReferenceMetricEsTableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.FRONT_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.FRONT_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.BEHIND_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.BEHIND_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.TRANSACTION_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.TRANSACTION_ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.TRANSACTION_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.TRANSACTION_AVERAGE_DURATION, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.MQ_TRANSACTION_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.MQ_TRANSACTION_ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.MQ_TRANSACTION_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(InstanceReferenceMetricTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/irmp/InstanceReferenceDayMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/irmp/InstanceReferenceDayMetricEsTableDefine.java deleted file mode 100644 index e633c972eedcd98722b9a4b731ae2a1e188043e7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/irmp/InstanceReferenceDayMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.irmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceDayMetricEsTableDefine extends AbstractInstanceReferenceMetricEsTableDefine { - - public InstanceReferenceDayMetricEsTableDefine() { - super(InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/irmp/InstanceReferenceHourMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/irmp/InstanceReferenceHourMetricEsTableDefine.java deleted file mode 100644 index 09db9ae742a421b8f823e9d2aa872d68f198b269..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/irmp/InstanceReferenceHourMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.irmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceHourMetricEsTableDefine extends AbstractInstanceReferenceMetricEsTableDefine { - - public InstanceReferenceHourMetricEsTableDefine() { - super(InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/irmp/InstanceReferenceMinuteMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/irmp/InstanceReferenceMinuteMetricEsTableDefine.java deleted file mode 100644 index a8046b40c92d78766fdc1bd474e69460dc5e4579..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/irmp/InstanceReferenceMinuteMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.irmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMinuteMetricEsTableDefine extends AbstractInstanceReferenceMetricEsTableDefine { - - public InstanceReferenceMinuteMetricEsTableDefine() { - super(InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/irmp/InstanceReferenceMonthMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/irmp/InstanceReferenceMonthMetricEsTableDefine.java deleted file mode 100644 index 90360ef3e65f42803fe28bf4e515f9a22f343a5e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/irmp/InstanceReferenceMonthMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.irmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMonthMetricEsTableDefine extends AbstractInstanceReferenceMetricEsTableDefine { - - public InstanceReferenceMonthMetricEsTableDefine() { - super(InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/memory/AbstractMemoryMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/memory/AbstractMemoryMetricEsTableDefine.java deleted file mode 100644 index e4a2810f07fd478ea7cedbe55c598d087ee1a7aa..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/memory/AbstractMemoryMetricEsTableDefine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.memory; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractMemoryMetricEsTableDefine extends ElasticSearchTableDefine { - - AbstractMemoryMetricEsTableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.IS_HEAP, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.INIT, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.MAX, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.USED, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.COMMITTED, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.TIMES, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(MemoryMetricTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/memory/MemoryDayMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/memory/MemoryDayMetricEsTableDefine.java deleted file mode 100644 index 8f59a93ab18501be8a5e6b75d36de3c2fbd3787a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/memory/MemoryDayMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.memory; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryDayMetricEsTableDefine extends AbstractMemoryMetricEsTableDefine { - - public MemoryDayMetricEsTableDefine() { - super(MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/memory/MemoryHourMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/memory/MemoryHourMetricEsTableDefine.java deleted file mode 100644 index e0606fe8a053e2ead8573f618bc40d69dd63c657..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/memory/MemoryHourMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.memory; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryHourMetricEsTableDefine extends AbstractMemoryMetricEsTableDefine { - - public MemoryHourMetricEsTableDefine() { - super(MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/memory/MemoryMinuteMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/memory/MemoryMinuteMetricEsTableDefine.java deleted file mode 100644 index 51129ef05bb6c8c3d8e256463f568f4242a2b9f0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/memory/MemoryMinuteMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.memory; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryMinuteMetricEsTableDefine extends AbstractMemoryMetricEsTableDefine { - - public MemoryMinuteMetricEsTableDefine() { - super(MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/memory/MemoryMonthMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/memory/MemoryMonthMetricEsTableDefine.java deleted file mode 100644 index 6e9368b3d4e488c66a1f6e7d4c95415ddf814fc4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/memory/MemoryMonthMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.memory; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryMonthMetricEsTableDefine extends AbstractMemoryMetricEsTableDefine { - - public MemoryMonthMetricEsTableDefine() { - super(MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/mpool/AbstractMemoryPoolMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/mpool/AbstractMemoryPoolMetricEsTableDefine.java deleted file mode 100644 index d8cb0a4093090583fb66b9f7c485d2a452cbaed1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/mpool/AbstractMemoryPoolMetricEsTableDefine.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.mpool; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractMemoryPoolMetricEsTableDefine extends ElasticSearchTableDefine { - - AbstractMemoryPoolMetricEsTableDefine(String name) { - super(name); - } - - @Override public int refreshInterval() { - return 1; - } - - @Override public final void initialize() { - addColumn(new ElasticSearchColumnDefine(MemoryPoolMetricTable.ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(MemoryPoolMetricTable.METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(MemoryPoolMetricTable.INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(MemoryPoolMetricTable.POOL_TYPE, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(MemoryPoolMetricTable.INIT, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(MemoryPoolMetricTable.MAX, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(MemoryPoolMetricTable.USED, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(MemoryPoolMetricTable.COMMITTED, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(MemoryPoolMetricTable.TIMES, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(MemoryPoolMetricTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/mpool/MemoryPoolDayMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/mpool/MemoryPoolDayMetricEsTableDefine.java deleted file mode 100644 index 846582d4f8233fcdb88397f71409b270648e6709..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/mpool/MemoryPoolDayMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.mpool; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolDayMetricEsTableDefine extends AbstractMemoryPoolMetricEsTableDefine { - - public MemoryPoolDayMetricEsTableDefine() { - super(MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/mpool/MemoryPoolHourMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/mpool/MemoryPoolHourMetricEsTableDefine.java deleted file mode 100644 index 530428a962aaabc14a13f34aa3dd074e2d6c1fa3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/mpool/MemoryPoolHourMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.mpool; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolHourMetricEsTableDefine extends AbstractMemoryPoolMetricEsTableDefine { - - public MemoryPoolHourMetricEsTableDefine() { - super(MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/mpool/MemoryPoolMinuteMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/mpool/MemoryPoolMinuteMetricEsTableDefine.java deleted file mode 100644 index 024cadf21bc1323606f8283dcc48732e421ef90a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/mpool/MemoryPoolMinuteMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.mpool; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolMinuteMetricEsTableDefine extends AbstractMemoryPoolMetricEsTableDefine { - - public MemoryPoolMinuteMetricEsTableDefine() { - super(MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/mpool/MemoryPoolMonthMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/mpool/MemoryPoolMonthMetricEsTableDefine.java deleted file mode 100644 index 3ce6fa2ac2a1e0016ff21086e75271d2671926a4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/mpool/MemoryPoolMonthMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.mpool; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolMonthMetricEsTableDefine extends AbstractMemoryPoolMetricEsTableDefine { - - public MemoryPoolMonthMetricEsTableDefine() { - super(MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/register/ApplicationEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/register/ApplicationEsTableDefine.java deleted file mode 100644 index 1b3cbe47208d86e5fbe90518aad45527f4709192..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/register/ApplicationEsTableDefine.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.register; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.register.ApplicationTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationEsTableDefine extends ElasticSearchTableDefine { - - public ApplicationEsTableDefine() { - super(ApplicationTable.TABLE); - } - - @Override public int refreshInterval() { - return 2; - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(ApplicationTable.APPLICATION_CODE, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationTable.APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationTable.ADDRESS_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ApplicationTable.IS_ADDRESS, ElasticSearchColumnDefine.Type.Integer.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/register/InstanceEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/register/InstanceEsTableDefine.java deleted file mode 100644 index d818c5e270bdb97dffa957d51419ade1b51acb3e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/register/InstanceEsTableDefine.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.register; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; - -/** - * @author peng-yongsheng - */ -public class InstanceEsTableDefine extends ElasticSearchTableDefine { - - public InstanceEsTableDefine() { - super(InstanceTable.TABLE); - } - - @Override public int refreshInterval() { - return 2; - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(InstanceTable.APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceTable.APPLICATION_CODE, ElasticSearchColumnDefine.Type.Text.name())); - addColumn(new ElasticSearchColumnDefine(InstanceTable.AGENT_UUID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(InstanceTable.REGISTER_TIME, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceTable.INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceTable.HEARTBEAT_TIME, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(InstanceTable.OS_INFO, ElasticSearchColumnDefine.Type.Text.name())); - addColumn(new ElasticSearchColumnDefine(InstanceTable.ADDRESS_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(InstanceTable.IS_ADDRESS, ElasticSearchColumnDefine.Type.Integer.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/register/NetworkAddressEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/register/NetworkAddressEsTableDefine.java deleted file mode 100644 index c281a3b557124c4f152c9dc5a16bfa5891e52b24..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/register/NetworkAddressEsTableDefine.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.register; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddressTable; - -/** - * @author peng-yongsheng - */ -public class NetworkAddressEsTableDefine extends ElasticSearchTableDefine { - - public NetworkAddressEsTableDefine() { - super(NetworkAddressTable.TABLE); - } - - @Override public int refreshInterval() { - return 1; - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(NetworkAddressTable.NETWORK_ADDRESS, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(NetworkAddressTable.ADDRESS_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(NetworkAddressTable.SRC_SPAN_LAYER, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(NetworkAddressTable.SERVER_TYPE, ElasticSearchColumnDefine.Type.Integer.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/register/ServiceNameEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/register/ServiceNameEsTableDefine.java deleted file mode 100644 index fb37727d849732e80dab4db8bb6b8e9a95e7fe34..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/register/ServiceNameEsTableDefine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.register; - -import org.apache.skywalking.apm.collector.storage.es.base.define.*; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceNameTable; - -/** - * @author peng-yongsheng - */ -public class ServiceNameEsTableDefine extends ElasticSearchTableDefine { - - public ServiceNameEsTableDefine() { - super(ServiceNameTable.TABLE); - } - - @Override public int refreshInterval() { - return 2; - } - - @Override public void initialize() { - addColumn(new ElasticSearchColumnDefine(ServiceNameTable.APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceNameTable.SERVICE_NAME, ElasticSearchColumnDefine.Type.Text.name())); - addColumn(new ElasticSearchColumnDefine(ServiceNameTable.SERVICE_NAME_KEYWORD, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(ServiceNameTable.SERVICE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceNameTable.SRC_SPAN_TYPE, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceNameTable.REGISTER_TIME, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceNameTable.HEARTBEAT_TIME, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/rtd/AbstractResponseTimeDistributionEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/rtd/AbstractResponseTimeDistributionEsTableDefine.java deleted file mode 100644 index 0fb9099c2628a4b35a3dba403d52ec497ce97512..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/rtd/AbstractResponseTimeDistributionEsTableDefine.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.rtd; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractResponseTimeDistributionEsTableDefine extends ElasticSearchTableDefine { - - AbstractResponseTimeDistributionEsTableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new ElasticSearchColumnDefine(ResponseTimeDistributionTable.METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(ResponseTimeDistributionTable.STEP, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ResponseTimeDistributionTable.CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ResponseTimeDistributionTable.ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ResponseTimeDistributionTable.SUCCESS_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ResponseTimeDistributionTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/rtd/ResponseTimeDistributionDayEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/rtd/ResponseTimeDistributionDayEsTableDefine.java deleted file mode 100644 index bdc6c710dc78cb29987218bcda5dcf87b6670052..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/rtd/ResponseTimeDistributionDayEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.rtd; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionDayEsTableDefine extends AbstractResponseTimeDistributionEsTableDefine { - - public ResponseTimeDistributionDayEsTableDefine() { - super(ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/rtd/ResponseTimeDistributionHourEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/rtd/ResponseTimeDistributionHourEsTableDefine.java deleted file mode 100644 index a85fc6b6b3e82d4d625e34f8109d43fb4ae45724..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/rtd/ResponseTimeDistributionHourEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.rtd; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionHourEsTableDefine extends AbstractResponseTimeDistributionEsTableDefine { - - public ResponseTimeDistributionHourEsTableDefine() { - super(ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/rtd/ResponseTimeDistributionMinuteEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/rtd/ResponseTimeDistributionMinuteEsTableDefine.java deleted file mode 100644 index e102b4402ca745d3171c551172a485ae4fc0bff3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/rtd/ResponseTimeDistributionMinuteEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.rtd; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionMinuteEsTableDefine extends AbstractResponseTimeDistributionEsTableDefine { - - public ResponseTimeDistributionMinuteEsTableDefine() { - super(ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/rtd/ResponseTimeDistributionMonthEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/rtd/ResponseTimeDistributionMonthEsTableDefine.java deleted file mode 100644 index 3eb0d9453621cd292d733c9c1cb98674c5b3828d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/rtd/ResponseTimeDistributionMonthEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.rtd; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionMonthEsTableDefine extends AbstractResponseTimeDistributionEsTableDefine { - - public ResponseTimeDistributionMonthEsTableDefine() { - super(ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/smp/AbstractServiceMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/smp/AbstractServiceMetricEsTableDefine.java deleted file mode 100644 index 182334a6c1eff1a737bcc2666359d56ea899dfe3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/smp/AbstractServiceMetricEsTableDefine.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.smp; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractServiceMetricEsTableDefine extends ElasticSearchTableDefine { - - AbstractServiceMetricEsTableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.SERVICE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.TRANSACTION_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.TRANSACTION_ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.TRANSACTION_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.TRANSACTION_ERROR_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.TRANSACTION_AVERAGE_DURATION, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.BUSINESS_TRANSACTION_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.MQ_TRANSACTION_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.MQ_TRANSACTION_ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.MQ_TRANSACTION_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceMetricTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/smp/ServiceDayMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/smp/ServiceDayMetricEsTableDefine.java deleted file mode 100644 index f10d8e1dd7768bc044c6f51de72c19413e33e720..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/smp/ServiceDayMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.smp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceDayMetricEsTableDefine extends AbstractServiceMetricEsTableDefine { - - public ServiceDayMetricEsTableDefine() { - super(ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/smp/ServiceHourMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/smp/ServiceHourMetricEsTableDefine.java deleted file mode 100644 index 337d38d8042018b5153be4efce8c0c39e45e14f8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/smp/ServiceHourMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.smp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceHourMetricEsTableDefine extends AbstractServiceMetricEsTableDefine { - - public ServiceHourMetricEsTableDefine() { - super(ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/smp/ServiceMinuteMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/smp/ServiceMinuteMetricEsTableDefine.java deleted file mode 100644 index 714b6a714ebdd5ba1505a3391916de9bb81e2d3d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/smp/ServiceMinuteMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.smp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceMinuteMetricEsTableDefine extends AbstractServiceMetricEsTableDefine { - - public ServiceMinuteMetricEsTableDefine() { - super(ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/smp/ServiceMonthMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/smp/ServiceMonthMetricEsTableDefine.java deleted file mode 100644 index 073aebce859cb4af7b79b136add9f106fadbceb0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/smp/ServiceMonthMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.smp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceMonthMetricEsTableDefine extends AbstractServiceMetricEsTableDefine { - - public ServiceMonthMetricEsTableDefine() { - super(ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/srmp/AbstractServiceReferenceMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/srmp/AbstractServiceReferenceMetricEsTableDefine.java deleted file mode 100644 index 64a4f2ab40397ab01e55e6eacbbc8837a4789a1b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/srmp/AbstractServiceReferenceMetricEsTableDefine.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.srmp; - -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; -import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractServiceReferenceMetricEsTableDefine extends ElasticSearchTableDefine { - - AbstractServiceReferenceMetricEsTableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.METRIC_ID, ElasticSearchColumnDefine.Type.Keyword.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.FRONT_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.FRONT_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.FRONT_SERVICE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.BEHIND_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.BEHIND_INSTANCE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.BEHIND_SERVICE_ID, ElasticSearchColumnDefine.Type.Integer.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.TRANSACTION_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.TRANSACTION_ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.TRANSACTION_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.TRANSACTION_AVERAGE_DURATION, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.MQ_TRANSACTION_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.MQ_TRANSACTION_ERROR_CALLS, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.MQ_TRANSACTION_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, ElasticSearchColumnDefine.Type.Long.name())); - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, ElasticSearchColumnDefine.Type.Long.name())); - - addColumn(new ElasticSearchColumnDefine(ServiceReferenceMetricTable.TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/srmp/ServiceReferenceDayMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/srmp/ServiceReferenceDayMetricEsTableDefine.java deleted file mode 100644 index f7ed7ae0b87c49a5b71091f365cc07f9dd52805f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/srmp/ServiceReferenceDayMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.srmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceDayMetricEsTableDefine extends AbstractServiceReferenceMetricEsTableDefine { - - public ServiceReferenceDayMetricEsTableDefine() { - super(ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/srmp/ServiceReferenceHourMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/srmp/ServiceReferenceHourMetricEsTableDefine.java deleted file mode 100644 index 2ebf04e84c2d961b61faeb81cbaa35427abddf8f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/srmp/ServiceReferenceHourMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.srmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceHourMetricEsTableDefine extends AbstractServiceReferenceMetricEsTableDefine { - - public ServiceReferenceHourMetricEsTableDefine() { - super(ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/srmp/ServiceReferenceMinuteMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/srmp/ServiceReferenceMinuteMetricEsTableDefine.java deleted file mode 100644 index 9030753e427b7bc9c81f78813922bc4dd9dd5993..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/srmp/ServiceReferenceMinuteMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.srmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMinuteMetricEsTableDefine extends AbstractServiceReferenceMetricEsTableDefine { - - public ServiceReferenceMinuteMetricEsTableDefine() { - super(ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/srmp/ServiceReferenceMonthMetricEsTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/srmp/ServiceReferenceMonthMetricEsTableDefine.java deleted file mode 100644 index 147b3be1285eab4bbdc8848cfb69d69ce754d590..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/srmp/ServiceReferenceMonthMetricEsTableDefine.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.define.srmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMonthMetricEsTableDefine extends AbstractServiceReferenceMetricEsTableDefine { - - public ServiceReferenceMonthMetricEsTableDefine() { - super(ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } - - @Override public int refreshInterval() { - return 2; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/ttl/TTLConfigService.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/ttl/TTLConfigService.java deleted file mode 100644 index bb700683ae6f342c48aafd1e899373cdf659c31a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/ttl/TTLConfigService.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es.ttl; - -import org.apache.skywalking.apm.collector.storage.es.StorageModuleEsConfig; -import org.apache.skywalking.apm.collector.storage.ttl.ITTLConfigService; - -/** - * @author peng-yongsheng - */ -public class TTLConfigService implements ITTLConfigService { - - private StorageModuleEsConfig config; - - public TTLConfigService(StorageModuleEsConfig config) { - this.config = config; - } - - @Override public int traceDataTTL() { - return config.getTraceDataTTL(); - } - - @Override public int minuteMetricDataTTL() { - return config.getMinuteMetricDataTTL(); - } - - @Override public int hourMetricDataTTL() { - return config.getHourMetricDataTTL(); - } - - @Override public int dayMetricDataTTL() { - return config.getDayMetricDataTTL(); - } - - @Override public int monthMetricDataTTL() { - return config.getMonthMetricDataTTL(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/resources/META-INF/defines/storage.define b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/resources/META-INF/defines/storage.define deleted file mode 100644 index 4006d77818c1c4ee4834399b8beaf205d4bb6fc0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/resources/META-INF/defines/storage.define +++ /dev/null @@ -1,114 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.storage.es.define.register.ApplicationEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.register.InstanceEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.register.ServiceNameEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.register.NetworkAddressEsTableDefine - -org.apache.skywalking.apm.collector.storage.es.define.acp.ApplicationComponentMinuteEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.acp.ApplicationComponentHourEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.acp.ApplicationComponentDayEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.acp.ApplicationComponentMonthEsTableDefine - -org.apache.skywalking.apm.collector.storage.es.define.ampp.ApplicationMappingMinuteEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.ampp.ApplicationMappingHourEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.ampp.ApplicationMappingDayEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.ampp.ApplicationMappingMonthEsTableDefine - -org.apache.skywalking.apm.collector.storage.es.define.impp.InstanceMappingMinuteEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.impp.InstanceMappingHourEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.impp.InstanceMappingDayEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.impp.InstanceMappingMonthEsTableDefine - -org.apache.skywalking.apm.collector.storage.es.define.srmp.ServiceReferenceMinuteMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.srmp.ServiceReferenceHourMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.srmp.ServiceReferenceDayMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.srmp.ServiceReferenceMonthMetricEsTableDefine - -org.apache.skywalking.apm.collector.storage.es.define.smp.ServiceMinuteMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.smp.ServiceHourMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.smp.ServiceDayMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.smp.ServiceMonthMetricEsTableDefine - -org.apache.skywalking.apm.collector.storage.es.define.irmp.InstanceReferenceMinuteMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.irmp.InstanceReferenceHourMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.irmp.InstanceReferenceDayMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.irmp.InstanceReferenceMonthMetricEsTableDefine - -org.apache.skywalking.apm.collector.storage.es.define.imp.InstanceMinuteMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.imp.InstanceHourMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.imp.InstanceDayMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.imp.InstanceMonthMetricEsTableDefine - -org.apache.skywalking.apm.collector.storage.es.define.armp.ApplicationReferenceMinuteMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.armp.ApplicationReferenceHourMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.armp.ApplicationReferenceDayMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.armp.ApplicationReferenceMonthMetricEsTableDefine - -org.apache.skywalking.apm.collector.storage.es.define.amp.ApplicationMinuteMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.amp.ApplicationHourMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.amp.ApplicationDayMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.amp.ApplicationMonthMetricEsTableDefine - -org.apache.skywalking.apm.collector.storage.es.define.rtd.ResponseTimeDistributionMinuteEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.rtd.ResponseTimeDistributionHourEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.rtd.ResponseTimeDistributionDayEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.rtd.ResponseTimeDistributionMonthEsTableDefine - -org.apache.skywalking.apm.collector.storage.es.define.GlobalTraceEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.SegmentEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.SegmentDurationEsTableDefine - -org.apache.skywalking.apm.collector.storage.es.define.alarm.ApplicationAlarmEsTableDefine - -org.apache.skywalking.apm.collector.storage.es.define.alarm.ApplicationAlarmListMinuteEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.alarm.ApplicationAlarmListHourEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.alarm.ApplicationAlarmListDayEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.alarm.ApplicationAlarmListMonthEsTableDefine - -org.apache.skywalking.apm.collector.storage.es.define.alarm.ApplicationReferenceAlarmEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.alarm.ApplicationReferenceAlarmListEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.alarm.InstanceAlarmEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.alarm.InstanceAlarmListEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.alarm.InstanceReferenceAlarmEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.alarm.InstanceReferenceAlarmListEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.alarm.ServiceAlarmEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.alarm.ServiceAlarmListEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.alarm.ServiceReferenceAlarmEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.alarm.ServiceReferenceAlarmListEsTableDefine - -org.apache.skywalking.apm.collector.storage.es.define.mpool.MemoryPoolMinuteMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.mpool.MemoryPoolHourMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.mpool.MemoryPoolDayMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.mpool.MemoryPoolMonthMetricEsTableDefine - -org.apache.skywalking.apm.collector.storage.es.define.memory.MemoryMinuteMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.memory.MemoryHourMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.memory.MemoryDayMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.memory.MemoryMonthMetricEsTableDefine - -org.apache.skywalking.apm.collector.storage.es.define.gc.GCMinuteMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.gc.GCHourMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.gc.GCDayMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.gc.GCMonthMetricEsTableDefine - -org.apache.skywalking.apm.collector.storage.es.define.cpu.CpuMinuteMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.cpu.CpuHourMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.cpu.CpuDayMetricEsTableDefine -org.apache.skywalking.apm.collector.storage.es.define.cpu.CpuMonthMetricEsTableDefine \ No newline at end of file diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index 136e90904b13e89f14175089c3975868a5ed4607..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.storage.es.StorageModuleEsProvider diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/test/java/org/apache/skywalking/apm/collector/storage/es/DataTTLKeeperTimerTestCase.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/test/java/org/apache/skywalking/apm/collector/storage/es/DataTTLKeeperTimerTestCase.java deleted file mode 100644 index 47787f18544d73277139636f82057eea56d4e897..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/test/java/org/apache/skywalking/apm/collector/storage/es/DataTTLKeeperTimerTestCase.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.es; - -import org.joda.time.DateTime; -import org.junit.*; -import org.powermock.reflect.Whitebox; - -/** - * @author peng-yongsheng - */ -public class DataTTLKeeperTimerTestCase { - - @Test - public void testConvertTimeBucket() { - DataTTLKeeperTimer timer = new DataTTLKeeperTimer(null, null, null, new StorageModuleEsConfig()); - - DateTime currentTime = new DateTime(2018, 5, 26, 15, 5); - DataTTLKeeperTimer.TimeBuckets timeBuckets = timer.convertTimeBucket(currentTime); - - long traceDataBefore = Whitebox.getInternalState(timeBuckets, "traceDataBefore"); - Assert.assertEquals(201805261335L, traceDataBefore); - - long minuteTimeBucketBefore = Whitebox.getInternalState(timeBuckets, "minuteTimeBucketBefore"); - Assert.assertEquals(201805261335L, minuteTimeBucketBefore); - - long hourTimeBucketBefore = Whitebox.getInternalState(timeBuckets, "hourTimeBucketBefore"); - Assert.assertEquals(2018052503, hourTimeBucketBefore); - - long dayTimeBucketBefore = Whitebox.getInternalState(timeBuckets, "dayTimeBucketBefore"); - Assert.assertEquals(20180411, dayTimeBucketBefore); - - long monthTimeBucketBefore = Whitebox.getInternalState(timeBuckets, "monthTimeBucketBefore"); - Assert.assertEquals(201611, monthTimeBucketBefore); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/pom.xml b/apm-collector/apm-collector-storage/collector-storage-h2-provider/pom.xml deleted file mode 100644 index 7b7f415b74941a9617107e58f30c11120c8d9adc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - apm-collector-storage - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-storage-h2-provider - jar - - - - org.apache.skywalking - collector-storage-define - ${project.version} - - - diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/MetricTransformUtil.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/MetricTransformUtil.java deleted file mode 100644 index 8a4e0f222adeda855ba8334caebd887ae526c883..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/MetricTransformUtil.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Map; -import org.apache.skywalking.apm.collector.storage.table.Metric; -import org.apache.skywalking.apm.collector.storage.table.MetricColumns; - -/** - * @author peng-yongsheng - */ -public enum MetricTransformUtil { - INSTANCE; - - public void h2DataToStreamData(ResultSet source, Metric target) throws SQLException { - target.setSourceValue(source.getInt(MetricColumns.SOURCE_VALUE.getName())); - target.setTimeBucket(source.getLong(MetricColumns.TIME_BUCKET.getName())); - - target.setTransactionCalls(source.getLong(MetricColumns.TRANSACTION_CALLS.getName())); - target.setTransactionErrorCalls(source.getLong(MetricColumns.TRANSACTION_ERROR_CALLS.getName())); - target.setTransactionDurationSum(source.getLong(MetricColumns.TRANSACTION_DURATION_SUM.getName())); - target.setTransactionErrorDurationSum(source.getLong(MetricColumns.TRANSACTION_ERROR_DURATION_SUM.getName())); - target.setTransactionAverageDuration(source.getLong(MetricColumns.TRANSACTION_AVERAGE_DURATION.getName())); - - target.setBusinessTransactionCalls(source.getLong(MetricColumns.BUSINESS_TRANSACTION_CALLS.getName())); - target.setBusinessTransactionErrorCalls(source.getLong(MetricColumns.BUSINESS_TRANSACTION_ERROR_CALLS.getName())); - target.setBusinessTransactionDurationSum(source.getLong(MetricColumns.BUSINESS_TRANSACTION_DURATION_SUM.getName())); - target.setBusinessTransactionErrorDurationSum(source.getLong(MetricColumns.BUSINESS_TRANSACTION_ERROR_DURATION_SUM.getName())); - target.setBusinessTransactionAverageDuration(source.getLong(MetricColumns.BUSINESS_TRANSACTION_AVERAGE_DURATION.getName())); - - target.setMqTransactionCalls(source.getLong(MetricColumns.MQ_TRANSACTION_CALLS.getName())); - target.setMqTransactionErrorCalls(source.getLong(MetricColumns.MQ_TRANSACTION_ERROR_CALLS.getName())); - target.setMqTransactionDurationSum(source.getLong(MetricColumns.MQ_TRANSACTION_DURATION_SUM.getName())); - target.setMqTransactionErrorDurationSum(source.getLong(MetricColumns.MQ_TRANSACTION_ERROR_DURATION_SUM.getName())); - target.setMqTransactionAverageDuration(source.getLong(MetricColumns.MQ_TRANSACTION_AVERAGE_DURATION.getName())); - } - - public void streamDataToH2Data(Metric source, Map target) { - target.put(MetricColumns.SOURCE_VALUE.getName(), source.getSourceValue()); - target.put(MetricColumns.TIME_BUCKET.getName(), source.getTimeBucket()); - - target.put(MetricColumns.TRANSACTION_CALLS.getName(), source.getTransactionCalls()); - target.put(MetricColumns.TRANSACTION_ERROR_CALLS.getName(), source.getTransactionErrorCalls()); - target.put(MetricColumns.TRANSACTION_DURATION_SUM.getName(), source.getTransactionDurationSum()); - target.put(MetricColumns.TRANSACTION_ERROR_DURATION_SUM.getName(), source.getTransactionErrorDurationSum()); - target.put(MetricColumns.TRANSACTION_AVERAGE_DURATION.getName(), source.getTransactionAverageDuration()); - - target.put(MetricColumns.BUSINESS_TRANSACTION_CALLS.getName(), source.getBusinessTransactionCalls()); - target.put(MetricColumns.BUSINESS_TRANSACTION_ERROR_CALLS.getName(), source.getBusinessTransactionErrorCalls()); - target.put(MetricColumns.BUSINESS_TRANSACTION_DURATION_SUM.getName(), source.getBusinessTransactionDurationSum()); - target.put(MetricColumns.BUSINESS_TRANSACTION_ERROR_DURATION_SUM.getName(), source.getBusinessTransactionErrorDurationSum()); - target.put(MetricColumns.BUSINESS_TRANSACTION_AVERAGE_DURATION.getName(), source.getBusinessTransactionAverageDuration()); - - target.put(MetricColumns.MQ_TRANSACTION_CALLS.getName(), source.getMqTransactionCalls()); - target.put(MetricColumns.MQ_TRANSACTION_ERROR_CALLS.getName(), source.getMqTransactionErrorCalls()); - target.put(MetricColumns.MQ_TRANSACTION_DURATION_SUM.getName(), source.getMqTransactionDurationSum()); - target.put(MetricColumns.MQ_TRANSACTION_ERROR_DURATION_SUM.getName(), source.getMqTransactionErrorDurationSum()); - target.put(MetricColumns.MQ_TRANSACTION_AVERAGE_DURATION.getName(), source.getMqTransactionAverageDuration()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/StorageModuleH2Config.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/StorageModuleH2Config.java deleted file mode 100644 index 460d4d1ac8911a011786520bb4f237863fecaf78..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/StorageModuleH2Config.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2; - -import org.apache.skywalking.apm.collector.client.h2.H2ClientConfig; - -/** - * @author peng-yongsheng - */ -class StorageModuleH2Config extends H2ClientConfig { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/StorageModuleH2Provider.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/StorageModuleH2Provider.java deleted file mode 100644 index a44c21c7ddfd4e5824239bacc965c1545440fa83..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/StorageModuleH2Provider.java +++ /dev/null @@ -1,438 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.cluster.ClusterModule; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.storage.StorageException; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IBatchDAO; -import org.apache.skywalking.apm.collector.storage.dao.IGlobalTracePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.IInstanceHeartBeatPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ISegmentDurationPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ISegmentPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationReferenceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationReferenceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceReferenceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceReferenceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceReferenceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceReferenceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.cache.IApplicationCacheDAO; -import org.apache.skywalking.apm.collector.storage.dao.cache.IInstanceCacheDAO; -import org.apache.skywalking.apm.collector.storage.dao.cache.INetworkAddressCacheDAO; -import org.apache.skywalking.apm.collector.storage.dao.cache.IServiceNameCacheDAO; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.register.IApplicationRegisterDAO; -import org.apache.skywalking.apm.collector.storage.dao.register.IInstanceRegisterDAO; -import org.apache.skywalking.apm.collector.storage.dao.register.INetworkAddressRegisterDAO; -import org.apache.skywalking.apm.collector.storage.dao.register.IServiceNameRegisterDAO; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationAlarmListUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationAlarmUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationComponentUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMappingUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationReferenceMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.ICpuMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IGCMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IGlobalTraceUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceAlarmUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IMemoryMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.INetworkAddressUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IResponseTimeDistributionUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentDurationUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceAlarmUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceNameServiceUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceReferenceMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.BatchH2DAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2StorageInstaller; -import org.apache.skywalking.apm.collector.storage.h2.dao.GlobalTraceH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.InstanceHeartBeatH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.SegmentDurationH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.SegmentH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.acp.ApplicationComponentDayH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.acp.ApplicationComponentHourH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.acp.ApplicationComponentMinuteH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.acp.ApplicationComponentMonthH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.alarm.ApplicationAlarmH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.alarm.ApplicationAlarmListH2DayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.alarm.ApplicationAlarmListH2HourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.alarm.ApplicationAlarmListH2MinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.alarm.ApplicationAlarmListH2MonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.alarm.ApplicationReferenceAlarmH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.alarm.ApplicationReferenceAlarmListH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.alarm.InstanceAlarmH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.alarm.InstanceAlarmListH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.alarm.InstanceReferenceAlarmH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.alarm.InstanceReferenceAlarmListH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.alarm.ServiceAlarmH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.alarm.ServiceAlarmListH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.alarm.ServiceReferenceAlarmH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.alarm.ServiceReferenceAlarmListH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.amp.ApplicationDayMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.amp.ApplicationHourMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.amp.ApplicationMinuteMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.amp.ApplicationMonthMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ampp.ApplicationMappingDayH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ampp.ApplicationMappingHourH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ampp.ApplicationMappingMinuteH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ampp.ApplicationMappingMonthH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.armp.ApplicationReferenceDayMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.armp.ApplicationReferenceHourMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.armp.ApplicationReferenceMinuteMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.armp.ApplicationReferenceMonthMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.cache.ApplicationH2CacheDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.cache.InstanceH2CacheDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.cache.NetworkAddressH2CacheDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.cache.ServiceNameH2CacheDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.cpu.CpuDayMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.cpu.CpuHourMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.cpu.CpuMinuteMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.cpu.CpuMonthMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.gc.GCDayMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.gc.GCHourMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.gc.GCMinuteMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.gc.GCMonthMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.imp.InstanceDayMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.imp.InstanceHourMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.imp.InstanceMinuteMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.imp.InstanceMonthMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.impp.InstanceMappingDayH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.impp.InstanceMappingHourH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.impp.InstanceMappingMinuteH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.impp.InstanceMappingMonthH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.irmp.InstanceReferenceDayMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.irmp.InstanceReferenceHourMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.irmp.InstanceReferenceMinuteMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.irmp.InstanceReferenceMonthMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.memory.MemoryDayMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.memory.MemoryHourMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.memory.MemoryMinuteMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.memory.MemoryMonthMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.mpool.MemoryPoolDayMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.mpool.MemoryPoolHourMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.mpool.MemoryPoolMinuteMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.mpool.MemoryPoolMonthMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.register.ApplicationRegisterH2DAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.register.InstanceRegisterH2DAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.register.NetworkAddressRegisterH2DAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.register.ServiceNameRegisterH2DAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.rtd.ResponseTimeDistributionDayH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.rtd.ResponseTimeDistributionHourH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.rtd.ResponseTimeDistributionMinuteH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.rtd.ResponseTimeDistributionMonthH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.smp.ServiceDayMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.smp.ServiceHourMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.smp.ServiceMinuteMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.smp.ServiceMonthMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.srmp.ServiceReferenceDayMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.srmp.ServiceReferenceHourMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.srmp.ServiceReferenceMinuteMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.srmp.ServiceReferenceMonthMetricH2PersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.ApplicationAlarmH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.ApplicationAlarmListH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.ApplicationComponentH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.ApplicationMappingH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.ApplicationMetricH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.ApplicationReferenceMetricH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.CpuMetricH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.GCMetricH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.GlobalTraceH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.InstanceAlarmH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.InstanceH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.InstanceMetricH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.MemoryMetricH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.NetworkAddressH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.ResponseTimeDistributionH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.SegmentDurationH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.SegmentH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.ServiceAlarmH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.ServiceMetricH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.ServiceNameServiceH2UIDAO; -import org.apache.skywalking.apm.collector.storage.h2.dao.ui.ServiceReferenceH2MetricUIDAO; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class StorageModuleH2Provider extends ModuleProvider { - - private static final Logger logger = LoggerFactory.getLogger(StorageModuleH2Provider.class); - - private H2Client h2Client; - private final StorageModuleH2Config config; - - public StorageModuleH2Provider() { - this.config = new StorageModuleH2Config(); - } - - @Override public String name() { - return "h2"; - } - - @Override public Class module() { - return StorageModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() throws ServiceNotProvidedException { - h2Client = new H2Client(config.getUrl(), config.getUserName(), config.getPassword()); - - this.registerServiceImplementation(IBatchDAO.class, new BatchH2DAO(h2Client)); - registerCacheDAO(); - registerRegisterDAO(); - registerPersistenceDAO(); - registerUiDAO(); - registerAlarmDAO(); - } - - @Override public void start() { - try { - h2Client.initialize(); - - H2StorageInstaller installer = new H2StorageInstaller(false); - installer.install(h2Client); - } catch (H2ClientException | StorageException e) { - logger.error(e.getMessage(), e); - } - } - - @Override public void notifyAfterCompleted() { - } - - @Override public String[] requiredModules() { - return new String[] {ClusterModule.NAME, ConfigurationModule.NAME, RemoteModule.NAME}; - } - - private void registerCacheDAO() throws ServiceNotProvidedException { - this.registerServiceImplementation(IApplicationCacheDAO.class, new ApplicationH2CacheDAO(h2Client)); - this.registerServiceImplementation(IInstanceCacheDAO.class, new InstanceH2CacheDAO(h2Client)); - this.registerServiceImplementation(IServiceNameCacheDAO.class, new ServiceNameH2CacheDAO(h2Client)); - this.registerServiceImplementation(INetworkAddressCacheDAO.class, new NetworkAddressH2CacheDAO(h2Client)); - } - - private void registerRegisterDAO() throws ServiceNotProvidedException { - this.registerServiceImplementation(INetworkAddressRegisterDAO.class, new NetworkAddressRegisterH2DAO(h2Client)); - this.registerServiceImplementation(IApplicationRegisterDAO.class, new ApplicationRegisterH2DAO(h2Client)); - this.registerServiceImplementation(IInstanceRegisterDAO.class, new InstanceRegisterH2DAO(h2Client)); - this.registerServiceImplementation(IServiceNameRegisterDAO.class, new ServiceNameRegisterH2DAO(h2Client)); - } - - private void registerPersistenceDAO() throws ServiceNotProvidedException { - this.registerServiceImplementation(ICpuMinuteMetricPersistenceDAO.class, new CpuMinuteMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(ICpuHourMetricPersistenceDAO.class, new CpuHourMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(ICpuDayMetricPersistenceDAO.class, new CpuDayMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(ICpuMonthMetricPersistenceDAO.class, new CpuMonthMetricH2PersistenceDAO(h2Client)); - - this.registerServiceImplementation(IGCMinuteMetricPersistenceDAO.class, new GCMinuteMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IGCHourMetricPersistenceDAO.class, new GCHourMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IGCDayMetricPersistenceDAO.class, new GCDayMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IGCMonthMetricPersistenceDAO.class, new GCMonthMetricH2PersistenceDAO(h2Client)); - - this.registerServiceImplementation(IMemoryMinuteMetricPersistenceDAO.class, new MemoryMinuteMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IMemoryHourMetricPersistenceDAO.class, new MemoryHourMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IMemoryDayMetricPersistenceDAO.class, new MemoryDayMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IMemoryMonthMetricPersistenceDAO.class, new MemoryMonthMetricH2PersistenceDAO(h2Client)); - - this.registerServiceImplementation(IMemoryPoolMinuteMetricPersistenceDAO.class, new MemoryPoolMinuteMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IMemoryPoolHourMetricPersistenceDAO.class, new MemoryPoolHourMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IMemoryPoolDayMetricPersistenceDAO.class, new MemoryPoolDayMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IMemoryPoolMonthMetricPersistenceDAO.class, new MemoryPoolMonthMetricH2PersistenceDAO(h2Client)); - - this.registerServiceImplementation(IGlobalTracePersistenceDAO.class, new GlobalTraceH2PersistenceDAO(h2Client)); - - this.registerServiceImplementation(IResponseTimeDistributionMinutePersistenceDAO.class, new ResponseTimeDistributionMinuteH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IResponseTimeDistributionHourPersistenceDAO.class, new ResponseTimeDistributionHourH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IResponseTimeDistributionDayPersistenceDAO.class, new ResponseTimeDistributionDayH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IResponseTimeDistributionMonthPersistenceDAO.class, new ResponseTimeDistributionMonthH2PersistenceDAO(h2Client)); - - this.registerServiceImplementation(ISegmentDurationPersistenceDAO.class, new SegmentDurationH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(ISegmentPersistenceDAO.class, new SegmentH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IInstanceHeartBeatPersistenceDAO.class, new InstanceHeartBeatH2PersistenceDAO(h2Client)); - - this.registerServiceImplementation(IApplicationComponentMinutePersistenceDAO.class, new ApplicationComponentMinuteH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IApplicationComponentHourPersistenceDAO.class, new ApplicationComponentHourH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IApplicationComponentDayPersistenceDAO.class, new ApplicationComponentDayH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IApplicationComponentMonthPersistenceDAO.class, new ApplicationComponentMonthH2PersistenceDAO(h2Client)); - - this.registerServiceImplementation(IApplicationMappingMinutePersistenceDAO.class, new ApplicationMappingMinuteH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IApplicationMappingHourPersistenceDAO.class, new ApplicationMappingHourH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IApplicationMappingDayPersistenceDAO.class, new ApplicationMappingDayH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IApplicationMappingMonthPersistenceDAO.class, new ApplicationMappingMonthH2PersistenceDAO(h2Client)); - - this.registerServiceImplementation(IInstanceMappingMinutePersistenceDAO.class, new InstanceMappingMinuteH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IInstanceMappingHourPersistenceDAO.class, new InstanceMappingHourH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IInstanceMappingDayPersistenceDAO.class, new InstanceMappingDayH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IInstanceMappingMonthPersistenceDAO.class, new InstanceMappingMonthH2PersistenceDAO(h2Client)); - - this.registerServiceImplementation(IApplicationMinuteMetricPersistenceDAO.class, new ApplicationMinuteMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IApplicationHourMetricPersistenceDAO.class, new ApplicationHourMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IApplicationDayMetricPersistenceDAO.class, new ApplicationDayMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IApplicationMonthMetricPersistenceDAO.class, new ApplicationMonthMetricH2PersistenceDAO(h2Client)); - - this.registerServiceImplementation(IApplicationReferenceMinuteMetricPersistenceDAO.class, new ApplicationReferenceMinuteMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IApplicationReferenceHourMetricPersistenceDAO.class, new ApplicationReferenceHourMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IApplicationReferenceDayMetricPersistenceDAO.class, new ApplicationReferenceDayMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IApplicationReferenceMonthMetricPersistenceDAO.class, new ApplicationReferenceMonthMetricH2PersistenceDAO(h2Client)); - - this.registerServiceImplementation(IInstanceMinuteMetricPersistenceDAO.class, new InstanceMinuteMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IInstanceHourMetricPersistenceDAO.class, new InstanceHourMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IInstanceDayMetricPersistenceDAO.class, new InstanceDayMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IInstanceMonthMetricPersistenceDAO.class, new InstanceMonthMetricH2PersistenceDAO(h2Client)); - - this.registerServiceImplementation(IInstanceReferenceMinuteMetricPersistenceDAO.class, new InstanceReferenceMinuteMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IInstanceReferenceHourMetricPersistenceDAO.class, new InstanceReferenceHourMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IInstanceReferenceDayMetricPersistenceDAO.class, new InstanceReferenceDayMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IInstanceReferenceMonthMetricPersistenceDAO.class, new InstanceReferenceMonthMetricH2PersistenceDAO(h2Client)); - - this.registerServiceImplementation(IServiceMinuteMetricPersistenceDAO.class, new ServiceMinuteMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IServiceHourMetricPersistenceDAO.class, new ServiceHourMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IServiceDayMetricPersistenceDAO.class, new ServiceDayMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IServiceMonthMetricPersistenceDAO.class, new ServiceMonthMetricH2PersistenceDAO(h2Client)); - - this.registerServiceImplementation(IServiceReferenceMinuteMetricPersistenceDAO.class, new ServiceReferenceMinuteMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IServiceReferenceHourMetricPersistenceDAO.class, new ServiceReferenceHourMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IServiceReferenceDayMetricPersistenceDAO.class, new ServiceReferenceDayMetricH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IServiceReferenceMonthMetricPersistenceDAO.class, new ServiceReferenceMonthMetricH2PersistenceDAO(h2Client)); - } - - private void registerUiDAO() throws ServiceNotProvidedException { - this.registerServiceImplementation(IInstanceUIDAO.class, new InstanceH2UIDAO(h2Client)); - this.registerServiceImplementation(INetworkAddressUIDAO.class, new NetworkAddressH2UIDAO(h2Client)); - this.registerServiceImplementation(IServiceNameServiceUIDAO.class, new ServiceNameServiceH2UIDAO(h2Client)); - this.registerServiceImplementation(IServiceMetricUIDAO.class, new ServiceMetricH2UIDAO(h2Client)); - - this.registerServiceImplementation(ICpuMetricUIDAO.class, new CpuMetricH2UIDAO(h2Client)); - this.registerServiceImplementation(IGCMetricUIDAO.class, new GCMetricH2UIDAO(h2Client)); - this.registerServiceImplementation(IMemoryMetricUIDAO.class, new MemoryMetricH2UIDAO(h2Client)); - - this.registerServiceImplementation(IGlobalTraceUIDAO.class, new GlobalTraceH2UIDAO(h2Client)); - this.registerServiceImplementation(IInstanceMetricUIDAO.class, new InstanceMetricH2UIDAO(h2Client)); - this.registerServiceImplementation(IApplicationComponentUIDAO.class, new ApplicationComponentH2UIDAO(h2Client)); - this.registerServiceImplementation(IApplicationMappingUIDAO.class, new ApplicationMappingH2UIDAO(h2Client)); - this.registerServiceImplementation(IApplicationMetricUIDAO.class, new ApplicationMetricH2UIDAO(h2Client)); - this.registerServiceImplementation(IApplicationReferenceMetricUIDAO.class, new ApplicationReferenceMetricH2UIDAO(h2Client)); - this.registerServiceImplementation(ISegmentDurationUIDAO.class, new SegmentDurationH2UIDAO(h2Client)); - this.registerServiceImplementation(ISegmentUIDAO.class, new SegmentH2UIDAO(h2Client)); - this.registerServiceImplementation(IServiceReferenceMetricUIDAO.class, new ServiceReferenceH2MetricUIDAO(h2Client)); - - this.registerServiceImplementation(IApplicationAlarmUIDAO.class, new ApplicationAlarmH2UIDAO(h2Client)); - this.registerServiceImplementation(IInstanceAlarmUIDAO.class, new InstanceAlarmH2UIDAO(h2Client)); - this.registerServiceImplementation(IServiceAlarmUIDAO.class, new ServiceAlarmH2UIDAO(h2Client)); - - this.registerServiceImplementation(IApplicationAlarmListUIDAO.class, new ApplicationAlarmListH2UIDAO(h2Client)); - this.registerServiceImplementation(IResponseTimeDistributionUIDAO.class, new ResponseTimeDistributionH2UIDAO(h2Client)); - } - - private void registerAlarmDAO() throws ServiceNotProvidedException { - this.registerServiceImplementation(IServiceReferenceAlarmPersistenceDAO.class, new ServiceReferenceAlarmH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IServiceReferenceAlarmListPersistenceDAO.class, new ServiceReferenceAlarmListH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IInstanceReferenceAlarmPersistenceDAO.class, new InstanceReferenceAlarmH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IInstanceReferenceAlarmListPersistenceDAO.class, new InstanceReferenceAlarmListH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IApplicationReferenceAlarmPersistenceDAO.class, new ApplicationReferenceAlarmH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IApplicationReferenceAlarmListPersistenceDAO.class, new ApplicationReferenceAlarmListH2PersistenceDAO(h2Client)); - - this.registerServiceImplementation(IServiceAlarmPersistenceDAO.class, new ServiceAlarmH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IServiceAlarmListPersistenceDAO.class, new ServiceAlarmListH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IInstanceAlarmPersistenceDAO.class, new InstanceAlarmH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IInstanceAlarmListPersistenceDAO.class, new InstanceAlarmListH2PersistenceDAO(h2Client)); - this.registerServiceImplementation(IApplicationAlarmPersistenceDAO.class, new ApplicationAlarmH2PersistenceDAO(h2Client)); - - this.registerServiceImplementation(IApplicationAlarmListMinutePersistenceDAO.class, new ApplicationAlarmListH2MinutePersistenceDAO(h2Client)); - this.registerServiceImplementation(IApplicationAlarmListHourPersistenceDAO.class, new ApplicationAlarmListH2HourPersistenceDAO(h2Client)); - this.registerServiceImplementation(IApplicationAlarmListDayPersistenceDAO.class, new ApplicationAlarmListH2DayPersistenceDAO(h2Client)); - this.registerServiceImplementation(IApplicationAlarmListMonthPersistenceDAO.class, new ApplicationAlarmListH2MonthPersistenceDAO(h2Client)); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/dao/AbstractPersistenceH2DAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/dao/AbstractPersistenceH2DAO.java deleted file mode 100644 index e0fb6477f247d8f130898ba33f29df532d54475f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/dao/AbstractPersistenceH2DAO.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.base.dao; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.core.data.CommonTable; -import org.apache.skywalking.apm.collector.core.data.StreamData; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractPersistenceH2DAO extends H2DAO implements IPersistenceDAO { - - private final Logger logger = LoggerFactory.getLogger(AbstractPersistenceH2DAO.class); - - public AbstractPersistenceH2DAO(H2Client client) { - super(client); - } - - private static final String GET_SQL = "select * from {0} where {1} = ?"; - - protected abstract STREAM_DATA h2DataToStreamData(ResultSet resultSet) throws SQLException; - - protected abstract String tableName(); - - @Override public final STREAM_DATA get(String id) { - String sql = SqlBuilder.buildSql(GET_SQL, tableName(), CommonTable.ID.getName()); - - Object[] params = new Object[] {id}; - try (ResultSet resultSet = getClient().executeQuery(sql, params)) { - if (resultSet.next()) { - return h2DataToStreamData(resultSet); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return null; - } - - protected abstract Map streamDataToH2Data(STREAM_DATA streamData); - - @Override public final H2SqlEntity prepareBatchInsert(STREAM_DATA streamData) { - Map source = streamDataToH2Data(streamData); - source.put(CommonTable.ID.getName(), streamData.getId()); - - H2SqlEntity entity = new H2SqlEntity(); - - String sql = SqlBuilder.buildBatchInsertSql(tableName(), source.keySet()); - entity.setSql(sql); - entity.setParams(source.values().toArray(new Object[0])); - return entity; - } - - @Override public final H2SqlEntity prepareBatchUpdate(STREAM_DATA streamData) { - Map source = streamDataToH2Data(streamData); - - H2SqlEntity entity = new H2SqlEntity(); - String sql = SqlBuilder.buildBatchUpdateSql(tableName(), source.keySet(), CommonTable.ID.getName()); - entity.setSql(sql); - List values = new ArrayList<>(source.values()); - values.add(streamData.getId()); - entity.setParams(values.toArray(new Object[0])); - return entity; - } - - @Override public void deleteHistory(Long timeBucketBefore) { - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/dao/BatchH2DAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/dao/BatchH2DAO.java deleted file mode 100644 index 0de2a2c6cfdb5036e7d178619f16ae83c30b74c5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/dao/BatchH2DAO.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.base.dao; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.base.dao.IBatchDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class BatchH2DAO extends H2DAO implements IBatchDAO { - - private static final Logger logger = LoggerFactory.getLogger(BatchH2DAO.class); - - public BatchH2DAO(H2Client client) { - super(client); - } - - @Override - public void batchPersistence(List batchCollection) { - if (batchCollection != null && batchCollection.size() > 0) { - if (logger.isDebugEnabled()) { - logger.debug("the batch collection size is {}", batchCollection.size()); - } - - Connection conn; - final Map batchSqls = new HashMap<>(); - try { - conn = getClient().getConnection(); - conn.setAutoCommit(true); - PreparedStatement ps; - for (Object entity : batchCollection) { - H2SqlEntity e = getH2SqlEntity(entity); - String sql = e.getSql(); - if (batchSqls.containsKey(sql)) { - ps = batchSqls.get(sql); - } else { - ps = conn.prepareStatement(sql); - batchSqls.put(sql, ps); - } - - Object[] params = e.getParams(); - if (params != null) { - if (logger.isDebugEnabled()) { - logger.debug("the sql is {}, params size is {}, params: {}", e.getSql(), params.length, params); - } - - for (int i = 0; i < params.length; i++) { - ps.setObject(i + 1, params[i]); - } - } - ps.addBatch(); - } - - for (String k : batchSqls.keySet()) { - batchSqls.get(k).executeBatch(); - } - } catch (SQLException e) { - logger.error(e.getMessage(), e); - } - batchSqls.clear(); - } - } - - private H2SqlEntity getH2SqlEntity(Object entity) { - if (entity instanceof H2SqlEntity) { - return (H2SqlEntity)entity; - } - return null; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/dao/H2DAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/dao/H2DAO.java deleted file mode 100644 index 463a18416728dbaa417d3e06b1557d64b6c7ee9c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/dao/H2DAO.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.base.dao; - -import java.sql.ResultSet; -import java.sql.SQLException; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.base.dao.AbstractDAO; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public abstract class H2DAO extends AbstractDAO { - - private final Logger logger = LoggerFactory.getLogger(H2DAO.class); - - public H2DAO(H2Client client) { - super(client); - } - - protected final int getMaxId(String tableName, String columnName) { - String sql = "select max(" + columnName + ") from " + tableName; - return getIntValueBySQL(sql); - } - - protected final int getMinId(String tableName, String columnName) { - String sql = "select min(" + columnName + ") from " + tableName; - return getIntValueBySQL(sql); - } - - private int getIntValueBySQL(String sql) { - H2Client client = getClient(); - try (ResultSet rs = client.executeQuery(sql, null)) { - if (rs.next()) { - int id = rs.getInt(1); - if (id == Integer.MAX_VALUE || id == Integer.MIN_VALUE) { - return 0; - } else { - return id; - } - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/define/H2ColumnDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/define/H2ColumnDefine.java deleted file mode 100644 index c497272f25148def10cfafa39c774fd9e8d073fe..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/define/H2ColumnDefine.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.base.define; - -import org.apache.skywalking.apm.collector.core.data.ColumnDefine; -import org.apache.skywalking.apm.collector.core.data.ColumnName; - -/** - * @author peng-yongsheng - */ -public class H2ColumnDefine extends ColumnDefine { - - public H2ColumnDefine(ColumnName columnName, String type) { - super(columnName, type); - } - - public enum Type { - Varchar, Int, Bigint, BINARY, Double - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/define/H2SqlEntity.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/define/H2SqlEntity.java deleted file mode 100644 index de1f2d6dbb871271cf72a7da5e6b57038b38c21e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/define/H2SqlEntity.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.base.define; - -/** - * @author clevertension - */ -public class H2SqlEntity { - private String sql; - private Object[] params; - - public String getSql() { - return sql; - } - - public void setSql(String sql) { - this.sql = sql; - } - - public Object[] getParams() { - return params; - } - - public void setParams(Object[] params) { - this.params = params; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/define/H2StorageInstaller.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/define/H2StorageInstaller.java deleted file mode 100644 index 1e8fcd402adab4994b7125428714200e1b0c5973..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/define/H2StorageInstaller.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.base.define; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.List; -import org.apache.skywalking.apm.collector.client.Client; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.core.data.TableDefine; -import org.apache.skywalking.apm.collector.storage.StorageException; -import org.apache.skywalking.apm.collector.storage.StorageInstallException; -import org.apache.skywalking.apm.collector.storage.StorageInstaller; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class H2StorageInstaller extends StorageInstaller { - - private final Logger logger = LoggerFactory.getLogger(H2StorageInstaller.class); - - public H2StorageInstaller(boolean isHighPerformanceMode) { - super(isHighPerformanceMode); - } - - @Override protected void defineFilter(List tableDefines) { - int size = tableDefines.size(); - for (int i = size - 1; i >= 0; i--) { - if (!(tableDefines.get(i) instanceof H2TableDefine)) { - tableDefines.remove(i); - } - } - } - - @Override protected boolean isExists(Client client, TableDefine tableDefine) throws StorageException { - H2Client h2Client = (H2Client)client; - ResultSet rs = null; - try { - logger.info("check if table {} exist ", tableDefine.getName()); - rs = h2Client.getConnection().getMetaData().getTables(null, null, tableDefine.getName().toUpperCase(), null); - if (rs.next()) { - return true; - } - } catch (SQLException e) { - throw new StorageInstallException(e.getMessage(), e); - } finally { - try { - if (rs != null) { - rs.close(); - } - } catch (SQLException e) { - throw new StorageInstallException(e.getMessage(), e); - } - } - return false; - } - - @Override protected void columnCheck(Client client, TableDefine tableDefine) throws StorageException { - - } - - @Override protected void deleteTable(Client client, TableDefine tableDefine) throws StorageException { - H2Client h2Client = (H2Client)client; - try { - h2Client.execute("drop table if exists " + tableDefine.getName()); - } catch (H2ClientException e) { - throw new StorageInstallException(e.getMessage(), e); - } - } - - @Override protected void createTable(Client client, TableDefine tableDefine) throws StorageException { - H2Client h2Client = (H2Client)client; - H2TableDefine h2TableDefine = (H2TableDefine)tableDefine; - - StringBuilder sqlBuilder = new StringBuilder(); - sqlBuilder.append("CREATE TABLE ").append(h2TableDefine.getName()).append(" ("); - - h2TableDefine.getColumnDefines().forEach(columnDefine -> { - H2ColumnDefine h2ColumnDefine = (H2ColumnDefine)columnDefine; - if (h2ColumnDefine.getType().equals(H2ColumnDefine.Type.Varchar.name())) { - sqlBuilder.append(h2ColumnDefine.getColumnName()).append(" ").append(h2ColumnDefine.getType()).append("(255),"); - } else { - sqlBuilder.append(h2ColumnDefine.getColumnName()).append(" ").append(h2ColumnDefine.getType()).append(","); - } - }); - //remove last comma - sqlBuilder.delete(sqlBuilder.length() - 1, sqlBuilder.length()); - sqlBuilder.append(")"); - try { - logger.info("create h2 table with sql {}", sqlBuilder); - h2Client.execute(sqlBuilder.toString()); - } catch (H2ClientException e) { - throw new StorageInstallException(e.getMessage(), e); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/define/H2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/define/H2TableDefine.java deleted file mode 100644 index 38ec25d067f90e475e7df0f3ebd641ca78adb250..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/base/define/H2TableDefine.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.base.define; - -import org.apache.skywalking.apm.collector.core.data.TableDefine; - -/** - * @author peng-yongsheng - */ -public abstract class H2TableDefine extends TableDefine { - - public H2TableDefine(String name) { - super(name); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/GlobalTraceH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/GlobalTraceH2PersistenceDAO.java deleted file mode 100644 index 606f9985cd41bfd166b94f3a397652dec818c152..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/GlobalTraceH2PersistenceDAO.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao; - -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.UnexpectedException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.IGlobalTracePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.global.GlobalTrace; -import org.apache.skywalking.apm.collector.storage.table.global.GlobalTraceTable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng, clevertension - */ -public class GlobalTraceH2PersistenceDAO extends H2DAO implements IGlobalTracePersistenceDAO { - - private static final Logger logger = LoggerFactory.getLogger(GlobalTraceH2PersistenceDAO.class); - - public GlobalTraceH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override public GlobalTrace get(String id) { - throw new UnexpectedException("There is no need to merge stream data with database data."); - } - - @Override public H2SqlEntity prepareBatchUpdate(GlobalTrace data) { - throw new UnexpectedException("There is no need to merge stream data with database data."); - } - - @Override public H2SqlEntity prepareBatchInsert(GlobalTrace data) { - Map target = new HashMap<>(); - H2SqlEntity entity = new H2SqlEntity(); - target.put(GlobalTraceTable.ID.getName(), data.getId()); - target.put(GlobalTraceTable.SEGMENT_ID.getName(), data.getSegmentId()); - target.put(GlobalTraceTable.TRACE_ID.getName(), data.getTraceId()); - target.put(GlobalTraceTable.TIME_BUCKET.getName(), data.getTimeBucket()); - logger.debug("global trace source: {}", target.toString()); - - String sql = SqlBuilder.buildBatchInsertSql(GlobalTraceTable.TABLE, target.keySet()); - entity.setSql(sql); - entity.setParams(target.values().toArray(new Object[0])); - return entity; - } - - @Override public void deleteHistory(Long timeBucketBefore) { - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceHeartBeatH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceHeartBeatH2PersistenceDAO.java deleted file mode 100644 index b5816467073172de1e3224e1716990525cb2e500..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/InstanceHeartBeatH2PersistenceDAO.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao; - -import java.sql.*; -import java.util.*; -import org.apache.skywalking.apm.collector.client.h2.*; -import org.apache.skywalking.apm.collector.core.UnexpectedException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.IInstanceHeartBeatPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.register.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng, clevertension - */ -public class InstanceHeartBeatH2PersistenceDAO extends H2DAO implements IInstanceHeartBeatPersistenceDAO { - - private static final Logger logger = LoggerFactory.getLogger(InstanceHeartBeatH2PersistenceDAO.class); - - public InstanceHeartBeatH2PersistenceDAO(H2Client client) { - super(client); - } - - private static final String GET_INSTANCE_HEARTBEAT_SQL = "select * from {0} where {1} = ?"; - - @Override public Instance get(String id) { - H2Client client = getClient(); - String sql = SqlBuilder.buildSql(GET_INSTANCE_HEARTBEAT_SQL, InstanceTable.TABLE, InstanceTable.INSTANCE_ID.getName()); - Object[] params = new Object[] {id}; - try (ResultSet rs = client.executeQuery(sql, params)) { - if (rs.next()) { - Instance instance = new Instance(); - instance.setId(id); - instance.setInstanceId(rs.getInt(InstanceTable.INSTANCE_ID.getName())); - instance.setHeartBeatTime(rs.getLong(InstanceTable.HEARTBEAT_TIME.getName())); - return instance; - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return null; - } - - @Override public H2SqlEntity prepareBatchInsert(Instance data) { - throw new UnexpectedException("There is no need to merge stream data with database data."); - } - - @Override public H2SqlEntity prepareBatchUpdate(Instance data) { - H2SqlEntity entity = new H2SqlEntity(); - Map target = new HashMap<>(); - target.put(InstanceTable.HEARTBEAT_TIME.getName(), data.getHeartBeatTime()); - String sql = SqlBuilder.buildBatchUpdateSql(InstanceTable.TABLE, target.keySet(), InstanceTable.INSTANCE_ID.getName()); - entity.setSql(sql); - List params = new ArrayList<>(target.values()); - params.add(data.getId()); - entity.setParams(params.toArray(new Object[0])); - return entity; - } - - @Override public void deleteHistory(Long timeBucketBefore) { - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/SegmentDurationH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/SegmentDurationH2PersistenceDAO.java deleted file mode 100644 index 8ac78ab77b8d3c943c9b3d6305180390492755f1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/SegmentDurationH2PersistenceDAO.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao; - -import java.util.*; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ISegmentDurationPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.segment.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng, clevertension - */ -public class SegmentDurationH2PersistenceDAO extends H2DAO implements ISegmentDurationPersistenceDAO { - - private static final Logger logger = LoggerFactory.getLogger(SegmentDurationH2PersistenceDAO.class); - - public SegmentDurationH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override public SegmentDuration get(String id) { - return null; - } - - @Override public H2SqlEntity prepareBatchInsert(SegmentDuration data) { - logger.debug("segment cost prepareBatchInsert, getApplicationId: {}", data.getId()); - H2SqlEntity entity = new H2SqlEntity(); - Map target = new HashMap<>(); - target.put(SegmentDurationTable.ID.getName(), data.getId()); - target.put(SegmentDurationTable.SEGMENT_ID.getName(), data.getSegmentId()); - target.put(SegmentDurationTable.APPLICATION_ID.getName(), data.getApplicationId()); - target.put(SegmentDurationTable.SERVICE_NAME.getName(), data.getServiceName()); - target.put(SegmentDurationTable.DURATION.getName(), data.getDuration()); - target.put(SegmentDurationTable.START_TIME.getName(), data.getStartTime()); - target.put(SegmentDurationTable.END_TIME.getName(), data.getEndTime()); - target.put(SegmentDurationTable.IS_ERROR.getName(), data.getIsError()); - target.put(SegmentDurationTable.TIME_BUCKET.getName(), data.getTimeBucket()); - logger.debug("segment cost source: {}", target.toString()); - - String sql = SqlBuilder.buildBatchInsertSql(SegmentDurationTable.TABLE, target.keySet()); - entity.setSql(sql); - entity.setParams(target.values().toArray(new Object[0])); - return entity; - } - - @Override public H2SqlEntity prepareBatchUpdate(SegmentDuration data) { - return null; - } - - @Override public void deleteHistory(Long timeBucketBefore) { - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/SegmentH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/SegmentH2PersistenceDAO.java deleted file mode 100644 index bcc95d288af774b96f48dad4c503fbed4b6cdadc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/SegmentH2PersistenceDAO.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao; - -import java.util.*; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ISegmentPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.segment.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng, clevertension - */ -public class SegmentH2PersistenceDAO extends H2DAO implements ISegmentPersistenceDAO { - - private static final Logger logger = LoggerFactory.getLogger(SegmentH2PersistenceDAO.class); - - public SegmentH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override public Segment get(String id) { - return null; - } - - @Override public H2SqlEntity prepareBatchInsert(Segment data) { - Map target = new HashMap<>(); - H2SqlEntity entity = new H2SqlEntity(); - target.put(SegmentTable.ID.getName(), data.getId()); - target.put(SegmentTable.DATA_BINARY.getName(), data.getDataBinary()); - target.put(SegmentTable.TIME_BUCKET.getName(), data.getTimeBucket()); - logger.debug("segment source: {}", target.toString()); - - String sql = SqlBuilder.buildBatchInsertSql(SegmentTable.TABLE, target.keySet()); - entity.setSql(sql); - entity.setParams(target.values().toArray(new Object[0])); - return entity; - } - - @Override public H2SqlEntity prepareBatchUpdate(Segment data) { - return null; - } - - @Override public void deleteHistory(Long timeBucketBefore) { - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/AbstractApplicationComponentH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/AbstractApplicationComponentH2PersistenceDAO.java deleted file mode 100644 index d3aa80259820f56c97099b1fd11b23607a151ea0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/AbstractApplicationComponentH2PersistenceDAO.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.acp; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationComponentH2PersistenceDAO extends AbstractPersistenceH2DAO { - - AbstractApplicationComponentH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected final ApplicationComponent h2DataToStreamData(ResultSet resultSet) throws SQLException { - ApplicationComponent applicationComponent = new ApplicationComponent(); - applicationComponent.setId(resultSet.getString(ApplicationComponentTable.ID.getName())); - applicationComponent.setMetricId(resultSet.getString(ApplicationComponentTable.METRIC_ID.getName())); - - applicationComponent.setComponentId(resultSet.getInt(ApplicationComponentTable.COMPONENT_ID.getName())); - applicationComponent.setApplicationId(resultSet.getInt(ApplicationComponentTable.APPLICATION_ID.getName())); - applicationComponent.setTimeBucket(resultSet.getLong(ApplicationComponentTable.TIME_BUCKET.getName())); - return applicationComponent; - } - - @Override protected final Map streamDataToH2Data(ApplicationComponent streamData) { - Map target = new HashMap<>(); - target.put(ApplicationComponentTable.ID.getName(), streamData.getId()); - target.put(ApplicationComponentTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(ApplicationComponentTable.COMPONENT_ID.getName(), streamData.getComponentId()); - target.put(ApplicationComponentTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - target.put(ApplicationComponentTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/ApplicationComponentDayH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/ApplicationComponentDayH2PersistenceDAO.java deleted file mode 100644 index 292af6c7396e84bdee4f6835796ada3be257f9b6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/ApplicationComponentDayH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.acp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng, clevertension - */ -public class ApplicationComponentDayH2PersistenceDAO extends AbstractApplicationComponentH2PersistenceDAO implements IApplicationComponentDayPersistenceDAO { - - public ApplicationComponentDayH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/ApplicationComponentHourH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/ApplicationComponentHourH2PersistenceDAO.java deleted file mode 100644 index f83827ccd0038263bd0a48f7ed9f69badb9e6347..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/ApplicationComponentHourH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.acp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng, clevertension - */ -public class ApplicationComponentHourH2PersistenceDAO extends AbstractApplicationComponentH2PersistenceDAO implements IApplicationComponentHourPersistenceDAO { - - public ApplicationComponentHourH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/ApplicationComponentMinuteH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/ApplicationComponentMinuteH2PersistenceDAO.java deleted file mode 100644 index 592ae343169cf3d84fab515c887f27a0d58e5a6f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/ApplicationComponentMinuteH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.acp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng, clevertension - */ -public class ApplicationComponentMinuteH2PersistenceDAO extends AbstractApplicationComponentH2PersistenceDAO implements IApplicationComponentMinutePersistenceDAO { - - public ApplicationComponentMinuteH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/ApplicationComponentMonthH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/ApplicationComponentMonthH2PersistenceDAO.java deleted file mode 100644 index 11aa6707fbe0cb97a2ba8eeda018d14fd52327cb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/acp/ApplicationComponentMonthH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.acp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng, clevertension - */ -public class ApplicationComponentMonthH2PersistenceDAO extends AbstractApplicationComponentH2PersistenceDAO implements IApplicationComponentMonthPersistenceDAO { - - public ApplicationComponentMonthH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/AbstractApplicationAlarmListH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/AbstractApplicationAlarmListH2PersistenceDAO.java deleted file mode 100644 index c1735804f5d4ff7024c997fa8319e2659db14034..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/AbstractApplicationAlarmListH2PersistenceDAO.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationAlarmListH2PersistenceDAO extends AbstractPersistenceH2DAO { - - AbstractApplicationAlarmListH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected final ApplicationAlarmList h2DataToStreamData(ResultSet resultSet) throws SQLException { - ApplicationAlarmList applicationAlarmList = new ApplicationAlarmList(); - applicationAlarmList.setId(resultSet.getString(ApplicationAlarmListTable.ID.getName())); - applicationAlarmList.setMetricId(resultSet.getString(ApplicationAlarmListTable.METRIC_ID.getName())); - applicationAlarmList.setSourceValue(resultSet.getInt(ApplicationAlarmListTable.SOURCE_VALUE.getName())); - - applicationAlarmList.setAlarmType(resultSet.getInt(ApplicationAlarmListTable.ALARM_TYPE.getName())); - - applicationAlarmList.setApplicationId(resultSet.getInt(ApplicationAlarmListTable.APPLICATION_ID.getName())); - - applicationAlarmList.setTimeBucket(resultSet.getLong(ApplicationAlarmListTable.TIME_BUCKET.getName())); - applicationAlarmList.setAlarmContent(resultSet.getString(ApplicationAlarmListTable.ALARM_CONTENT.getName())); - - return applicationAlarmList; - } - - @Override protected final Map streamDataToH2Data(ApplicationAlarmList streamData) { - Map target = new HashMap<>(); - target.put(ApplicationAlarmListTable.ID.getName(), streamData.getId()); - target.put(ApplicationAlarmListTable.METRIC_ID.getName(), streamData.getMetricId()); - target.put(ApplicationAlarmListTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(ApplicationAlarmListTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(ApplicationAlarmListTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - - target.put(ApplicationAlarmListTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - target.put(ApplicationAlarmListTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationAlarmH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationAlarmH2PersistenceDAO.java deleted file mode 100644 index 34ad12344e9c2e0a501ee5b296c90473ae55b218..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationAlarmH2PersistenceDAO.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmH2PersistenceDAO extends AbstractPersistenceH2DAO implements IApplicationAlarmPersistenceDAO { - - public ApplicationAlarmH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationAlarmTable.TABLE; - } - - @Override protected ApplicationAlarm h2DataToStreamData(ResultSet resultSet) throws SQLException { - ApplicationAlarm applicationAlarm = new ApplicationAlarm(); - applicationAlarm.setId(resultSet.getString(ApplicationAlarmTable.ID.getName())); - applicationAlarm.setSourceValue(resultSet.getInt(ApplicationAlarmTable.SOURCE_VALUE.getName())); - - applicationAlarm.setAlarmType(resultSet.getInt(ApplicationAlarmTable.ALARM_TYPE.getName())); - - applicationAlarm.setApplicationId(resultSet.getInt(ApplicationAlarmTable.APPLICATION_ID.getName())); - - applicationAlarm.setLastTimeBucket(resultSet.getLong(ApplicationAlarmTable.LAST_TIME_BUCKET.getName())); - applicationAlarm.setAlarmContent(resultSet.getString(ApplicationAlarmTable.ALARM_CONTENT.getName())); - - return applicationAlarm; - } - - @Override protected Map streamDataToH2Data(ApplicationAlarm streamData) { - Map target = new HashMap<>(); - target.put(ApplicationAlarmTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(ApplicationAlarmTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(ApplicationAlarmTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - - target.put(ApplicationAlarmTable.LAST_TIME_BUCKET.getName(), streamData.getLastTimeBucket()); - target.put(ApplicationAlarmTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationAlarmListH2DayPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationAlarmListH2DayPersistenceDAO.java deleted file mode 100644 index c4aafee373edefe37a994abc29c0c0653b883a9d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationAlarmListH2DayPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.alarm; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmListH2DayPersistenceDAO extends AbstractApplicationAlarmListH2PersistenceDAO implements IApplicationAlarmListDayPersistenceDAO { - - public ApplicationAlarmListH2DayPersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationAlarmListH2HourPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationAlarmListH2HourPersistenceDAO.java deleted file mode 100644 index 7653b1ef52016b9c5491c07b92caf8b0cf4d72f4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationAlarmListH2HourPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.alarm; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmListH2HourPersistenceDAO extends AbstractApplicationAlarmListH2PersistenceDAO implements IApplicationAlarmListHourPersistenceDAO { - - public ApplicationAlarmListH2HourPersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationAlarmListH2MinutePersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationAlarmListH2MinutePersistenceDAO.java deleted file mode 100644 index 6ae540d9a8ef8f4eba7c92e3c5e87e9c8be723b6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationAlarmListH2MinutePersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.alarm; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmListH2MinutePersistenceDAO extends AbstractApplicationAlarmListH2PersistenceDAO implements IApplicationAlarmListMinutePersistenceDAO { - - public ApplicationAlarmListH2MinutePersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationAlarmListH2MonthPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationAlarmListH2MonthPersistenceDAO.java deleted file mode 100644 index bc09f0b6c1871e5fbe340ed3db7b5cd2ffa20f61..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationAlarmListH2MonthPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.alarm; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmListH2MonthPersistenceDAO extends AbstractApplicationAlarmListH2PersistenceDAO implements IApplicationAlarmListMonthPersistenceDAO { - - public ApplicationAlarmListH2MonthPersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationReferenceAlarmH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationReferenceAlarmH2PersistenceDAO.java deleted file mode 100644 index 5d4a59b0edaf0e2e64affac32834718c508aaeb6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationReferenceAlarmH2PersistenceDAO.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationReferenceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceAlarmH2PersistenceDAO extends AbstractPersistenceH2DAO implements IApplicationReferenceAlarmPersistenceDAO { - - public ApplicationReferenceAlarmH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationReferenceAlarmTable.TABLE; - } - - @Override protected ApplicationReferenceAlarm h2DataToStreamData(ResultSet resultSet) throws SQLException { - ApplicationReferenceAlarm applicationReferenceAlarm = new ApplicationReferenceAlarm(); - applicationReferenceAlarm.setId(resultSet.getString(ApplicationReferenceAlarmTable.ID.getName())); - applicationReferenceAlarm.setSourceValue(resultSet.getInt(ApplicationReferenceAlarmTable.SOURCE_VALUE.getName())); - - applicationReferenceAlarm.setAlarmType(resultSet.getInt(ApplicationReferenceAlarmTable.ALARM_TYPE.getName())); - - applicationReferenceAlarm.setFrontApplicationId(resultSet.getInt(ApplicationReferenceAlarmTable.FRONT_APPLICATION_ID.getName())); - applicationReferenceAlarm.setBehindApplicationId(resultSet.getInt(ApplicationReferenceAlarmTable.BEHIND_APPLICATION_ID.getName())); - - applicationReferenceAlarm.setLastTimeBucket(resultSet.getLong(ApplicationReferenceAlarmTable.LAST_TIME_BUCKET.getName())); - applicationReferenceAlarm.setAlarmContent(resultSet.getString(ApplicationReferenceAlarmTable.ALARM_CONTENT.getName())); - - return applicationReferenceAlarm; - } - - @Override protected Map streamDataToH2Data(ApplicationReferenceAlarm streamData) { - Map target = new HashMap<>(); - target.put(ApplicationReferenceAlarmTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(ApplicationReferenceAlarmTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(ApplicationReferenceAlarmTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()); - target.put(ApplicationReferenceAlarmTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()); - - target.put(ApplicationReferenceAlarmTable.LAST_TIME_BUCKET.getName(), streamData.getLastTimeBucket()); - target.put(ApplicationReferenceAlarmTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationReferenceAlarmListH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationReferenceAlarmListH2PersistenceDAO.java deleted file mode 100644 index 192b70fe50f131a6bb23bde29e247a7d70f4a95f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ApplicationReferenceAlarmListH2PersistenceDAO.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationReferenceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceAlarmListH2PersistenceDAO extends AbstractPersistenceH2DAO implements IApplicationReferenceAlarmListPersistenceDAO { - - public ApplicationReferenceAlarmListH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationReferenceAlarmListTable.TABLE; - } - - @Override protected ApplicationReferenceAlarmList h2DataToStreamData(ResultSet resultSet) throws SQLException { - ApplicationReferenceAlarmList applicationReferenceAlarmList = new ApplicationReferenceAlarmList(); - applicationReferenceAlarmList.setId(resultSet.getString(ApplicationReferenceAlarmListTable.ID.getName())); - applicationReferenceAlarmList.setSourceValue(resultSet.getInt(ApplicationReferenceAlarmListTable.SOURCE_VALUE.getName())); - - applicationReferenceAlarmList.setAlarmType(resultSet.getInt(ApplicationReferenceAlarmListTable.ALARM_TYPE.getName())); - - applicationReferenceAlarmList.setFrontApplicationId(resultSet.getInt(ApplicationReferenceAlarmListTable.FRONT_APPLICATION_ID.getName())); - applicationReferenceAlarmList.setBehindApplicationId(resultSet.getInt(ApplicationReferenceAlarmListTable.BEHIND_APPLICATION_ID.getName())); - - applicationReferenceAlarmList.setTimeBucket(resultSet.getLong(ApplicationReferenceAlarmListTable.TIME_BUCKET.getName())); - applicationReferenceAlarmList.setAlarmContent(resultSet.getString(ApplicationReferenceAlarmListTable.ALARM_CONTENT.getName())); - - return applicationReferenceAlarmList; - } - - @Override protected Map streamDataToH2Data(ApplicationReferenceAlarmList streamData) { - Map target = new HashMap<>(); - target.put(ApplicationReferenceAlarmListTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(ApplicationReferenceAlarmListTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(ApplicationReferenceAlarmListTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()); - target.put(ApplicationReferenceAlarmListTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()); - - target.put(ApplicationReferenceAlarmListTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - target.put(ApplicationReferenceAlarmListTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/InstanceAlarmH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/InstanceAlarmH2PersistenceDAO.java deleted file mode 100644 index 94d2605cd3400f5dde877ec30b3c34306f19e710..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/InstanceAlarmH2PersistenceDAO.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmTable; - -/** - * @author peng-yongsheng - */ -public class InstanceAlarmH2PersistenceDAO extends AbstractPersistenceH2DAO implements IInstanceAlarmPersistenceDAO { - - public InstanceAlarmH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return InstanceAlarmTable.TABLE; - } - - @Override protected InstanceAlarm h2DataToStreamData(ResultSet resultSet) throws SQLException { - InstanceAlarm instanceAlarm = new InstanceAlarm(); - instanceAlarm.setId(resultSet.getString(InstanceAlarmTable.ID.getName())); - instanceAlarm.setSourceValue(resultSet.getInt(InstanceAlarmTable.SOURCE_VALUE.getName())); - - instanceAlarm.setAlarmType(resultSet.getInt(InstanceAlarmTable.ALARM_TYPE.getName())); - - instanceAlarm.setApplicationId(resultSet.getInt(InstanceAlarmTable.APPLICATION_ID.getName())); - instanceAlarm.setInstanceId(resultSet.getInt(InstanceAlarmTable.INSTANCE_ID.getName())); - - instanceAlarm.setLastTimeBucket(resultSet.getLong(InstanceAlarmTable.LAST_TIME_BUCKET.getName())); - instanceAlarm.setAlarmContent(resultSet.getString(InstanceAlarmTable.ALARM_CONTENT.getName())); - - return instanceAlarm; - } - - @Override protected Map streamDataToH2Data(InstanceAlarm streamData) { - Map target = new HashMap<>(); - target.put(InstanceAlarmTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(InstanceAlarmTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(InstanceAlarmTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - target.put(InstanceAlarmTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - - target.put(InstanceAlarmTable.LAST_TIME_BUCKET.getName(), streamData.getLastTimeBucket()); - target.put(InstanceAlarmTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/InstanceAlarmListH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/InstanceAlarmListH2PersistenceDAO.java deleted file mode 100644 index ff4afc7e820cdb6e2467677c04a1dce0493de627..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/InstanceAlarmListH2PersistenceDAO.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class InstanceAlarmListH2PersistenceDAO extends AbstractPersistenceH2DAO implements IInstanceAlarmListPersistenceDAO { - - public InstanceAlarmListH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return InstanceAlarmListTable.TABLE; - } - - @Override protected InstanceAlarmList h2DataToStreamData(ResultSet resultSet) throws SQLException { - InstanceAlarmList instanceAlarmList = new InstanceAlarmList(); - instanceAlarmList.setId(resultSet.getString(InstanceAlarmListTable.ID.getName())); - instanceAlarmList.setSourceValue(resultSet.getInt(InstanceAlarmListTable.SOURCE_VALUE.getName())); - - instanceAlarmList.setAlarmType(resultSet.getInt(InstanceAlarmListTable.ALARM_TYPE.getName())); - - instanceAlarmList.setApplicationId(resultSet.getInt(InstanceAlarmListTable.APPLICATION_ID.getName())); - instanceAlarmList.setInstanceId(resultSet.getInt(InstanceAlarmListTable.INSTANCE_ID.getName())); - - instanceAlarmList.setTimeBucket(resultSet.getLong(InstanceAlarmListTable.TIME_BUCKET.getName())); - instanceAlarmList.setAlarmContent(resultSet.getString(InstanceAlarmListTable.ALARM_CONTENT.getName())); - - return instanceAlarmList; - } - - @Override protected Map streamDataToH2Data(InstanceAlarmList streamData) { - Map target = new HashMap<>(); - target.put(InstanceAlarmListTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(InstanceAlarmListTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(InstanceAlarmListTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - target.put(InstanceAlarmListTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - - target.put(InstanceAlarmListTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - target.put(InstanceAlarmListTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/InstanceReferenceAlarmH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/InstanceReferenceAlarmH2PersistenceDAO.java deleted file mode 100644 index 8a21c84e1db45345422dc1790782d249c574fca2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/InstanceReferenceAlarmH2PersistenceDAO.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceReferenceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmTable; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceAlarmH2PersistenceDAO extends AbstractPersistenceH2DAO implements IInstanceReferenceAlarmPersistenceDAO { - - public InstanceReferenceAlarmH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return InstanceReferenceAlarmTable.TABLE; - } - - @Override protected InstanceReferenceAlarm h2DataToStreamData(ResultSet resultSet) throws SQLException { - InstanceReferenceAlarm instanceReferenceAlarm = new InstanceReferenceAlarm(); - instanceReferenceAlarm.setId(resultSet.getString(ServiceReferenceAlarmTable.ID.getName())); - instanceReferenceAlarm.setSourceValue(resultSet.getInt(ServiceReferenceAlarmTable.SOURCE_VALUE.getName())); - - instanceReferenceAlarm.setAlarmType(resultSet.getInt(ServiceReferenceAlarmTable.ALARM_TYPE.getName())); - - instanceReferenceAlarm.setFrontApplicationId(resultSet.getInt(ServiceReferenceAlarmTable.FRONT_APPLICATION_ID.getName())); - instanceReferenceAlarm.setFrontInstanceId(resultSet.getInt(ServiceReferenceAlarmTable.FRONT_INSTANCE_ID.getName())); - instanceReferenceAlarm.setBehindApplicationId(resultSet.getInt(ServiceReferenceAlarmTable.BEHIND_APPLICATION_ID.getName())); - instanceReferenceAlarm.setBehindInstanceId(resultSet.getInt(ServiceReferenceAlarmTable.BEHIND_INSTANCE_ID.getName())); - - instanceReferenceAlarm.setLastTimeBucket(resultSet.getLong(ServiceReferenceAlarmTable.LAST_TIME_BUCKET.getName())); - instanceReferenceAlarm.setAlarmContent(resultSet.getString(ServiceReferenceAlarmTable.ALARM_CONTENT.getName())); - - return instanceReferenceAlarm; - } - - @Override protected Map streamDataToH2Data(InstanceReferenceAlarm streamData) { - Map target = new HashMap<>(); - target.put(ServiceReferenceAlarmTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(ServiceReferenceAlarmTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(ServiceReferenceAlarmTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()); - target.put(ServiceReferenceAlarmTable.FRONT_INSTANCE_ID.getName(), streamData.getFrontInstanceId()); - target.put(ServiceReferenceAlarmTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()); - target.put(ServiceReferenceAlarmTable.BEHIND_INSTANCE_ID.getName(), streamData.getBehindInstanceId()); - - target.put(ServiceReferenceAlarmTable.LAST_TIME_BUCKET.getName(), streamData.getLastTimeBucket()); - target.put(ServiceReferenceAlarmTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/InstanceReferenceAlarmListH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/InstanceReferenceAlarmListH2PersistenceDAO.java deleted file mode 100644 index 728f5689b14e618ec7fbe99003b8fbf3e3aca7c2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/InstanceReferenceAlarmListH2PersistenceDAO.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceReferenceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceAlarmListH2PersistenceDAO extends AbstractPersistenceH2DAO implements IInstanceReferenceAlarmListPersistenceDAO { - - public InstanceReferenceAlarmListH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return InstanceReferenceAlarmListTable.TABLE; - } - - @Override protected InstanceReferenceAlarmList h2DataToStreamData(ResultSet resultSet) throws SQLException { - InstanceReferenceAlarmList instanceReferenceAlarmList = new InstanceReferenceAlarmList(); - instanceReferenceAlarmList.setId(resultSet.getString(InstanceReferenceAlarmListTable.ID.getName())); - instanceReferenceAlarmList.setSourceValue(resultSet.getInt(InstanceReferenceAlarmListTable.SOURCE_VALUE.getName())); - - instanceReferenceAlarmList.setAlarmType(resultSet.getInt(InstanceReferenceAlarmListTable.ALARM_TYPE.getName())); - - instanceReferenceAlarmList.setFrontApplicationId(resultSet.getInt(InstanceReferenceAlarmListTable.FRONT_APPLICATION_ID.getName())); - instanceReferenceAlarmList.setFrontInstanceId(resultSet.getInt(InstanceReferenceAlarmListTable.FRONT_INSTANCE_ID.getName())); - instanceReferenceAlarmList.setBehindApplicationId(resultSet.getInt(InstanceReferenceAlarmListTable.BEHIND_APPLICATION_ID.getName())); - instanceReferenceAlarmList.setBehindInstanceId(resultSet.getInt(InstanceReferenceAlarmListTable.BEHIND_INSTANCE_ID.getName())); - - instanceReferenceAlarmList.setTimeBucket(resultSet.getLong(InstanceReferenceAlarmListTable.TIME_BUCKET.getName())); - instanceReferenceAlarmList.setAlarmContent(resultSet.getString(InstanceReferenceAlarmListTable.ALARM_CONTENT.getName())); - - return instanceReferenceAlarmList; - } - - @Override protected Map streamDataToH2Data(InstanceReferenceAlarmList streamData) { - Map target = new HashMap<>(); - target.put(InstanceReferenceAlarmListTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(InstanceReferenceAlarmListTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(InstanceReferenceAlarmListTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()); - target.put(InstanceReferenceAlarmListTable.FRONT_INSTANCE_ID.getName(), streamData.getFrontInstanceId()); - target.put(InstanceReferenceAlarmListTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()); - target.put(InstanceReferenceAlarmListTable.BEHIND_INSTANCE_ID.getName(), streamData.getBehindInstanceId()); - - target.put(InstanceReferenceAlarmListTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - target.put(InstanceReferenceAlarmListTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ServiceAlarmH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ServiceAlarmH2PersistenceDAO.java deleted file mode 100644 index d003ed74d88fcc369156b8bde513910b0c32d0d7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ServiceAlarmH2PersistenceDAO.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmTable; - -/** - * @author peng-yongsheng - */ -public class ServiceAlarmH2PersistenceDAO extends AbstractPersistenceH2DAO implements IServiceAlarmPersistenceDAO { - - public ServiceAlarmH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ServiceAlarmTable.TABLE; - } - - @Override protected ServiceAlarm h2DataToStreamData(ResultSet resultSet) throws SQLException { - ServiceAlarm serviceAlarm = new ServiceAlarm(); - serviceAlarm.setId(resultSet.getString(ServiceAlarmTable.ID.getName())); - serviceAlarm.setSourceValue(resultSet.getInt(ServiceAlarmTable.SOURCE_VALUE.getName())); - - serviceAlarm.setAlarmType(resultSet.getInt(ServiceAlarmTable.ALARM_TYPE.getName())); - - serviceAlarm.setApplicationId(resultSet.getInt(ServiceAlarmTable.APPLICATION_ID.getName())); - serviceAlarm.setInstanceId(resultSet.getInt(ServiceAlarmTable.INSTANCE_ID.getName())); - serviceAlarm.setServiceId(resultSet.getInt(ServiceAlarmTable.SERVICE_ID.getName())); - - serviceAlarm.setLastTimeBucket(resultSet.getLong(ServiceAlarmTable.LAST_TIME_BUCKET.getName())); - serviceAlarm.setAlarmContent(resultSet.getString(ServiceAlarmTable.ALARM_CONTENT.getName())); - - return serviceAlarm; - } - - @Override protected Map streamDataToH2Data(ServiceAlarm streamData) { - Map target = new HashMap<>(); - target.put(ServiceAlarmTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(ServiceAlarmTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(ServiceAlarmTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - target.put(ServiceAlarmTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - target.put(ServiceAlarmTable.SERVICE_ID.getName(), streamData.getServiceId()); - - target.put(ServiceAlarmTable.LAST_TIME_BUCKET.getName(), streamData.getLastTimeBucket()); - target.put(ServiceAlarmTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ServiceAlarmListH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ServiceAlarmListH2PersistenceDAO.java deleted file mode 100644 index 484575c164a74dcefc4ef6b582319fc32f5133f4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ServiceAlarmListH2PersistenceDAO.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ServiceAlarmListH2PersistenceDAO extends AbstractPersistenceH2DAO implements IServiceAlarmListPersistenceDAO { - - public ServiceAlarmListH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ServiceAlarmListTable.TABLE; - } - - @Override protected ServiceAlarmList h2DataToStreamData(ResultSet resultSet) throws SQLException { - ServiceAlarmList serviceAlarmList = new ServiceAlarmList(); - serviceAlarmList.setId(resultSet.getString(ServiceAlarmListTable.ID.getName())); - serviceAlarmList.setSourceValue(resultSet.getInt(ServiceAlarmListTable.SOURCE_VALUE.getName())); - - serviceAlarmList.setAlarmType(resultSet.getInt(ServiceAlarmListTable.ALARM_TYPE.getName())); - - serviceAlarmList.setApplicationId(resultSet.getInt(ServiceAlarmListTable.APPLICATION_ID.getName())); - serviceAlarmList.setInstanceId(resultSet.getInt(ServiceAlarmListTable.INSTANCE_ID.getName())); - serviceAlarmList.setServiceId(resultSet.getInt(ServiceAlarmListTable.SERVICE_ID.getName())); - - serviceAlarmList.setTimeBucket(resultSet.getLong(ServiceAlarmListTable.TIME_BUCKET.getName())); - serviceAlarmList.setAlarmContent(resultSet.getString(ServiceAlarmListTable.ALARM_CONTENT.getName())); - - return serviceAlarmList; - } - - @Override protected Map streamDataToH2Data(ServiceAlarmList streamData) { - Map target = new HashMap<>(); - target.put(ServiceAlarmListTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(ServiceAlarmListTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(ServiceAlarmListTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - target.put(ServiceAlarmListTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - target.put(ServiceAlarmListTable.SERVICE_ID.getName(), streamData.getServiceId()); - - target.put(ServiceAlarmListTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - target.put(ServiceAlarmListTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ServiceReferenceAlarmH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ServiceReferenceAlarmH2PersistenceDAO.java deleted file mode 100644 index e0ecbbb6d060ac7f4c78e92caccbe19cd9d395c2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ServiceReferenceAlarmH2PersistenceDAO.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceReferenceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceAlarmH2PersistenceDAO extends AbstractPersistenceH2DAO implements IServiceReferenceAlarmPersistenceDAO { - - public ServiceReferenceAlarmH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ServiceReferenceAlarmTable.TABLE; - } - - @Override protected ServiceReferenceAlarm h2DataToStreamData(ResultSet resultSet) throws SQLException { - ServiceReferenceAlarm serviceReferenceAlarm = new ServiceReferenceAlarm(); - serviceReferenceAlarm.setId(resultSet.getString(ServiceReferenceAlarmTable.ID.getName())); - serviceReferenceAlarm.setSourceValue(resultSet.getInt(ServiceReferenceAlarmTable.SOURCE_VALUE.getName())); - - serviceReferenceAlarm.setAlarmType(resultSet.getInt(ServiceReferenceAlarmTable.ALARM_TYPE.getName())); - - serviceReferenceAlarm.setFrontApplicationId(resultSet.getInt(ServiceReferenceAlarmTable.FRONT_APPLICATION_ID.getName())); - serviceReferenceAlarm.setFrontInstanceId(resultSet.getInt(ServiceReferenceAlarmTable.FRONT_INSTANCE_ID.getName())); - serviceReferenceAlarm.setFrontServiceId(resultSet.getInt(ServiceReferenceAlarmTable.FRONT_SERVICE_ID.getName())); - serviceReferenceAlarm.setBehindApplicationId(resultSet.getInt(ServiceReferenceAlarmTable.BEHIND_APPLICATION_ID.getName())); - serviceReferenceAlarm.setBehindInstanceId(resultSet.getInt(ServiceReferenceAlarmTable.BEHIND_INSTANCE_ID.getName())); - serviceReferenceAlarm.setBehindServiceId(resultSet.getInt(ServiceReferenceAlarmTable.BEHIND_SERVICE_ID.getName())); - - serviceReferenceAlarm.setLastTimeBucket(resultSet.getLong(ServiceReferenceAlarmTable.LAST_TIME_BUCKET.getName())); - serviceReferenceAlarm.setAlarmContent(resultSet.getString(ServiceReferenceAlarmTable.ALARM_CONTENT.getName())); - - return serviceReferenceAlarm; - } - - @Override protected Map streamDataToH2Data(ServiceReferenceAlarm streamData) { - Map target = new HashMap<>(); - target.put(ServiceReferenceAlarmTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(ServiceReferenceAlarmTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(ServiceReferenceAlarmTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()); - target.put(ServiceReferenceAlarmTable.FRONT_INSTANCE_ID.getName(), streamData.getFrontInstanceId()); - target.put(ServiceReferenceAlarmTable.FRONT_SERVICE_ID.getName(), streamData.getFrontServiceId()); - target.put(ServiceReferenceAlarmTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()); - target.put(ServiceReferenceAlarmTable.BEHIND_INSTANCE_ID.getName(), streamData.getBehindInstanceId()); - target.put(ServiceReferenceAlarmTable.BEHIND_SERVICE_ID.getName(), streamData.getBehindServiceId()); - - target.put(ServiceReferenceAlarmTable.LAST_TIME_BUCKET.getName(), streamData.getLastTimeBucket()); - target.put(ServiceReferenceAlarmTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ServiceReferenceAlarmListH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ServiceReferenceAlarmListH2PersistenceDAO.java deleted file mode 100644 index f4ba5861d36d9ca76ac93fcb70b325187625a6fa..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/alarm/ServiceReferenceAlarmListH2PersistenceDAO.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceReferenceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceAlarmListH2PersistenceDAO extends AbstractPersistenceH2DAO implements IServiceReferenceAlarmListPersistenceDAO { - - public ServiceReferenceAlarmListH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ServiceReferenceAlarmListTable.TABLE; - } - - @Override protected ServiceReferenceAlarmList h2DataToStreamData(ResultSet resultSet) throws SQLException { - ServiceReferenceAlarmList serviceReferenceAlarmList = new ServiceReferenceAlarmList(); - serviceReferenceAlarmList.setId(resultSet.getString(ServiceReferenceAlarmListTable.ID.getName())); - serviceReferenceAlarmList.setSourceValue(resultSet.getInt(ServiceReferenceAlarmListTable.SOURCE_VALUE.getName())); - - serviceReferenceAlarmList.setAlarmType(resultSet.getInt(ServiceReferenceAlarmListTable.ALARM_TYPE.getName())); - - serviceReferenceAlarmList.setFrontApplicationId(resultSet.getInt(ServiceReferenceAlarmListTable.FRONT_APPLICATION_ID.getName())); - serviceReferenceAlarmList.setFrontInstanceId(resultSet.getInt(ServiceReferenceAlarmListTable.FRONT_INSTANCE_ID.getName())); - serviceReferenceAlarmList.setFrontServiceId(resultSet.getInt(ServiceReferenceAlarmListTable.FRONT_SERVICE_ID.getName())); - serviceReferenceAlarmList.setBehindApplicationId(resultSet.getInt(ServiceReferenceAlarmListTable.BEHIND_APPLICATION_ID.getName())); - serviceReferenceAlarmList.setBehindInstanceId(resultSet.getInt(ServiceReferenceAlarmListTable.BEHIND_INSTANCE_ID.getName())); - serviceReferenceAlarmList.setBehindServiceId(resultSet.getInt(ServiceReferenceAlarmListTable.BEHIND_SERVICE_ID.getName())); - - serviceReferenceAlarmList.setTimeBucket(resultSet.getLong(ServiceReferenceAlarmListTable.TIME_BUCKET.getName())); - serviceReferenceAlarmList.setAlarmContent(resultSet.getString(ServiceReferenceAlarmListTable.ALARM_CONTENT.getName())); - - return serviceReferenceAlarmList; - } - - @Override protected Map streamDataToH2Data(ServiceReferenceAlarmList streamData) { - Map target = new HashMap<>(); - target.put(ServiceReferenceAlarmListTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(ServiceReferenceAlarmListTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(ServiceReferenceAlarmListTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()); - target.put(ServiceReferenceAlarmListTable.FRONT_INSTANCE_ID.getName(), streamData.getFrontInstanceId()); - target.put(ServiceReferenceAlarmListTable.FRONT_SERVICE_ID.getName(), streamData.getFrontServiceId()); - target.put(ServiceReferenceAlarmListTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()); - target.put(ServiceReferenceAlarmListTable.BEHIND_INSTANCE_ID.getName(), streamData.getBehindInstanceId()); - target.put(ServiceReferenceAlarmListTable.BEHIND_SERVICE_ID.getName(), streamData.getBehindServiceId()); - - target.put(ServiceReferenceAlarmListTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - target.put(ServiceReferenceAlarmListTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/amp/AbstractApplicationMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/amp/AbstractApplicationMetricH2PersistenceDAO.java deleted file mode 100644 index fcf3038f31922b351bc1b650a9999e18e7aca5b2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/amp/AbstractApplicationMetricH2PersistenceDAO.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.amp; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.h2.MetricTransformUtil; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationMetricH2PersistenceDAO extends AbstractPersistenceH2DAO { - - AbstractApplicationMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected final ApplicationMetric h2DataToStreamData(ResultSet resultSet) throws SQLException { - ApplicationMetric applicationMetric = new ApplicationMetric(); - applicationMetric.setId(resultSet.getString(ApplicationMetricTable.ID.getName())); - applicationMetric.setMetricId(resultSet.getString(ApplicationMetricTable.METRIC_ID.getName())); - - applicationMetric.setApplicationId(resultSet.getInt(ApplicationMetricTable.APPLICATION_ID.getName())); - - MetricTransformUtil.INSTANCE.h2DataToStreamData(resultSet, applicationMetric); - - applicationMetric.setSatisfiedCount(resultSet.getLong(ApplicationMetricTable.SATISFIED_COUNT.getName())); - applicationMetric.setToleratingCount(resultSet.getLong(ApplicationMetricTable.TOLERATING_COUNT.getName())); - applicationMetric.setFrustratedCount(resultSet.getLong(ApplicationMetricTable.FRUSTRATED_COUNT.getName())); - - return applicationMetric; - } - - @Override protected final Map streamDataToH2Data(ApplicationMetric streamData) { - Map target = new HashMap<>(); - target.put(ApplicationMetricTable.ID.getName(), streamData.getId()); - target.put(ApplicationMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(ApplicationMetricTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - - MetricTransformUtil.INSTANCE.streamDataToH2Data(streamData, target); - - target.put(ApplicationMetricTable.SATISFIED_COUNT.getName(), streamData.getSatisfiedCount()); - target.put(ApplicationMetricTable.TOLERATING_COUNT.getName(), streamData.getToleratingCount()); - target.put(ApplicationMetricTable.FRUSTRATED_COUNT.getName(), streamData.getFrustratedCount()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/amp/ApplicationDayMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/amp/ApplicationDayMetricH2PersistenceDAO.java deleted file mode 100644 index 7147ddcb02766db71d4b61bb37dd7c53bc4b3b14..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/amp/ApplicationDayMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.amp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng, clevertension - */ -public class ApplicationDayMetricH2PersistenceDAO extends AbstractApplicationMetricH2PersistenceDAO implements IApplicationDayMetricPersistenceDAO { - - public ApplicationDayMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/amp/ApplicationHourMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/amp/ApplicationHourMetricH2PersistenceDAO.java deleted file mode 100644 index b4d52c769270d65e904ad40d4e00f9e68eb24aee..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/amp/ApplicationHourMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.amp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng, clevertension - */ -public class ApplicationHourMetricH2PersistenceDAO extends AbstractApplicationMetricH2PersistenceDAO implements IApplicationHourMetricPersistenceDAO { - - public ApplicationHourMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/amp/ApplicationMinuteMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/amp/ApplicationMinuteMetricH2PersistenceDAO.java deleted file mode 100644 index 5ade074b20dddb9f2df9074d96f76e22aeef9689..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/amp/ApplicationMinuteMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.amp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng, clevertension - */ -public class ApplicationMinuteMetricH2PersistenceDAO extends AbstractApplicationMetricH2PersistenceDAO implements IApplicationMinuteMetricPersistenceDAO { - - public ApplicationMinuteMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/amp/ApplicationMonthMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/amp/ApplicationMonthMetricH2PersistenceDAO.java deleted file mode 100644 index fb2c51e5323445fc25c84667e7678c2f8b7ea4c8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/amp/ApplicationMonthMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.amp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng, clevertension - */ -public class ApplicationMonthMetricH2PersistenceDAO extends AbstractApplicationMetricH2PersistenceDAO implements IApplicationMonthMetricPersistenceDAO { - - public ApplicationMonthMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/AbstractApplicationMappingH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/AbstractApplicationMappingH2PersistenceDAO.java deleted file mode 100644 index e94c6be1dc4c046a113fd8b182851760d0475ff2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/AbstractApplicationMappingH2PersistenceDAO.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ampp; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationMappingH2PersistenceDAO extends AbstractPersistenceH2DAO { - - AbstractApplicationMappingH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected final ApplicationMapping h2DataToStreamData(ResultSet resultSet) throws SQLException { - ApplicationMapping applicationMapping = new ApplicationMapping(); - applicationMapping.setId(resultSet.getString(ApplicationMappingTable.ID.getName())); - applicationMapping.setMetricId(resultSet.getString(ApplicationMappingTable.METRIC_ID.getName())); - - applicationMapping.setApplicationId(resultSet.getInt(ApplicationMappingTable.APPLICATION_ID.getName())); - applicationMapping.setMappingApplicationId(resultSet.getInt(ApplicationMappingTable.MAPPING_APPLICATION_ID.getName())); - applicationMapping.setTimeBucket(resultSet.getLong(ApplicationMappingTable.TIME_BUCKET.getName())); - return applicationMapping; - } - - @Override protected final Map streamDataToH2Data(ApplicationMapping streamData) { - Map target = new HashMap<>(); - target.put(ApplicationMappingTable.ID.getName(), streamData.getId()); - target.put(ApplicationMappingTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(ApplicationMappingTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - target.put(ApplicationMappingTable.MAPPING_APPLICATION_ID.getName(), streamData.getMappingApplicationId()); - target.put(ApplicationMappingTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/ApplicationMappingDayH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/ApplicationMappingDayH2PersistenceDAO.java deleted file mode 100644 index 3a433a68d2baf87c6185f7a4f500083d6fccd79a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/ApplicationMappingDayH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ampp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingDayH2PersistenceDAO extends AbstractApplicationMappingH2PersistenceDAO implements IApplicationMappingDayPersistenceDAO { - - public ApplicationMappingDayH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/ApplicationMappingHourH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/ApplicationMappingHourH2PersistenceDAO.java deleted file mode 100644 index ca761d24fde84e5d248c8db7b7b7a95fd05be2fc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/ApplicationMappingHourH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ampp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingHourH2PersistenceDAO extends AbstractApplicationMappingH2PersistenceDAO implements IApplicationMappingHourPersistenceDAO { - - public ApplicationMappingHourH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/ApplicationMappingMinuteH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/ApplicationMappingMinuteH2PersistenceDAO.java deleted file mode 100644 index d4c1e96e0359849e415a5000afb426c48fc27fd1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/ApplicationMappingMinuteH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ampp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingMinuteH2PersistenceDAO extends AbstractApplicationMappingH2PersistenceDAO implements IApplicationMappingMinutePersistenceDAO { - - public ApplicationMappingMinuteH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/ApplicationMappingMonthH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/ApplicationMappingMonthH2PersistenceDAO.java deleted file mode 100644 index 83cc8e12f706487a5ea4075b3d5b99668fc13756..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ampp/ApplicationMappingMonthH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ampp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingMonthH2PersistenceDAO extends AbstractApplicationMappingH2PersistenceDAO implements IApplicationMappingMonthPersistenceDAO { - - public ApplicationMappingMonthH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/armp/AbstractApplicationReferenceMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/armp/AbstractApplicationReferenceMetricH2PersistenceDAO.java deleted file mode 100644 index a639797450dbfedb719a45ce8d072357284abfd8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/armp/AbstractApplicationReferenceMetricH2PersistenceDAO.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.armp; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.h2.MetricTransformUtil; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationReferenceMetricH2PersistenceDAO extends AbstractPersistenceH2DAO { - - AbstractApplicationReferenceMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected final ApplicationReferenceMetric h2DataToStreamData(ResultSet resultSet) throws SQLException { - ApplicationReferenceMetric applicationReferenceMetric = new ApplicationReferenceMetric(); - applicationReferenceMetric.setId(resultSet.getString(ApplicationReferenceMetricTable.ID.getName())); - applicationReferenceMetric.setMetricId(resultSet.getString(ApplicationReferenceMetricTable.METRIC_ID.getName())); - - applicationReferenceMetric.setFrontApplicationId(resultSet.getInt(ApplicationReferenceMetricTable.FRONT_APPLICATION_ID.getName())); - applicationReferenceMetric.setBehindApplicationId(resultSet.getInt(ApplicationReferenceMetricTable.BEHIND_APPLICATION_ID.getName())); - - MetricTransformUtil.INSTANCE.h2DataToStreamData(resultSet, applicationReferenceMetric); - - applicationReferenceMetric.setSatisfiedCount(resultSet.getLong(ApplicationReferenceMetricTable.SATISFIED_COUNT.getName())); - applicationReferenceMetric.setToleratingCount(resultSet.getLong(ApplicationReferenceMetricTable.TOLERATING_COUNT.getName())); - applicationReferenceMetric.setFrustratedCount(resultSet.getLong(ApplicationReferenceMetricTable.FRUSTRATED_COUNT.getName())); - - return applicationReferenceMetric; - } - - @Override protected final Map streamDataToH2Data(ApplicationReferenceMetric streamData) { - Map target = new HashMap<>(); - target.put(ApplicationReferenceMetricTable.ID.getName(), streamData.getId()); - target.put(ApplicationReferenceMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(ApplicationReferenceMetricTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()); - target.put(ApplicationReferenceMetricTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()); - - MetricTransformUtil.INSTANCE.streamDataToH2Data(streamData, target); - - target.put(ApplicationReferenceMetricTable.SATISFIED_COUNT.getName(), streamData.getSatisfiedCount()); - target.put(ApplicationReferenceMetricTable.TOLERATING_COUNT.getName(), streamData.getToleratingCount()); - target.put(ApplicationReferenceMetricTable.FRUSTRATED_COUNT.getName(), streamData.getFrustratedCount()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/armp/ApplicationReferenceDayMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/armp/ApplicationReferenceDayMetricH2PersistenceDAO.java deleted file mode 100644 index 09529ed20069aed7a4ece30b47e383f75fe5e563..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/armp/ApplicationReferenceDayMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.armp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceDayMetricH2PersistenceDAO extends AbstractApplicationReferenceMetricH2PersistenceDAO implements IApplicationReferenceDayMetricPersistenceDAO { - - public ApplicationReferenceDayMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/armp/ApplicationReferenceHourMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/armp/ApplicationReferenceHourMetricH2PersistenceDAO.java deleted file mode 100644 index a2ce5acb170fe77876b45c895276098b72b93d61..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/armp/ApplicationReferenceHourMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.armp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceHourMetricH2PersistenceDAO extends AbstractApplicationReferenceMetricH2PersistenceDAO implements IApplicationReferenceHourMetricPersistenceDAO { - - public ApplicationReferenceHourMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/armp/ApplicationReferenceMinuteMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/armp/ApplicationReferenceMinuteMetricH2PersistenceDAO.java deleted file mode 100644 index d30ffc56e8600d1280610876c52a0fed11f85b92..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/armp/ApplicationReferenceMinuteMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.armp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMinuteMetricH2PersistenceDAO extends AbstractApplicationReferenceMetricH2PersistenceDAO implements IApplicationReferenceMinuteMetricPersistenceDAO { - - public ApplicationReferenceMinuteMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/armp/ApplicationReferenceMonthMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/armp/ApplicationReferenceMonthMetricH2PersistenceDAO.java deleted file mode 100644 index bb71256d6c1c0db0e3095e3e2a5552713f29eb5d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/armp/ApplicationReferenceMonthMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.armp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMonthMetricH2PersistenceDAO extends AbstractApplicationReferenceMetricH2PersistenceDAO implements IApplicationReferenceMonthMetricPersistenceDAO { - - public ApplicationReferenceMonthMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cache/ApplicationH2CacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cache/ApplicationH2CacheDAO.java deleted file mode 100644 index e2f5d5e3491aed6111983d74d5a34a7906cad41e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cache/ApplicationH2CacheDAO.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.cache; - -import java.sql.ResultSet; -import java.sql.SQLException; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.cache.IApplicationCacheDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.register.Application; -import org.apache.skywalking.apm.collector.storage.table.register.ApplicationTable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng, clevertension - */ -public class ApplicationH2CacheDAO extends H2DAO implements IApplicationCacheDAO { - - private static final Logger logger = LoggerFactory.getLogger(ApplicationH2CacheDAO.class); - - private static final String GET_APPLICATION_ID_SQL = "select {0} from {1} where {2} = ? and {3} = ?"; - private static final String GET_APPLICATION_SQL = "select {0},{1} from {2} where {3} = ?"; - - public ApplicationH2CacheDAO(H2Client client) { - super(client); - } - - @Override - public int getApplicationIdByCode(String applicationCode) { - logger.info("get the application id with application code = {}", applicationCode); - H2Client client = getClient(); - String sql = SqlBuilder.buildSql(GET_APPLICATION_ID_SQL, ApplicationTable.APPLICATION_ID.getName(), ApplicationTable.TABLE, ApplicationTable.APPLICATION_CODE.getName(), ApplicationTable.IS_ADDRESS.getName()); - - Object[] params = new Object[] {applicationCode, false}; - try (ResultSet rs = client.executeQuery(sql, params)) { - if (rs.next()) { - return rs.getInt(1); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } - - @Override public Application getApplication(int applicationId) { - logger.debug("get application code, applicationId: {}", applicationId); - H2Client client = getClient(); - String sql = SqlBuilder.buildSql(GET_APPLICATION_SQL, ApplicationTable.APPLICATION_CODE.getName(), ApplicationTable.IS_ADDRESS.getName(), ApplicationTable.TABLE, ApplicationTable.APPLICATION_ID.getName()); - Object[] params = new Object[] {applicationId}; - try (ResultSet rs = client.executeQuery(sql, params)) { - if (rs.next()) { - Application application = new Application(); - application.setApplicationId(applicationId); - application.setApplicationCode(rs.getString(1)); - application.setIsAddress(rs.getInt(2)); - return application; - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return null; - } - - @Override public int getApplicationIdByAddressId(int addressId) { - logger.info("get the application id with address id = {}", addressId); - H2Client client = getClient(); - String sql = SqlBuilder.buildSql(GET_APPLICATION_ID_SQL, ApplicationTable.APPLICATION_ID.getName(), ApplicationTable.TABLE, ApplicationTable.ADDRESS_ID.getName(), ApplicationTable.IS_ADDRESS.getName()); - - Object[] params = new Object[] {addressId, true}; - try (ResultSet rs = client.executeQuery(sql, params)) { - if (rs.next()) { - return rs.getInt(1); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cache/InstanceH2CacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cache/InstanceH2CacheDAO.java deleted file mode 100644 index 0c14ec33ac246bd2fbae5e8d0cae45e5d9ab2dc5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cache/InstanceH2CacheDAO.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.cache; - -import java.sql.ResultSet; -import java.sql.SQLException; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.core.util.BooleanUtils; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.cache.IInstanceCacheDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class InstanceH2CacheDAO extends H2DAO implements IInstanceCacheDAO { - - private static final Logger logger = LoggerFactory.getLogger(InstanceH2CacheDAO.class); - - private static final String GET_APPLICATION_ID_SQL = "select {0} from {1} where {2} = ?"; - private static final String GET_INSTANCE_ID_SQL = "select {0} from {1} where {2} = ? and {3} = ? and {4} = ?"; - - public InstanceH2CacheDAO(H2Client client) { - super(client); - } - - @Override public int getApplicationId(int instanceId) { - logger.info("get the application id by instance id = {}", instanceId); - H2Client client = getClient(); - String sql = SqlBuilder.buildSql(GET_APPLICATION_ID_SQL, InstanceTable.APPLICATION_ID.getName(), InstanceTable.TABLE, InstanceTable.INSTANCE_ID.getName()); - Object[] params = new Object[] {instanceId}; - try (ResultSet rs = client.executeQuery(sql, params)) { - if (rs.next()) { - return rs.getInt(InstanceTable.APPLICATION_ID.getName()); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } - - @Override public int getInstanceIdByAgentUUID(int applicationId, String agentUUID) { - logger.info("get the instance id by application id = {}, agentUUID = {}", applicationId, agentUUID); - H2Client client = getClient(); - String sql = SqlBuilder.buildSql(GET_INSTANCE_ID_SQL, InstanceTable.INSTANCE_ID.getName(), InstanceTable.TABLE, InstanceTable.APPLICATION_ID.getName(), - InstanceTable.AGENT_UUID.getName(), InstanceTable.IS_ADDRESS.getName()); - Object[] params = new Object[] {applicationId, agentUUID, BooleanUtils.FALSE}; - try (ResultSet rs = client.executeQuery(sql, params)) { - if (rs.next()) { - return rs.getInt(InstanceTable.INSTANCE_ID.getName()); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } - - @Override public int getInstanceIdByAddressId(int applicationId, int addressId) { - logger.info("get the instance id by application id = {}, address id = {}", applicationId, addressId); - H2Client client = getClient(); - String sql = SqlBuilder.buildSql(GET_INSTANCE_ID_SQL, InstanceTable.INSTANCE_ID.getName(), InstanceTable.TABLE, InstanceTable.APPLICATION_ID.getName(), - InstanceTable.ADDRESS_ID.getName(), InstanceTable.IS_ADDRESS.getName()); - Object[] params = new Object[] {applicationId, addressId, BooleanUtils.TRUE}; - try (ResultSet rs = client.executeQuery(sql, params)) { - if (rs.next()) { - return rs.getInt(InstanceTable.INSTANCE_ID.getName()); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cache/NetworkAddressH2CacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cache/NetworkAddressH2CacheDAO.java deleted file mode 100644 index a3c829cae37d4904f824bde6f9dbd65332a7192c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cache/NetworkAddressH2CacheDAO.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.cache; - -import java.sql.ResultSet; -import java.sql.SQLException; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.cache.INetworkAddressCacheDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddress; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddressTable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng, clevertension - */ -public class NetworkAddressH2CacheDAO extends H2DAO implements INetworkAddressCacheDAO { - - private static final Logger logger = LoggerFactory.getLogger(NetworkAddressH2CacheDAO.class); - - private static final String GET_ADDRESS_ID_OR_CODE_SQL = "select {0} from {1} where {2} = ?"; - - public NetworkAddressH2CacheDAO(H2Client client) { - super(client); - } - - @Override - public int getAddressId(String networkAddress) { - logger.info("get the address id with network address = {}", networkAddress); - H2Client client = getClient(); - - String sql = SqlBuilder.buildSql(GET_ADDRESS_ID_OR_CODE_SQL, NetworkAddressTable.ADDRESS_ID.getName(), NetworkAddressTable.TABLE, NetworkAddressTable.NETWORK_ADDRESS.getName()); - - Object[] params = new Object[] {networkAddress}; - try (ResultSet rs = client.executeQuery(sql, params)) { - if (rs.next()) { - return rs.getInt(1); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return Const.NONE; - } - - @Override public NetworkAddress getAddressById(int addressId) { - logger.debug("get network address, address id: {}", addressId); - H2Client client = getClient(); - - String dynamicSql = "select * from {0} where {1} = ?"; - String sql = SqlBuilder.buildSql(dynamicSql, NetworkAddressTable.TABLE, NetworkAddressTable.ADDRESS_ID.getName()); - Object[] params = new Object[] {addressId}; - try (ResultSet rs = client.executeQuery(sql, params)) { - if (rs.next()) { - NetworkAddress networkAddress = new NetworkAddress(); - networkAddress.setId(rs.getString(NetworkAddressTable.ID.getName())); - networkAddress.setAddressId(rs.getInt(NetworkAddressTable.ADDRESS_ID.getName())); - networkAddress.setNetworkAddress(rs.getString(NetworkAddressTable.NETWORK_ADDRESS.getName())); - networkAddress.setSrcSpanLayer(rs.getInt(NetworkAddressTable.SRC_SPAN_LAYER.getName())); - networkAddress.setServerType(rs.getInt(NetworkAddressTable.SERVER_TYPE.getName())); - return networkAddress; - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return null; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cache/ServiceNameH2CacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cache/ServiceNameH2CacheDAO.java deleted file mode 100644 index 82870fe344e9775994a6ed9eccb8fc9213e98927..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cache/ServiceNameH2CacheDAO.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.cache; - -import java.sql.ResultSet; -import java.sql.SQLException; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.cache.IServiceNameCacheDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceNameTable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng, clevertension - */ -public class ServiceNameH2CacheDAO extends H2DAO implements IServiceNameCacheDAO { - - private static final Logger logger = LoggerFactory.getLogger(ServiceNameH2CacheDAO.class); - - private static final String GET_SERVICE_NAME_SQL = "select {0},{1} from {2} where {3} = ?"; - private static final String GET_SERVICE_ID_SQL = "select {0} from {1} where {2} = ? and {3} = ? and {4} = ? limit 1"; - - public ServiceNameH2CacheDAO(H2Client client) { - super(client); - } - - @Override public ServiceName get(int serviceId) { - H2Client client = getClient(); - String sql = SqlBuilder.buildSql(GET_SERVICE_NAME_SQL, ServiceNameTable.APPLICATION_ID.getName(), ServiceNameTable.SERVICE_NAME.getName(), - ServiceNameTable.TABLE, ServiceNameTable.SERVICE_ID.getName()); - Object[] params = new Object[] {serviceId}; - try (ResultSet rs = client.executeQuery(sql, params)) { - if (rs.next()) { - ServiceName serviceName = new ServiceName(); - serviceName.setServiceId(serviceId); - serviceName.setApplicationId(rs.getInt(ServiceNameTable.APPLICATION_ID.getName())); - serviceName.setServiceName(rs.getString(ServiceNameTable.SERVICE_NAME.getName())); - return serviceName; - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return null; - } - - @Override public int getServiceId(int applicationId, int srcSpanType, String serviceName) { - H2Client client = getClient(); - String sql = SqlBuilder.buildSql(GET_SERVICE_ID_SQL, ServiceNameTable.SERVICE_ID.getName(), ServiceNameTable.TABLE, - ServiceNameTable.APPLICATION_ID.getName(), ServiceNameTable.SRC_SPAN_TYPE.getName(), ServiceNameTable.SERVICE_NAME.getName()); - - Object[] params = new Object[] {applicationId, srcSpanType, serviceName}; - try (ResultSet rs = client.executeQuery(sql, params)) { - if (rs.next()) { - return rs.getInt(ServiceNameTable.SERVICE_ID.getName()); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cpu/AbstractCpuMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cpu/AbstractCpuMetricH2PersistenceDAO.java deleted file mode 100644 index 7f978a0f9a23744ffe258cec9665d7027fd7ce3a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cpu/AbstractCpuMetricH2PersistenceDAO.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.cpu; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractCpuMetricH2PersistenceDAO extends AbstractPersistenceH2DAO { - - AbstractCpuMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected final CpuMetric h2DataToStreamData(ResultSet resultSet) throws SQLException { - CpuMetric cpuMetric = new CpuMetric(); - cpuMetric.setId(resultSet.getString(CpuMetricTable.ID.getName())); - cpuMetric.setMetricId(resultSet.getString(CpuMetricTable.METRIC_ID.getName())); - - cpuMetric.setInstanceId(resultSet.getInt(CpuMetricTable.INSTANCE_ID.getName())); - - cpuMetric.setUsagePercent(resultSet.getDouble(CpuMetricTable.USAGE_PERCENT.getName())); - cpuMetric.setTimes(resultSet.getLong(CpuMetricTable.TIMES.getName())); - cpuMetric.setTimeBucket(resultSet.getLong(CpuMetricTable.TIME_BUCKET.getName())); - - return cpuMetric; - } - - @Override protected final Map streamDataToH2Data(CpuMetric streamData) { - Map target = new HashMap<>(); - target.put(CpuMetricTable.ID.getName(), streamData.getId()); - target.put(CpuMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(CpuMetricTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - target.put(CpuMetricTable.USAGE_PERCENT.getName(), streamData.getUsagePercent()); - target.put(CpuMetricTable.TIMES.getName(), streamData.getTimes()); - target.put(CpuMetricTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cpu/CpuDayMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cpu/CpuDayMetricH2PersistenceDAO.java deleted file mode 100644 index eb07a506c02bd3cbf0fd0d68d9c1308966029d3d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cpu/CpuDayMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.cpu; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author peng-yongsheng - */ -public class CpuDayMetricH2PersistenceDAO extends AbstractCpuMetricH2PersistenceDAO implements ICpuDayMetricPersistenceDAO { - - public CpuDayMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cpu/CpuHourMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cpu/CpuHourMetricH2PersistenceDAO.java deleted file mode 100644 index 5695ab29745ca0dbbb6ed333cce4670db4cedf88..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cpu/CpuHourMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.cpu; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author peng-yongsheng - */ -public class CpuHourMetricH2PersistenceDAO extends AbstractCpuMetricH2PersistenceDAO implements ICpuHourMetricPersistenceDAO { - - public CpuHourMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cpu/CpuMinuteMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cpu/CpuMinuteMetricH2PersistenceDAO.java deleted file mode 100644 index e7998cadf40804283c4fa5b003f2cb899c743ae0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cpu/CpuMinuteMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.cpu; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author peng-yongsheng - */ -public class CpuMinuteMetricH2PersistenceDAO extends AbstractCpuMetricH2PersistenceDAO implements ICpuMinuteMetricPersistenceDAO { - - public CpuMinuteMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cpu/CpuMonthMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cpu/CpuMonthMetricH2PersistenceDAO.java deleted file mode 100644 index dd16591139eaa45e0f6b1e1ae7c64e26c3bbc7ae..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/cpu/CpuMonthMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.cpu; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author peng-yongsheng - */ -public class CpuMonthMetricH2PersistenceDAO extends AbstractCpuMetricH2PersistenceDAO implements ICpuMonthMetricPersistenceDAO { - - public CpuMonthMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/gc/AbstractGCMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/gc/AbstractGCMetricH2PersistenceDAO.java deleted file mode 100644 index 1b8b28a29dc3ef86aa1e563e02769745fca42434..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/gc/AbstractGCMetricH2PersistenceDAO.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.gc; - -import java.sql.*; -import java.util.*; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.*; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractGCMetricH2PersistenceDAO extends AbstractPersistenceH2DAO { - - AbstractGCMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected final GCMetric h2DataToStreamData(ResultSet resultSet) throws SQLException { - GCMetric gcMetric = new GCMetric(); - gcMetric.setId(resultSet.getString(GCMetricTable.ID.getName())); - gcMetric.setMetricId(resultSet.getString(GCMetricTable.METRIC_ID.getName())); - - gcMetric.setInstanceId(resultSet.getInt(GCMetricTable.INSTANCE_ID.getName())); - gcMetric.setPhrase(resultSet.getInt(GCMetricTable.PHRASE.getName())); - - gcMetric.setCount(resultSet.getLong(GCMetricTable.COUNT.getName())); - gcMetric.setTimes(resultSet.getLong(GCMetricTable.TIMES.getName())); - gcMetric.setDuration(resultSet.getLong(GCMetricTable.DURATION.getName())); - - gcMetric.setTimeBucket(resultSet.getLong(GCMetricTable.TIME_BUCKET.getName())); - - return gcMetric; - } - - @Override protected final Map streamDataToH2Data(GCMetric streamData) { - Map target = new HashMap<>(); - target.put(GCMetricTable.ID.getName(), streamData.getId()); - target.put(GCMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(GCMetricTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - target.put(GCMetricTable.PHRASE.getName(), streamData.getPhrase()); - target.put(GCMetricTable.COUNT.getName(), streamData.getCount()); - target.put(GCMetricTable.TIMES.getName(), streamData.getTimes()); - target.put(GCMetricTable.DURATION.getName(), streamData.getDuration()); - target.put(GCMetricTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/gc/GCDayMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/gc/GCDayMetricH2PersistenceDAO.java deleted file mode 100644 index 2cd3c409a1dcfadebb594b0af8fb0da0d315fe50..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/gc/GCDayMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.gc; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author peng-yongsheng - */ -public class GCDayMetricH2PersistenceDAO extends AbstractGCMetricH2PersistenceDAO implements IGCDayMetricPersistenceDAO { - - public GCDayMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/gc/GCHourMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/gc/GCHourMetricH2PersistenceDAO.java deleted file mode 100644 index eff54bb874bdcfd4889418560ac0a0da10e7cd43..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/gc/GCHourMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.gc; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author peng-yongsheng - */ -public class GCHourMetricH2PersistenceDAO extends AbstractGCMetricH2PersistenceDAO implements IGCHourMetricPersistenceDAO { - - public GCHourMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/gc/GCMinuteMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/gc/GCMinuteMetricH2PersistenceDAO.java deleted file mode 100644 index 737c73188ce7d0a9825ed0b78f930e76cf97490d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/gc/GCMinuteMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.gc; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author peng-yongsheng - */ -public class GCMinuteMetricH2PersistenceDAO extends AbstractGCMetricH2PersistenceDAO implements IGCMinuteMetricPersistenceDAO { - - public GCMinuteMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/gc/GCMonthMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/gc/GCMonthMetricH2PersistenceDAO.java deleted file mode 100644 index 75d711e64561e0babf24408d73c6ce9fc3d95e9a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/gc/GCMonthMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.gc; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author peng-yongsheng - */ -public class GCMonthMetricH2PersistenceDAO extends AbstractGCMetricH2PersistenceDAO implements IGCMonthMetricPersistenceDAO { - - public GCMonthMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/imp/AbstractInstanceMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/imp/AbstractInstanceMetricH2PersistenceDAO.java deleted file mode 100644 index 3e1ed4302592c2dcceac2ca3884e52ec9a5c1e83..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/imp/AbstractInstanceMetricH2PersistenceDAO.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.imp; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.h2.MetricTransformUtil; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractInstanceMetricH2PersistenceDAO extends AbstractPersistenceH2DAO { - - AbstractInstanceMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected final InstanceMetric h2DataToStreamData(ResultSet resultSet) throws SQLException { - InstanceMetric instanceMetric = new InstanceMetric(); - - instanceMetric.setId(resultSet.getString(InstanceMetricTable.ID.getName())); - instanceMetric.setMetricId(resultSet.getString(InstanceMetricTable.METRIC_ID.getName())); - instanceMetric.setApplicationId(resultSet.getInt(InstanceMetricTable.APPLICATION_ID.getName())); - instanceMetric.setInstanceId(resultSet.getInt(InstanceMetricTable.INSTANCE_ID.getName())); - - MetricTransformUtil.INSTANCE.h2DataToStreamData(resultSet, instanceMetric); - return instanceMetric; - } - - @Override protected final Map streamDataToH2Data(InstanceMetric streamData) { - Map target = new HashMap<>(); - target.put(InstanceMetricTable.ID.getName(), streamData.getId()); - target.put(InstanceMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(InstanceMetricTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - target.put(InstanceMetricTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - - MetricTransformUtil.INSTANCE.streamDataToH2Data(streamData, target); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/imp/InstanceDayMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/imp/InstanceDayMetricH2PersistenceDAO.java deleted file mode 100644 index a0c675d5bf2c0510fa6122f8f227f56a31c1de4a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/imp/InstanceDayMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.imp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceDayMetricH2PersistenceDAO extends AbstractInstanceMetricH2PersistenceDAO implements IInstanceDayMetricPersistenceDAO { - - public InstanceDayMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/imp/InstanceHourMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/imp/InstanceHourMetricH2PersistenceDAO.java deleted file mode 100644 index 47155ea3cc318770754853851258b6c2d5f38bac..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/imp/InstanceHourMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.imp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceHourMetricH2PersistenceDAO extends AbstractInstanceMetricH2PersistenceDAO implements IInstanceHourMetricPersistenceDAO { - - public InstanceHourMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/imp/InstanceMinuteMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/imp/InstanceMinuteMetricH2PersistenceDAO.java deleted file mode 100644 index 1345bf9f41d99e1c2750f9fc24755c8deadeaa47..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/imp/InstanceMinuteMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.imp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMinuteMetricH2PersistenceDAO extends AbstractInstanceMetricH2PersistenceDAO implements IInstanceMinuteMetricPersistenceDAO { - - public InstanceMinuteMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/imp/InstanceMonthMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/imp/InstanceMonthMetricH2PersistenceDAO.java deleted file mode 100644 index 2e9a5b246bf9abdbaba5df152c9459205ef91881..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/imp/InstanceMonthMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.imp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMonthMetricH2PersistenceDAO extends AbstractInstanceMetricH2PersistenceDAO implements IInstanceMonthMetricPersistenceDAO { - - public InstanceMonthMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/impp/AbstractInstanceMappingH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/impp/AbstractInstanceMappingH2PersistenceDAO.java deleted file mode 100644 index 58bded9f92db4e59b30742d7139de07400af9989..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/impp/AbstractInstanceMappingH2PersistenceDAO.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.impp; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractInstanceMappingH2PersistenceDAO extends AbstractPersistenceH2DAO { - - AbstractInstanceMappingH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected final InstanceMapping h2DataToStreamData(ResultSet resultSet) throws SQLException { - InstanceMapping instanceMapping = new InstanceMapping(); - instanceMapping.setId(resultSet.getString(InstanceMappingTable.ID.getName())); - instanceMapping.setMetricId(resultSet.getString(InstanceMappingTable.METRIC_ID.getName())); - - instanceMapping.setApplicationId(resultSet.getInt(InstanceMappingTable.APPLICATION_ID.getName())); - instanceMapping.setInstanceId(resultSet.getInt(InstanceMappingTable.INSTANCE_ID.getName())); - instanceMapping.setAddressId(resultSet.getInt(InstanceMappingTable.ADDRESS_ID.getName())); - instanceMapping.setTimeBucket(resultSet.getLong(InstanceMappingTable.TIME_BUCKET.getName())); - return instanceMapping; - } - - @Override protected final Map streamDataToH2Data(InstanceMapping streamData) { - Map target = new HashMap<>(); - target.put(InstanceMappingTable.ID.getName(), streamData.getId()); - target.put(InstanceMappingTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(InstanceMappingTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - target.put(InstanceMappingTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - target.put(InstanceMappingTable.ADDRESS_ID.getName(), streamData.getAddressId()); - target.put(InstanceMappingTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/impp/InstanceMappingDayH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/impp/InstanceMappingDayH2PersistenceDAO.java deleted file mode 100644 index 4bdcaa297055a2104c782da481d5de83d9c8f9a7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/impp/InstanceMappingDayH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.impp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingDayH2PersistenceDAO extends AbstractInstanceMappingH2PersistenceDAO implements IInstanceMappingDayPersistenceDAO { - - public InstanceMappingDayH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/impp/InstanceMappingHourH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/impp/InstanceMappingHourH2PersistenceDAO.java deleted file mode 100644 index 216d413567eadd3dad754bfebfa14ece607c8a5e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/impp/InstanceMappingHourH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.impp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingHourH2PersistenceDAO extends AbstractInstanceMappingH2PersistenceDAO implements IInstanceMappingHourPersistenceDAO { - - public InstanceMappingHourH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/impp/InstanceMappingMinuteH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/impp/InstanceMappingMinuteH2PersistenceDAO.java deleted file mode 100644 index 7b0447211f05bf6aec286f244752ffc902d71b9d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/impp/InstanceMappingMinuteH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.impp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingMinuteH2PersistenceDAO extends AbstractInstanceMappingH2PersistenceDAO implements IInstanceMappingMinutePersistenceDAO { - - public InstanceMappingMinuteH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/impp/InstanceMappingMonthH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/impp/InstanceMappingMonthH2PersistenceDAO.java deleted file mode 100644 index 6718a862524e44f617d7c9037109490fe09c447f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/impp/InstanceMappingMonthH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.impp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingMonthH2PersistenceDAO extends AbstractInstanceMappingH2PersistenceDAO implements IInstanceMappingMonthPersistenceDAO { - - public InstanceMappingMonthH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/irmp/AbstractInstanceReferenceMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/irmp/AbstractInstanceReferenceMetricH2PersistenceDAO.java deleted file mode 100644 index dd56e46476831bad650ade926c985dfeca244713..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/irmp/AbstractInstanceReferenceMetricH2PersistenceDAO.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.irmp; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.h2.MetricTransformUtil; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractInstanceReferenceMetricH2PersistenceDAO extends AbstractPersistenceH2DAO { - - AbstractInstanceReferenceMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected final InstanceReferenceMetric h2DataToStreamData(ResultSet resultSet) throws SQLException { - InstanceReferenceMetric instanceReferenceMetric = new InstanceReferenceMetric(); - instanceReferenceMetric.setId(resultSet.getString(InstanceReferenceMetricTable.ID.getName())); - instanceReferenceMetric.setMetricId(resultSet.getString(InstanceReferenceMetricTable.METRIC_ID.getName())); - - instanceReferenceMetric.setFrontApplicationId(resultSet.getInt(InstanceReferenceMetricTable.FRONT_APPLICATION_ID.getName())); - instanceReferenceMetric.setBehindApplicationId(resultSet.getInt(InstanceReferenceMetricTable.BEHIND_APPLICATION_ID.getName())); - instanceReferenceMetric.setFrontInstanceId(resultSet.getInt(InstanceReferenceMetricTable.FRONT_INSTANCE_ID.getName())); - instanceReferenceMetric.setBehindInstanceId(resultSet.getInt(InstanceReferenceMetricTable.BEHIND_INSTANCE_ID.getName())); - - MetricTransformUtil.INSTANCE.h2DataToStreamData(resultSet, instanceReferenceMetric); - - return instanceReferenceMetric; - } - - @Override protected final Map streamDataToH2Data(InstanceReferenceMetric streamData) { - Map target = new HashMap<>(); - target.put(InstanceReferenceMetricTable.ID.getName(), streamData.getId()); - target.put(InstanceReferenceMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(InstanceReferenceMetricTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()); - target.put(InstanceReferenceMetricTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()); - target.put(InstanceReferenceMetricTable.FRONT_INSTANCE_ID.getName(), streamData.getFrontInstanceId()); - target.put(InstanceReferenceMetricTable.BEHIND_INSTANCE_ID.getName(), streamData.getBehindInstanceId()); - - MetricTransformUtil.INSTANCE.streamDataToH2Data(streamData, target); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/irmp/InstanceReferenceDayMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/irmp/InstanceReferenceDayMetricH2PersistenceDAO.java deleted file mode 100644 index 4625c1c942fd11f08bc9ab1ceb9aebab882666ef..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/irmp/InstanceReferenceDayMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.irmp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceDayMetricH2PersistenceDAO extends AbstractInstanceReferenceMetricH2PersistenceDAO implements IInstanceReferenceDayMetricPersistenceDAO { - - public InstanceReferenceDayMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/irmp/InstanceReferenceHourMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/irmp/InstanceReferenceHourMetricH2PersistenceDAO.java deleted file mode 100644 index c5432dbc1cbdcfb0c53b1aaadd88774cf0127bb1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/irmp/InstanceReferenceHourMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.irmp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceHourMetricH2PersistenceDAO extends AbstractInstanceReferenceMetricH2PersistenceDAO implements IInstanceReferenceHourMetricPersistenceDAO { - - public InstanceReferenceHourMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/irmp/InstanceReferenceMinuteMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/irmp/InstanceReferenceMinuteMetricH2PersistenceDAO.java deleted file mode 100644 index e6a84cd60e6f90e3b228b7633fb8e16273fb591b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/irmp/InstanceReferenceMinuteMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.irmp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMinuteMetricH2PersistenceDAO extends AbstractInstanceReferenceMetricH2PersistenceDAO implements IInstanceReferenceMinuteMetricPersistenceDAO { - - public InstanceReferenceMinuteMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/irmp/InstanceReferenceMonthMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/irmp/InstanceReferenceMonthMetricH2PersistenceDAO.java deleted file mode 100644 index a696399ea914537108a4648dae5d0abc9abda4d1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/irmp/InstanceReferenceMonthMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.irmp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMonthMetricH2PersistenceDAO extends AbstractInstanceReferenceMetricH2PersistenceDAO implements IInstanceReferenceMonthMetricPersistenceDAO { - - public InstanceReferenceMonthMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/memory/AbstractMemoryMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/memory/AbstractMemoryMetricH2PersistenceDAO.java deleted file mode 100644 index 5fc7a56c325290316320ff06694115915c8156f1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/memory/AbstractMemoryMetricH2PersistenceDAO.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.memory; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractMemoryMetricH2PersistenceDAO extends AbstractPersistenceH2DAO { - - AbstractMemoryMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected final MemoryMetric h2DataToStreamData(ResultSet resultSet) throws SQLException { - MemoryMetric memoryMetric = new MemoryMetric(); - memoryMetric.setId(resultSet.getString(MemoryMetricTable.ID.getName())); - memoryMetric.setMetricId(resultSet.getString(MemoryMetricTable.METRIC_ID.getName())); - - memoryMetric.setInstanceId(resultSet.getInt(MemoryMetricTable.INSTANCE_ID.getName())); - memoryMetric.setIsHeap(resultSet.getInt(MemoryMetricTable.IS_HEAP.getName())); - - memoryMetric.setInit(resultSet.getLong(MemoryMetricTable.INIT.getName())); - memoryMetric.setMax(resultSet.getLong(MemoryMetricTable.MAX.getName())); - memoryMetric.setUsed(resultSet.getLong(MemoryMetricTable.USED.getName())); - memoryMetric.setCommitted(resultSet.getLong(MemoryMetricTable.COMMITTED.getName())); - memoryMetric.setTimes(resultSet.getLong(MemoryMetricTable.TIMES.getName())); - - memoryMetric.setTimeBucket(resultSet.getLong(MemoryMetricTable.TIME_BUCKET.getName())); - return memoryMetric; - } - - @Override protected final Map streamDataToH2Data(MemoryMetric streamData) { - Map target = new HashMap<>(); - target.put(MemoryMetricTable.ID.getName(), streamData.getId()); - target.put(MemoryMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(MemoryMetricTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - target.put(MemoryMetricTable.IS_HEAP.getName(), streamData.getIsHeap()); - target.put(MemoryMetricTable.INIT.getName(), streamData.getInit()); - target.put(MemoryMetricTable.MAX.getName(), streamData.getMax()); - target.put(MemoryMetricTable.USED.getName(), streamData.getUsed()); - target.put(MemoryMetricTable.COMMITTED.getName(), streamData.getCommitted()); - target.put(MemoryMetricTable.TIMES.getName(), streamData.getTimes()); - target.put(MemoryMetricTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/memory/MemoryDayMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/memory/MemoryDayMetricH2PersistenceDAO.java deleted file mode 100644 index 57aeb9e56e52af2985ea029ceaa2f5d825398c1f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/memory/MemoryDayMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.memory; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryDayMetricH2PersistenceDAO extends AbstractMemoryMetricH2PersistenceDAO implements IMemoryDayMetricPersistenceDAO { - - public MemoryDayMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/memory/MemoryHourMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/memory/MemoryHourMetricH2PersistenceDAO.java deleted file mode 100644 index 69a986d204743d1596dae3c5d32c5a5a55ce490c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/memory/MemoryHourMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.memory; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryHourMetricH2PersistenceDAO extends AbstractMemoryMetricH2PersistenceDAO implements IMemoryHourMetricPersistenceDAO { - - public MemoryHourMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/memory/MemoryMinuteMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/memory/MemoryMinuteMetricH2PersistenceDAO.java deleted file mode 100644 index 7b7fc6e10070898b4966b2dcf9ee1b6dd8c692f3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/memory/MemoryMinuteMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.memory; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryMinuteMetricH2PersistenceDAO extends AbstractMemoryMetricH2PersistenceDAO implements IMemoryMinuteMetricPersistenceDAO { - - public MemoryMinuteMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/memory/MemoryMonthMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/memory/MemoryMonthMetricH2PersistenceDAO.java deleted file mode 100644 index 08a56cf2d51b1383e212c96dab8edb137789b642..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/memory/MemoryMonthMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.memory; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryMonthMetricH2PersistenceDAO extends AbstractMemoryMetricH2PersistenceDAO implements IMemoryMonthMetricPersistenceDAO { - - public MemoryMonthMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/mpool/AbstractMemoryPoolMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/mpool/AbstractMemoryPoolMetricH2PersistenceDAO.java deleted file mode 100644 index 19e17f732895bffb1f11a4a614064d534df201ef..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/mpool/AbstractMemoryPoolMetricH2PersistenceDAO.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.mpool; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractMemoryPoolMetricH2PersistenceDAO extends AbstractPersistenceH2DAO { - - AbstractMemoryPoolMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected final MemoryPoolMetric h2DataToStreamData(ResultSet resultSet) throws SQLException { - MemoryPoolMetric memoryPoolMetric = new MemoryPoolMetric(); - memoryPoolMetric.setId(resultSet.getString(MemoryPoolMetricTable.ID.getName())); - memoryPoolMetric.setMetricId(resultSet.getString(MemoryPoolMetricTable.METRIC_ID.getName())); - - memoryPoolMetric.setInstanceId(resultSet.getInt(MemoryPoolMetricTable.INSTANCE_ID.getName())); - memoryPoolMetric.setPoolType(resultSet.getInt(MemoryPoolMetricTable.POOL_TYPE.getName())); - - memoryPoolMetric.setInit(resultSet.getLong(MemoryPoolMetricTable.INIT.getName())); - memoryPoolMetric.setMax(resultSet.getLong(MemoryPoolMetricTable.MAX.getName())); - memoryPoolMetric.setUsed(resultSet.getLong(MemoryPoolMetricTable.USED.getName())); - memoryPoolMetric.setCommitted(resultSet.getLong(MemoryPoolMetricTable.COMMITTED.getName())); - memoryPoolMetric.setTimes(resultSet.getLong(MemoryPoolMetricTable.TIMES.getName())); - - memoryPoolMetric.setTimeBucket(resultSet.getLong(MemoryPoolMetricTable.TIME_BUCKET.getName())); - return memoryPoolMetric; - } - - @Override protected final Map streamDataToH2Data(MemoryPoolMetric streamData) { - Map target = new HashMap<>(); - target.put(MemoryPoolMetricTable.ID.getName(), streamData.getId()); - target.put(MemoryPoolMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(MemoryPoolMetricTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - target.put(MemoryPoolMetricTable.POOL_TYPE.getName(), streamData.getPoolType()); - target.put(MemoryPoolMetricTable.INIT.getName(), streamData.getInit()); - target.put(MemoryPoolMetricTable.MAX.getName(), streamData.getMax()); - target.put(MemoryPoolMetricTable.USED.getName(), streamData.getUsed()); - target.put(MemoryPoolMetricTable.COMMITTED.getName(), streamData.getCommitted()); - target.put(MemoryPoolMetricTable.TIMES.getName(), streamData.getTimes()); - target.put(MemoryPoolMetricTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/mpool/MemoryPoolDayMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/mpool/MemoryPoolDayMetricH2PersistenceDAO.java deleted file mode 100644 index 08696452d371b2c08fdb407e0a1965e22ebc4bd0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/mpool/MemoryPoolDayMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.mpool; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolDayMetricH2PersistenceDAO extends AbstractMemoryPoolMetricH2PersistenceDAO implements IMemoryPoolDayMetricPersistenceDAO { - - public MemoryPoolDayMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/mpool/MemoryPoolHourMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/mpool/MemoryPoolHourMetricH2PersistenceDAO.java deleted file mode 100644 index a413293e4e48562f64b6f5b459fe6bd453e9706a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/mpool/MemoryPoolHourMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.mpool; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolHourMetricH2PersistenceDAO extends AbstractMemoryPoolMetricH2PersistenceDAO implements IMemoryPoolHourMetricPersistenceDAO { - - public MemoryPoolHourMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/mpool/MemoryPoolMinuteMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/mpool/MemoryPoolMinuteMetricH2PersistenceDAO.java deleted file mode 100644 index cc5bede89bed8d56423f3628c3fac6008aa8c739..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/mpool/MemoryPoolMinuteMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.mpool; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolMinuteMetricH2PersistenceDAO extends AbstractMemoryPoolMetricH2PersistenceDAO implements IMemoryPoolMinuteMetricPersistenceDAO { - - public MemoryPoolMinuteMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/mpool/MemoryPoolMonthMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/mpool/MemoryPoolMonthMetricH2PersistenceDAO.java deleted file mode 100644 index 6bf657669e392a6d320509f71a7f789abb9d7c61..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/mpool/MemoryPoolMonthMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.mpool; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolMonthMetricH2PersistenceDAO extends AbstractMemoryPoolMetricH2PersistenceDAO implements IMemoryPoolMonthMetricPersistenceDAO { - - public MemoryPoolMonthMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/register/ApplicationRegisterH2DAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/register/ApplicationRegisterH2DAO.java deleted file mode 100644 index e408b7432b0140677e8007319e63384715f86bc9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/register/ApplicationRegisterH2DAO.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.register; - -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.register.IApplicationRegisterDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.register.Application; -import org.apache.skywalking.apm.collector.storage.table.register.ApplicationTable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng, clevertension - */ -public class ApplicationRegisterH2DAO extends H2DAO implements IApplicationRegisterDAO { - - private static final Logger logger = LoggerFactory.getLogger(ApplicationRegisterH2DAO.class); - - public ApplicationRegisterH2DAO(H2Client client) { - super(client); - } - - @Override - public int getMaxApplicationId() { - return getMaxId(ApplicationTable.TABLE, ApplicationTable.APPLICATION_ID.getName()); - } - - @Override - public int getMinApplicationId() { - return getMinId(ApplicationTable.TABLE, ApplicationTable.APPLICATION_ID.getName()); - } - - @Override - public void save(Application application) { - H2Client client = getClient(); - - Map target = new HashMap<>(); - target.put(ApplicationTable.ID.getName(), application.getId()); - target.put(ApplicationTable.APPLICATION_CODE.getName(), application.getApplicationCode()); - target.put(ApplicationTable.APPLICATION_ID.getName(), application.getApplicationId()); - target.put(ApplicationTable.ADDRESS_ID.getName(), application.getAddressId()); - target.put(ApplicationTable.IS_ADDRESS.getName(), application.getIsAddress()); - - String sql = SqlBuilder.buildBatchInsertSql(ApplicationTable.TABLE, target.keySet()); - Object[] params = target.values().toArray(new Object[0]); - try { - client.execute(sql, params); - } catch (H2ClientException e) { - logger.error(e.getMessage(), e); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/register/InstanceRegisterH2DAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/register/InstanceRegisterH2DAO.java deleted file mode 100644 index 14c9db0c7308de19240cace05d445fc548085bd1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/register/InstanceRegisterH2DAO.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.register; - -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.register.IInstanceRegisterDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.register.Instance; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng, clevertension - */ -public class InstanceRegisterH2DAO extends H2DAO implements IInstanceRegisterDAO { - - private static final Logger logger = LoggerFactory.getLogger(InstanceRegisterH2DAO.class); - - public InstanceRegisterH2DAO(H2Client client) { - super(client); - } - - private static final String UPDATE_HEARTBEAT_TIME_SQL = "update {0} set {1} = ? where {2} = ?"; - - @Override public int getMaxInstanceId() { - return getMaxId(InstanceTable.TABLE, InstanceTable.INSTANCE_ID.getName()); - } - - @Override public int getMinInstanceId() { - return getMinId(InstanceTable.TABLE, InstanceTable.INSTANCE_ID.getName()); - } - - @Override public void save(Instance instance) { - H2Client client = getClient(); - Map target = new HashMap<>(); - target.put(InstanceTable.ID.getName(), instance.getId()); - target.put(InstanceTable.INSTANCE_ID.getName(), instance.getInstanceId()); - target.put(InstanceTable.APPLICATION_ID.getName(), instance.getApplicationId()); - target.put(InstanceTable.APPLICATION_CODE.getName(), instance.getApplicationCode()); - target.put(InstanceTable.AGENT_UUID.getName(), instance.getAgentUUID()); - target.put(InstanceTable.REGISTER_TIME.getName(), TimeBucketUtils.INSTANCE.getSecondTimeBucket(instance.getRegisterTime())); - target.put(InstanceTable.HEARTBEAT_TIME.getName(), TimeBucketUtils.INSTANCE.getSecondTimeBucket(instance.getHeartBeatTime())); - target.put(InstanceTable.OS_INFO.getName(), instance.getOsInfo()); - target.put(InstanceTable.ADDRESS_ID.getName(), instance.getAddressId()); - target.put(InstanceTable.IS_ADDRESS.getName(), instance.getIsAddress()); - - String sql = SqlBuilder.buildBatchInsertSql(InstanceTable.TABLE, target.keySet()); - Object[] params = target.values().toArray(new Object[0]); - try { - client.execute(sql, params); - } catch (H2ClientException e) { - logger.error(e.getMessage(), e); - } - } - - @Override public void updateHeartbeatTime(int instanceId, long heartbeatTime) { - H2Client client = getClient(); - String sql = SqlBuilder.buildSql(UPDATE_HEARTBEAT_TIME_SQL, InstanceTable.TABLE, InstanceTable.HEARTBEAT_TIME.getName(), - InstanceTable.ID.getName()); - Object[] params = new Object[] {TimeBucketUtils.INSTANCE.getSecondTimeBucket(heartbeatTime), instanceId}; - try { - client.execute(sql, params); - } catch (H2ClientException e) { - logger.error(e.getMessage(), e); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/register/NetworkAddressRegisterH2DAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/register/NetworkAddressRegisterH2DAO.java deleted file mode 100644 index 15e8a37504210eabbf8944709b42f78a21d6e94d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/register/NetworkAddressRegisterH2DAO.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.register; - -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.register.INetworkAddressRegisterDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddress; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddressTable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng, clevertension - */ -public class NetworkAddressRegisterH2DAO extends H2DAO implements INetworkAddressRegisterDAO { - - private static final Logger logger = LoggerFactory.getLogger(NetworkAddressRegisterH2DAO.class); - - public NetworkAddressRegisterH2DAO(H2Client client) { - super(client); - } - - @Override - public int getMaxNetworkAddressId() { - return getMaxId(NetworkAddressTable.TABLE, NetworkAddressTable.ADDRESS_ID.getName()); - } - - @Override - public int getMinNetworkAddressId() { - return getMinId(NetworkAddressTable.TABLE, NetworkAddressTable.ADDRESS_ID.getName()); - } - - @Override - public void save(NetworkAddress networkAddress) { - H2Client client = getClient(); - - Map target = new HashMap<>(); - target.put(NetworkAddressTable.ID.getName(), networkAddress.getId()); - target.put(NetworkAddressTable.NETWORK_ADDRESS.getName(), networkAddress.getNetworkAddress()); - target.put(NetworkAddressTable.ADDRESS_ID.getName(), networkAddress.getAddressId()); - target.put(NetworkAddressTable.SRC_SPAN_LAYER.getName(), networkAddress.getSrcSpanLayer()); - target.put(NetworkAddressTable.SERVER_TYPE.getName(), networkAddress.getServerType()); - - String sql = SqlBuilder.buildBatchInsertSql(NetworkAddressTable.TABLE, target.keySet()); - Object[] params = target.values().toArray(new Object[0]); - try { - client.execute(sql, params); - } catch (H2ClientException e) { - logger.error(e.getMessage(), e); - } - } - - @Override public void update(String id, int spanLayer, int serverType) { - H2Client client = getClient(); - - Map source = new HashMap<>(); - source.put(NetworkAddressTable.SRC_SPAN_LAYER.getName(), spanLayer); - source.put(NetworkAddressTable.SERVER_TYPE.getName(), serverType); - - String sql = SqlBuilder.buildBatchUpdateSql(InstanceTable.TABLE, source.keySet(), InstanceTable.INSTANCE_ID.getName()); - Object[] params = source.values().toArray(new Object[] {id}); - - try { - client.execute(sql, params); - } catch (H2ClientException e) { - logger.error(e.getMessage(), e); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/register/ServiceNameRegisterH2DAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/register/ServiceNameRegisterH2DAO.java deleted file mode 100644 index baf8b8043a51eed09105e1017e4aa2a05f82b75d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/register/ServiceNameRegisterH2DAO.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.register; - -import java.util.*; -import org.apache.skywalking.apm.collector.client.h2.*; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.register.IServiceNameRegisterDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.register.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng, clevertension - */ -public class ServiceNameRegisterH2DAO extends H2DAO implements IServiceNameRegisterDAO { - - private final Logger logger = LoggerFactory.getLogger(ServiceNameRegisterH2DAO.class); - - public ServiceNameRegisterH2DAO(H2Client client) { - super(client); - } - - @Override - public int getMaxServiceId() { - return getMaxId(ServiceNameTable.TABLE, ServiceNameTable.SERVICE_ID.getName()); - } - - @Override - public int getMinServiceId() { - return getMinId(ServiceNameTable.TABLE, ServiceNameTable.SERVICE_ID.getName()); - } - - @Override - public void save(ServiceName serviceName) { - logger.debug("save service name register info, application getApplicationId: {}, service name: {}", serviceName.getId(), serviceName.getServiceName()); - H2Client client = getClient(); - Map target = new HashMap<>(); - target.put(ServiceNameTable.ID.getName(), serviceName.getId()); - target.put(ServiceNameTable.SERVICE_ID.getName(), serviceName.getServiceId()); - target.put(ServiceNameTable.APPLICATION_ID.getName(), serviceName.getApplicationId()); - target.put(ServiceNameTable.SERVICE_NAME.getName(), serviceName.getServiceName()); - target.put(ServiceNameTable.SRC_SPAN_TYPE.getName(), serviceName.getSrcSpanType()); - target.put(ServiceNameTable.REGISTER_TIME.getName(), serviceName.getRegisterTime()); - target.put(ServiceNameTable.HEARTBEAT_TIME.getName(), serviceName.getHeartBeatTime()); - - String sql = SqlBuilder.buildBatchInsertSql(ServiceNameTable.TABLE, target.keySet()); - Object[] params = target.values().toArray(new Object[0]); - try { - client.execute(sql, params); - } catch (H2ClientException e) { - logger.error(e.getMessage(), e); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/rtd/AbstractResponseTimeDistributionH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/rtd/AbstractResponseTimeDistributionH2PersistenceDAO.java deleted file mode 100644 index f6ff210ab8d79704c4f2c456d3351fbce91d0d30..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/rtd/AbstractResponseTimeDistributionH2PersistenceDAO.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.rtd; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractResponseTimeDistributionH2PersistenceDAO extends AbstractPersistenceH2DAO { - - AbstractResponseTimeDistributionH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected final ResponseTimeDistribution h2DataToStreamData(ResultSet resultSet) throws SQLException { - ResponseTimeDistribution responseTimeDistribution = new ResponseTimeDistribution(); - responseTimeDistribution.setMetricId(resultSet.getString(ResponseTimeDistributionTable.METRIC_ID.getName())); - - responseTimeDistribution.setStep(resultSet.getInt(ResponseTimeDistributionTable.STEP.getName())); - - responseTimeDistribution.setCalls(resultSet.getLong(ResponseTimeDistributionTable.CALLS.getName())); - responseTimeDistribution.setErrorCalls(resultSet.getLong(ResponseTimeDistributionTable.ERROR_CALLS.getName())); - responseTimeDistribution.setSuccessCalls(resultSet.getLong(ResponseTimeDistributionTable.SUCCESS_CALLS.getName())); - - responseTimeDistribution.setTimeBucket(resultSet.getLong(ResponseTimeDistributionTable.TIME_BUCKET.getName())); - - return responseTimeDistribution; - } - - @Override protected final Map streamDataToH2Data(ResponseTimeDistribution streamData) { - Map target = new HashMap<>(); - target.put(ResponseTimeDistributionTable.ID.getName(), streamData.getId()); - target.put(ResponseTimeDistributionTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(ResponseTimeDistributionTable.STEP.getName(), streamData.getStep()); - - target.put(ResponseTimeDistributionTable.CALLS.getName(), streamData.getCalls()); - target.put(ResponseTimeDistributionTable.ERROR_CALLS.getName(), streamData.getErrorCalls()); - target.put(ResponseTimeDistributionTable.SUCCESS_CALLS.getName(), streamData.getSuccessCalls()); - - target.put(ResponseTimeDistributionTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/rtd/ResponseTimeDistributionDayH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/rtd/ResponseTimeDistributionDayH2PersistenceDAO.java deleted file mode 100644 index 3ea7e4479d7487ac73fb829d2c75fa05772a32b3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/rtd/ResponseTimeDistributionDayH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.rtd; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionDayH2PersistenceDAO extends AbstractResponseTimeDistributionH2PersistenceDAO implements IResponseTimeDistributionDayPersistenceDAO { - - public ResponseTimeDistributionDayH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/rtd/ResponseTimeDistributionHourH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/rtd/ResponseTimeDistributionHourH2PersistenceDAO.java deleted file mode 100644 index cf7b9eae7a7539ea53a68881a9ca8d35570fb575..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/rtd/ResponseTimeDistributionHourH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.rtd; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionHourH2PersistenceDAO extends AbstractResponseTimeDistributionH2PersistenceDAO implements IResponseTimeDistributionHourPersistenceDAO { - - public ResponseTimeDistributionHourH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/rtd/ResponseTimeDistributionMinuteH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/rtd/ResponseTimeDistributionMinuteH2PersistenceDAO.java deleted file mode 100644 index 382d27eef0f6d175afe7e4d3edeff7e96523053d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/rtd/ResponseTimeDistributionMinuteH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.rtd; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionMinuteH2PersistenceDAO extends AbstractResponseTimeDistributionH2PersistenceDAO implements IResponseTimeDistributionMinutePersistenceDAO { - - public ResponseTimeDistributionMinuteH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/rtd/ResponseTimeDistributionMonthH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/rtd/ResponseTimeDistributionMonthH2PersistenceDAO.java deleted file mode 100644 index 0838b7607eb140932f293ab7d8cbc467c7e31163..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/rtd/ResponseTimeDistributionMonthH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.rtd; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionMonthH2PersistenceDAO extends AbstractResponseTimeDistributionH2PersistenceDAO implements IResponseTimeDistributionMonthPersistenceDAO { - - public ResponseTimeDistributionMonthH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/smp/AbstractServiceMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/smp/AbstractServiceMetricH2PersistenceDAO.java deleted file mode 100644 index ec0726dcadce51e205ae3a498402b4dd2a3e01bd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/smp/AbstractServiceMetricH2PersistenceDAO.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.smp; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.h2.MetricTransformUtil; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractServiceMetricH2PersistenceDAO extends AbstractPersistenceH2DAO { - - AbstractServiceMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected final ServiceMetric h2DataToStreamData(ResultSet resultSet) throws SQLException { - ServiceMetric serviceMetric = new ServiceMetric(); - serviceMetric.setId(resultSet.getString(ServiceMetricTable.ID.getName())); - serviceMetric.setMetricId(resultSet.getString(ServiceMetricTable.METRIC_ID.getName())); - - serviceMetric.setApplicationId(resultSet.getInt(ServiceMetricTable.APPLICATION_ID.getName())); - serviceMetric.setInstanceId(resultSet.getInt(ServiceMetricTable.INSTANCE_ID.getName())); - serviceMetric.setServiceId(resultSet.getInt(ServiceMetricTable.SERVICE_ID.getName())); - - MetricTransformUtil.INSTANCE.h2DataToStreamData(resultSet, serviceMetric); - - return serviceMetric; - } - - @Override protected final Map streamDataToH2Data(ServiceMetric streamData) { - Map target = new HashMap<>(); - target.put(ServiceMetricTable.ID.getName(), streamData.getId()); - target.put(ServiceMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(ServiceMetricTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - target.put(ServiceMetricTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - target.put(ServiceMetricTable.SERVICE_ID.getName(), streamData.getServiceId()); - - MetricTransformUtil.INSTANCE.streamDataToH2Data(streamData, target); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/smp/ServiceDayMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/smp/ServiceDayMetricH2PersistenceDAO.java deleted file mode 100644 index f2af31a866c3874ebbb21dee16e7c9dcbc6b186c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/smp/ServiceDayMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.smp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceDayMetricH2PersistenceDAO extends AbstractServiceMetricH2PersistenceDAO implements IServiceDayMetricPersistenceDAO { - - public ServiceDayMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/smp/ServiceHourMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/smp/ServiceHourMetricH2PersistenceDAO.java deleted file mode 100644 index 14c116216edf14b62ba24baa0dd2455fe430826f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/smp/ServiceHourMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.smp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceHourMetricH2PersistenceDAO extends AbstractServiceMetricH2PersistenceDAO implements IServiceHourMetricPersistenceDAO { - - public ServiceHourMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/smp/ServiceMinuteMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/smp/ServiceMinuteMetricH2PersistenceDAO.java deleted file mode 100644 index 7b9a22db8363b9f78f9cc0c29d667b2368ce6a19..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/smp/ServiceMinuteMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.smp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceMinuteMetricH2PersistenceDAO extends AbstractServiceMetricH2PersistenceDAO implements IServiceMinuteMetricPersistenceDAO { - - public ServiceMinuteMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/smp/ServiceMonthMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/smp/ServiceMonthMetricH2PersistenceDAO.java deleted file mode 100644 index 6b537ce70365c68fde19e99a6d46061cfeeb2c75..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/smp/ServiceMonthMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.smp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceMonthMetricH2PersistenceDAO extends AbstractServiceMetricH2PersistenceDAO implements IServiceMonthMetricPersistenceDAO { - - public ServiceMonthMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/srmp/AbstractServiceReferenceMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/srmp/AbstractServiceReferenceMetricH2PersistenceDAO.java deleted file mode 100644 index f559aed07d12160a4c9c0e65217ac2dfc9f2cb97..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/srmp/AbstractServiceReferenceMetricH2PersistenceDAO.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.srmp; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.h2.MetricTransformUtil; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.AbstractPersistenceH2DAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractServiceReferenceMetricH2PersistenceDAO extends AbstractPersistenceH2DAO { - - AbstractServiceReferenceMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected final ServiceReferenceMetric h2DataToStreamData(ResultSet resultSet) throws SQLException { - ServiceReferenceMetric serviceReferenceMetric = new ServiceReferenceMetric(); - serviceReferenceMetric.setId(resultSet.getString(ServiceReferenceMetricTable.ID.getName())); - serviceReferenceMetric.setMetricId(resultSet.getString(ServiceReferenceMetricTable.METRIC_ID.getName())); - - serviceReferenceMetric.setFrontApplicationId(resultSet.getInt(ServiceReferenceMetricTable.FRONT_APPLICATION_ID.getName())); - serviceReferenceMetric.setBehindApplicationId(resultSet.getInt(ServiceReferenceMetricTable.BEHIND_APPLICATION_ID.getName())); - serviceReferenceMetric.setFrontInstanceId(resultSet.getInt(ServiceReferenceMetricTable.FRONT_INSTANCE_ID.getName())); - serviceReferenceMetric.setBehindInstanceId(resultSet.getInt(ServiceReferenceMetricTable.BEHIND_INSTANCE_ID.getName())); - serviceReferenceMetric.setFrontServiceId(resultSet.getInt(ServiceReferenceMetricTable.FRONT_SERVICE_ID.getName())); - serviceReferenceMetric.setBehindServiceId(resultSet.getInt(ServiceReferenceMetricTable.BEHIND_SERVICE_ID.getName())); - - MetricTransformUtil.INSTANCE.h2DataToStreamData(resultSet, serviceReferenceMetric); - - return serviceReferenceMetric; - } - - @Override protected final Map streamDataToH2Data(ServiceReferenceMetric streamData) { - Map target = new HashMap<>(); - target.put(ServiceReferenceMetricTable.ID.getName(), streamData.getId()); - target.put(ServiceReferenceMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(ServiceReferenceMetricTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()); - target.put(ServiceReferenceMetricTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()); - target.put(ServiceReferenceMetricTable.FRONT_INSTANCE_ID.getName(), streamData.getFrontInstanceId()); - target.put(ServiceReferenceMetricTable.BEHIND_INSTANCE_ID.getName(), streamData.getBehindInstanceId()); - target.put(ServiceReferenceMetricTable.FRONT_SERVICE_ID.getName(), streamData.getFrontServiceId()); - target.put(ServiceReferenceMetricTable.BEHIND_SERVICE_ID.getName(), streamData.getBehindServiceId()); - - MetricTransformUtil.INSTANCE.streamDataToH2Data(streamData, target); - - return target; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/srmp/ServiceReferenceDayMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/srmp/ServiceReferenceDayMetricH2PersistenceDAO.java deleted file mode 100644 index 66bc73ebcbe35cf820e95472b0e78ee143741982..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/srmp/ServiceReferenceDayMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.srmp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceDayMetricH2PersistenceDAO extends AbstractServiceReferenceMetricH2PersistenceDAO implements IServiceReferenceDayMetricPersistenceDAO { - - public ServiceReferenceDayMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/srmp/ServiceReferenceHourMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/srmp/ServiceReferenceHourMetricH2PersistenceDAO.java deleted file mode 100644 index 5e251d45c7e677e5f5f2032adc16b0a778967754..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/srmp/ServiceReferenceHourMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.srmp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceHourMetricH2PersistenceDAO extends AbstractServiceReferenceMetricH2PersistenceDAO implements IServiceReferenceHourMetricPersistenceDAO { - - public ServiceReferenceHourMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/srmp/ServiceReferenceMinuteMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/srmp/ServiceReferenceMinuteMetricH2PersistenceDAO.java deleted file mode 100644 index fb2fefed1f9e943c4c592fdb3d9e8cc2235005c6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/srmp/ServiceReferenceMinuteMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.srmp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMinuteMetricH2PersistenceDAO extends AbstractServiceReferenceMetricH2PersistenceDAO implements IServiceReferenceMinuteMetricPersistenceDAO { - - public ServiceReferenceMinuteMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/srmp/ServiceReferenceMonthMetricH2PersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/srmp/ServiceReferenceMonthMetricH2PersistenceDAO.java deleted file mode 100644 index ce7b293165670308ab210bb7c714a41abedc063e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/srmp/ServiceReferenceMonthMetricH2PersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.srmp; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2SqlEntity; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMonthMetricH2PersistenceDAO extends AbstractServiceReferenceMetricH2PersistenceDAO implements IServiceReferenceMonthMetricPersistenceDAO { - - public ServiceReferenceMonthMetricH2PersistenceDAO(H2Client client) { - super(client); - } - - @Override protected String tableName() { - return ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationAlarmH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationAlarmH2UIDAO.java deleted file mode 100644 index 6f0acd7b5c2daa8914dd1de89a150884c2797b77..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationAlarmH2UIDAO.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import java.text.ParseException; -import java.util.List; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationAlarmUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.ui.alarm.Alarm; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmH2UIDAO extends H2DAO implements IApplicationAlarmUIDAO { - - public ApplicationAlarmH2UIDAO(H2Client client) { - super(client); - } - - @Override - public Alarm loadAlarmList(String keyword, List applicationIds, long startTimeBucket, long endTimeBucket, - int limit, int from) throws ParseException { - return null; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationAlarmListH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationAlarmListH2UIDAO.java deleted file mode 100644 index 73eb9408b1e0b9129476b070d316a9dc17f919eb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationAlarmListH2UIDAO.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationAlarmListUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmListH2UIDAO extends H2DAO implements IApplicationAlarmListUIDAO { - - public ApplicationAlarmListH2UIDAO(H2Client client) { - super(client); - } - - @Override public List getAlarmedApplicationNum(Step step, long startTimeBucket, long endTimeBucket) { - return null; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationComponentH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationComponentH2UIDAO.java deleted file mode 100644 index 885cfea95a0251d854525532c64cb14d020d1b15..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationComponentH2UIDAO.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.LinkedList; -import java.util.List; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationComponentUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng, clevertension - */ -public class ApplicationComponentH2UIDAO extends H2DAO implements IApplicationComponentUIDAO { - - private final Logger logger = LoggerFactory.getLogger(ApplicationComponentH2UIDAO.class); - private static final String AGGREGATE_COMPONENT_SQL = "select {0}, {1} from {2} where {3} >= ? and {3} <= ? group by {0}, {1} limit 100"; - - public ApplicationComponentH2UIDAO(H2Client client) { - super(client); - } - - @Override public List load(Step step, long startTimeBucket, long endTimeBucket) { - H2Client client = getClient(); - - String tableName = TimePyramidTableNameBuilder.build(step, ApplicationComponentTable.TABLE); - - List applicationComponents = new LinkedList<>(); - String sql = SqlBuilder.buildSql(AGGREGATE_COMPONENT_SQL, ApplicationComponentTable.COMPONENT_ID.getName(), ApplicationComponentTable.APPLICATION_ID.getName(), - tableName, ApplicationComponentTable.TIME_BUCKET.getName()); - - Object[] params = new Object[] {startTimeBucket, endTimeBucket}; - try (ResultSet rs = client.executeQuery(sql, params)) { - while (rs.next()) { - int applicationId = rs.getInt(ApplicationComponentTable.APPLICATION_ID.getName()); - int componentId = rs.getInt(ApplicationComponentTable.COMPONENT_ID.getName()); - - ApplicationComponent applicationComponent = new ApplicationComponent(); - applicationComponent.setComponentId(componentId); - applicationComponent.setApplicationId(applicationId); - applicationComponents.add(applicationComponent); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return applicationComponents; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationMappingH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationMappingH2UIDAO.java deleted file mode 100644 index 7dbc2d0150827d26fab146ab3d6f69a3b4a230a5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationMappingH2UIDAO.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.LinkedList; -import java.util.List; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMappingUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng, clevertension - */ -public class ApplicationMappingH2UIDAO extends H2DAO implements IApplicationMappingUIDAO { - - private final Logger logger = LoggerFactory.getLogger(ApplicationMappingH2UIDAO.class); - private static final String APPLICATION_MAPPING_SQL = "select {0}, {1} from {2} where {3} >= ? and {3} <= ? group by {0}, {1} limit 100"; - - public ApplicationMappingH2UIDAO(H2Client client) { - super(client); - } - - @Override public List load(Step step, long startTimeBucket, long endTimeBucket) { - String tableName = TimePyramidTableNameBuilder.build(step, ApplicationMappingTable.TABLE); - - H2Client client = getClient(); - String sql = SqlBuilder.buildSql(APPLICATION_MAPPING_SQL, ApplicationMappingTable.APPLICATION_ID.getName(), - ApplicationMappingTable.MAPPING_APPLICATION_ID.getName(), tableName, ApplicationMappingTable.TIME_BUCKET.getName()); - - List applicationMappings = new LinkedList<>(); - Object[] params = new Object[] {startTimeBucket, endTimeBucket}; - try (ResultSet rs = client.executeQuery(sql, params)) { - while (rs.next()) { - int applicationId = rs.getInt(ApplicationMappingTable.APPLICATION_ID.getName()); - int addressId = rs.getInt(ApplicationMappingTable.MAPPING_APPLICATION_ID.getName()); - - ApplicationMapping applicationMapping = new ApplicationMapping(); - applicationMapping.setApplicationId(applicationId); - applicationMapping.setMappingApplicationId(addressId); - applicationMappings.add(applicationMapping); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - logger.debug("node mapping data: {}", applicationMappings.toString()); - return applicationMappings; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationMetricH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationMetricH2UIDAO.java deleted file mode 100644 index 5c4f2bc8708948a93394024f846437d9b752cf43..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationMetricH2UIDAO.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.ui.overview.ApplicationThroughput; - -/** - * @author peng-yongsheng - */ -public class ApplicationMetricH2UIDAO extends H2DAO implements IApplicationMetricUIDAO { - - public ApplicationMetricH2UIDAO(H2Client client) { - super(client); - } - - @Override - public List getTopNApplicationThroughput(Step step, long startTimeBucket, long endTimeBucket, - int minutesBetween, int topN, MetricSource metricSource) { - return null; - } - - @Override public List getApplications(Step step, long startTimeBucket, - long endTimeBucket, MetricSource metricSource) { - return null; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationReferenceMetricH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationReferenceMetricH2UIDAO.java deleted file mode 100644 index 97c3755effe2558424fcef63ecf48e79bcbbbd63..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationReferenceMetricH2UIDAO.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationReferenceMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; - -/** - * @author peng-yongsheng, clevertension - */ -public class ApplicationReferenceMetricH2UIDAO extends H2DAO implements IApplicationReferenceMetricUIDAO { - - private static final String APPLICATION_REFERENCE_SQL = "select {8}, {9}, sum({0}) as {0}, sum({1}) as {1}, sum({2}) as {2}, " + - "sum({3}) as {3}, sum({4}) as {4}, sum({5}) as {5} from {6} where {7} >= ? and {7} <= ? group by {8}, {9} limit 100"; - - public ApplicationReferenceMetricH2UIDAO(H2Client client) { - super(client); - } - - @Override public List getReferences(Step step, - long startTimeBucket, long endTimeBucket, MetricSource metricSource, Integer... applicationIds) { - return null; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/CpuMetricH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/CpuMetricH2UIDAO.java deleted file mode 100644 index df506c4ad97209879e63d70d1acd8c12243c6f55..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/CpuMetricH2UIDAO.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.LinkedList; -import java.util.List; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.ICpuMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng, clevertension - */ -public class CpuMetricH2UIDAO extends H2DAO implements ICpuMetricUIDAO { - private final Logger logger = LoggerFactory.getLogger(CpuMetricH2UIDAO.class); - private static final String GET_CPU_METRIC_SQL = "select * from {0} where {1} = ?"; - - public CpuMetricH2UIDAO(H2Client client) { - super(client); - } - - @Override public List getCPUTrend(int instanceId, Step step, List durationPoints) { - H2Client client = getClient(); - String tableName = TimePyramidTableNameBuilder.build(step, CpuMetricTable.TABLE); - String sql = SqlBuilder.buildSql(GET_CPU_METRIC_SQL, tableName, CpuMetricTable.ID.getName()); - - List cpuTrends = new LinkedList<>(); - durationPoints.forEach(durationPoint -> { - String id = durationPoint.getPoint() + Const.ID_SPLIT + instanceId; - - try (ResultSet rs = client.executeQuery(sql, new String[] {id})) { - if (rs.next()) { - double cpuUsed = rs.getDouble(CpuMetricTable.USAGE_PERCENT.getName()); - long times = rs.getLong(CpuMetricTable.TIMES.getName()); - cpuTrends.add((int)((cpuUsed / times) * 100)); - } else { - cpuTrends.add(0); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - }); - - return cpuTrends; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/GCMetricH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/GCMetricH2UIDAO.java deleted file mode 100644 index a7fc1f63f106548d7588f51cffafb5e612f861e2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/GCMetricH2UIDAO.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import java.sql.*; -import java.util.*; -import org.apache.skywalking.apm.collector.client.h2.*; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IGCMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.*; -import org.apache.skywalking.apm.network.language.agent.GCPhrase; -import org.slf4j.*; - -/** - * @author peng-yongsheng, clevertension - */ -public class GCMetricH2UIDAO extends H2DAO implements IGCMetricUIDAO { - - private final Logger logger = LoggerFactory.getLogger(GCMetricH2UIDAO.class); - private static final String GET_GC_METRIC_SQL = "select * from {0} where {1} = ?"; - - public GCMetricH2UIDAO(H2Client client) { - super(client); - } - - @Override public List getYoungGCTrend(int instanceId, Step step, List durationPoints) { - return getGCTrend(instanceId, step, durationPoints, GCPhrase.NEW_VALUE); - } - - @Override public List getOldGCTrend(int instanceId, Step step, List durationPoints) { - return getGCTrend(instanceId, step, durationPoints, GCPhrase.OLD_VALUE); - } - - private List getGCTrend(int instanceId, Step step, List durationPoints, int gcPhrase) { - String tableName = TimePyramidTableNameBuilder.build(step, GCMetricTable.TABLE); - - H2Client client = getClient(); - String sql = SqlBuilder.buildSql(GET_GC_METRIC_SQL, tableName, GCMetricTable.ID.getName()); - - List gcTrends = new LinkedList<>(); - durationPoints.forEach(durationPoint -> { - String id = durationPoint.getPoint() + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + gcPhrase; - try (ResultSet rs = client.executeQuery(sql, new String[] {id})) { - if (rs.next()) { - long count = rs.getLong(GCMetricTable.COUNT.getName()); - long duration = rs.getLong(GCMetricTable.DURATION.getName()); - long times = rs.getLong(GCMetricTable.TIMES.getName()); - gcTrends.add(new Trend((int)count, (int)(duration / times))); - } else { - gcTrends.add(new Trend(0, 0)); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - gcTrends.add(new Trend(0, 0)); - } - }); - - return gcTrends; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/GlobalTraceH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/GlobalTraceH2UIDAO.java deleted file mode 100644 index 5f9e523998c412196f7e189b704c81299b55f58f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/GlobalTraceH2UIDAO.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IGlobalTraceUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.storage.table.global.GlobalTraceTable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng, clevertension - */ -public class GlobalTraceH2UIDAO extends H2DAO implements IGlobalTraceUIDAO { - - private final Logger logger = LoggerFactory.getLogger(GlobalTraceH2UIDAO.class); - - private static final String GET_GLOBAL_TRACE_ID_SQL = "select {0} from {1} where {2} = ? limit 10"; - private static final String GET_SEGMENT_IDS_SQL = "select {0} from {1} where {2} = ? limit 10"; - - public GlobalTraceH2UIDAO(H2Client client) { - super(client); - } - - @Override public List getGlobalTraceId(String segmentId) { - List globalTraceIds = new ArrayList<>(); - H2Client client = getClient(); - String sql = SqlBuilder.buildSql(GET_GLOBAL_TRACE_ID_SQL, GlobalTraceTable.TRACE_ID.getName(), - GlobalTraceTable.TABLE, GlobalTraceTable.SEGMENT_ID.getName()); - Object[] params = new Object[] {segmentId}; - try (ResultSet rs = client.executeQuery(sql, params)) { - while (rs.next()) { - String globalTraceId = rs.getString(GlobalTraceTable.TRACE_ID.getName()); - logger.debug("segmentId: {}, global trace id: {}", segmentId, globalTraceId); - globalTraceIds.add(globalTraceId); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return globalTraceIds; - } - - @Override public List getSegmentIds(String globalTraceId) { - List segmentIds = new ArrayList<>(); - H2Client client = getClient(); - String sql = SqlBuilder.buildSql(GET_SEGMENT_IDS_SQL, GlobalTraceTable.SEGMENT_ID.getName(), - GlobalTraceTable.TABLE, GlobalTraceTable.TRACE_ID); - Object[] params = new Object[] {globalTraceId}; - try (ResultSet rs = client.executeQuery(sql, params)) { - while (rs.next()) { - String segmentId = rs.getString(GlobalTraceTable.SEGMENT_ID.getName()); - logger.debug("segmentId: {}, global trace id: {}", segmentId, globalTraceId); - segmentIds.add(segmentId); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return segmentIds; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/InstanceAlarmH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/InstanceAlarmH2UIDAO.java deleted file mode 100644 index 6316978fe87911498f5df53fd339725cc8e3727e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/InstanceAlarmH2UIDAO.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceAlarmUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.ui.alarm.Alarm; - -/** - * @author peng-yongsheng - */ -public class InstanceAlarmH2UIDAO extends H2DAO implements IInstanceAlarmUIDAO { - - public InstanceAlarmH2UIDAO(H2Client client) { - super(client); - } - - @Override public Alarm loadAlarmList(String keyword, long startTimeBucket, long endTimeBucket, int limit, int from) { - return null; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/InstanceH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/InstanceH2UIDAO.java deleted file mode 100644 index 4e960612fac1b2ee9a109d5cd7ab0c3179147874..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/InstanceH2UIDAO.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.LinkedList; -import java.util.List; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.core.util.BooleanUtils; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.register.Instance; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; -import org.apache.skywalking.apm.collector.storage.ui.application.Application; -import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng, clevertension - */ -public class InstanceH2UIDAO extends H2DAO implements IInstanceUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(InstanceH2UIDAO.class); - - public InstanceH2UIDAO(H2Client client) { - super(client); - } - - private static final String GET_INSTANCE_SQL = "select * from {0} where {1} = ?"; - private static final String GET_APPLICATIONS_SQL = "select {3}, count({0}) as cnt from {1} where {2} >= ? group by {3} limit 100"; - - @Override - public List getApplications(long startSecondTimeBucket, long endSecondTimeBucket, - int... applicationIds) { - H2Client client = getClient(); - List applications = new LinkedList<>(); - String sql = SqlBuilder.buildSql(GET_APPLICATIONS_SQL, InstanceTable.INSTANCE_ID.getName(), - InstanceTable.TABLE, InstanceTable.HEARTBEAT_TIME.getName(), InstanceTable.APPLICATION_ID.getName()); - Object[] params = new Object[] {startSecondTimeBucket}; - try (ResultSet rs = client.executeQuery(sql, params)) { - while (rs.next()) { - Integer applicationId = rs.getInt(InstanceTable.APPLICATION_ID.getName()); - logger.debug("applicationId: {}", applicationId); - Application application = new Application(); - application.setId(applicationId); - application.setNumOfServer(rs.getInt("cnt")); - applications.add(application); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return applications; - } - - @Override - public Instance getInstance(int instanceId) { - H2Client client = getClient(); - String sql = SqlBuilder.buildSql(GET_INSTANCE_SQL, InstanceTable.TABLE, InstanceTable.INSTANCE_ID.getName()); - Object[] params = new Object[] {instanceId}; - try (ResultSet rs = client.executeQuery(sql, params)) { - if (rs.next()) { - Instance instance = new Instance(); - instance.setId(rs.getString(InstanceTable.ID.getName())); - instance.setApplicationId(rs.getInt(InstanceTable.APPLICATION_ID.getName())); - instance.setAgentUUID(rs.getString(InstanceTable.AGENT_UUID.getName())); - instance.setRegisterTime(rs.getLong(InstanceTable.REGISTER_TIME.getName())); - instance.setHeartBeatTime(rs.getLong(InstanceTable.HEARTBEAT_TIME.getName())); - instance.setOsInfo(rs.getString(InstanceTable.OS_INFO.getName())); - return instance; - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return null; - } - - @Override - public List searchServer(String keyword, long startSecondTimeBucket, long endSecondTimeBucket) { - logger.debug("get instances info, keyword: {}, start: {}, end: {}", keyword, startSecondTimeBucket, endSecondTimeBucket); - String dynamicSql = "select * from {0} where {1} like ? and (({2} >= ? and {2} <= ?) or ({3} >= ? and {3} <= ?)) and {4} = ?"; - String sql = SqlBuilder.buildSql(dynamicSql, InstanceTable.TABLE, InstanceTable.OS_INFO.getName(), InstanceTable.REGISTER_TIME.getName(), InstanceTable.HEARTBEAT_TIME.getName(), InstanceTable.IS_ADDRESS.getName()); - Object[] params = new Object[] {keyword, startSecondTimeBucket, endSecondTimeBucket, startSecondTimeBucket, endSecondTimeBucket, BooleanUtils.FALSE}; - return buildAppServerInfo(sql, params); - } - - @Override - public List getAllServer(int applicationId, long startSecondTimeBucket, long endSecondTimeBucket) { - logger.debug("get instances info, applicationId: {}, startSecondTimeBucket: {}, endSecondTimeBucket: {}", applicationId, startSecondTimeBucket, endSecondTimeBucket); - String dynamicSql = "select * from {0} where {1} = ? and (({2} >= ? and {2} <= ?) or ({3} >= ? and {3} <= ?)) and {4} = ?"; - String sql = SqlBuilder.buildSql(dynamicSql, InstanceTable.TABLE, InstanceTable.APPLICATION_ID.getName(), InstanceTable.REGISTER_TIME.getName(), InstanceTable.HEARTBEAT_TIME.getName(), InstanceTable.IS_ADDRESS.getName()); - Object[] params = new Object[] {applicationId, startSecondTimeBucket, endSecondTimeBucket, startSecondTimeBucket, endSecondTimeBucket, BooleanUtils.FALSE}; - return buildAppServerInfo(sql, params); - } - - private List buildAppServerInfo(String sql, Object[] params) { - H2Client client = getClient(); - - List appServerInfos = new LinkedList<>(); - try (ResultSet rs = client.executeQuery(sql, params)) { - while (rs.next()) { - AppServerInfo appServerInfo = new AppServerInfo(); - appServerInfo.setId(rs.getInt(InstanceTable.INSTANCE_ID.getName())); - appServerInfo.setOsInfo(rs.getString(InstanceTable.OS_INFO.getName())); - appServerInfos.add(appServerInfo); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return appServerInfos; - } - - //TODO - @Override public long getEarliestRegisterTime(int applicationId) { - return 0; - } - - //TODO - @Override public long getLatestHeartBeatTime(int applicationId) { - return 0; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/InstanceMetricH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/InstanceMetricH2UIDAO.java deleted file mode 100644 index 84115efec52f3cb25a2eef03c78f8755fa5c8c84..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/InstanceMetricH2UIDAO.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import java.sql.*; -import java.util.*; -import org.apache.skywalking.apm.collector.client.h2.*; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo; -import org.apache.skywalking.apm.collector.storage.utils.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng, clevertension - */ -public class InstanceMetricH2UIDAO extends H2DAO implements IInstanceMetricUIDAO { - - private final Logger logger = LoggerFactory.getLogger(InstanceMetricH2UIDAO.class); - private static final String GET_TPS_METRIC_SQL = "select * from {0} where {1} = ?"; - - public InstanceMetricH2UIDAO(H2Client client) { - super(client); - } - - @Override public List getServerThroughput(int applicationId, Step step, long startTimeBucket, - long endTimeBucket, - int minutesBetween, int topN, MetricSource metricSource) { - return null; - } - - @Override - public List getServerThroughputTrend(int instanceId, Step step, List durationPoints) { - H2Client client = getClient(); - String tableName = TimePyramidTableNameBuilder.build(step, InstanceMetricTable.TABLE); - - String sql = SqlBuilder.buildSql(GET_TPS_METRIC_SQL, tableName, InstanceMetricTable.ID.getName()); - - List throughputTrend = new LinkedList<>(); - durationPoints.forEach(durationPoint -> { - String id = durationPoint.getPoint() + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + MetricSource.Callee.getValue(); - try (ResultSet rs = client.executeQuery(sql, new Object[] {id})) { - if (rs.next()) { - long callTimes = rs.getLong(InstanceMetricTable.TRANSACTION_CALLS.getName()); - throughputTrend.add((int)(callTimes / durationPoint.getMinutesBetween())); - } else { - throughputTrend.add(0); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - }); - - return throughputTrend; - } - - @Override public List getResponseTimeTrend(int instanceId, Step step, List durationPoints) { - H2Client client = getClient(); - - String tableName = TimePyramidTableNameBuilder.build(step, InstanceMetricTable.TABLE); - String sql = SqlBuilder.buildSql(GET_TPS_METRIC_SQL, tableName, InstanceMetricTable.ID.getName()); - - List responseTimeTrends = new LinkedList<>(); - durationPoints.forEach(durationPoint -> { - String id = durationPoint.getPoint() + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + MetricSource.Callee.getValue(); - try (ResultSet rs = client.executeQuery(sql, new Object[] {id})) { - if (rs.next()) { - long callTimes = rs.getLong(InstanceMetricTable.TRANSACTION_CALLS.getName()); - long durationSum = rs.getLong(InstanceMetricTable.TRANSACTION_DURATION_SUM.getName()); - responseTimeTrends.add((int)(durationSum / callTimes)); - } else { - responseTimeTrends.add(0); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - }); - return responseTimeTrends; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/MemoryMetricH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/MemoryMetricH2UIDAO.java deleted file mode 100644 index d15573822117fdb7d3eed7fc37cb740a2f78e123..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/MemoryMetricH2UIDAO.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.List; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.core.util.BooleanUtils; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IMemoryMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author clevertension - */ -public class MemoryMetricH2UIDAO extends H2DAO implements IMemoryMetricUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(MemoryMetricH2UIDAO.class); - private static final String GET_MEMORY_METRIC_SQL = "select * from {0} where {1} =?"; - - public MemoryMetricH2UIDAO(H2Client client) { - super(client); - } - - @Override public Trend getHeapMemoryTrend(int instanceId, Step step, List durationPoints) { - return getMemoryTrend(instanceId, step, durationPoints, true); - } - - @Override public Trend getNoHeapMemoryTrend(int instanceId, Step step, List durationPoints) { - return getMemoryTrend(instanceId, step, durationPoints, false); - } - - private Trend getMemoryTrend(int instanceId, Step step, List durationPoints, - boolean isHeap) { - String tableName = TimePyramidTableNameBuilder.build(step, MemoryMetricTable.TABLE); - - H2Client client = getClient(); - String sql = SqlBuilder.buildSql(GET_MEMORY_METRIC_SQL, tableName, MemoryMetricTable.ID.getName()); - - Trend trend = new Trend(); - durationPoints.forEach(durationPoint -> { - String id = durationPoint.getPoint() + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + BooleanUtils.booleanToValue(isHeap); - try (ResultSet rs = client.executeQuery(sql, new String[] {id})) { - if (rs.next()) { - long max = rs.getLong(MemoryMetricTable.MAX.getName()); - long used = rs.getLong(MemoryMetricTable.USED.getName()); - long times = rs.getLong(MemoryMetricTable.TIMES.getName()); - trend.getMetrics().add((int)(used / times)); - - if (max < 0) { - trend.getMaxMetrics().add((int)(used / times)); - } else { - trend.getMaxMetrics().add((int)(max / times)); - } - } else { - trend.getMetrics().add(0); - trend.getMaxMetrics().add(0); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - }); - - return trend; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/NetworkAddressH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/NetworkAddressH2UIDAO.java deleted file mode 100644 index 9368fc60ec5fc1127c2b249b817f8374e2d927e6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/NetworkAddressH2UIDAO.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.List; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.INetworkAddressUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddressTable; -import org.apache.skywalking.apm.collector.storage.ui.overview.ConjecturalApp; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng - */ -public class NetworkAddressH2UIDAO extends H2DAO implements INetworkAddressUIDAO { - - private final Logger logger = LoggerFactory.getLogger(NetworkAddressH2UIDAO.class); - - public NetworkAddressH2UIDAO(H2Client client) { - super(client); - } - - @Override public int getNumOfSpanLayer(int srcSpanLayer) { - String dynamicSql = "select count({0}) as cnt from {1} where {2} = ?"; - String sql = SqlBuilder.buildSql(dynamicSql, NetworkAddressTable.NETWORK_ADDRESS.getName(), NetworkAddressTable.TABLE, NetworkAddressTable.SRC_SPAN_LAYER.getName()); - Object[] params = new Object[] {srcSpanLayer}; - - try (ResultSet rs = getClient().executeQuery(sql, params)) { - if (rs.next()) { - return rs.getInt("cnt"); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } - - @Override public List getConjecturalApps() { - return null; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ResponseTimeDistributionH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ResponseTimeDistributionH2UIDAO.java deleted file mode 100644 index 84ad9c653f82a1ae865af6ef5c88dd97858fec62..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ResponseTimeDistributionH2UIDAO.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.ui.IResponseTimeDistributionUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionH2UIDAO extends H2DAO implements IResponseTimeDistributionUIDAO { - - public ResponseTimeDistributionH2UIDAO(H2Client client) { - super(client); - } - - @Override public void loadMetrics(Step step, List responseTimeSteps) { - - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/SegmentDurationH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/SegmentDurationH2UIDAO.java deleted file mode 100644 index 2ffddc7b07a3a123afd64ccb0149fb35e3443f37..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/SegmentDurationH2UIDAO.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.collector.core.util.BooleanUtils; -import org.apache.skywalking.apm.collector.core.util.StringUtils; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentDurationUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentDurationTable; -import org.apache.skywalking.apm.collector.storage.ui.trace.BasicTrace; -import org.apache.skywalking.apm.collector.storage.ui.trace.QueryOrder; -import org.apache.skywalking.apm.collector.storage.ui.trace.TraceBrief; -import org.apache.skywalking.apm.collector.storage.ui.trace.TraceState; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng, clevertension - */ -public class SegmentDurationH2UIDAO extends H2DAO implements ISegmentDurationUIDAO { - - private final Logger logger = LoggerFactory.getLogger(SegmentDurationH2UIDAO.class); - - public SegmentDurationH2UIDAO(H2Client client) { - super(client); - } - - @Override - public TraceBrief loadTop(long startSecondTimeBucket, long endSecondTimeBucket, long minDuration, long maxDuration, - String operationName, int applicationId, int limit, int from, TraceState traceState, QueryOrder queryOrder, String... segmentIds) { - H2Client client = getClient(); - String sql = "select * from {0} where {1} >= ? and {1} <= ?"; - List params = new ArrayList<>(); - List columns = new ArrayList<>(); - columns.add(SegmentDurationTable.TABLE); - columns.add(SegmentDurationTable.TIME_BUCKET.getName()); - params.add(startSecondTimeBucket); - params.add(endSecondTimeBucket); - int paramIndex = 1; - if (minDuration != -1 || maxDuration != -1) { - if (minDuration != -1) { - paramIndex++; - sql = sql + " and {" + paramIndex + "} >= ?"; - params.add(minDuration); - columns.add(SegmentDurationTable.DURATION.getName()); - } - if (maxDuration != -1) { - paramIndex++; - sql = sql + " and {" + paramIndex + "} <= ?"; - params.add(maxDuration); - columns.add(SegmentDurationTable.DURATION.getName()); - } - } - if (StringUtils.isNotEmpty(operationName)) { - paramIndex++; - sql = sql + " and {" + paramIndex + "} = ?"; - params.add(operationName); - columns.add(SegmentDurationTable.SERVICE_NAME.getName()); - } - if (StringUtils.isNotEmpty(segmentIds)) { - paramIndex++; - sql = sql + " and {" + paramIndex + "} = ?"; - params.add(segmentIds); - columns.add(SegmentDurationTable.TRACE_ID.getName()); - } - if (applicationId != 0) { - paramIndex++; - sql = sql + " and {" + paramIndex + "} = ?"; - params.add(applicationId); - columns.add(SegmentDurationTable.APPLICATION_ID.getName()); - } - if (traceState != null) { - paramIndex++; - sql = sql + " and {" + paramIndex + "} = ?"; - switch (traceState) { - case ERROR: - params.add(BooleanUtils.TRUE); - break; - case SUCCESS: - params.add(BooleanUtils.FALSE); - break; - } - - columns.add(SegmentDurationTable.IS_ERROR); - } - - sql = sql + " limit " + from + "," + limit; - switch (queryOrder) { - case BY_START_TIME: - sql = sql + " queryOrder by " + SegmentDurationTable.START_TIME.getName() + " dsc"; - break; - case BY_DURATION: - sql = sql + " queryOrder by " + SegmentDurationTable.DURATION.getName() + " dsc"; - break; - } - sql = SqlBuilder.buildSql(sql, columns); - Object[] p = params.toArray(new Object[0]); - - TraceBrief traceBrief = new TraceBrief(); - - int cnt = 0; - try (ResultSet rs = client.executeQuery(sql, p)) { - while (rs.next()) { - BasicTrace basicTrace = new BasicTrace(); - basicTrace.setSegmentId(rs.getString(SegmentDurationTable.SEGMENT_ID.getName())); - basicTrace.setDuration(rs.getInt(SegmentDurationTable.DURATION.getName())); - basicTrace.setStart(rs.getLong(SegmentDurationTable.START_TIME.getName())); -// basicTrace.setOperationName(rs.getString(SegmentDurationTable.SERVICE_NAME.getName())); - basicTrace.setError(BooleanUtils.valueToBoolean(rs.getInt(SegmentDurationTable.IS_ERROR.getName()))); - traceBrief.getTraces().add(basicTrace); - cnt++; - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - traceBrief.setTotal(cnt); - return traceBrief; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/SegmentH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/SegmentH2UIDAO.java deleted file mode 100644 index 9678f0011d6fbebe25a3818935d0055462d1ca62..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/SegmentH2UIDAO.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import com.google.protobuf.InvalidProtocolBufferException; -import java.sql.ResultSet; -import java.sql.SQLException; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentTable; -import org.apache.skywalking.apm.collector.client.h2.H2ClientException; -import org.apache.skywalking.apm.network.language.agent.TraceSegmentObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author peng-yongsheng, clevertension - */ -public class SegmentH2UIDAO extends H2DAO implements ISegmentUIDAO { - private final Logger logger = LoggerFactory.getLogger(SegmentH2UIDAO.class); - private static final String GET_SEGMENT_SQL = "select {0} from {1} where {2} = ?"; - - public SegmentH2UIDAO(H2Client client) { - super(client); - } - - @Override public TraceSegmentObject load(String segmentId) { - H2Client client = getClient(); - String sql = SqlBuilder.buildSql(GET_SEGMENT_SQL, SegmentTable.DATA_BINARY.getName(), - SegmentTable.TABLE, SegmentTable.ID.getName()); - Object[] params = new Object[] {segmentId}; - try (ResultSet rs = client.executeQuery(sql, params)) { - if (rs.next()) { - byte[] dataBinary = rs.getBytes(SegmentTable.DATA_BINARY.getName()); - try { - return TraceSegmentObject.parseFrom(dataBinary); - } catch (InvalidProtocolBufferException e) { - logger.error(e.getMessage(), e); - } - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return null; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ServiceAlarmH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ServiceAlarmH2UIDAO.java deleted file mode 100644 index 01b4cf6ea054b2bb9a40b5d2402b93870390d79d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ServiceAlarmH2UIDAO.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceAlarmUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.ui.alarm.Alarm; - -/** - * @author peng-yongsheng - */ -public class ServiceAlarmH2UIDAO extends H2DAO implements IServiceAlarmUIDAO { - - public ServiceAlarmH2UIDAO(H2Client client) { - super(client); - } - - @Override public Alarm loadAlarmList(String keyword, long startTimeBucket, long endTimeBucket, int limit, int from) { - return null; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ServiceMetricH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ServiceMetricH2UIDAO.java deleted file mode 100644 index ca8e85b52ff03df4f24a723148a84b9ccf380bfd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ServiceMetricH2UIDAO.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import java.sql.*; -import java.util.*; -import org.apache.skywalking.apm.collector.client.h2.*; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.apache.skywalking.apm.collector.storage.ui.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.utils.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class ServiceMetricH2UIDAO extends H2DAO implements IServiceMetricUIDAO { - - private final Logger logger = LoggerFactory.getLogger(ServiceMetricH2UIDAO.class); - - public ServiceMetricH2UIDAO(H2Client client) { - super(client); - } - - @Override - public List getServiceResponseTimeTrend(int serviceId, Step step, List durationPoints) { - String tableName = TimePyramidTableNameBuilder.build(step, ServiceMetricTable.TABLE); - - H2Client client = getClient(); - String dynamicSql = "select * from {0} where {1} = ?"; - String sql = SqlBuilder.buildSql(dynamicSql, tableName, ServiceMetricTable.ID.getName()); - - List trends = new LinkedList<>(); - durationPoints.forEach(durationPoint -> { - String id = durationPoint.getPoint() + Const.ID_SPLIT + serviceId + Const.ID_SPLIT + MetricSource.Callee.getValue(); - - try (ResultSet rs = client.executeQuery(sql, new String[] {id})) { - if (rs.next()) { - long calls = rs.getLong(ServiceMetricTable.TRANSACTION_CALLS.getName()); - long durationSum = rs.getLong(ServiceMetricTable.TRANSACTION_DURATION_SUM.getName()); - trends.add((int)(durationSum / calls)); - } else { - trends.add(0); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - }); - - return trends; - } - - @Override - public List getServiceThroughputTrend(int serviceId, Step step, List durationPoints) { - return null; - } - - @Override public List getServiceSLATrend(int serviceId, Step step, List durationPoints) { - String tableName = TimePyramidTableNameBuilder.build(step, ServiceMetricTable.TABLE); - - H2Client client = getClient(); - String dynamicSql = "select * from {0} where {1} = ?"; - String sql = SqlBuilder.buildSql(dynamicSql, tableName, ServiceMetricTable.ID); - - List trends = new LinkedList<>(); - durationPoints.forEach(durationPoint -> { - String id = durationPoint.getPoint() + Const.ID_SPLIT + serviceId + Const.ID_SPLIT + MetricSource.Callee.getValue(); - - try (ResultSet rs = client.executeQuery(sql, new String[] {id})) { - if (rs.next()) { - long calls = rs.getLong(ServiceMetricTable.TRANSACTION_CALLS.getName()); - long errorCalls = rs.getLong(ServiceMetricTable.TRANSACTION_ERROR_CALLS.getName()); - trends.add((int)(((calls - errorCalls) / calls)) * 10000); - } else { - trends.add(10000); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - }); - - return trends; - } - - @Override - public List getServicesMetric(Step step, long startTimeBucket, long endTimeBucket, MetricSource metricSource, - Collection serviceIds) { - return null; - } - - @Override - public List getSlowService(int applicationId, Step step, long startTimeBucket, long endTimeBucket, - Integer topN, - MetricSource metricSource) { - return null; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ServiceNameServiceH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ServiceNameServiceH2UIDAO.java deleted file mode 100644 index 910e417a0dc425b663d8135030f75130a250800e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ServiceNameServiceH2UIDAO.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import java.sql.*; -import java.util.*; -import org.apache.skywalking.apm.collector.client.h2.*; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceNameServiceUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceNameTable; -import org.apache.skywalking.apm.collector.storage.ui.service.ServiceInfo; -import org.apache.skywalking.apm.network.language.agent.SpanType; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class ServiceNameServiceH2UIDAO extends H2DAO implements IServiceNameServiceUIDAO { - - private final Logger logger = LoggerFactory.getLogger(ServiceNameServiceH2UIDAO.class); - - public ServiceNameServiceH2UIDAO(H2Client client) { - super(client); - } - - @Override public int getCount(long startTimeMillis) { - String dynamicSql = "select count({0}) as cnt from {1} where {2} = ? and {3} >= ?"; - String sql = SqlBuilder.buildSql(dynamicSql, ServiceNameTable.SERVICE_ID.getName(), ServiceNameTable.TABLE, ServiceNameTable.SRC_SPAN_TYPE.getName(), ServiceNameTable.HEARTBEAT_TIME.getName()); - Object[] params = new Object[] {SpanType.Entry_VALUE, startTimeMillis}; - - try (ResultSet rs = getClient().executeQuery(sql, params)) { - if (rs.next()) { - return rs.getInt("cnt"); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } - - @Override - public List searchService(String keyword, int applicationId, long startTimeMillis, int topN) { - String dynamicSql = "select {0},{1},{2} from {3} where {4} like ? and {5} = ? and {6} = ? and {7} >= ? limit ?"; - String sql = SqlBuilder.buildSql(dynamicSql, ServiceNameTable.SERVICE_ID.getName(), ServiceNameTable.SERVICE_NAME.getName(), ServiceNameTable.APPLICATION_ID.getName(), ServiceNameTable.TABLE, ServiceNameTable.SERVICE_NAME.getName(), ServiceNameTable.SRC_SPAN_TYPE.getName(), ServiceNameTable.APPLICATION_ID.getName(), ServiceNameTable.HEARTBEAT_TIME.getName()); - Object[] params = new Object[] {keyword, SpanType.Entry_VALUE, applicationId, startTimeMillis, topN}; - - List serviceInfos = new LinkedList<>(); - try (ResultSet rs = getClient().executeQuery(sql, params)) { - while (rs.next()) { - ServiceInfo serviceInfo = new ServiceInfo(); - serviceInfo.setId(rs.getInt(ServiceNameTable.SERVICE_ID.getName())); - serviceInfo.setName(rs.getString(ServiceNameTable.SERVICE_NAME.getName())); - serviceInfo.setApplicationId(rs.getInt(ServiceNameTable.APPLICATION_ID.getName())); - serviceInfos.add(serviceInfo); - } - } catch (SQLException | H2ClientException e) { - logger.error(e.getMessage(), e); - } - return serviceInfos; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ServiceReferenceH2MetricUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ServiceReferenceH2MetricUIDAO.java deleted file mode 100644 index 435664df4c49864ec5009d74608c9c7f198119dc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ServiceReferenceH2MetricUIDAO.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.dao.ui; - -import java.util.List; -import org.apache.skywalking.apm.collector.client.h2.H2Client; -import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceReferenceMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceH2MetricUIDAO extends H2DAO implements IServiceReferenceMetricUIDAO { - - public ServiceReferenceH2MetricUIDAO(H2Client client) { - super(client); - } - - @Override public List getFrontServices(Step step, long startTimeBucket, long endTimeBucket, - MetricSource metricSource, - int behindServiceId) { - return null; - } - - @Override public List getBehindServices(Step step, long startTimeBucket, long endTimeBucket, - MetricSource metricSource, - int frontServiceId) { - return null; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/GlobalTraceH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/GlobalTraceH2TableDefine.java deleted file mode 100644 index 4b3eee57b10b97f18baf0ced29ce9c0e942566aa..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/GlobalTraceH2TableDefine.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.global.GlobalTraceTable; - -/** - * @author peng-yongsheng - */ -public class GlobalTraceH2TableDefine extends H2TableDefine { - - public GlobalTraceH2TableDefine() { - super(GlobalTraceTable.TABLE); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(GlobalTraceTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(GlobalTraceTable.SEGMENT_ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(GlobalTraceTable.TRACE_ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(GlobalTraceTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/SegmentDurationH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/SegmentDurationH2TableDefine.java deleted file mode 100644 index 37df0d108175cdcdb6fea800cc9202ce11feb118..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/SegmentDurationH2TableDefine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentDurationTable; - -/** - * @author peng-yongsheng - */ -public class SegmentDurationH2TableDefine extends H2TableDefine { - - public SegmentDurationH2TableDefine() { - super(SegmentDurationTable.TABLE); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(SegmentDurationTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(SegmentDurationTable.SEGMENT_ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(SegmentDurationTable.APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(SegmentDurationTable.SERVICE_NAME, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(SegmentDurationTable.TRACE_ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(SegmentDurationTable.DURATION, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(SegmentDurationTable.START_TIME, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(SegmentDurationTable.END_TIME, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(SegmentDurationTable.IS_ERROR, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(SegmentDurationTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/SegmentH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/SegmentH2TableDefine.java deleted file mode 100644 index 8fbb08f43f61f20b5bb31bc6ab345204c5f32703..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/SegmentH2TableDefine.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentTable; - -/** - * @author peng-yongsheng - */ -public class SegmentH2TableDefine extends H2TableDefine { - - public SegmentH2TableDefine() { - super(SegmentTable.TABLE); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(SegmentTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(SegmentTable.DATA_BINARY, H2ColumnDefine.Type.BINARY.name())); - addColumn(new H2ColumnDefine(SegmentTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/acp/AbstractApplicationComponentH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/acp/AbstractApplicationComponentH2TableDefine.java deleted file mode 100644 index 70cff26b51dc49f354dd227d6f9db27750c79753..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/acp/AbstractApplicationComponentH2TableDefine.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.acp; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationComponentH2TableDefine extends H2TableDefine { - - AbstractApplicationComponentH2TableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new H2ColumnDefine(ApplicationComponentTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ApplicationComponentTable.METRIC_ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ApplicationComponentTable.COMPONENT_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ApplicationComponentTable.APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ApplicationComponentTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/acp/ApplicationComponentDayH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/acp/ApplicationComponentDayH2TableDefine.java deleted file mode 100644 index 0d15dfb60746493d7ea6157a757538de33636ca5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/acp/ApplicationComponentDayH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.acp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentDayH2TableDefine extends AbstractApplicationComponentH2TableDefine { - - public ApplicationComponentDayH2TableDefine() { - super(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/acp/ApplicationComponentHourH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/acp/ApplicationComponentHourH2TableDefine.java deleted file mode 100644 index 4b79ba9354406ff3791f92fa0fb112d99dd8431d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/acp/ApplicationComponentHourH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.acp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentHourH2TableDefine extends AbstractApplicationComponentH2TableDefine { - - public ApplicationComponentHourH2TableDefine() { - super(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/acp/ApplicationComponentMinuteH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/acp/ApplicationComponentMinuteH2TableDefine.java deleted file mode 100644 index d5003273d6749fb0aee1a52401b39d57dd1ed41c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/acp/ApplicationComponentMinuteH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.acp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentMinuteH2TableDefine extends AbstractApplicationComponentH2TableDefine { - - public ApplicationComponentMinuteH2TableDefine() { - super(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/acp/ApplicationComponentMonthH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/acp/ApplicationComponentMonthH2TableDefine.java deleted file mode 100644 index 2dbb3cb14dbef0aca77fe19fac5fdd6d25eb145d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/acp/ApplicationComponentMonthH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.acp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationComponentMonthH2TableDefine extends AbstractApplicationComponentH2TableDefine { - - public ApplicationComponentMonthH2TableDefine() { - super(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/AbstractApplicationAlarmListH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/AbstractApplicationAlarmListH2TableDefine.java deleted file mode 100644 index 9a096525a999dc1f79f013ef2d67b0c1a8e2c74e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/AbstractApplicationAlarmListH2TableDefine.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.alarm; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationAlarmListH2TableDefine extends H2TableDefine { - - AbstractApplicationAlarmListH2TableDefine(String name) { - super(name); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(ApplicationAlarmListTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ApplicationAlarmListTable.APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ApplicationAlarmListTable.SOURCE_VALUE, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ApplicationAlarmListTable.ALARM_TYPE, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ApplicationAlarmListTable.ALARM_CONTENT, H2ColumnDefine.Type.Varchar.name())); - - addColumn(new H2ColumnDefine(ApplicationAlarmListTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationAlarmH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationAlarmH2TableDefine.java deleted file mode 100644 index 3337b011ff5abd4d1bb676e0b526bbd6c2d3239a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationAlarmH2TableDefine.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.alarm; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmH2TableDefine extends H2TableDefine { - - public ApplicationAlarmH2TableDefine() { - super(ApplicationAlarmTable.TABLE); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(ApplicationAlarmTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ApplicationAlarmTable.APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ApplicationAlarmTable.SOURCE_VALUE, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ApplicationAlarmTable.ALARM_TYPE, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ApplicationAlarmTable.ALARM_CONTENT, H2ColumnDefine.Type.Varchar.name())); - - addColumn(new H2ColumnDefine(ApplicationAlarmTable.LAST_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationAlarmListDayH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationAlarmListDayH2TableDefine.java deleted file mode 100644 index 2d79d633b15029a461764b21473cce9e79d4d996..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationAlarmListDayH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.alarm; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmListDayH2TableDefine extends AbstractApplicationAlarmListH2TableDefine { - - public ApplicationAlarmListDayH2TableDefine() { - super(ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationAlarmListHourH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationAlarmListHourH2TableDefine.java deleted file mode 100644 index f1e0242bffca7ccfd3e8d6ac2c783c576527a8aa..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationAlarmListHourH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.alarm; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmListHourH2TableDefine extends AbstractApplicationAlarmListH2TableDefine { - - public ApplicationAlarmListHourH2TableDefine() { - super(ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationAlarmListMinuteH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationAlarmListMinuteH2TableDefine.java deleted file mode 100644 index d69724ad578b68955a59d1b1ab7c6682dde0aa61..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationAlarmListMinuteH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.alarm; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmListMinuteH2TableDefine extends AbstractApplicationAlarmListH2TableDefine { - - public ApplicationAlarmListMinuteH2TableDefine() { - super(ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationAlarmListMonthH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationAlarmListMonthH2TableDefine.java deleted file mode 100644 index 5c4e294db42f1eae4914fdd32e381781413a04fa..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationAlarmListMonthH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.alarm; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationAlarmListMonthH2TableDefine extends AbstractApplicationAlarmListH2TableDefine { - - public ApplicationAlarmListMonthH2TableDefine() { - super(ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationReferenceAlarmH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationReferenceAlarmH2TableDefine.java deleted file mode 100644 index 6ecbfc70f816f9776460fa57c20dd7ac3b8605ad..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationReferenceAlarmH2TableDefine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.alarm; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceAlarmH2TableDefine extends H2TableDefine { - - public ApplicationReferenceAlarmH2TableDefine() { - super(ApplicationReferenceAlarmTable.TABLE); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(ApplicationReferenceAlarmTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceAlarmTable.FRONT_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceAlarmTable.BEHIND_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ApplicationReferenceAlarmTable.SOURCE_VALUE, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceAlarmTable.ALARM_TYPE, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ApplicationReferenceAlarmTable.ALARM_CONTENT, H2ColumnDefine.Type.Varchar.name())); - - addColumn(new H2ColumnDefine(ApplicationReferenceAlarmTable.LAST_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationReferenceAlarmListH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationReferenceAlarmListH2TableDefine.java deleted file mode 100644 index 908916e5821a665bc459e6cd1f48a9b9c63680ca..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ApplicationReferenceAlarmListH2TableDefine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.alarm; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceAlarmListH2TableDefine extends H2TableDefine { - - public ApplicationReferenceAlarmListH2TableDefine() { - super(ApplicationReferenceAlarmListTable.TABLE); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(ApplicationReferenceAlarmListTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceAlarmListTable.FRONT_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceAlarmListTable.BEHIND_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ApplicationReferenceAlarmListTable.SOURCE_VALUE, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceAlarmListTable.ALARM_TYPE, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ApplicationReferenceAlarmListTable.ALARM_CONTENT, H2ColumnDefine.Type.Varchar.name())); - - addColumn(new H2ColumnDefine(ApplicationReferenceAlarmListTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/InstanceAlarmH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/InstanceAlarmH2TableDefine.java deleted file mode 100644 index 926e49024cbaa37ebe45807802b35edd44bbb040..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/InstanceAlarmH2TableDefine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.alarm; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmTable; - -/** - * @author peng-yongsheng - */ -public class InstanceAlarmH2TableDefine extends H2TableDefine { - - public InstanceAlarmH2TableDefine() { - super(InstanceAlarmTable.TABLE); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(InstanceAlarmTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(InstanceAlarmTable.APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceAlarmTable.INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(InstanceAlarmTable.SOURCE_VALUE, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceAlarmTable.ALARM_TYPE, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(InstanceAlarmTable.ALARM_CONTENT, H2ColumnDefine.Type.Varchar.name())); - - addColumn(new H2ColumnDefine(InstanceAlarmTable.LAST_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/InstanceAlarmListH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/InstanceAlarmListH2TableDefine.java deleted file mode 100644 index 6e0b7327011faf669fd8d9862effedfeb63487be..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/InstanceAlarmListH2TableDefine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.alarm; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class InstanceAlarmListH2TableDefine extends H2TableDefine { - - public InstanceAlarmListH2TableDefine() { - super(InstanceAlarmListTable.TABLE); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(InstanceAlarmListTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(InstanceAlarmListTable.APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceAlarmListTable.INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(InstanceAlarmListTable.SOURCE_VALUE, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceAlarmListTable.ALARM_TYPE, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(InstanceAlarmListTable.ALARM_CONTENT, H2ColumnDefine.Type.Varchar.name())); - - addColumn(new H2ColumnDefine(InstanceAlarmListTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/InstanceReferenceAlarmH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/InstanceReferenceAlarmH2TableDefine.java deleted file mode 100644 index a0a1d07209bc956439a83524aa352ce7733c7901..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/InstanceReferenceAlarmH2TableDefine.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.alarm; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceAlarmH2TableDefine extends H2TableDefine { - - public InstanceReferenceAlarmH2TableDefine() { - super(InstanceReferenceAlarmTable.TABLE); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(InstanceReferenceAlarmTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(InstanceReferenceAlarmTable.FRONT_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceReferenceAlarmTable.BEHIND_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceReferenceAlarmTable.FRONT_INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceReferenceAlarmTable.BEHIND_INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(InstanceReferenceAlarmTable.SOURCE_VALUE, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceReferenceAlarmTable.ALARM_TYPE, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(InstanceReferenceAlarmTable.ALARM_CONTENT, H2ColumnDefine.Type.Varchar.name())); - - addColumn(new H2ColumnDefine(InstanceReferenceAlarmTable.LAST_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/InstanceReferenceAlarmListH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/InstanceReferenceAlarmListH2TableDefine.java deleted file mode 100644 index 8ef836a6ff554a3cc92985841bb36c543eb1db93..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/InstanceReferenceAlarmListH2TableDefine.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.alarm; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceAlarmListH2TableDefine extends H2TableDefine { - - public InstanceReferenceAlarmListH2TableDefine() { - super(InstanceReferenceAlarmListTable.TABLE); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(InstanceReferenceAlarmListTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(InstanceReferenceAlarmListTable.FRONT_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceReferenceAlarmListTable.BEHIND_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceReferenceAlarmListTable.FRONT_INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceReferenceAlarmListTable.BEHIND_INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(InstanceReferenceAlarmListTable.SOURCE_VALUE, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceReferenceAlarmListTable.ALARM_TYPE, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(InstanceReferenceAlarmListTable.ALARM_CONTENT, H2ColumnDefine.Type.Varchar.name())); - - addColumn(new H2ColumnDefine(InstanceReferenceAlarmListTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ServiceAlarmH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ServiceAlarmH2TableDefine.java deleted file mode 100644 index 554268351bc2a2c89932aabaabdd5fa62a33ff65..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ServiceAlarmH2TableDefine.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.alarm; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmTable; - -/** - * @author peng-yongsheng - */ -public class ServiceAlarmH2TableDefine extends H2TableDefine { - - public ServiceAlarmH2TableDefine() { - super(ServiceAlarmTable.TABLE); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(ServiceAlarmTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ServiceAlarmTable.APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceAlarmTable.INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceAlarmTable.SERVICE_ID, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ServiceAlarmTable.SOURCE_VALUE, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceAlarmTable.ALARM_TYPE, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ServiceAlarmTable.ALARM_CONTENT, H2ColumnDefine.Type.Varchar.name())); - - addColumn(new H2ColumnDefine(ServiceAlarmTable.LAST_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ServiceAlarmListH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ServiceAlarmListH2TableDefine.java deleted file mode 100644 index 3f5979cc88e5eabac3f9299fa32882fabbf0d42d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ServiceAlarmListH2TableDefine.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.alarm; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ServiceAlarmListH2TableDefine extends H2TableDefine { - - public ServiceAlarmListH2TableDefine() { - super(ServiceAlarmListTable.TABLE); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(ServiceAlarmListTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ServiceAlarmListTable.APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceAlarmListTable.INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceAlarmListTable.SERVICE_ID, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ServiceAlarmListTable.SOURCE_VALUE, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceAlarmListTable.ALARM_TYPE, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ServiceAlarmListTable.ALARM_CONTENT, H2ColumnDefine.Type.Varchar.name())); - - addColumn(new H2ColumnDefine(ServiceAlarmListTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ServiceReferenceAlarmH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ServiceReferenceAlarmH2TableDefine.java deleted file mode 100644 index c8b6290e28e377c4f26533e4b22617004c76aa6c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ServiceReferenceAlarmH2TableDefine.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.alarm; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceAlarmH2TableDefine extends H2TableDefine { - - public ServiceReferenceAlarmH2TableDefine() { - super(ServiceReferenceAlarmTable.TABLE); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(ServiceReferenceAlarmTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ServiceReferenceAlarmTable.FRONT_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceReferenceAlarmTable.BEHIND_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceReferenceAlarmTable.FRONT_INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceReferenceAlarmTable.BEHIND_INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceReferenceAlarmTable.FRONT_SERVICE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceReferenceAlarmTable.BEHIND_SERVICE_ID, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ServiceReferenceAlarmTable.SOURCE_VALUE, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceReferenceAlarmTable.ALARM_TYPE, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ServiceReferenceAlarmTable.ALARM_CONTENT, H2ColumnDefine.Type.Varchar.name())); - - addColumn(new H2ColumnDefine(ServiceReferenceAlarmTable.LAST_TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ServiceReferenceAlarmListH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ServiceReferenceAlarmListH2TableDefine.java deleted file mode 100644 index dbf774507258821f0b1ffa0574e06342ace1c583..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/alarm/ServiceReferenceAlarmListH2TableDefine.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.alarm; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmListTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceAlarmListH2TableDefine extends H2TableDefine { - - public ServiceReferenceAlarmListH2TableDefine() { - super(ServiceReferenceAlarmListTable.TABLE); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(ServiceReferenceAlarmListTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ServiceReferenceAlarmListTable.FRONT_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceReferenceAlarmListTable.BEHIND_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceReferenceAlarmListTable.FRONT_INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceReferenceAlarmListTable.BEHIND_INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceReferenceAlarmListTable.FRONT_SERVICE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceReferenceAlarmListTable.BEHIND_SERVICE_ID, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ServiceReferenceAlarmListTable.SOURCE_VALUE, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceReferenceAlarmListTable.ALARM_TYPE, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ServiceReferenceAlarmListTable.ALARM_CONTENT, H2ColumnDefine.Type.Varchar.name())); - - addColumn(new H2ColumnDefine(ServiceReferenceAlarmListTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/amp/AbstractApplicationMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/amp/AbstractApplicationMetricH2TableDefine.java deleted file mode 100644 index 24782620cb73e4c36650b6473b47f664f456015d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/amp/AbstractApplicationMetricH2TableDefine.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.amp; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationMetricH2TableDefine extends H2TableDefine { - - AbstractApplicationMetricH2TableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new H2ColumnDefine(ApplicationMetricTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ApplicationMetricTable.METRIC_ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ApplicationMetricTable.APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ApplicationMetricTable.SOURCE_VALUE, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ApplicationMetricTable.TRANSACTION_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationMetricTable.TRANSACTION_ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationMetricTable.TRANSACTION_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationMetricTable.TRANSACTION_ERROR_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationMetricTable.TRANSACTION_AVERAGE_DURATION, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(ApplicationMetricTable.BUSINESS_TRANSACTION_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(ApplicationMetricTable.MQ_TRANSACTION_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationMetricTable.MQ_TRANSACTION_ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationMetricTable.MQ_TRANSACTION_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(ApplicationMetricTable.SATISFIED_COUNT, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationMetricTable.TOLERATING_COUNT, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationMetricTable.FRUSTRATED_COUNT, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(ApplicationMetricTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/amp/ApplicationDayMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/amp/ApplicationDayMetricH2TableDefine.java deleted file mode 100644 index 530777049c1b4da442c812fa2a6a06be41d64305..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/amp/ApplicationDayMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.amp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationDayMetricH2TableDefine extends AbstractApplicationMetricH2TableDefine { - - public ApplicationDayMetricH2TableDefine() { - super(ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/amp/ApplicationHourMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/amp/ApplicationHourMetricH2TableDefine.java deleted file mode 100644 index ad6f7f0ed77be246bc2c7b41e2c530c75dbb5987..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/amp/ApplicationHourMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.amp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationHourMetricH2TableDefine extends AbstractApplicationMetricH2TableDefine { - - public ApplicationHourMetricH2TableDefine() { - super(ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/amp/ApplicationMinuteMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/amp/ApplicationMinuteMetricH2TableDefine.java deleted file mode 100644 index f7ade1f6b4026f14661d57f43ae6f4204a405d8c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/amp/ApplicationMinuteMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.amp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMinuteMetricH2TableDefine extends AbstractApplicationMetricH2TableDefine { - - public ApplicationMinuteMetricH2TableDefine() { - super(ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/amp/ApplicationMonthMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/amp/ApplicationMonthMetricH2TableDefine.java deleted file mode 100644 index 6df3be8cd0d7d7e0d75edaf17f96b17ed2273693..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/amp/ApplicationMonthMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.amp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMonthMetricH2TableDefine extends AbstractApplicationMetricH2TableDefine { - - public ApplicationMonthMetricH2TableDefine() { - super(ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/ampp/AbstractApplicationMappingH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/ampp/AbstractApplicationMappingH2TableDefine.java deleted file mode 100644 index 164c16c95fd05c55099c0f3faf74f64da4a26489..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/ampp/AbstractApplicationMappingH2TableDefine.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.ampp; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationMappingH2TableDefine extends H2TableDefine { - - AbstractApplicationMappingH2TableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new H2ColumnDefine(ApplicationMappingTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ApplicationMappingTable.METRIC_ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ApplicationMappingTable.APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ApplicationMappingTable.MAPPING_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ApplicationMappingTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/ampp/ApplicationMappingDayH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/ampp/ApplicationMappingDayH2TableDefine.java deleted file mode 100644 index 644d9d8e5495e72d783b833fd8352a83e9d6bf72..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/ampp/ApplicationMappingDayH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.ampp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingDayH2TableDefine extends AbstractApplicationMappingH2TableDefine { - - public ApplicationMappingDayH2TableDefine() { - super(ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/ampp/ApplicationMappingHourH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/ampp/ApplicationMappingHourH2TableDefine.java deleted file mode 100644 index 2a03390ba493d60d68a3f7d466d69c6375e32128..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/ampp/ApplicationMappingHourH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.ampp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingHourH2TableDefine extends AbstractApplicationMappingH2TableDefine { - - public ApplicationMappingHourH2TableDefine() { - super(ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/ampp/ApplicationMappingMinuteH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/ampp/ApplicationMappingMinuteH2TableDefine.java deleted file mode 100644 index 35c107dfa900f5500654695993b154c883d00c7e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/ampp/ApplicationMappingMinuteH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.ampp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingMinuteH2TableDefine extends AbstractApplicationMappingH2TableDefine { - - public ApplicationMappingMinuteH2TableDefine() { - super(ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/ampp/ApplicationMappingMonthH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/ampp/ApplicationMappingMonthH2TableDefine.java deleted file mode 100644 index 9006286669a7c77055fcb6384dfb7f590d34260d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/ampp/ApplicationMappingMonthH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.ampp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationMappingMonthH2TableDefine extends AbstractApplicationMappingH2TableDefine { - - public ApplicationMappingMonthH2TableDefine() { - super(ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/armp/AbstractApplicationReferenceMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/armp/AbstractApplicationReferenceMetricH2TableDefine.java deleted file mode 100644 index 37b023f23ede68d39de8a7cb8ba76bb25e58efc9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/armp/AbstractApplicationReferenceMetricH2TableDefine.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.armp; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractApplicationReferenceMetricH2TableDefine extends H2TableDefine { - - AbstractApplicationReferenceMetricH2TableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.METRIC_ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.FRONT_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.BEHIND_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.SOURCE_VALUE, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.TRANSACTION_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.TRANSACTION_ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.TRANSACTION_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.TRANSACTION_AVERAGE_DURATION, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.MQ_TRANSACTION_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.MQ_TRANSACTION_ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.MQ_TRANSACTION_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.SATISFIED_COUNT, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.TOLERATING_COUNT, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.FRUSTRATED_COUNT, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ApplicationReferenceMetricTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/armp/ApplicationReferenceDayMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/armp/ApplicationReferenceDayMetricH2TableDefine.java deleted file mode 100644 index 307c100d9e2e3a84ced77aa35fc7bfd95335435b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/armp/ApplicationReferenceDayMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.armp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceDayMetricH2TableDefine extends AbstractApplicationReferenceMetricH2TableDefine { - - public ApplicationReferenceDayMetricH2TableDefine() { - super(ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/armp/ApplicationReferenceHourMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/armp/ApplicationReferenceHourMetricH2TableDefine.java deleted file mode 100644 index 40a70bae8cca8be8c378f9a37a4eb5f8c99648df..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/armp/ApplicationReferenceHourMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.armp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceHourMetricH2TableDefine extends AbstractApplicationReferenceMetricH2TableDefine { - - public ApplicationReferenceHourMetricH2TableDefine() { - super(ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/armp/ApplicationReferenceMinuteMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/armp/ApplicationReferenceMinuteMetricH2TableDefine.java deleted file mode 100644 index cd9a3e329fd2338696ae8324355492067a6cb570..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/armp/ApplicationReferenceMinuteMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.armp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMinuteMetricH2TableDefine extends AbstractApplicationReferenceMetricH2TableDefine { - - public ApplicationReferenceMinuteMetricH2TableDefine() { - super(ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/armp/ApplicationReferenceMonthMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/armp/ApplicationReferenceMonthMetricH2TableDefine.java deleted file mode 100644 index 39cff15ec2dbc7a87fa7915d82065f1cd99b0ada..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/armp/ApplicationReferenceMonthMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.armp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationReferenceMonthMetricH2TableDefine extends AbstractApplicationReferenceMetricH2TableDefine { - - public ApplicationReferenceMonthMetricH2TableDefine() { - super(ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/cpu/AbstractCpuMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/cpu/AbstractCpuMetricH2TableDefine.java deleted file mode 100644 index f482fbed6214745096e8a693c3d1548ab5f3a2b5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/cpu/AbstractCpuMetricH2TableDefine.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.cpu; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractCpuMetricH2TableDefine extends H2TableDefine { - - AbstractCpuMetricH2TableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new H2ColumnDefine(CpuMetricTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(CpuMetricTable.METRIC_ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(CpuMetricTable.INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(CpuMetricTable.USAGE_PERCENT, H2ColumnDefine.Type.Double.name())); - addColumn(new H2ColumnDefine(CpuMetricTable.TIMES, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(CpuMetricTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/cpu/CpuDayMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/cpu/CpuDayMetricH2TableDefine.java deleted file mode 100644 index fbdf74fe9fd2ad11ac58f0a0a265f88d19e82d21..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/cpu/CpuDayMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.cpu; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author peng-yongsheng - */ -public class CpuDayMetricH2TableDefine extends AbstractCpuMetricH2TableDefine { - - public CpuDayMetricH2TableDefine() { - super(CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/cpu/CpuHourMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/cpu/CpuHourMetricH2TableDefine.java deleted file mode 100644 index caf29f00118d83dd075af965f1f5ef7c96181c08..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/cpu/CpuHourMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.cpu; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author peng-yongsheng - */ -public class CpuHourMetricH2TableDefine extends AbstractCpuMetricH2TableDefine { - - public CpuHourMetricH2TableDefine() { - super(CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/cpu/CpuMinuteMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/cpu/CpuMinuteMetricH2TableDefine.java deleted file mode 100644 index c925957a4cae19876c680b98041ccc7d896a8b24..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/cpu/CpuMinuteMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.cpu; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author peng-yongsheng - */ -public class CpuMinuteMetricH2TableDefine extends AbstractCpuMetricH2TableDefine { - - public CpuMinuteMetricH2TableDefine() { - super(CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/cpu/CpuMonthMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/cpu/CpuMonthMetricH2TableDefine.java deleted file mode 100644 index 6c87941079a960952f8a514b21a01f3ea2777d4b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/cpu/CpuMonthMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.cpu; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author peng-yongsheng - */ -public class CpuMonthMetricH2TableDefine extends AbstractCpuMetricH2TableDefine { - - public CpuMonthMetricH2TableDefine() { - super(CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/gc/AbstractGCMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/gc/AbstractGCMetricH2TableDefine.java deleted file mode 100644 index 78f4603ced1ba59d80fc385147c2f2d56c1e0da4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/gc/AbstractGCMetricH2TableDefine.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.gc; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.*; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractGCMetricH2TableDefine extends H2TableDefine { - - AbstractGCMetricH2TableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new H2ColumnDefine(GCMetricTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(GCMetricTable.METRIC_ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(GCMetricTable.INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(GCMetricTable.PHRASE, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(GCMetricTable.COUNT, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(GCMetricTable.DURATION, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(GCMetricTable.TIMES, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(GCMetricTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/gc/GCDayMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/gc/GCDayMetricH2TableDefine.java deleted file mode 100644 index f9789051ad0e86b15bca62b1292081975efa5dde..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/gc/GCDayMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.gc; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author peng-yongsheng - */ -public class GCDayMetricH2TableDefine extends AbstractGCMetricH2TableDefine { - - public GCDayMetricH2TableDefine() { - super(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/gc/GCHourMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/gc/GCHourMetricH2TableDefine.java deleted file mode 100644 index 52d75880954aaa4170b937f61a7ffef06246488a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/gc/GCHourMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.gc; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author peng-yongsheng - */ -public class GCHourMetricH2TableDefine extends AbstractGCMetricH2TableDefine { - - public GCHourMetricH2TableDefine() { - super(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/gc/GCMinuteMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/gc/GCMinuteMetricH2TableDefine.java deleted file mode 100644 index f53f6c12efdf123e2f7e1a2787b57e3fc31a9fa9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/gc/GCMinuteMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.gc; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author peng-yongsheng - */ -public class GCMinuteMetricH2TableDefine extends AbstractGCMetricH2TableDefine { - - public GCMinuteMetricH2TableDefine() { - super(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/gc/GCMonthMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/gc/GCMonthMetricH2TableDefine.java deleted file mode 100644 index d8aad921e809392e92450bea47a1bceddaab3506..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/gc/GCMonthMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.gc; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author peng-yongsheng - */ -public class GCMonthMetricH2TableDefine extends AbstractGCMetricH2TableDefine { - - public GCMonthMetricH2TableDefine() { - super(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/imp/AbstractInstanceMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/imp/AbstractInstanceMetricH2TableDefine.java deleted file mode 100644 index 62e41208a407d41e454aea63d395d1f498b68b9c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/imp/AbstractInstanceMetricH2TableDefine.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.imp; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractInstanceMetricH2TableDefine extends H2TableDefine { - - AbstractInstanceMetricH2TableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new H2ColumnDefine(InstanceMetricTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(InstanceMetricTable.METRIC_ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(InstanceMetricTable.APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceMetricTable.INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceMetricTable.SOURCE_VALUE, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(InstanceMetricTable.TRANSACTION_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceMetricTable.TRANSACTION_ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceMetricTable.TRANSACTION_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceMetricTable.TRANSACTION_ERROR_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceMetricTable.TRANSACTION_AVERAGE_DURATION, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(InstanceMetricTable.BUSINESS_TRANSACTION_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(InstanceMetricTable.MQ_TRANSACTION_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceMetricTable.MQ_TRANSACTION_ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceMetricTable.MQ_TRANSACTION_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(InstanceMetricTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/imp/InstanceDayMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/imp/InstanceDayMetricH2TableDefine.java deleted file mode 100644 index a92772d359307aec67d47a54c2855bdad52eb50d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/imp/InstanceDayMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.imp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceDayMetricH2TableDefine extends AbstractInstanceMetricH2TableDefine { - - public InstanceDayMetricH2TableDefine() { - super(InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/imp/InstanceHourMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/imp/InstanceHourMetricH2TableDefine.java deleted file mode 100644 index 42634db6824367ae21b68e850816c5270e0c4bc0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/imp/InstanceHourMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.imp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceHourMetricH2TableDefine extends AbstractInstanceMetricH2TableDefine { - - public InstanceHourMetricH2TableDefine() { - super(InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/imp/InstanceMinuteMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/imp/InstanceMinuteMetricH2TableDefine.java deleted file mode 100644 index 0991d637bbbd3afb07d75f2d382792358c3c0de1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/imp/InstanceMinuteMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.imp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMinuteMetricH2TableDefine extends AbstractInstanceMetricH2TableDefine { - - public InstanceMinuteMetricH2TableDefine() { - super(InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/imp/InstanceMonthMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/imp/InstanceMonthMetricH2TableDefine.java deleted file mode 100644 index 881aad5bb512876c3d0f04deeb5d7491901a3936..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/imp/InstanceMonthMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.imp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMonthMetricH2TableDefine extends AbstractInstanceMetricH2TableDefine { - - public InstanceMonthMetricH2TableDefine() { - super(InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/impp/AbstractInstanceMappingH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/impp/AbstractInstanceMappingH2TableDefine.java deleted file mode 100644 index 02e7ecee623516b9fda084f7fe52a4ebb484dce0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/impp/AbstractInstanceMappingH2TableDefine.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.impp; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractInstanceMappingH2TableDefine extends H2TableDefine { - - AbstractInstanceMappingH2TableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new H2ColumnDefine(InstanceMappingTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(InstanceMappingTable.METRIC_ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(InstanceMappingTable.APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceMappingTable.INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceMappingTable.ADDRESS_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceMappingTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/impp/InstanceMappingDayH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/impp/InstanceMappingDayH2TableDefine.java deleted file mode 100644 index f57eb31e56bd9628ede45e6aa24752912f8a9a01..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/impp/InstanceMappingDayH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.impp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingDayH2TableDefine extends AbstractInstanceMappingH2TableDefine { - - public InstanceMappingDayH2TableDefine() { - super(InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/impp/InstanceMappingHourH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/impp/InstanceMappingHourH2TableDefine.java deleted file mode 100644 index 5ac00779e7d8b658f5ce5222ea72dd3598553fdf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/impp/InstanceMappingHourH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.impp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingHourH2TableDefine extends AbstractInstanceMappingH2TableDefine { - - public InstanceMappingHourH2TableDefine() { - super(InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/impp/InstanceMappingMinuteH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/impp/InstanceMappingMinuteH2TableDefine.java deleted file mode 100644 index 5887d5bc080595ab2ff43b09aa8cae516bf2bf50..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/impp/InstanceMappingMinuteH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.impp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingMinuteH2TableDefine extends AbstractInstanceMappingH2TableDefine { - - public InstanceMappingMinuteH2TableDefine() { - super(InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/impp/InstanceMappingMonthH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/impp/InstanceMappingMonthH2TableDefine.java deleted file mode 100644 index 64d963cc4d6f88684180b486c91c518b11229234..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/impp/InstanceMappingMonthH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.impp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author peng-yongsheng - */ -public class InstanceMappingMonthH2TableDefine extends AbstractInstanceMappingH2TableDefine { - - public InstanceMappingMonthH2TableDefine() { - super(InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/irmp/AbstractInstanceReferenceMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/irmp/AbstractInstanceReferenceMetricH2TableDefine.java deleted file mode 100644 index 7102606186575bf5f391f1229dfc04c7785d9c2b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/irmp/AbstractInstanceReferenceMetricH2TableDefine.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.irmp; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractInstanceReferenceMetricH2TableDefine extends H2TableDefine { - - AbstractInstanceReferenceMetricH2TableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.METRIC_ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.FRONT_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.FRONT_INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.BEHIND_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.BEHIND_INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.SOURCE_VALUE, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.TRANSACTION_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.TRANSACTION_ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.TRANSACTION_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.TRANSACTION_AVERAGE_DURATION, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.MQ_TRANSACTION_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.MQ_TRANSACTION_ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.MQ_TRANSACTION_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(InstanceReferenceMetricTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/irmp/InstanceReferenceDayMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/irmp/InstanceReferenceDayMetricH2TableDefine.java deleted file mode 100644 index 6cab3f1ec745607108f7249c43a1592eb1deeb1c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/irmp/InstanceReferenceDayMetricH2TableDefine.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.irmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceDayMetricH2TableDefine extends AbstractInstanceReferenceMetricH2TableDefine { - - public InstanceReferenceDayMetricH2TableDefine() { - super(InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } - -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/irmp/InstanceReferenceHourMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/irmp/InstanceReferenceHourMetricH2TableDefine.java deleted file mode 100644 index 73b4f7cf76b433ccce5a78b9659146eadb764ef3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/irmp/InstanceReferenceHourMetricH2TableDefine.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.irmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceHourMetricH2TableDefine extends AbstractInstanceReferenceMetricH2TableDefine { - - public InstanceReferenceHourMetricH2TableDefine() { - super(InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } - -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/irmp/InstanceReferenceMinuteMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/irmp/InstanceReferenceMinuteMetricH2TableDefine.java deleted file mode 100644 index 481e3a6ba555e155c9915944d93878522f9a660f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/irmp/InstanceReferenceMinuteMetricH2TableDefine.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.irmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMinuteMetricH2TableDefine extends AbstractInstanceReferenceMetricH2TableDefine { - - public InstanceReferenceMinuteMetricH2TableDefine() { - super(InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } - -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/irmp/InstanceReferenceMonthMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/irmp/InstanceReferenceMonthMetricH2TableDefine.java deleted file mode 100644 index 9f6908dd4a708c053b53d6ff0cd7681ef3d8c742..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/irmp/InstanceReferenceMonthMetricH2TableDefine.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.irmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class InstanceReferenceMonthMetricH2TableDefine extends AbstractInstanceReferenceMetricH2TableDefine { - - public InstanceReferenceMonthMetricH2TableDefine() { - super(InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } - -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/memory/AbstractMemoryMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/memory/AbstractMemoryMetricH2TableDefine.java deleted file mode 100644 index 9ef936fc6c13eda227215d53b8b482e9ef315ab7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/memory/AbstractMemoryMetricH2TableDefine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.memory; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractMemoryMetricH2TableDefine extends H2TableDefine { - - AbstractMemoryMetricH2TableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new H2ColumnDefine(MemoryMetricTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(MemoryMetricTable.METRIC_ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(MemoryMetricTable.INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(MemoryMetricTable.IS_HEAP, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(MemoryMetricTable.INIT, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(MemoryMetricTable.MAX, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(MemoryMetricTable.USED, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(MemoryMetricTable.COMMITTED, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(MemoryMetricTable.TIMES, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(MemoryMetricTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/memory/MemoryDayMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/memory/MemoryDayMetricH2TableDefine.java deleted file mode 100644 index 7c1e38f4899f600b1a62490afa1d17dab30f0f18..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/memory/MemoryDayMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.memory; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryDayMetricH2TableDefine extends AbstractMemoryMetricH2TableDefine { - - public MemoryDayMetricH2TableDefine() { - super(MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/memory/MemoryHourMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/memory/MemoryHourMetricH2TableDefine.java deleted file mode 100644 index 132cd0408551e542a080643b73e5bb59dc6b86d9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/memory/MemoryHourMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.memory; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryHourMetricH2TableDefine extends AbstractMemoryMetricH2TableDefine { - - public MemoryHourMetricH2TableDefine() { - super(MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/memory/MemoryMinuteMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/memory/MemoryMinuteMetricH2TableDefine.java deleted file mode 100644 index bfcd099e3c47960fe514eda0403222781733308c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/memory/MemoryMinuteMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.memory; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryMinuteMetricH2TableDefine extends AbstractMemoryMetricH2TableDefine { - - public MemoryMinuteMetricH2TableDefine() { - super(MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/memory/MemoryMonthMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/memory/MemoryMonthMetricH2TableDefine.java deleted file mode 100644 index bf0523dbf13675f0c9e7c677a889e445d4465bb0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/memory/MemoryMonthMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.memory; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryMonthMetricH2TableDefine extends AbstractMemoryMetricH2TableDefine { - - public MemoryMonthMetricH2TableDefine() { - super(MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/mpool/AbstractMemoryPoolMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/mpool/AbstractMemoryPoolMetricH2TableDefine.java deleted file mode 100644 index b094f9bb902749ebe5a971806fe2e5a9738c25d9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/mpool/AbstractMemoryPoolMetricH2TableDefine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.mpool; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractMemoryPoolMetricH2TableDefine extends H2TableDefine { - - AbstractMemoryPoolMetricH2TableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new H2ColumnDefine(MemoryPoolMetricTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(MemoryPoolMetricTable.METRIC_ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(MemoryPoolMetricTable.INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(MemoryPoolMetricTable.POOL_TYPE, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(MemoryPoolMetricTable.INIT, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(MemoryPoolMetricTable.MAX, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(MemoryPoolMetricTable.USED, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(MemoryPoolMetricTable.COMMITTED, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(MemoryPoolMetricTable.TIMES, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(MemoryPoolMetricTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/mpool/MemoryPoolDayMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/mpool/MemoryPoolDayMetricH2TableDefine.java deleted file mode 100644 index 474a9119e35ee3cbf84ced375adf155e34019fdb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/mpool/MemoryPoolDayMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.mpool; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolDayMetricH2TableDefine extends AbstractMemoryPoolMetricH2TableDefine { - - public MemoryPoolDayMetricH2TableDefine() { - super(MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/mpool/MemoryPoolHourMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/mpool/MemoryPoolHourMetricH2TableDefine.java deleted file mode 100644 index 3d5d9388aa2aa9b95c8a2742e8fcd6d1174ca3ae..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/mpool/MemoryPoolHourMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.mpool; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolHourMetricH2TableDefine extends AbstractMemoryPoolMetricH2TableDefine { - - public MemoryPoolHourMetricH2TableDefine() { - super(MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/mpool/MemoryPoolMonthMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/mpool/MemoryPoolMonthMetricH2TableDefine.java deleted file mode 100644 index 52538e0aad9bb475d6ef37936dcc87f78f5839ef..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/mpool/MemoryPoolMonthMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.mpool; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author peng-yongsheng - */ -public class MemoryPoolMonthMetricH2TableDefine extends AbstractMemoryPoolMetricH2TableDefine { - - public MemoryPoolMonthMetricH2TableDefine() { - super(MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/register/ApplicationH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/register/ApplicationH2TableDefine.java deleted file mode 100644 index bd47a3749b8b6cd2bc1d7d13c4790249bc68900d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/register/ApplicationH2TableDefine.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.register; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.register.ApplicationTable; - -/** - * @author peng-yongsheng - */ -public class ApplicationH2TableDefine extends H2TableDefine { - - public ApplicationH2TableDefine() { - super(ApplicationTable.TABLE); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(ApplicationTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ApplicationTable.APPLICATION_CODE, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ApplicationTable.APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ApplicationTable.ADDRESS_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ApplicationTable.IS_ADDRESS, H2ColumnDefine.Type.Int.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/register/InstanceH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/register/InstanceH2TableDefine.java deleted file mode 100644 index 9c89c665a72149e923dd25252acd6c0046448a51..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/register/InstanceH2TableDefine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.register; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; - -/** - * @author peng-yongsheng - */ -public class InstanceH2TableDefine extends H2TableDefine { - - public InstanceH2TableDefine() { - super(InstanceTable.TABLE); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(InstanceTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(InstanceTable.APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceTable.APPLICATION_CODE, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(InstanceTable.AGENT_UUID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(InstanceTable.REGISTER_TIME, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceTable.INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceTable.HEARTBEAT_TIME, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(InstanceTable.OS_INFO, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(InstanceTable.ADDRESS_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(InstanceTable.IS_ADDRESS, H2ColumnDefine.Type.Int.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/register/NetworkAddressH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/register/NetworkAddressH2TableDefine.java deleted file mode 100644 index bd2817864e9f6ad7ad2c37363c1d172a6afc5d88..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/register/NetworkAddressH2TableDefine.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.register; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddressTable; - -/** - * @author peng-yongsheng - */ -public class NetworkAddressH2TableDefine extends H2TableDefine { - - public NetworkAddressH2TableDefine() { - super(NetworkAddressTable.TABLE); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(NetworkAddressTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(NetworkAddressTable.NETWORK_ADDRESS, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(NetworkAddressTable.SRC_SPAN_LAYER, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(NetworkAddressTable.SERVER_TYPE, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(NetworkAddressTable.ADDRESS_ID, H2ColumnDefine.Type.Int.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/register/ServiceNameH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/register/ServiceNameH2TableDefine.java deleted file mode 100644 index d81410bc1e196543399bcdbd63bd8019e8d447e9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/register/ServiceNameH2TableDefine.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.register; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.*; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceNameTable; - -/** - * @author peng-yongsheng - */ -public class ServiceNameH2TableDefine extends H2TableDefine { - - public ServiceNameH2TableDefine() { - super(ServiceNameTable.TABLE); - } - - @Override public void initialize() { - addColumn(new H2ColumnDefine(ServiceNameTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ServiceNameTable.APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceNameTable.SERVICE_NAME, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ServiceNameTable.SERVICE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceNameTable.SRC_SPAN_TYPE, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceNameTable.REGISTER_TIME, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceNameTable.HEARTBEAT_TIME, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/rtd/AbstractResponseTimeDistributionH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/rtd/AbstractResponseTimeDistributionH2TableDefine.java deleted file mode 100644 index e907a815a382f876f87a4b453b27e7f0b4e37bee..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/rtd/AbstractResponseTimeDistributionH2TableDefine.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.rtd; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractResponseTimeDistributionH2TableDefine extends H2TableDefine { - - AbstractResponseTimeDistributionH2TableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new H2ColumnDefine(ResponseTimeDistributionTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ResponseTimeDistributionTable.METRIC_ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ResponseTimeDistributionTable.STEP, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ResponseTimeDistributionTable.CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ResponseTimeDistributionTable.ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ResponseTimeDistributionTable.SUCCESS_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ResponseTimeDistributionTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/rtd/ResponseTimeDistributionDayH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/rtd/ResponseTimeDistributionDayH2TableDefine.java deleted file mode 100644 index 89dda09c3ecf1507866b132012b4c7d0bb56f42c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/rtd/ResponseTimeDistributionDayH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.rtd; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionDayH2TableDefine extends AbstractResponseTimeDistributionH2TableDefine { - - public ResponseTimeDistributionDayH2TableDefine() { - super(ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/rtd/ResponseTimeDistributionHourH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/rtd/ResponseTimeDistributionHourH2TableDefine.java deleted file mode 100644 index 8ff7394f0424155ad371f61fd753cd65a6b7209b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/rtd/ResponseTimeDistributionHourH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.rtd; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionHourH2TableDefine extends AbstractResponseTimeDistributionH2TableDefine { - - public ResponseTimeDistributionHourH2TableDefine() { - super(ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/rtd/ResponseTimeDistributionMinuteH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/rtd/ResponseTimeDistributionMinuteH2TableDefine.java deleted file mode 100644 index 386ce3c2a3a87125b055237e527979427814fb73..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/rtd/ResponseTimeDistributionMinuteH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.rtd; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionMinuteH2TableDefine extends AbstractResponseTimeDistributionH2TableDefine { - - public ResponseTimeDistributionMinuteH2TableDefine() { - super(ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/rtd/ResponseTimeDistributionMonthH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/rtd/ResponseTimeDistributionMonthH2TableDefine.java deleted file mode 100644 index b463331eafec41343f6873b40f6f7655843293a5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/rtd/ResponseTimeDistributionMonthH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.rtd; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionMonthH2TableDefine extends AbstractResponseTimeDistributionH2TableDefine { - - public ResponseTimeDistributionMonthH2TableDefine() { - super(ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/smp/AbstractServiceMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/smp/AbstractServiceMetricH2TableDefine.java deleted file mode 100644 index 73e5f482322c922b07d9bc7df53096bf8f560fa1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/smp/AbstractServiceMetricH2TableDefine.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.smp; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractServiceMetricH2TableDefine extends H2TableDefine { - - AbstractServiceMetricH2TableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new H2ColumnDefine(ServiceMetricTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ServiceMetricTable.METRIC_ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ServiceMetricTable.APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceMetricTable.INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceMetricTable.SERVICE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceMetricTable.SOURCE_VALUE, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ServiceMetricTable.TRANSACTION_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceMetricTable.TRANSACTION_ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceMetricTable.TRANSACTION_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceMetricTable.TRANSACTION_ERROR_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceMetricTable.TRANSACTION_AVERAGE_DURATION, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(ServiceMetricTable.BUSINESS_TRANSACTION_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(ServiceMetricTable.MQ_TRANSACTION_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceMetricTable.MQ_TRANSACTION_ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceMetricTable.MQ_TRANSACTION_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(ServiceMetricTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/smp/ServiceDayMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/smp/ServiceDayMetricH2TableDefine.java deleted file mode 100644 index 262f793c3c307d0110097f689bd9efa1f8696f06..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/smp/ServiceDayMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.smp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceDayMetricH2TableDefine extends AbstractServiceMetricH2TableDefine { - - public ServiceDayMetricH2TableDefine() { - super(ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/smp/ServiceHourMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/smp/ServiceHourMetricH2TableDefine.java deleted file mode 100644 index 8c67a95fc5156ca24c6e5364711c2479f760ab84..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/smp/ServiceHourMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.smp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceHourMetricH2TableDefine extends AbstractServiceMetricH2TableDefine { - - public ServiceHourMetricH2TableDefine() { - super(ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/smp/ServiceMinuteMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/smp/ServiceMinuteMetricH2TableDefine.java deleted file mode 100644 index f35f53514e94e330a80836f277278ca3c00c5057..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/smp/ServiceMinuteMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.smp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceMinuteMetricH2TableDefine extends AbstractServiceMetricH2TableDefine { - - public ServiceMinuteMetricH2TableDefine() { - super(ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/smp/ServiceMonthMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/smp/ServiceMonthMetricH2TableDefine.java deleted file mode 100644 index 6b08167f43ab525bd550367bcc82b58d054eebe2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/smp/ServiceMonthMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.smp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceMonthMetricH2TableDefine extends AbstractServiceMetricH2TableDefine { - - public ServiceMonthMetricH2TableDefine() { - super(ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/srmp/AbstractServiceReferenceMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/srmp/AbstractServiceReferenceMetricH2TableDefine.java deleted file mode 100644 index 999c5f30c96d9153e01e5b8d0541141cc57ad634..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/srmp/AbstractServiceReferenceMetricH2TableDefine.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.srmp; - -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2ColumnDefine; -import org.apache.skywalking.apm.collector.storage.h2.base.define.H2TableDefine; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public abstract class AbstractServiceReferenceMetricH2TableDefine extends H2TableDefine { - - AbstractServiceReferenceMetricH2TableDefine(String name) { - super(name); - } - - @Override public final void initialize() { - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.ID, H2ColumnDefine.Type.Varchar.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.METRIC_ID, H2ColumnDefine.Type.Varchar.name())); - - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.FRONT_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.FRONT_INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.FRONT_SERVICE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.BEHIND_APPLICATION_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.BEHIND_INSTANCE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.BEHIND_SERVICE_ID, H2ColumnDefine.Type.Int.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.SOURCE_VALUE, H2ColumnDefine.Type.Int.name())); - - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.TRANSACTION_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.TRANSACTION_ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.TRANSACTION_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.TRANSACTION_AVERAGE_DURATION, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.MQ_TRANSACTION_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.MQ_TRANSACTION_ERROR_CALLS, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.MQ_TRANSACTION_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, H2ColumnDefine.Type.Bigint.name())); - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, H2ColumnDefine.Type.Bigint.name())); - - addColumn(new H2ColumnDefine(ServiceReferenceMetricTable.TIME_BUCKET, H2ColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/srmp/ServiceReferenceDayMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/srmp/ServiceReferenceDayMetricH2TableDefine.java deleted file mode 100644 index bb517017776c9de7ddd8267ea11d28a6f9d05303..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/srmp/ServiceReferenceDayMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.srmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceDayMetricH2TableDefine extends AbstractServiceReferenceMetricH2TableDefine { - - public ServiceReferenceDayMetricH2TableDefine() { - super(ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/srmp/ServiceReferenceHourMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/srmp/ServiceReferenceHourMetricH2TableDefine.java deleted file mode 100644 index a6c2bdf8929d070d392dea70176cc5a5d4869c00..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/srmp/ServiceReferenceHourMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.srmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceHourMetricH2TableDefine extends AbstractServiceReferenceMetricH2TableDefine { - - public ServiceReferenceHourMetricH2TableDefine() { - super(ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/srmp/ServiceReferenceMinuteMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/srmp/ServiceReferenceMinuteMetricH2TableDefine.java deleted file mode 100644 index 3c6881da02af8f5c2b715c3ac692c2dd08fee6fc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/srmp/ServiceReferenceMinuteMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.srmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMinuteMetricH2TableDefine extends AbstractServiceReferenceMetricH2TableDefine { - - public ServiceReferenceMinuteMetricH2TableDefine() { - super(ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/srmp/ServiceReferenceMonthMetricH2TableDefine.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/srmp/ServiceReferenceMonthMetricH2TableDefine.java deleted file mode 100644 index acd07ef18ce869cd754b87fedd643345c7905086..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/srmp/ServiceReferenceMonthMetricH2TableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.h2.define.srmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author peng-yongsheng - */ -public class ServiceReferenceMonthMetricH2TableDefine extends AbstractServiceReferenceMetricH2TableDefine { - - public ServiceReferenceMonthMetricH2TableDefine() { - super(ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/resources/META-INF/defines/storage.define b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/resources/META-INF/defines/storage.define deleted file mode 100644 index f9f67289ba37ff6fc916bc4469e01b2b15023409..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/resources/META-INF/defines/storage.define +++ /dev/null @@ -1,117 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.storage.h2.define.register.NetworkAddressH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.register.ApplicationH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.register.InstanceH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.register.ServiceNameH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.cpu.CpuMinuteMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.cpu.CpuHourMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.cpu.CpuDayMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.cpu.CpuMonthMetricH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.gc.GCMinuteMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.gc.GCHourMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.gc.GCDayMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.gc.GCMonthMetricH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.memory.MemoryMinuteMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.memory.MemoryHourMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.memory.MemoryDayMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.memory.MemoryMonthMetricH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.mpool.MemoryPoolMinuteMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.mpool.MemoryPoolHourMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.mpool.MemoryPoolDayMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.mpool.MemoryPoolMonthMetricH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.acp.ApplicationComponentMinuteH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.acp.ApplicationComponentHourH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.acp.ApplicationComponentDayH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.acp.ApplicationComponentMonthH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.ampp.ApplicationMappingMinuteH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.ampp.ApplicationMappingHourH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.ampp.ApplicationMappingDayH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.ampp.ApplicationMappingMonthH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.impp.InstanceMappingMinuteH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.impp.InstanceMappingHourH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.impp.InstanceMappingDayH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.impp.InstanceMappingMonthH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.GlobalTraceH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.rtd.ResponseTimeDistributionMinuteH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.rtd.ResponseTimeDistributionHourH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.rtd.ResponseTimeDistributionDayH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.rtd.ResponseTimeDistributionMonthH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.SegmentDurationH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.SegmentH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.amp.ApplicationMinuteMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.amp.ApplicationHourMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.amp.ApplicationDayMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.amp.ApplicationMonthMetricH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.armp.ApplicationReferenceMinuteMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.armp.ApplicationReferenceHourMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.armp.ApplicationReferenceDayMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.armp.ApplicationReferenceMonthMetricH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.imp.InstanceMinuteMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.imp.InstanceHourMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.imp.InstanceDayMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.imp.InstanceMonthMetricH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.irmp.InstanceReferenceMinuteMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.irmp.InstanceReferenceHourMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.irmp.InstanceReferenceDayMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.irmp.InstanceReferenceMonthMetricH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.smp.ServiceMinuteMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.smp.ServiceHourMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.smp.ServiceDayMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.smp.ServiceMonthMetricH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.srmp.ServiceReferenceMinuteMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.srmp.ServiceReferenceHourMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.srmp.ServiceReferenceDayMetricH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.srmp.ServiceReferenceMonthMetricH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.alarm.ApplicationAlarmH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.alarm.ApplicationAlarmListMinuteH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.alarm.ApplicationAlarmListHourH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.alarm.ApplicationAlarmListDayH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.alarm.ApplicationAlarmListMonthH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.alarm.ApplicationReferenceAlarmH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.alarm.ApplicationReferenceAlarmListH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.alarm.InstanceAlarmH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.alarm.InstanceAlarmListH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.alarm.InstanceReferenceAlarmH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.alarm.InstanceReferenceAlarmListH2TableDefine - -org.apache.skywalking.apm.collector.storage.h2.define.alarm.ServiceAlarmH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.alarm.ServiceAlarmListH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.alarm.ServiceReferenceAlarmH2TableDefine -org.apache.skywalking.apm.collector.storage.h2.define.alarm.ServiceReferenceAlarmListH2TableDefine \ No newline at end of file diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index 09b7f89e3253fd0b07abee494a84230683f35ee8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.storage.h2.StorageModuleH2Provider \ No newline at end of file diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/pom.xml b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/pom.xml deleted file mode 100644 index a4198c9cfbdc412fba76dee76b686ec6e20f93ff..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - apm-collector-storage - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-storage-shardingjdbc-provider - jar - - - - org.apache.skywalking - collector-storage-define - ${project.version} - - - diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/MetricTransformUtil.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/MetricTransformUtil.java deleted file mode 100644 index 8e87ee7fed16a1b8548fc0e3e7d8c447c9d9e8b5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/MetricTransformUtil.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Map; -import org.apache.skywalking.apm.collector.storage.table.Metric; -import org.apache.skywalking.apm.collector.storage.table.MetricColumns; - -/** - * @author linjiaqi - */ -public enum MetricTransformUtil { - INSTANCE; - - public void shardingjdbcDataToStreamData(ResultSet source, Metric target) throws SQLException { - target.setSourceValue(source.getInt(MetricColumns.SOURCE_VALUE.getName())); - target.setTimeBucket(source.getLong(MetricColumns.TIME_BUCKET.getName())); - - target.setTransactionCalls(source.getLong(MetricColumns.TRANSACTION_CALLS.getName())); - target.setTransactionErrorCalls(source.getLong(MetricColumns.TRANSACTION_ERROR_CALLS.getName())); - target.setTransactionDurationSum(source.getLong(MetricColumns.TRANSACTION_DURATION_SUM.getName())); - target.setTransactionErrorDurationSum(source.getLong(MetricColumns.TRANSACTION_ERROR_DURATION_SUM.getName())); - target.setTransactionAverageDuration(source.getLong(MetricColumns.TRANSACTION_AVERAGE_DURATION.getName())); - - target.setBusinessTransactionCalls(source.getLong(MetricColumns.BUSINESS_TRANSACTION_CALLS.getName())); - target.setBusinessTransactionErrorCalls(source.getLong(MetricColumns.BUSINESS_TRANSACTION_ERROR_CALLS.getName())); - target.setBusinessTransactionDurationSum(source.getLong(MetricColumns.BUSINESS_TRANSACTION_DURATION_SUM.getName())); - target.setBusinessTransactionErrorDurationSum(source.getLong(MetricColumns.BUSINESS_TRANSACTION_ERROR_DURATION_SUM.getName())); - target.setBusinessTransactionAverageDuration(source.getLong(MetricColumns.BUSINESS_TRANSACTION_AVERAGE_DURATION.getName())); - - target.setMqTransactionCalls(source.getLong(MetricColumns.MQ_TRANSACTION_CALLS.getName())); - target.setMqTransactionErrorCalls(source.getLong(MetricColumns.MQ_TRANSACTION_ERROR_CALLS.getName())); - target.setMqTransactionDurationSum(source.getLong(MetricColumns.MQ_TRANSACTION_DURATION_SUM.getName())); - target.setMqTransactionErrorDurationSum(source.getLong(MetricColumns.MQ_TRANSACTION_ERROR_DURATION_SUM.getName())); - target.setMqTransactionAverageDuration(source.getLong(MetricColumns.MQ_TRANSACTION_AVERAGE_DURATION.getName())); - } - - public void streamDataToShardingjdbcData(Metric source, Map target) { - target.put(MetricColumns.SOURCE_VALUE.getName(), source.getSourceValue()); - target.put(MetricColumns.TIME_BUCKET.getName(), source.getTimeBucket()); - - target.put(MetricColumns.TRANSACTION_CALLS.getName(), source.getTransactionCalls()); - target.put(MetricColumns.TRANSACTION_ERROR_CALLS.getName(), source.getTransactionErrorCalls()); - target.put(MetricColumns.TRANSACTION_DURATION_SUM.getName(), source.getTransactionDurationSum()); - target.put(MetricColumns.TRANSACTION_ERROR_DURATION_SUM.getName(), source.getTransactionErrorDurationSum()); - target.put(MetricColumns.TRANSACTION_AVERAGE_DURATION.getName(), source.getTransactionAverageDuration()); - - target.put(MetricColumns.BUSINESS_TRANSACTION_CALLS.getName(), source.getBusinessTransactionCalls()); - target.put(MetricColumns.BUSINESS_TRANSACTION_ERROR_CALLS.getName(), source.getBusinessTransactionErrorCalls()); - target.put(MetricColumns.BUSINESS_TRANSACTION_DURATION_SUM.getName(), source.getBusinessTransactionDurationSum()); - target.put(MetricColumns.BUSINESS_TRANSACTION_ERROR_DURATION_SUM.getName(), source.getBusinessTransactionErrorDurationSum()); - target.put(MetricColumns.BUSINESS_TRANSACTION_AVERAGE_DURATION.getName(), source.getBusinessTransactionAverageDuration()); - - target.put(MetricColumns.MQ_TRANSACTION_CALLS.getName(), source.getMqTransactionCalls()); - target.put(MetricColumns.MQ_TRANSACTION_ERROR_CALLS.getName(), source.getMqTransactionErrorCalls()); - target.put(MetricColumns.MQ_TRANSACTION_DURATION_SUM.getName(), source.getMqTransactionDurationSum()); - target.put(MetricColumns.MQ_TRANSACTION_ERROR_DURATION_SUM.getName(), source.getMqTransactionErrorDurationSum()); - target.put(MetricColumns.MQ_TRANSACTION_AVERAGE_DURATION.getName(), source.getMqTransactionAverageDuration()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/StorageModuleShardingjdbcConfig.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/StorageModuleShardingjdbcConfig.java deleted file mode 100644 index e850678cfd7760dcc8007097d93b061ed086c66a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/StorageModuleShardingjdbcConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientConfig; - -/** - * @author linjiaqi - */ -class StorageModuleShardingjdbcConfig extends ShardingjdbcClientConfig { -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/StorageModuleShardingjdbcProvider.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/StorageModuleShardingjdbcProvider.java deleted file mode 100644 index 627640e2927a97f61e196595f709f642b5f0794e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/StorageModuleShardingjdbcProvider.java +++ /dev/null @@ -1,440 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc; - -import io.shardingjdbc.core.api.config.ShardingRuleConfiguration; -import org.apache.commons.lang3.StringUtils; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientConfig; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.cluster.ClusterModule; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; -import org.apache.skywalking.apm.collector.core.module.ModuleProvider; -import org.apache.skywalking.apm.collector.core.module.ServiceNotProvidedException; -import org.apache.skywalking.apm.collector.remote.RemoteModule; -import org.apache.skywalking.apm.collector.storage.StorageException; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.base.dao.IBatchDAO; -import org.apache.skywalking.apm.collector.storage.dao.IGlobalTracePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.IInstanceHeartBeatPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ISegmentDurationPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ISegmentPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationReferenceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationReferenceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceReferenceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceReferenceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceReferenceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceReferenceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.cache.IApplicationCacheDAO; -import org.apache.skywalking.apm.collector.storage.dao.cache.IInstanceCacheDAO; -import org.apache.skywalking.apm.collector.storage.dao.cache.INetworkAddressCacheDAO; -import org.apache.skywalking.apm.collector.storage.dao.cache.IServiceNameCacheDAO; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.register.IApplicationRegisterDAO; -import org.apache.skywalking.apm.collector.storage.dao.register.IInstanceRegisterDAO; -import org.apache.skywalking.apm.collector.storage.dao.register.INetworkAddressRegisterDAO; -import org.apache.skywalking.apm.collector.storage.dao.register.IServiceNameRegisterDAO; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.BatchShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcStorageInstaller; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.GlobalTraceShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.InstanceHeartBeatShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.SegmentDurationShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.SegmentShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.acp.ApplicationComponentDayShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.acp.ApplicationComponentHourShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.acp.ApplicationComponentMinuteShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.acp.ApplicationComponentMonthShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ApplicationAlarmListShardingjdbcDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ApplicationAlarmListShardingjdbcHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ApplicationAlarmListShardingjdbcMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ApplicationAlarmListShardingjdbcMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ApplicationAlarmShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ApplicationReferenceAlarmListShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ApplicationReferenceAlarmShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.InstanceAlarmListShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.InstanceAlarmShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.InstanceReferenceAlarmListShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.InstanceReferenceAlarmShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ServiceAlarmListShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ServiceAlarmShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ServiceReferenceAlarmListShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ServiceReferenceAlarmShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.amp.ApplicationDayMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.amp.ApplicationHourMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.amp.ApplicationMinuteMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.amp.ApplicationMonthMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ampp.ApplicationMappingDayShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ampp.ApplicationMappingHourShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ampp.ApplicationMappingMinuteShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ampp.ApplicationMappingMonthShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.armp.ApplicationReferenceDayMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.armp.ApplicationReferenceHourMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.armp.ApplicationReferenceMinuteMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.armp.ApplicationReferenceMonthMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.cache.ApplicationShardingjdbcCacheDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.cache.InstanceShardingjdbcCacheDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.cache.NetworkAddressShardingjdbcCacheDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.cache.ServiceNameShardingjdbcCacheDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.cpu.CpuDayMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.cpu.CpuHourMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.cpu.CpuMinuteMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.cpu.CpuMonthMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.gc.GCDayMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.gc.GCHourMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.gc.GCMinuteMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.gc.GCMonthMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.imp.InstanceDayMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.imp.InstanceHourMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.imp.InstanceMinuteMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.imp.InstanceMonthMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.impp.InstanceMappingDayShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.impp.InstanceMappingHourShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.impp.InstanceMappingMinuteShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.impp.InstanceMappingMonthShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.irmp.InstanceReferenceDayMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.irmp.InstanceReferenceHourMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.irmp.InstanceReferenceMinuteMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.irmp.InstanceReferenceMonthMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.memory.MemoryDayMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.memory.MemoryHourMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.memory.MemoryMinuteMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.memory.MemoryMonthMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.mpool.MemoryPoolDayMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.mpool.MemoryPoolHourMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.mpool.MemoryPoolMinuteMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.mpool.MemoryPoolMonthMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.register.ApplicationRegisterShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.register.InstanceRegisterShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.register.NetworkAddressRegisterShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.register.ServiceNameRegisterShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.rtd.ResponseTimeDistributionDayShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.rtd.ResponseTimeDistributionHourShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.rtd.ResponseTimeDistributionMinuteShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.rtd.ResponseTimeDistributionMonthShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.smp.ServiceDayMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.smp.ServiceHourMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.smp.ServiceMinuteMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.smp.ServiceMonthMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.srmp.ServiceReferenceDayMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.srmp.ServiceReferenceHourMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.srmp.ServiceReferenceMinuteMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.srmp.ServiceReferenceMonthMetricShardingjdbcPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.strategy.ShardingjdbcStrategy; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.HashMap; -import java.util.Map; - -/** - * @author linjiaqi - */ -public class StorageModuleShardingjdbcProvider extends ModuleProvider { - - private static final Logger logger = LoggerFactory.getLogger(StorageModuleShardingjdbcProvider.class); - - private ShardingjdbcClient shardingjdbcClient; - private final StorageModuleShardingjdbcConfig config; - - public StorageModuleShardingjdbcProvider() { - this.config = new StorageModuleShardingjdbcConfig(); - } - - @Override - public String name() { - return "shardingjdbc"; - } - - @Override - public Class module() { - return StorageModule.class; - } - - @Override - public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override - public void prepare() throws ServiceNotProvidedException { - Map shardingjdbcClientConfigs = createShardingjdbcClientConfigs(); - ShardingRuleConfiguration shardingRuleConfig = createShardingRule(shardingjdbcClientConfigs.size()); - shardingjdbcClient = new ShardingjdbcClient(shardingjdbcClientConfigs, shardingRuleConfig); - - this.registerServiceImplementation(IBatchDAO.class, new BatchShardingjdbcDAO(shardingjdbcClient)); - registerCacheDAO(); - registerRegisterDAO(); - registerPersistenceDAO(); - registerUiDAO(); - registerAlarmDAO(); - } - - @Override - public void start() { - try { - shardingjdbcClient.initialize(); - - ShardingjdbcStorageInstaller installer = new ShardingjdbcStorageInstaller(false); - installer.install(shardingjdbcClient); - } catch (ShardingjdbcClientException | StorageException e) { - logger.error(e.getMessage(), e); - } - } - - @Override - public void notifyAfterCompleted() { - } - - @Override - public String[] requiredModules() { - return new String[]{ClusterModule.NAME, ConfigurationModule.NAME, RemoteModule.NAME}; - } - - private Map createShardingjdbcClientConfigs() { - Map shardingjdbcClientConfigs = new HashMap(); - if (StringUtils.isEmpty(config.getUrl())) { - return shardingjdbcClientConfigs; - } - String driverClass = config.getDriverClass(); - String[] url = config.getUrl().split(","); - String[] userName = config.getUserName().split(","); - String[] password = config.getPassword().split(","); - for (int i = 0; i < url.length; i++) { - shardingjdbcClientConfigs.put(ShardingjdbcStrategy.SHARDING_DS_PREFIX + i, new ShardingjdbcClientConfig(driverClass, url[i].trim(), userName[i].trim(), password[i].trim())); - logger.info("create datasource: {}, url: {}", ShardingjdbcStrategy.SHARDING_DS_PREFIX + i, url[i].trim()); - } - return shardingjdbcClientConfigs; - } - - private ShardingRuleConfiguration createShardingRule(int shardingNodeSize) { - ShardingjdbcStrategy strategy = new ShardingjdbcStrategy(shardingNodeSize); - ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration(); - shardingRuleConfig.getTableRuleConfigs().addAll(strategy.tableRules()); - shardingRuleConfig.setDefaultDatabaseShardingStrategyConfig(strategy.defaultDatabaseSharding()); - return shardingRuleConfig; - } - - private void registerCacheDAO() throws ServiceNotProvidedException { - this.registerServiceImplementation(IApplicationCacheDAO.class, new ApplicationShardingjdbcCacheDAO(shardingjdbcClient)); - this.registerServiceImplementation(IInstanceCacheDAO.class, new InstanceShardingjdbcCacheDAO(shardingjdbcClient)); - this.registerServiceImplementation(IServiceNameCacheDAO.class, new ServiceNameShardingjdbcCacheDAO(shardingjdbcClient)); - this.registerServiceImplementation(INetworkAddressCacheDAO.class, new NetworkAddressShardingjdbcCacheDAO(shardingjdbcClient)); - } - - private void registerRegisterDAO() throws ServiceNotProvidedException { - this.registerServiceImplementation(INetworkAddressRegisterDAO.class, new NetworkAddressRegisterShardingjdbcDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationRegisterDAO.class, new ApplicationRegisterShardingjdbcDAO(shardingjdbcClient)); - this.registerServiceImplementation(IInstanceRegisterDAO.class, new InstanceRegisterShardingjdbcDAO(shardingjdbcClient)); - this.registerServiceImplementation(IServiceNameRegisterDAO.class, new ServiceNameRegisterShardingjdbcDAO(shardingjdbcClient)); - } - - private void registerPersistenceDAO() throws ServiceNotProvidedException { - this.registerServiceImplementation(ICpuMinuteMetricPersistenceDAO.class, new CpuMinuteMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(ICpuHourMetricPersistenceDAO.class, new CpuHourMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(ICpuDayMetricPersistenceDAO.class, new CpuDayMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(ICpuMonthMetricPersistenceDAO.class, new CpuMonthMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IGCMinuteMetricPersistenceDAO.class, new GCMinuteMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IGCHourMetricPersistenceDAO.class, new GCHourMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IGCDayMetricPersistenceDAO.class, new GCDayMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IGCMonthMetricPersistenceDAO.class, new GCMonthMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IMemoryMinuteMetricPersistenceDAO.class, new MemoryMinuteMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IMemoryHourMetricPersistenceDAO.class, new MemoryHourMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IMemoryDayMetricPersistenceDAO.class, new MemoryDayMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IMemoryMonthMetricPersistenceDAO.class, new MemoryMonthMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IMemoryPoolMinuteMetricPersistenceDAO.class, new MemoryPoolMinuteMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IMemoryPoolHourMetricPersistenceDAO.class, new MemoryPoolHourMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IMemoryPoolDayMetricPersistenceDAO.class, new MemoryPoolDayMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IMemoryPoolMonthMetricPersistenceDAO.class, new MemoryPoolMonthMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IGlobalTracePersistenceDAO.class, new GlobalTraceShardingjdbcPersistenceDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IResponseTimeDistributionMinutePersistenceDAO.class, new ResponseTimeDistributionMinuteShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IResponseTimeDistributionHourPersistenceDAO.class, new ResponseTimeDistributionHourShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IResponseTimeDistributionDayPersistenceDAO.class, new ResponseTimeDistributionDayShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IResponseTimeDistributionMonthPersistenceDAO.class, new ResponseTimeDistributionMonthShardingjdbcPersistenceDAO(shardingjdbcClient)); - - this.registerServiceImplementation(ISegmentDurationPersistenceDAO.class, new SegmentDurationShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(ISegmentPersistenceDAO.class, new SegmentShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IInstanceHeartBeatPersistenceDAO.class, new InstanceHeartBeatShardingjdbcPersistenceDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IApplicationComponentMinutePersistenceDAO.class, new ApplicationComponentMinuteShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationComponentHourPersistenceDAO.class, new ApplicationComponentHourShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationComponentDayPersistenceDAO.class, new ApplicationComponentDayShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationComponentMonthPersistenceDAO.class, new ApplicationComponentMonthShardingjdbcPersistenceDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IApplicationMappingMinutePersistenceDAO.class, new ApplicationMappingMinuteShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationMappingHourPersistenceDAO.class, new ApplicationMappingHourShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationMappingDayPersistenceDAO.class, new ApplicationMappingDayShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationMappingMonthPersistenceDAO.class, new ApplicationMappingMonthShardingjdbcPersistenceDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IInstanceMappingMinutePersistenceDAO.class, new InstanceMappingMinuteShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IInstanceMappingHourPersistenceDAO.class, new InstanceMappingHourShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IInstanceMappingDayPersistenceDAO.class, new InstanceMappingDayShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IInstanceMappingMonthPersistenceDAO.class, new InstanceMappingMonthShardingjdbcPersistenceDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IApplicationMinuteMetricPersistenceDAO.class, new ApplicationMinuteMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationHourMetricPersistenceDAO.class, new ApplicationHourMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationDayMetricPersistenceDAO.class, new ApplicationDayMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationMonthMetricPersistenceDAO.class, new ApplicationMonthMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IApplicationReferenceMinuteMetricPersistenceDAO.class, new ApplicationReferenceMinuteMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationReferenceHourMetricPersistenceDAO.class, new ApplicationReferenceHourMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationReferenceDayMetricPersistenceDAO.class, new ApplicationReferenceDayMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationReferenceMonthMetricPersistenceDAO.class, new ApplicationReferenceMonthMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IInstanceMinuteMetricPersistenceDAO.class, new InstanceMinuteMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IInstanceHourMetricPersistenceDAO.class, new InstanceHourMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IInstanceDayMetricPersistenceDAO.class, new InstanceDayMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IInstanceMonthMetricPersistenceDAO.class, new InstanceMonthMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IInstanceReferenceMinuteMetricPersistenceDAO.class, new InstanceReferenceMinuteMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IInstanceReferenceHourMetricPersistenceDAO.class, new InstanceReferenceHourMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IInstanceReferenceDayMetricPersistenceDAO.class, new InstanceReferenceDayMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IInstanceReferenceMonthMetricPersistenceDAO.class, new InstanceReferenceMonthMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IServiceMinuteMetricPersistenceDAO.class, new ServiceMinuteMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IServiceHourMetricPersistenceDAO.class, new ServiceHourMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IServiceDayMetricPersistenceDAO.class, new ServiceDayMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IServiceMonthMetricPersistenceDAO.class, new ServiceMonthMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IServiceReferenceMinuteMetricPersistenceDAO.class, new ServiceReferenceMinuteMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IServiceReferenceHourMetricPersistenceDAO.class, new ServiceReferenceHourMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IServiceReferenceDayMetricPersistenceDAO.class, new ServiceReferenceDayMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IServiceReferenceMonthMetricPersistenceDAO.class, new ServiceReferenceMonthMetricShardingjdbcPersistenceDAO(shardingjdbcClient)); - } - - private void registerUiDAO() throws ServiceNotProvidedException { - this.registerServiceImplementation(IInstanceUIDAO.class, new InstanceShardingjdbcUIDAO(shardingjdbcClient)); - this.registerServiceImplementation(INetworkAddressUIDAO.class, new NetworkAddressShardingjdbcUIDAO(shardingjdbcClient)); - this.registerServiceImplementation(IServiceNameServiceUIDAO.class, new ServiceNameServiceShardingjdbcUIDAO(shardingjdbcClient)); - this.registerServiceImplementation(IServiceMetricUIDAO.class, new ServiceMetricShardingjdbcUIDAO(shardingjdbcClient)); - - this.registerServiceImplementation(ICpuMetricUIDAO.class, new CpuMetricShardingjdbcUIDAO(shardingjdbcClient)); - this.registerServiceImplementation(IGCMetricUIDAO.class, new GCMetricShardingjdbcUIDAO(shardingjdbcClient)); - this.registerServiceImplementation(IMemoryMetricUIDAO.class, new MemoryMetricShardingjdbcUIDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IGlobalTraceUIDAO.class, new GlobalTraceShardingjdbcUIDAO(shardingjdbcClient)); - this.registerServiceImplementation(IInstanceMetricUIDAO.class, new InstanceMetricShardingjdbcUIDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationComponentUIDAO.class, new ApplicationComponentShardingjdbcUIDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationMappingUIDAO.class, new ApplicationMappingShardingjdbcUIDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationMetricUIDAO.class, new ApplicationMetricShardingjdbcUIDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationReferenceMetricUIDAO.class, new ApplicationReferenceMetricShardingjdbcUIDAO(shardingjdbcClient)); - this.registerServiceImplementation(ISegmentDurationUIDAO.class, new SegmentDurationShardingjdbcUIDAO(shardingjdbcClient)); - this.registerServiceImplementation(ISegmentUIDAO.class, new SegmentShardingjdbcUIDAO(shardingjdbcClient)); - this.registerServiceImplementation(IServiceReferenceMetricUIDAO.class, new ServiceReferenceShardingjdbcMetricUIDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IApplicationAlarmUIDAO.class, new ApplicationAlarmShardingjdbcUIDAO(shardingjdbcClient)); - this.registerServiceImplementation(IInstanceAlarmUIDAO.class, new InstanceAlarmShardingjdbcUIDAO(shardingjdbcClient)); - this.registerServiceImplementation(IServiceAlarmUIDAO.class, new ServiceAlarmShardingjdbcUIDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IApplicationAlarmListUIDAO.class, new ApplicationAlarmListShardingjdbcUIDAO(shardingjdbcClient)); - this.registerServiceImplementation(IResponseTimeDistributionUIDAO.class, new ResponseTimeDistributionShardingjdbcUIDAO(shardingjdbcClient)); - } - - private void registerAlarmDAO() throws ServiceNotProvidedException { - this.registerServiceImplementation(IServiceReferenceAlarmPersistenceDAO.class, new ServiceReferenceAlarmShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IServiceReferenceAlarmListPersistenceDAO.class, new ServiceReferenceAlarmListShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IInstanceReferenceAlarmPersistenceDAO.class, new InstanceReferenceAlarmShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IInstanceReferenceAlarmListPersistenceDAO.class, new InstanceReferenceAlarmListShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationReferenceAlarmPersistenceDAO.class, new ApplicationReferenceAlarmShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationReferenceAlarmListPersistenceDAO.class, new ApplicationReferenceAlarmListShardingjdbcPersistenceDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IServiceAlarmPersistenceDAO.class, new ServiceAlarmShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IServiceAlarmListPersistenceDAO.class, new ServiceAlarmListShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IInstanceAlarmPersistenceDAO.class, new InstanceAlarmShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IInstanceAlarmListPersistenceDAO.class, new InstanceAlarmListShardingjdbcPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationAlarmPersistenceDAO.class, new ApplicationAlarmShardingjdbcPersistenceDAO(shardingjdbcClient)); - - this.registerServiceImplementation(IApplicationAlarmListMinutePersistenceDAO.class, new ApplicationAlarmListShardingjdbcMinutePersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationAlarmListHourPersistenceDAO.class, new ApplicationAlarmListShardingjdbcHourPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationAlarmListDayPersistenceDAO.class, new ApplicationAlarmListShardingjdbcDayPersistenceDAO(shardingjdbcClient)); - this.registerServiceImplementation(IApplicationAlarmListMonthPersistenceDAO.class, new ApplicationAlarmListShardingjdbcMonthPersistenceDAO(shardingjdbcClient)); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/dao/AbstractPersistenceShardingjdbcDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/dao/AbstractPersistenceShardingjdbcDAO.java deleted file mode 100644 index 341e37a0380f5ba9686f4d2fca95006fe7886263..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/dao/AbstractPersistenceShardingjdbcDAO.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.core.data.CommonTable; -import org.apache.skywalking.apm.collector.core.data.StreamData; -import org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public abstract class AbstractPersistenceShardingjdbcDAO extends ShardingjdbcDAO implements IPersistenceDAO { - - private static final Logger logger = LoggerFactory.getLogger(AbstractPersistenceShardingjdbcDAO.class); - - public AbstractPersistenceShardingjdbcDAO(ShardingjdbcClient client) { - super(client); - } - - private static final String GET_SQL = "select * from {0} where {1} = ?"; - - protected abstract STREAM_DATA shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException; - - protected abstract String tableName(); - - @Override public STREAM_DATA get(String id) { - String sql = SqlBuilder.buildSql(GET_SQL, tableName(), CommonTable.ID.getName()); - - Object[] params = new Object[] {id}; - try ( - ResultSet rs = getClient().executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - return shardingjdbcDataToStreamData(rs); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return null; - } - - protected abstract Map streamDataToShardingjdbcData(STREAM_DATA streamData); - - @Override public final ShardingjdbcSqlEntity prepareBatchInsert(STREAM_DATA streamData) { - Map source = streamDataToShardingjdbcData(streamData); - source.put(CommonTable.ID.getName(), streamData.getId()); - - ShardingjdbcSqlEntity entity = new ShardingjdbcSqlEntity(); - - String sql = SqlBuilder.buildBatchInsertSql(tableName(), source.keySet()); - entity.setSql(sql); - entity.setParams(source.values().toArray(new Object[0])); - return entity; - } - - @Override public final ShardingjdbcSqlEntity prepareBatchUpdate(STREAM_DATA streamData) { - Map source = streamDataToShardingjdbcData(streamData); - - ShardingjdbcSqlEntity entity = new ShardingjdbcSqlEntity(); - String sql = SqlBuilder.buildBatchUpdateSql(tableName(), source.keySet(), CommonTable.ID.getName()); - entity.setSql(sql); - List values = new ArrayList<>(source.values()); - values.add(streamData.getId()); - entity.setParams(values.toArray(new Object[0])); - return entity; - } - - protected abstract String timeBucketColumnNameForDelete(); - - @Override public void deleteHistory(Long timeBucketBefore) { - ShardingjdbcClient client = getClient(); - - String dynamicSql = "delete from {0} where {1} <= ?"; - String sql = SqlBuilder.buildSql(dynamicSql, tableName(), timeBucketColumnNameForDelete()); - - Object[] params = new Object[] {timeBucketBefore}; - - try { - client.execute(sql, params); - logger.info("Deleted history rows from {} table.", tableName()); - } catch (ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/dao/BatchShardingjdbcDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/dao/BatchShardingjdbcDAO.java deleted file mode 100644 index 39070ec093b0ac990e572f1b75b64f0d01bd292c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/dao/BatchShardingjdbcDAO.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.storage.base.dao.IBatchDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class BatchShardingjdbcDAO extends ShardingjdbcDAO implements IBatchDAO { - - private static final Logger logger = LoggerFactory.getLogger(BatchShardingjdbcDAO.class); - - public BatchShardingjdbcDAO(ShardingjdbcClient client) { - super(client); - } - - @Override - public void batchPersistence(List batchCollection) { - if (batchCollection != null && batchCollection.size() > 0) { - logger.debug("the batch collection size is {}", batchCollection.size()); - Connection conn; - final Map batchSqls = new HashMap<>(); - try { - conn = getClient().getConnection(); - conn.setAutoCommit(true); - PreparedStatement ps; - for (Object entity : batchCollection) { - ShardingjdbcSqlEntity e = getShardingjdbcSqlEntity(entity); - String sql = e.getSql(); - if (batchSqls.containsKey(sql)) { - ps = batchSqls.get(sql); - } else { - ps = conn.prepareStatement(sql); - batchSqls.put(sql, ps); - } - - Object[] params = e.getParams(); - if (params != null) { - logger.debug("the sql is {}, params size is {}, params: {}", e.getSql(), params.length, params); - for (int i = 0; i < params.length; i++) { - ps.setObject(i + 1, params[i]); - } - } - ps.addBatch(); - } - - for (String k : batchSqls.keySet()) { - batchSqls.get(k).executeBatch(); - } - } catch (SQLException e) { - logger.error(e.getMessage(), e); - } - batchSqls.clear(); - } - } - - private ShardingjdbcSqlEntity getShardingjdbcSqlEntity(Object entity) { - if (entity instanceof ShardingjdbcSqlEntity) { - return (ShardingjdbcSqlEntity)entity; - } - return null; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/dao/ShardingjdbcDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/dao/ShardingjdbcDAO.java deleted file mode 100644 index 13f043406c19aad8f2645a19c17b614a51993b47..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/dao/ShardingjdbcDAO.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.storage.base.dao.AbstractDAO; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public abstract class ShardingjdbcDAO extends AbstractDAO { - - private static final Logger logger = LoggerFactory.getLogger(ShardingjdbcDAO.class); - - public ShardingjdbcDAO(ShardingjdbcClient client) { - super(client); - } - - protected final int getMaxId(String tableName, String columnName) { - String sql = "select max(" + columnName + ") from " + tableName; - return getIntValueBySQL(sql); - } - - protected final int getMinId(String tableName, String columnName) { - String sql = "select min(" + columnName + ") from " + tableName; - return getIntValueBySQL(sql); - } - - private int getIntValueBySQL(String sql) { - ShardingjdbcClient client = getClient(); - try ( - ResultSet rs = client.executeQuery(sql, null); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - int id = rs.getInt(1); - if (id == Integer.MAX_VALUE || id == Integer.MIN_VALUE) { - return 0; - } else { - return id; - } - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/define/ShardingjdbcColumnDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/define/ShardingjdbcColumnDefine.java deleted file mode 100644 index 7f1d28e4e940714a7fa008e82f6263a8904a4ecc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/define/ShardingjdbcColumnDefine.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define; - -import org.apache.skywalking.apm.collector.core.data.ColumnDefine; -import org.apache.skywalking.apm.collector.core.data.ColumnName; - -/** - * @author linjiaqi - */ -public class ShardingjdbcColumnDefine extends ColumnDefine { - - public ShardingjdbcColumnDefine(ColumnName columnName, String type) { - super(columnName, type); - } - - public enum Type { - Varchar, Int, Bigint, BINARY, Double, BLOB - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/define/ShardingjdbcSqlEntity.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/define/ShardingjdbcSqlEntity.java deleted file mode 100644 index 2d825759414ed2d48083801aa3b0aa0fa0cc3f1f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/define/ShardingjdbcSqlEntity.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define; - -/** - * @author linjiaqi - */ -public class ShardingjdbcSqlEntity { - private String sql; - private Object[] params; - - public String getSql() { - return sql; - } - - public void setSql(String sql) { - this.sql = sql; - } - - public Object[] getParams() { - return params; - } - - public void setParams(Object[] params) { - this.params = params; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/define/ShardingjdbcStorageInstaller.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/define/ShardingjdbcStorageInstaller.java deleted file mode 100644 index 975a2a87da2d12ecaa259ebb649a00521c016dfe..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/define/ShardingjdbcStorageInstaller.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define; - -import java.util.List; - -import org.apache.skywalking.apm.collector.client.Client; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.core.data.TableDefine; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.StorageException; -import org.apache.skywalking.apm.collector.storage.StorageInstallException; -import org.apache.skywalking.apm.collector.storage.StorageInstaller; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class ShardingjdbcStorageInstaller extends StorageInstaller { - - private static final Logger logger = LoggerFactory.getLogger(ShardingjdbcStorageInstaller.class); - - public ShardingjdbcStorageInstaller(boolean isHighPerformanceMode) { - super(isHighPerformanceMode); - } - - @Override protected void defineFilter(List tableDefines) { - int size = tableDefines.size(); - for (int i = size - 1; i >= 0; i--) { - if (!(tableDefines.get(i) instanceof ShardingjdbcTableDefine)) { - tableDefines.remove(i); - } - } - } - - @Override protected boolean isExists(Client client, TableDefine tableDefine) throws StorageException { - logger.info("check if table {} exist ", tableDefine.getName()); - return false; - } - - @Override protected void columnCheck(Client client, TableDefine tableDefine) throws StorageException { - - } - - @Override protected void deleteTable(Client client, TableDefine tableDefine) throws StorageException { - ShardingjdbcClient shardingjdbcClient = (ShardingjdbcClient)client; - try { - shardingjdbcClient.execute("DROP TABLE IF EXISTS " + tableDefine.getName()); - } catch (ShardingjdbcClientException e) { - throw new StorageInstallException(e.getMessage(), e); - } - } - - @Override protected void createTable(Client client, TableDefine tableDefine) throws StorageException { - ShardingjdbcClient shardingjdbcClient = (ShardingjdbcClient)client; - ShardingjdbcTableDefine shardingjdbcTableDefine = (ShardingjdbcTableDefine)tableDefine; - - StringBuilder sqlBuilder = new StringBuilder(); - sqlBuilder.append("CREATE TABLE IF NOT EXISTS ").append(shardingjdbcTableDefine.getName()).append(" ("); - - shardingjdbcTableDefine.getColumnDefines().forEach(columnDefine -> { - ShardingjdbcColumnDefine shardingjdbcColumnDefine = (ShardingjdbcColumnDefine)columnDefine; - if (shardingjdbcColumnDefine.getType().equals(ShardingjdbcColumnDefine.Type.Varchar.name())) { - sqlBuilder.append(shardingjdbcColumnDefine.getColumnName().getName()).append(" ").append(shardingjdbcColumnDefine.getType()).append("(255),"); - } else { - sqlBuilder.append(shardingjdbcColumnDefine.getColumnName().getName()).append(" ").append(shardingjdbcColumnDefine.getType()).append(","); - } - }); - sqlBuilder.append(" PRIMARY KEY (id)"); - if (shardingjdbcTableDefine.getIndex() != null) { - sqlBuilder.append(", KEY " + shardingjdbcTableDefine.getName() + Const.ID_SPLIT + shardingjdbcTableDefine.getIndex() + " (" + shardingjdbcTableDefine.getIndex() + ")"); - } - sqlBuilder.append(")"); - try { - logger.info("create if not exists shardingjdbc table with sql {}", sqlBuilder); - shardingjdbcClient.execute(sqlBuilder.toString()); - } catch (ShardingjdbcClientException e) { - throw new StorageInstallException(e.getMessage(), e); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/define/ShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/define/ShardingjdbcTableDefine.java deleted file mode 100644 index 639ecf0ac45c90695bc65fdcd61d6de39418a0ed..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/base/define/ShardingjdbcTableDefine.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define; - -import org.apache.skywalking.apm.collector.core.data.TableDefine; - -/** - * @author linjiaqi - */ -public abstract class ShardingjdbcTableDefine extends TableDefine { - private final String index; - - public ShardingjdbcTableDefine(String name, String index) { - super(name); - this.index = index; - } - - public String getIndex() { - return index; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/GlobalTraceShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/GlobalTraceShardingjdbcPersistenceDAO.java deleted file mode 100644 index f76b759a9e7e68585c39a9442b739cff0e39e13b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/GlobalTraceShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.IGlobalTracePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.global.GlobalTrace; -import org.apache.skywalking.apm.collector.storage.table.global.GlobalTraceTable; - -/** - * @author linjiaqi - */ -public class GlobalTraceShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO implements IGlobalTracePersistenceDAO { - - public GlobalTraceShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return GlobalTraceTable.TABLE; - } - - @Override protected GlobalTrace shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - GlobalTrace globalTrace = new GlobalTrace(); - globalTrace.setSegmentId(resultSet.getString(GlobalTraceTable.SEGMENT_ID.getName())); - globalTrace.setTraceId(resultSet.getString(GlobalTraceTable.TRACE_ID.getName())); - globalTrace.setTimeBucket(resultSet.getLong(GlobalTraceTable.TIME_BUCKET.getName())); - return globalTrace; - } - - @Override protected Map streamDataToShardingjdbcData(GlobalTrace streamData) { - Map target = new HashMap<>(); - target.put(GlobalTraceTable.SEGMENT_ID.getName(), streamData.getSegmentId()); - target.put(GlobalTraceTable.TRACE_ID.getName(), streamData.getTraceId()); - target.put(GlobalTraceTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - return target; - } - - @Override protected String timeBucketColumnNameForDelete() { - return GlobalTraceTable.TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + GlobalTraceTable.TABLE) - @Override public GlobalTrace get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/InstanceHeartBeatShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/InstanceHeartBeatShardingjdbcPersistenceDAO.java deleted file mode 100644 index 412756ae5dbd598320830b174f1037536170b421..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/InstanceHeartBeatShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao; - -import java.sql.*; -import java.util.*; -import org.apache.skywalking.apm.collector.client.shardingjdbc.*; -import org.apache.skywalking.apm.collector.core.UnexpectedException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.IInstanceHeartBeatPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.register.*; -import org.slf4j.*; - -/** - * @author linjiaqi - */ -public class InstanceHeartBeatShardingjdbcPersistenceDAO extends ShardingjdbcDAO implements IInstanceHeartBeatPersistenceDAO { - - private static final Logger logger = LoggerFactory.getLogger(InstanceHeartBeatShardingjdbcPersistenceDAO.class); - - public InstanceHeartBeatShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - private static final String GET_INSTANCE_HEARTBEAT_SQL = "select * from {0} where {1} = ?"; - - @Override public Instance get(String id) { - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(GET_INSTANCE_HEARTBEAT_SQL, InstanceTable.TABLE, InstanceTable.INSTANCE_ID.getName()); - Object[] params = new Object[] {id}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - Instance instance = new Instance(); - instance.setId(id); - instance.setInstanceId(rs.getInt(InstanceTable.INSTANCE_ID.getName())); - instance.setHeartBeatTime(rs.getLong(InstanceTable.HEARTBEAT_TIME.getName())); - return instance; - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return null; - } - - @Override public ShardingjdbcSqlEntity prepareBatchInsert(Instance data) { - throw new UnexpectedException("There is no need to merge stream data with database data."); - } - - @Override public ShardingjdbcSqlEntity prepareBatchUpdate(Instance data) { - ShardingjdbcSqlEntity entity = new ShardingjdbcSqlEntity(); - Map target = new HashMap<>(); - target.put(InstanceTable.HEARTBEAT_TIME.getName(), data.getHeartBeatTime()); - String sql = SqlBuilder.buildBatchUpdateSql(InstanceTable.TABLE, target.keySet(), InstanceTable.INSTANCE_ID.getName()); - entity.setSql(sql); - List params = new ArrayList<>(target.values()); - params.add(data.getId()); - entity.setParams(params.toArray(new Object[0])); - return entity; - } - - @Override public void deleteHistory(Long timeBucketBefore) { - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/SegmentDurationShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/SegmentDurationShardingjdbcPersistenceDAO.java deleted file mode 100644 index b8d33623044a94289c4153855da2ebb80866b699..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/SegmentDurationShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao; - -import java.util.*; - -import com.google.gson.Gson; -import org.apache.skywalking.apm.collector.client.shardingjdbc.*; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ISegmentDurationPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.segment.*; -import org.slf4j.*; - -/** - * @author linjiaqi - */ -public class SegmentDurationShardingjdbcPersistenceDAO extends ShardingjdbcDAO implements ISegmentDurationPersistenceDAO { - - private static final Logger logger = LoggerFactory.getLogger(SegmentDurationShardingjdbcPersistenceDAO.class); - - private final Gson gson = new Gson(); - - public SegmentDurationShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public SegmentDuration get(String id) { - return null; - } - - @Override public ShardingjdbcSqlEntity prepareBatchInsert(SegmentDuration data) { - logger.debug("segment cost prepareBatchInsert, getApplicationId: {}", data.getId()); - ShardingjdbcSqlEntity entity = new ShardingjdbcSqlEntity(); - Map target = new HashMap<>(); - target.put(SegmentDurationTable.ID.getName(), data.getId()); - target.put(SegmentDurationTable.SEGMENT_ID.getName(), data.getSegmentId()); - target.put(SegmentDurationTable.APPLICATION_ID.getName(), data.getApplicationId()); - target.put(SegmentDurationTable.SERVICE_NAME.getName(), gson.toJson(data.getServiceName())); - target.put(SegmentDurationTable.DURATION.getName(), data.getDuration()); - target.put(SegmentDurationTable.START_TIME.getName(), data.getStartTime()); - target.put(SegmentDurationTable.END_TIME.getName(), data.getEndTime()); - target.put(SegmentDurationTable.IS_ERROR.getName(), data.getIsError()); - target.put(SegmentDurationTable.TIME_BUCKET.getName(), data.getTimeBucket()); - logger.debug("segment cost source: {}", target.toString()); - - String sql = SqlBuilder.buildBatchInsertSql(SegmentDurationTable.TABLE, target.keySet()); - entity.setSql(sql); - entity.setParams(target.values().toArray(new Object[0])); - return entity; - } - - @Override public ShardingjdbcSqlEntity prepareBatchUpdate(SegmentDuration data) { - return null; - } - - @Override public void deleteHistory(Long timeBucketBefore) { - ShardingjdbcClient client = getClient(); - - String dynamicSql = "delete from {0} where {1} <= ?"; - String sql = SqlBuilder.buildSql(dynamicSql, SegmentDurationTable.TABLE, SegmentDurationTable.TIME_BUCKET.getName()); - - Object[] params = new Object[] {timeBucketBefore}; - - try { - client.execute(sql, params); - logger.info("Deleted history rows from {} table.", SegmentDurationTable.TABLE); - } catch (ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/SegmentShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/SegmentShardingjdbcPersistenceDAO.java deleted file mode 100644 index 6216094ad4f9758c9442c64fc39b2fae0f3cdc32..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/SegmentShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Base64; -import java.util.HashMap; -import java.util.Map; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.ISegmentPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.segment.Segment; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentTable; - -/** - * @author linjiaqi - */ -public class SegmentShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO implements ISegmentPersistenceDAO { - - public SegmentShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return SegmentTable.TABLE; - } - - @Override protected Segment shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - Segment segment = new Segment(); - segment.setDataBinary(Base64.getDecoder().decode(resultSet.getString(SegmentTable.DATA_BINARY.getName()))); - segment.setTimeBucket(resultSet.getLong(SegmentTable.TIME_BUCKET.getName())); - return segment; - } - - @Override protected Map streamDataToShardingjdbcData(Segment streamData) { - Map target = new HashMap<>(); - target.put(SegmentTable.DATA_BINARY.getName(), new String(Base64.getEncoder().encode(streamData.getDataBinary()))); - target.put(SegmentTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - return target; - } - - @Override protected String timeBucketColumnNameForDelete() { - return SegmentTable.TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + SegmentTable.TABLE) - @Override public Segment get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ServiceNameHeartBeatShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ServiceNameHeartBeatShardingjdbcPersistenceDAO.java deleted file mode 100644 index d07c6f9f8658abc02bf8471bedaebdf7e18008b8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ServiceNameHeartBeatShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.core.UnexpectedException; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.IServiceNameHeartBeatPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceNameTable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class ServiceNameHeartBeatShardingjdbcPersistenceDAO extends ShardingjdbcDAO implements IServiceNameHeartBeatPersistenceDAO { - - private static final Logger logger = LoggerFactory.getLogger(ServiceNameHeartBeatShardingjdbcPersistenceDAO.class); - - public ServiceNameHeartBeatShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - private static final String GET_SERVICENAME_HEARTBEAT_SQL = "select * from {0} where {1} = ?"; - - @GraphComputingMetric(name = "/persistence/get/" + ServiceNameTable.TABLE + "/heartbeat") - @Override public ServiceName get(String id) { - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(GET_SERVICENAME_HEARTBEAT_SQL, ServiceNameTable.TABLE, ServiceNameTable.SERVICE_ID.getName()); - Object[] params = new Object[] {id}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - ServiceName serviceName = new ServiceName(); - serviceName.setId(id); - serviceName.setServiceId(rs.getInt(ServiceNameTable.SERVICE_ID.getName())); - serviceName.setHeartBeatTime(rs.getLong(ServiceNameTable.HEARTBEAT_TIME.getName())); - return serviceName; - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return null; - } - - @Override public ShardingjdbcSqlEntity prepareBatchInsert(ServiceName data) { - throw new UnexpectedException("Received an service name heart beat message under service id= " + data.getId() + " , which doesn't exist."); - } - - @Override public ShardingjdbcSqlEntity prepareBatchUpdate(ServiceName data) { - ShardingjdbcSqlEntity entity = new ShardingjdbcSqlEntity(); - Map target = new HashMap<>(); - target.put(ServiceNameTable.HEARTBEAT_TIME.getName(), data.getHeartBeatTime()); - String sql = SqlBuilder.buildBatchUpdateSql(ServiceNameTable.TABLE, target.keySet(), ServiceNameTable.SERVICE_ID.getName()); - entity.setSql(sql); - List params = new ArrayList<>(target.values()); - params.add(data.getId()); - entity.setParams(params.toArray(new Object[0])); - return entity; - } - - @Override public void deleteHistory(Long timeBucketBefore) { - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/acp/AbstractApplicationComponentShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/acp/AbstractApplicationComponentShardingjdbcPersistenceDAO.java deleted file mode 100644 index 663f5ab94b34eeec0b900da2a00697e73c6fd56c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/acp/AbstractApplicationComponentShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.acp; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractApplicationComponentShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO { - - AbstractApplicationComponentShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return ApplicationComponentTable.TIME_BUCKET.getName(); - } - - @Override protected final ApplicationComponent shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - ApplicationComponent applicationComponent = new ApplicationComponent(); - applicationComponent.setId(resultSet.getString(ApplicationComponentTable.ID.getName())); - applicationComponent.setMetricId(resultSet.getString(ApplicationComponentTable.METRIC_ID.getName())); - - applicationComponent.setComponentId(resultSet.getInt(ApplicationComponentTable.COMPONENT_ID.getName())); - applicationComponent.setApplicationId(resultSet.getInt(ApplicationComponentTable.APPLICATION_ID.getName())); - applicationComponent.setTimeBucket(resultSet.getLong(ApplicationComponentTable.TIME_BUCKET.getName())); - return applicationComponent; - } - - @Override protected final Map streamDataToShardingjdbcData(ApplicationComponent streamData) { - Map target = new HashMap<>(); - target.put(ApplicationComponentTable.ID.getName(), streamData.getId()); - target.put(ApplicationComponentTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(ApplicationComponentTable.COMPONENT_ID.getName(), streamData.getComponentId()); - target.put(ApplicationComponentTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - target.put(ApplicationComponentTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + ApplicationComponentTable.TABLE) - @Override public final ApplicationComponent get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/acp/ApplicationComponentDayShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/acp/ApplicationComponentDayShardingjdbcPersistenceDAO.java deleted file mode 100644 index ae60741f77aa4528a5bb4fc685d818e1698ebb60..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/acp/ApplicationComponentDayShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.acp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author linjiaqi - */ -public class ApplicationComponentDayShardingjdbcPersistenceDAO extends AbstractApplicationComponentShardingjdbcPersistenceDAO implements IApplicationComponentDayPersistenceDAO { - - public ApplicationComponentDayShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/acp/ApplicationComponentHourShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/acp/ApplicationComponentHourShardingjdbcPersistenceDAO.java deleted file mode 100644 index 0b5ba076e3ee38dbb1881557985571be072ff33f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/acp/ApplicationComponentHourShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.acp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author linjiaqi - */ -public class ApplicationComponentHourShardingjdbcPersistenceDAO extends AbstractApplicationComponentShardingjdbcPersistenceDAO implements IApplicationComponentHourPersistenceDAO { - - public ApplicationComponentHourShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/acp/ApplicationComponentMinuteShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/acp/ApplicationComponentMinuteShardingjdbcPersistenceDAO.java deleted file mode 100644 index 742a3a8043d39fd3634484558642ce73af56174f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/acp/ApplicationComponentMinuteShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.acp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author linjiaqi - */ -public class ApplicationComponentMinuteShardingjdbcPersistenceDAO extends AbstractApplicationComponentShardingjdbcPersistenceDAO implements IApplicationComponentMinutePersistenceDAO { - - public ApplicationComponentMinuteShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/acp/ApplicationComponentMonthShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/acp/ApplicationComponentMonthShardingjdbcPersistenceDAO.java deleted file mode 100644 index 92810bf546b76682d060729c9a402aeffc4364dc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/acp/ApplicationComponentMonthShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.acp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponent; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author linjiaqi - */ -public class ApplicationComponentMonthShardingjdbcPersistenceDAO extends AbstractApplicationComponentShardingjdbcPersistenceDAO implements IApplicationComponentMonthPersistenceDAO { - - public ApplicationComponentMonthShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/AbstractApplicationAlarmListShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/AbstractApplicationAlarmListShardingjdbcPersistenceDAO.java deleted file mode 100644 index 68fc79eafc2daa1d7182f39812a30093a201e035..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/AbstractApplicationAlarmListShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractApplicationAlarmListShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO { - - AbstractApplicationAlarmListShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return ApplicationAlarmListTable.TIME_BUCKET.getName(); - } - - @Override protected final ApplicationAlarmList shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - ApplicationAlarmList applicationAlarmList = new ApplicationAlarmList(); - applicationAlarmList.setId(resultSet.getString(ApplicationAlarmListTable.ID.getName())); - applicationAlarmList.setMetricId(resultSet.getString(ApplicationAlarmListTable.METRIC_ID.getName())); - applicationAlarmList.setSourceValue(resultSet.getInt(ApplicationAlarmListTable.SOURCE_VALUE.getName())); - - applicationAlarmList.setAlarmType(resultSet.getInt(ApplicationAlarmListTable.ALARM_TYPE.getName())); - - applicationAlarmList.setApplicationId(resultSet.getInt(ApplicationAlarmListTable.APPLICATION_ID.getName())); - - applicationAlarmList.setTimeBucket(resultSet.getLong(ApplicationAlarmListTable.TIME_BUCKET.getName())); - applicationAlarmList.setAlarmContent(resultSet.getString(ApplicationAlarmListTable.ALARM_CONTENT.getName())); - - return applicationAlarmList; - } - - @Override protected final Map streamDataToShardingjdbcData(ApplicationAlarmList streamData) { - Map target = new HashMap<>(); - target.put(ApplicationAlarmListTable.ID.getName(), streamData.getId()); - target.put(ApplicationAlarmListTable.METRIC_ID.getName(), streamData.getMetricId()); - target.put(ApplicationAlarmListTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(ApplicationAlarmListTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(ApplicationAlarmListTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - - target.put(ApplicationAlarmListTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - target.put(ApplicationAlarmListTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + ApplicationAlarmListTable.TABLE) - @Override public final ApplicationAlarmList get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationAlarmListShardingjdbcDayPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationAlarmListShardingjdbcDayPersistenceDAO.java deleted file mode 100644 index 3765055def7074eea6d24634aaaecb379e97d839..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationAlarmListShardingjdbcDayPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author linjiaqi - */ -public class ApplicationAlarmListShardingjdbcDayPersistenceDAO extends AbstractApplicationAlarmListShardingjdbcPersistenceDAO implements IApplicationAlarmListDayPersistenceDAO { - - public ApplicationAlarmListShardingjdbcDayPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationAlarmListShardingjdbcHourPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationAlarmListShardingjdbcHourPersistenceDAO.java deleted file mode 100644 index 1995582cbbadd7fc115df3f88f2588444911848e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationAlarmListShardingjdbcHourPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author linjiaqi - */ -public class ApplicationAlarmListShardingjdbcHourPersistenceDAO extends AbstractApplicationAlarmListShardingjdbcPersistenceDAO implements IApplicationAlarmListHourPersistenceDAO { - - public ApplicationAlarmListShardingjdbcHourPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationAlarmListShardingjdbcMinutePersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationAlarmListShardingjdbcMinutePersistenceDAO.java deleted file mode 100644 index 5672b4509755dc6959924cd647b783fb506c52ab..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationAlarmListShardingjdbcMinutePersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author linjiaqi - */ -public class ApplicationAlarmListShardingjdbcMinutePersistenceDAO extends AbstractApplicationAlarmListShardingjdbcPersistenceDAO implements IApplicationAlarmListMinutePersistenceDAO { - - public ApplicationAlarmListShardingjdbcMinutePersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationAlarmListShardingjdbcMonthPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationAlarmListShardingjdbcMonthPersistenceDAO.java deleted file mode 100644 index bbf1b8da5518467bd5151f7718fcaea4b34dd80c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationAlarmListShardingjdbcMonthPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author linjiaqi - */ -public class ApplicationAlarmListShardingjdbcMonthPersistenceDAO extends AbstractApplicationAlarmListShardingjdbcPersistenceDAO implements IApplicationAlarmListMonthPersistenceDAO { - - public ApplicationAlarmListShardingjdbcMonthPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationAlarmShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationAlarmShardingjdbcPersistenceDAO.java deleted file mode 100644 index ae5ee843360d2da23aac9977bc71ed0f08779f62..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationAlarmShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmTable; - -/** - * @author linjiaqi - */ -public class ApplicationAlarmShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO implements IApplicationAlarmPersistenceDAO { - - public ApplicationAlarmShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationAlarmTable.TABLE; - } - - @Override protected ApplicationAlarm shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - ApplicationAlarm applicationAlarm = new ApplicationAlarm(); - applicationAlarm.setId(resultSet.getString(ApplicationAlarmTable.ID.getName())); - applicationAlarm.setSourceValue(resultSet.getInt(ApplicationAlarmTable.SOURCE_VALUE.getName())); - - applicationAlarm.setAlarmType(resultSet.getInt(ApplicationAlarmTable.ALARM_TYPE.getName())); - - applicationAlarm.setApplicationId(resultSet.getInt(ApplicationAlarmTable.APPLICATION_ID.getName())); - - applicationAlarm.setLastTimeBucket(resultSet.getLong(ApplicationAlarmTable.LAST_TIME_BUCKET.getName())); - applicationAlarm.setAlarmContent(resultSet.getString(ApplicationAlarmTable.ALARM_CONTENT.getName())); - - return applicationAlarm; - } - - @Override protected Map streamDataToShardingjdbcData(ApplicationAlarm streamData) { - Map target = new HashMap<>(); - target.put(ApplicationAlarmTable.ID.getName(), streamData.getId()); - target.put(ApplicationAlarmTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(ApplicationAlarmTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(ApplicationAlarmTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - - target.put(ApplicationAlarmTable.LAST_TIME_BUCKET.getName(), streamData.getLastTimeBucket()); - target.put(ApplicationAlarmTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } - - @Override protected String timeBucketColumnNameForDelete() { - return ApplicationAlarmTable.LAST_TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + ApplicationAlarmTable.TABLE) - @Override public ApplicationAlarm get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationReferenceAlarmListShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationReferenceAlarmListShardingjdbcPersistenceDAO.java deleted file mode 100644 index d951449d40b0cad071e0e106f3207af92ddd9882..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationReferenceAlarmListShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationReferenceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmListTable; - -/** - * @author linjiaqi - */ -public class ApplicationReferenceAlarmListShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO implements IApplicationReferenceAlarmListPersistenceDAO { - - public ApplicationReferenceAlarmListShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationReferenceAlarmListTable.TABLE; - } - - @Override protected ApplicationReferenceAlarmList shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - ApplicationReferenceAlarmList applicationReferenceAlarmList = new ApplicationReferenceAlarmList(); - applicationReferenceAlarmList.setId(resultSet.getString(ApplicationReferenceAlarmListTable.ID.getName())); - applicationReferenceAlarmList.setSourceValue(resultSet.getInt(ApplicationReferenceAlarmListTable.SOURCE_VALUE.getName())); - - applicationReferenceAlarmList.setAlarmType(resultSet.getInt(ApplicationReferenceAlarmListTable.ALARM_TYPE.getName())); - - applicationReferenceAlarmList.setFrontApplicationId(resultSet.getInt(ApplicationReferenceAlarmListTable.FRONT_APPLICATION_ID.getName())); - applicationReferenceAlarmList.setBehindApplicationId(resultSet.getInt(ApplicationReferenceAlarmListTable.BEHIND_APPLICATION_ID.getName())); - - applicationReferenceAlarmList.setTimeBucket(resultSet.getLong(ApplicationReferenceAlarmListTable.TIME_BUCKET.getName())); - applicationReferenceAlarmList.setAlarmContent(resultSet.getString(ApplicationReferenceAlarmListTable.ALARM_CONTENT.getName())); - - return applicationReferenceAlarmList; - } - - @Override protected Map streamDataToShardingjdbcData(ApplicationReferenceAlarmList streamData) { - Map target = new HashMap<>(); - target.put(ApplicationReferenceAlarmListTable.ID.getName(), streamData.getId()); - target.put(ApplicationReferenceAlarmListTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(ApplicationReferenceAlarmListTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(ApplicationReferenceAlarmListTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()); - target.put(ApplicationReferenceAlarmListTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()); - - target.put(ApplicationReferenceAlarmListTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - target.put(ApplicationReferenceAlarmListTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } - - @Override protected String timeBucketColumnNameForDelete() { - return ApplicationReferenceAlarmListTable.TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + ApplicationReferenceAlarmListTable.TABLE) - @Override public ApplicationReferenceAlarmList get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationReferenceAlarmShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationReferenceAlarmShardingjdbcPersistenceDAO.java deleted file mode 100644 index 066deff7f347e891fe75b4f44ebfd0ce57bb8e8f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ApplicationReferenceAlarmShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationReferenceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmTable; - -/** - * @author linjiaqi - */ -public class ApplicationReferenceAlarmShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO implements IApplicationReferenceAlarmPersistenceDAO { - - public ApplicationReferenceAlarmShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationReferenceAlarmTable.TABLE; - } - - @Override protected ApplicationReferenceAlarm shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - ApplicationReferenceAlarm applicationReferenceAlarm = new ApplicationReferenceAlarm(); - applicationReferenceAlarm.setId(resultSet.getString(ApplicationReferenceAlarmTable.ID.getName())); - applicationReferenceAlarm.setSourceValue(resultSet.getInt(ApplicationReferenceAlarmTable.SOURCE_VALUE.getName())); - - applicationReferenceAlarm.setAlarmType(resultSet.getInt(ApplicationReferenceAlarmTable.ALARM_TYPE.getName())); - - applicationReferenceAlarm.setFrontApplicationId(resultSet.getInt(ApplicationReferenceAlarmTable.FRONT_APPLICATION_ID.getName())); - applicationReferenceAlarm.setBehindApplicationId(resultSet.getInt(ApplicationReferenceAlarmTable.BEHIND_APPLICATION_ID.getName())); - - applicationReferenceAlarm.setLastTimeBucket(resultSet.getLong(ApplicationReferenceAlarmTable.LAST_TIME_BUCKET.getName())); - applicationReferenceAlarm.setAlarmContent(resultSet.getString(ApplicationReferenceAlarmTable.ALARM_CONTENT.getName())); - - return applicationReferenceAlarm; - } - - @Override protected Map streamDataToShardingjdbcData(ApplicationReferenceAlarm streamData) { - Map target = new HashMap<>(); - target.put(ApplicationReferenceAlarmTable.ID.getName(), streamData.getId()); - target.put(ApplicationReferenceAlarmTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(ApplicationReferenceAlarmTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(ApplicationReferenceAlarmTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()); - target.put(ApplicationReferenceAlarmTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()); - - target.put(ApplicationReferenceAlarmTable.LAST_TIME_BUCKET.getName(), streamData.getLastTimeBucket()); - target.put(ApplicationReferenceAlarmTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } - - @Override protected String timeBucketColumnNameForDelete() { - return ApplicationReferenceAlarmTable.LAST_TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + ApplicationReferenceAlarmTable.TABLE) - @Override public final ApplicationReferenceAlarm get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/InstanceAlarmListShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/InstanceAlarmListShardingjdbcPersistenceDAO.java deleted file mode 100644 index dd1ce877be34e2316c7a2ee49c507aa5c6dd3b2f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/InstanceAlarmListShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmListTable; - -/** - * @author linjiaqi - */ -public class InstanceAlarmListShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO implements IInstanceAlarmListPersistenceDAO { - - public InstanceAlarmListShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceAlarmListTable.TABLE; - } - - @Override protected InstanceAlarmList shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - InstanceAlarmList instanceAlarmList = new InstanceAlarmList(); - instanceAlarmList.setId(resultSet.getString(InstanceAlarmListTable.ID.getName())); - instanceAlarmList.setSourceValue(resultSet.getInt(InstanceAlarmListTable.SOURCE_VALUE.getName())); - - instanceAlarmList.setAlarmType(resultSet.getInt(InstanceAlarmListTable.ALARM_TYPE.getName())); - - instanceAlarmList.setApplicationId(resultSet.getInt(InstanceAlarmListTable.APPLICATION_ID.getName())); - instanceAlarmList.setInstanceId(resultSet.getInt(InstanceAlarmListTable.INSTANCE_ID.getName())); - - instanceAlarmList.setTimeBucket(resultSet.getLong(InstanceAlarmListTable.TIME_BUCKET.getName())); - instanceAlarmList.setAlarmContent(resultSet.getString(InstanceAlarmListTable.ALARM_CONTENT.getName())); - - return instanceAlarmList; - } - - @Override protected Map streamDataToShardingjdbcData(InstanceAlarmList streamData) { - Map target = new HashMap<>(); - target.put(InstanceAlarmListTable.ID.getName(), streamData.getId()); - target.put(InstanceAlarmListTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(InstanceAlarmListTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(InstanceAlarmListTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - target.put(InstanceAlarmListTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - - target.put(InstanceAlarmListTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - target.put(InstanceAlarmListTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } - - @Override protected String timeBucketColumnNameForDelete() { - return InstanceAlarmListTable.TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + InstanceAlarmListTable.TABLE) - @Override public InstanceAlarmList get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/InstanceAlarmShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/InstanceAlarmShardingjdbcPersistenceDAO.java deleted file mode 100644 index ad346cc0719b1a43c5777b20471eeeced7958bca..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/InstanceAlarmShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmTable; - -/** - * @author linjiaqi - */ -public class InstanceAlarmShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO implements IInstanceAlarmPersistenceDAO { - - public InstanceAlarmShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceAlarmTable.TABLE; - } - - @Override protected InstanceAlarm shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - InstanceAlarm instanceAlarm = new InstanceAlarm(); - instanceAlarm.setId(resultSet.getString(InstanceAlarmTable.ID.getName())); - instanceAlarm.setSourceValue(resultSet.getInt(InstanceAlarmTable.SOURCE_VALUE.getName())); - - instanceAlarm.setAlarmType(resultSet.getInt(InstanceAlarmTable.ALARM_TYPE.getName())); - - instanceAlarm.setApplicationId(resultSet.getInt(InstanceAlarmTable.APPLICATION_ID.getName())); - instanceAlarm.setInstanceId(resultSet.getInt(InstanceAlarmTable.INSTANCE_ID.getName())); - - instanceAlarm.setLastTimeBucket(resultSet.getLong(InstanceAlarmTable.LAST_TIME_BUCKET.getName())); - instanceAlarm.setAlarmContent(resultSet.getString(InstanceAlarmTable.ALARM_CONTENT.getName())); - - return instanceAlarm; - } - - @Override protected Map streamDataToShardingjdbcData(InstanceAlarm streamData) { - Map target = new HashMap<>(); - target.put(InstanceAlarmTable.ID.getName(), streamData.getId()); - target.put(InstanceAlarmTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(InstanceAlarmTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(InstanceAlarmTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - target.put(InstanceAlarmTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - - target.put(InstanceAlarmTable.LAST_TIME_BUCKET.getName(), streamData.getLastTimeBucket()); - target.put(InstanceAlarmTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } - - @Override protected String timeBucketColumnNameForDelete() { - return InstanceAlarmTable.LAST_TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + InstanceAlarmTable.TABLE) - @Override public InstanceAlarm get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/InstanceReferenceAlarmListShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/InstanceReferenceAlarmListShardingjdbcPersistenceDAO.java deleted file mode 100644 index a9982fce9dbcd14f8ab3682d45b34c0103deb54f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/InstanceReferenceAlarmListShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceReferenceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmListTable; - -/** - * @author linjiaqi - */ -public class InstanceReferenceAlarmListShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO implements IInstanceReferenceAlarmListPersistenceDAO { - - public InstanceReferenceAlarmListShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceReferenceAlarmListTable.TABLE; - } - - @Override protected InstanceReferenceAlarmList shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - InstanceReferenceAlarmList instanceReferenceAlarmList = new InstanceReferenceAlarmList(); - instanceReferenceAlarmList.setId(resultSet.getString(InstanceReferenceAlarmListTable.ID.getName())); - instanceReferenceAlarmList.setSourceValue(resultSet.getInt(InstanceReferenceAlarmListTable.SOURCE_VALUE.getName())); - - instanceReferenceAlarmList.setAlarmType(resultSet.getInt(InstanceReferenceAlarmListTable.ALARM_TYPE.getName())); - - instanceReferenceAlarmList.setFrontApplicationId(resultSet.getInt(InstanceReferenceAlarmListTable.FRONT_APPLICATION_ID.getName())); - instanceReferenceAlarmList.setFrontInstanceId(resultSet.getInt(InstanceReferenceAlarmListTable.FRONT_INSTANCE_ID.getName())); - instanceReferenceAlarmList.setBehindApplicationId(resultSet.getInt(InstanceReferenceAlarmListTable.BEHIND_APPLICATION_ID.getName())); - instanceReferenceAlarmList.setBehindInstanceId(resultSet.getInt(InstanceReferenceAlarmListTable.BEHIND_INSTANCE_ID.getName())); - - instanceReferenceAlarmList.setTimeBucket(resultSet.getLong(InstanceReferenceAlarmListTable.TIME_BUCKET.getName())); - instanceReferenceAlarmList.setAlarmContent(resultSet.getString(InstanceReferenceAlarmListTable.ALARM_CONTENT.getName())); - - return instanceReferenceAlarmList; - } - - @Override protected Map streamDataToShardingjdbcData(InstanceReferenceAlarmList streamData) { - Map target = new HashMap<>(); - target.put(InstanceReferenceAlarmListTable.ID.getName(), streamData.getId()); - target.put(InstanceReferenceAlarmListTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(InstanceReferenceAlarmListTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(InstanceReferenceAlarmListTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()); - target.put(InstanceReferenceAlarmListTable.FRONT_INSTANCE_ID.getName(), streamData.getFrontInstanceId()); - target.put(InstanceReferenceAlarmListTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()); - target.put(InstanceReferenceAlarmListTable.BEHIND_INSTANCE_ID.getName(), streamData.getBehindInstanceId()); - - target.put(InstanceReferenceAlarmListTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - target.put(InstanceReferenceAlarmListTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } - - @Override protected String timeBucketColumnNameForDelete() { - return InstanceReferenceAlarmListTable.TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + InstanceReferenceAlarmListTable.TABLE) - @Override public InstanceReferenceAlarmList get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/InstanceReferenceAlarmShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/InstanceReferenceAlarmShardingjdbcPersistenceDAO.java deleted file mode 100644 index 4046357c3cdbe780e1dd893310569e13c5e5c511..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/InstanceReferenceAlarmShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceReferenceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmTable; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmTable; - -/** - * @author linjiaqi - */ -public class InstanceReferenceAlarmShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO implements IInstanceReferenceAlarmPersistenceDAO { - - public InstanceReferenceAlarmShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceReferenceAlarmTable.TABLE; - } - - @Override protected InstanceReferenceAlarm shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - InstanceReferenceAlarm instanceReferenceAlarm = new InstanceReferenceAlarm(); - instanceReferenceAlarm.setId(resultSet.getString(ServiceReferenceAlarmTable.ID.getName())); - instanceReferenceAlarm.setSourceValue(resultSet.getInt(ServiceReferenceAlarmTable.SOURCE_VALUE.getName())); - - instanceReferenceAlarm.setAlarmType(resultSet.getInt(ServiceReferenceAlarmTable.ALARM_TYPE.getName())); - - instanceReferenceAlarm.setFrontApplicationId(resultSet.getInt(ServiceReferenceAlarmTable.FRONT_APPLICATION_ID.getName())); - instanceReferenceAlarm.setFrontInstanceId(resultSet.getInt(ServiceReferenceAlarmTable.FRONT_INSTANCE_ID.getName())); - instanceReferenceAlarm.setBehindApplicationId(resultSet.getInt(ServiceReferenceAlarmTable.BEHIND_APPLICATION_ID.getName())); - instanceReferenceAlarm.setBehindInstanceId(resultSet.getInt(ServiceReferenceAlarmTable.BEHIND_INSTANCE_ID.getName())); - - instanceReferenceAlarm.setLastTimeBucket(resultSet.getLong(ServiceReferenceAlarmTable.LAST_TIME_BUCKET.getName())); - instanceReferenceAlarm.setAlarmContent(resultSet.getString(ServiceReferenceAlarmTable.ALARM_CONTENT.getName())); - - return instanceReferenceAlarm; - } - - @Override protected Map streamDataToShardingjdbcData(InstanceReferenceAlarm streamData) { - Map target = new HashMap<>(); - target.put(ServiceReferenceAlarmTable.ID.getName(), streamData.getId()); - target.put(ServiceReferenceAlarmTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(ServiceReferenceAlarmTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(ServiceReferenceAlarmTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()); - target.put(ServiceReferenceAlarmTable.FRONT_INSTANCE_ID.getName(), streamData.getFrontInstanceId()); - target.put(ServiceReferenceAlarmTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()); - target.put(ServiceReferenceAlarmTable.BEHIND_INSTANCE_ID.getName(), streamData.getBehindInstanceId()); - - target.put(ServiceReferenceAlarmTable.LAST_TIME_BUCKET.getName(), streamData.getLastTimeBucket()); - target.put(ServiceReferenceAlarmTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } - - @Override protected String timeBucketColumnNameForDelete() { - return InstanceReferenceAlarmTable.LAST_TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + InstanceReferenceAlarmTable.TABLE) - @Override public InstanceReferenceAlarm get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ServiceAlarmListShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ServiceAlarmListShardingjdbcPersistenceDAO.java deleted file mode 100644 index 2e92c09d3827fb931540038256282645293daaf3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ServiceAlarmListShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmListTable; - -/** - * @author linjiaqi - */ -public class ServiceAlarmListShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO implements IServiceAlarmListPersistenceDAO { - - public ServiceAlarmListShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceAlarmListTable.TABLE; - } - - @Override protected ServiceAlarmList shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - ServiceAlarmList serviceAlarmList = new ServiceAlarmList(); - serviceAlarmList.setId(resultSet.getString(ServiceAlarmListTable.ID.getName())); - serviceAlarmList.setSourceValue(resultSet.getInt(ServiceAlarmListTable.SOURCE_VALUE.getName())); - - serviceAlarmList.setAlarmType(resultSet.getInt(ServiceAlarmListTable.ALARM_TYPE.getName())); - - serviceAlarmList.setApplicationId(resultSet.getInt(ServiceAlarmListTable.APPLICATION_ID.getName())); - serviceAlarmList.setInstanceId(resultSet.getInt(ServiceAlarmListTable.INSTANCE_ID.getName())); - serviceAlarmList.setServiceId(resultSet.getInt(ServiceAlarmListTable.SERVICE_ID.getName())); - - serviceAlarmList.setTimeBucket(resultSet.getLong(ServiceAlarmListTable.TIME_BUCKET.getName())); - serviceAlarmList.setAlarmContent(resultSet.getString(ServiceAlarmListTable.ALARM_CONTENT.getName())); - - return serviceAlarmList; - } - - @Override protected Map streamDataToShardingjdbcData(ServiceAlarmList streamData) { - Map target = new HashMap<>(); - target.put(ServiceAlarmListTable.ID.getName(), streamData.getId()); - target.put(ServiceAlarmListTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(ServiceAlarmListTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(ServiceAlarmListTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - target.put(ServiceAlarmListTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - target.put(ServiceAlarmListTable.SERVICE_ID.getName(), streamData.getServiceId()); - - target.put(ServiceAlarmListTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - target.put(ServiceAlarmListTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } - - @Override protected String timeBucketColumnNameForDelete() { - return ServiceAlarmListTable.TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + ServiceAlarmListTable.TABLE) - @Override public ServiceAlarmList get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ServiceAlarmShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ServiceAlarmShardingjdbcPersistenceDAO.java deleted file mode 100644 index babda2f0893ba78856759805d0745dd5659f46be..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ServiceAlarmShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmTable; - -/** - * @author linjiaqi - */ -public class ServiceAlarmShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO implements IServiceAlarmPersistenceDAO { - - public ServiceAlarmShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceAlarmTable.TABLE; - } - - @Override protected ServiceAlarm shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - ServiceAlarm serviceAlarm = new ServiceAlarm(); - serviceAlarm.setId(resultSet.getString(ServiceAlarmTable.ID.getName())); - serviceAlarm.setSourceValue(resultSet.getInt(ServiceAlarmTable.SOURCE_VALUE.getName())); - - serviceAlarm.setAlarmType(resultSet.getInt(ServiceAlarmTable.ALARM_TYPE.getName())); - - serviceAlarm.setApplicationId(resultSet.getInt(ServiceAlarmTable.APPLICATION_ID.getName())); - serviceAlarm.setInstanceId(resultSet.getInt(ServiceAlarmTable.INSTANCE_ID.getName())); - serviceAlarm.setServiceId(resultSet.getInt(ServiceAlarmTable.SERVICE_ID.getName())); - - serviceAlarm.setLastTimeBucket(resultSet.getLong(ServiceAlarmTable.LAST_TIME_BUCKET.getName())); - serviceAlarm.setAlarmContent(resultSet.getString(ServiceAlarmTable.ALARM_CONTENT.getName())); - - return serviceAlarm; - } - - @Override protected Map streamDataToShardingjdbcData(ServiceAlarm streamData) { - Map target = new HashMap<>(); - target.put(ServiceAlarmTable.ID.getName(), streamData.getId()); - target.put(ServiceAlarmTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(ServiceAlarmTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(ServiceAlarmTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - target.put(ServiceAlarmTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - target.put(ServiceAlarmTable.SERVICE_ID.getName(), streamData.getServiceId()); - - target.put(ServiceAlarmTable.LAST_TIME_BUCKET.getName(), streamData.getLastTimeBucket()); - target.put(ServiceAlarmTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } - - @Override protected String timeBucketColumnNameForDelete() { - return ServiceAlarmTable.LAST_TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + ServiceAlarmTable.TABLE) - @Override public ServiceAlarm get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ServiceReferenceAlarmListShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ServiceReferenceAlarmListShardingjdbcPersistenceDAO.java deleted file mode 100644 index 21971fcc0ac4effcce524eff4e888386d9eff0d6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ServiceReferenceAlarmListShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceReferenceAlarmListPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmList; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmListTable; - -/** - * @author linjiaqi - */ -public class ServiceReferenceAlarmListShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO implements IServiceReferenceAlarmListPersistenceDAO { - - public ServiceReferenceAlarmListShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceReferenceAlarmListTable.TABLE; - } - - @Override protected ServiceReferenceAlarmList shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - ServiceReferenceAlarmList serviceReferenceAlarmList = new ServiceReferenceAlarmList(); - serviceReferenceAlarmList.setId(resultSet.getString(ServiceReferenceAlarmListTable.ID.getName())); - serviceReferenceAlarmList.setSourceValue(resultSet.getInt(ServiceReferenceAlarmListTable.SOURCE_VALUE.getName())); - - serviceReferenceAlarmList.setAlarmType(resultSet.getInt(ServiceReferenceAlarmListTable.ALARM_TYPE.getName())); - - serviceReferenceAlarmList.setFrontApplicationId(resultSet.getInt(ServiceReferenceAlarmListTable.FRONT_APPLICATION_ID.getName())); - serviceReferenceAlarmList.setFrontInstanceId(resultSet.getInt(ServiceReferenceAlarmListTable.FRONT_INSTANCE_ID.getName())); - serviceReferenceAlarmList.setFrontServiceId(resultSet.getInt(ServiceReferenceAlarmListTable.FRONT_SERVICE_ID.getName())); - serviceReferenceAlarmList.setBehindApplicationId(resultSet.getInt(ServiceReferenceAlarmListTable.BEHIND_APPLICATION_ID.getName())); - serviceReferenceAlarmList.setBehindInstanceId(resultSet.getInt(ServiceReferenceAlarmListTable.BEHIND_INSTANCE_ID.getName())); - serviceReferenceAlarmList.setBehindServiceId(resultSet.getInt(ServiceReferenceAlarmListTable.BEHIND_SERVICE_ID.getName())); - - serviceReferenceAlarmList.setTimeBucket(resultSet.getLong(ServiceReferenceAlarmListTable.TIME_BUCKET.getName())); - serviceReferenceAlarmList.setAlarmContent(resultSet.getString(ServiceReferenceAlarmListTable.ALARM_CONTENT.getName())); - - return serviceReferenceAlarmList; - } - - @Override protected Map streamDataToShardingjdbcData(ServiceReferenceAlarmList streamData) { - Map target = new HashMap<>(); - target.put(ServiceReferenceAlarmListTable.ID.getName(), streamData.getId()); - target.put(ServiceReferenceAlarmListTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(ServiceReferenceAlarmListTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(ServiceReferenceAlarmListTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()); - target.put(ServiceReferenceAlarmListTable.FRONT_INSTANCE_ID.getName(), streamData.getFrontInstanceId()); - target.put(ServiceReferenceAlarmListTable.FRONT_SERVICE_ID.getName(), streamData.getFrontServiceId()); - target.put(ServiceReferenceAlarmListTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()); - target.put(ServiceReferenceAlarmListTable.BEHIND_INSTANCE_ID.getName(), streamData.getBehindInstanceId()); - target.put(ServiceReferenceAlarmListTable.BEHIND_SERVICE_ID.getName(), streamData.getBehindServiceId()); - - target.put(ServiceReferenceAlarmListTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - target.put(ServiceReferenceAlarmListTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } - - @Override protected String timeBucketColumnNameForDelete() { - return ServiceReferenceAlarmListTable.TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + ServiceReferenceAlarmListTable.TABLE) - @Override public ServiceReferenceAlarmList get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ServiceReferenceAlarmShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ServiceReferenceAlarmShardingjdbcPersistenceDAO.java deleted file mode 100644 index afd94af711c114a8b6ca5ae9b8c00db54568ed88..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/alarm/ServiceReferenceAlarmShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceReferenceAlarmPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarm; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmTable; - -/** - * @author linjiaqi - */ -public class ServiceReferenceAlarmShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO implements IServiceReferenceAlarmPersistenceDAO { - - public ServiceReferenceAlarmShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceReferenceAlarmTable.TABLE; - } - - @Override protected ServiceReferenceAlarm shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - ServiceReferenceAlarm serviceReferenceAlarm = new ServiceReferenceAlarm(); - serviceReferenceAlarm.setId(resultSet.getString(ServiceReferenceAlarmTable.ID.getName())); - serviceReferenceAlarm.setSourceValue(resultSet.getInt(ServiceReferenceAlarmTable.SOURCE_VALUE.getName())); - - serviceReferenceAlarm.setAlarmType(resultSet.getInt(ServiceReferenceAlarmTable.ALARM_TYPE.getName())); - - serviceReferenceAlarm.setFrontApplicationId(resultSet.getInt(ServiceReferenceAlarmTable.FRONT_APPLICATION_ID.getName())); - serviceReferenceAlarm.setFrontInstanceId(resultSet.getInt(ServiceReferenceAlarmTable.FRONT_INSTANCE_ID.getName())); - serviceReferenceAlarm.setFrontServiceId(resultSet.getInt(ServiceReferenceAlarmTable.FRONT_SERVICE_ID.getName())); - serviceReferenceAlarm.setBehindApplicationId(resultSet.getInt(ServiceReferenceAlarmTable.BEHIND_APPLICATION_ID.getName())); - serviceReferenceAlarm.setBehindInstanceId(resultSet.getInt(ServiceReferenceAlarmTable.BEHIND_INSTANCE_ID.getName())); - serviceReferenceAlarm.setBehindServiceId(resultSet.getInt(ServiceReferenceAlarmTable.BEHIND_SERVICE_ID.getName())); - - serviceReferenceAlarm.setLastTimeBucket(resultSet.getLong(ServiceReferenceAlarmTable.LAST_TIME_BUCKET.getName())); - serviceReferenceAlarm.setAlarmContent(resultSet.getString(ServiceReferenceAlarmTable.ALARM_CONTENT.getName())); - - return serviceReferenceAlarm; - } - - @Override protected Map streamDataToShardingjdbcData(ServiceReferenceAlarm streamData) { - Map target = new HashMap<>(); - target.put(ServiceReferenceAlarmTable.ID.getName(), streamData.getId()); - target.put(ServiceReferenceAlarmTable.SOURCE_VALUE.getName(), streamData.getSourceValue()); - - target.put(ServiceReferenceAlarmTable.ALARM_TYPE.getName(), streamData.getAlarmType()); - - target.put(ServiceReferenceAlarmTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()); - target.put(ServiceReferenceAlarmTable.FRONT_INSTANCE_ID.getName(), streamData.getFrontInstanceId()); - target.put(ServiceReferenceAlarmTable.FRONT_SERVICE_ID.getName(), streamData.getFrontServiceId()); - target.put(ServiceReferenceAlarmTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()); - target.put(ServiceReferenceAlarmTable.BEHIND_INSTANCE_ID.getName(), streamData.getBehindInstanceId()); - target.put(ServiceReferenceAlarmTable.BEHIND_SERVICE_ID.getName(), streamData.getBehindServiceId()); - - target.put(ServiceReferenceAlarmTable.LAST_TIME_BUCKET.getName(), streamData.getLastTimeBucket()); - target.put(ServiceReferenceAlarmTable.ALARM_CONTENT.getName(), streamData.getAlarmContent()); - - return target; - } - - @Override protected String timeBucketColumnNameForDelete() { - return ServiceReferenceAlarmTable.LAST_TIME_BUCKET.getName(); - } - - @GraphComputingMetric(name = "/persistence/get/" + ServiceReferenceAlarmTable.TABLE) - @Override public ServiceReferenceAlarm get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/amp/AbstractApplicationMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/amp/AbstractApplicationMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 5e9677687997371519942351c79a98bb5451d7f5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/amp/AbstractApplicationMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.amp; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.MetricTransformUtil; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractApplicationMetricShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO { - - AbstractApplicationMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return ApplicationMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final ApplicationMetric shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - ApplicationMetric applicationMetric = new ApplicationMetric(); - applicationMetric.setId(resultSet.getString(ApplicationMetricTable.ID.getName())); - applicationMetric.setMetricId(resultSet.getString(ApplicationMetricTable.METRIC_ID.getName())); - - applicationMetric.setApplicationId(resultSet.getInt(ApplicationMetricTable.APPLICATION_ID.getName())); - - MetricTransformUtil.INSTANCE.shardingjdbcDataToStreamData(resultSet, applicationMetric); - - applicationMetric.setSatisfiedCount(resultSet.getLong(ApplicationMetricTable.SATISFIED_COUNT.getName())); - applicationMetric.setToleratingCount(resultSet.getLong(ApplicationMetricTable.TOLERATING_COUNT.getName())); - applicationMetric.setFrustratedCount(resultSet.getLong(ApplicationMetricTable.FRUSTRATED_COUNT.getName())); - - return applicationMetric; - } - - @Override protected final Map streamDataToShardingjdbcData(ApplicationMetric streamData) { - Map target = new HashMap<>(); - target.put(ApplicationMetricTable.ID.getName(), streamData.getId()); - target.put(ApplicationMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(ApplicationMetricTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - - MetricTransformUtil.INSTANCE.streamDataToShardingjdbcData(streamData, target); - - target.put(ApplicationMetricTable.SATISFIED_COUNT.getName(), streamData.getSatisfiedCount()); - target.put(ApplicationMetricTable.TOLERATING_COUNT.getName(), streamData.getToleratingCount()); - target.put(ApplicationMetricTable.FRUSTRATED_COUNT.getName(), streamData.getFrustratedCount()); - - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + ApplicationMetricTable.TABLE) - @Override public final ApplicationMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/amp/ApplicationDayMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/amp/ApplicationDayMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 49df7237c9dfb8f6f7f7813d8189ad7ec01d419a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/amp/ApplicationDayMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.amp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author linjiaqi - */ -public class ApplicationDayMetricShardingjdbcPersistenceDAO extends AbstractApplicationMetricShardingjdbcPersistenceDAO implements IApplicationDayMetricPersistenceDAO { - - public ApplicationDayMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/amp/ApplicationHourMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/amp/ApplicationHourMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 95dc4c6cd5701d8099a707317daf586e5a277da8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/amp/ApplicationHourMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.amp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author linjiaqi - */ -public class ApplicationHourMetricShardingjdbcPersistenceDAO extends AbstractApplicationMetricShardingjdbcPersistenceDAO implements IApplicationHourMetricPersistenceDAO { - - public ApplicationHourMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/amp/ApplicationMinuteMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/amp/ApplicationMinuteMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 521e31c278b1328c3299634e5de9d850b56b3bdf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/amp/ApplicationMinuteMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.amp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author linjiaqi - */ -public class ApplicationMinuteMetricShardingjdbcPersistenceDAO extends AbstractApplicationMetricShardingjdbcPersistenceDAO implements IApplicationMinuteMetricPersistenceDAO { - - public ApplicationMinuteMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/amp/ApplicationMonthMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/amp/ApplicationMonthMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 39f46e119daa1d147c742c0b9a89c28b64e9b883..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/amp/ApplicationMonthMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.amp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author linjiaqi - */ -public class ApplicationMonthMetricShardingjdbcPersistenceDAO extends AbstractApplicationMetricShardingjdbcPersistenceDAO implements IApplicationMonthMetricPersistenceDAO { - - public ApplicationMonthMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ampp/AbstractApplicationMappingShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ampp/AbstractApplicationMappingShardingjdbcPersistenceDAO.java deleted file mode 100644 index f4ff616aa361cbb8b40830a4970a809fe12db9b0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ampp/AbstractApplicationMappingShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ampp; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractApplicationMappingShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO { - - AbstractApplicationMappingShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return ApplicationMappingTable.TIME_BUCKET.getName(); - } - - @Override protected final ApplicationMapping shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - ApplicationMapping applicationMapping = new ApplicationMapping(); - applicationMapping.setId(resultSet.getString(ApplicationMappingTable.ID.getName())); - applicationMapping.setMetricId(resultSet.getString(ApplicationMappingTable.METRIC_ID.getName())); - - applicationMapping.setApplicationId(resultSet.getInt(ApplicationMappingTable.APPLICATION_ID.getName())); - applicationMapping.setMappingApplicationId(resultSet.getInt(ApplicationMappingTable.MAPPING_APPLICATION_ID.getName())); - applicationMapping.setTimeBucket(resultSet.getLong(ApplicationMappingTable.TIME_BUCKET.getName())); - return applicationMapping; - } - - @Override protected final Map streamDataToShardingjdbcData(ApplicationMapping streamData) { - Map target = new HashMap<>(); - target.put(ApplicationMappingTable.ID.getName(), streamData.getId()); - target.put(ApplicationMappingTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(ApplicationMappingTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - target.put(ApplicationMappingTable.MAPPING_APPLICATION_ID.getName(), streamData.getMappingApplicationId()); - target.put(ApplicationMappingTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + ApplicationMappingTable.TABLE) - @Override public final ApplicationMapping get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ampp/ApplicationMappingDayShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ampp/ApplicationMappingDayShardingjdbcPersistenceDAO.java deleted file mode 100644 index f354b37a53e677d03dcd584e7e11fc4708935e9b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ampp/ApplicationMappingDayShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ampp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author linjiaqi - */ -public class ApplicationMappingDayShardingjdbcPersistenceDAO extends AbstractApplicationMappingShardingjdbcPersistenceDAO implements IApplicationMappingDayPersistenceDAO { - - public ApplicationMappingDayShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ampp/ApplicationMappingHourShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ampp/ApplicationMappingHourShardingjdbcPersistenceDAO.java deleted file mode 100644 index 8300e4f60c2c24897273fe13e2077229d7c57082..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ampp/ApplicationMappingHourShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ampp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author linjiaqi - */ -public class ApplicationMappingHourShardingjdbcPersistenceDAO extends AbstractApplicationMappingShardingjdbcPersistenceDAO implements IApplicationMappingHourPersistenceDAO { - - public ApplicationMappingHourShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ampp/ApplicationMappingMinuteShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ampp/ApplicationMappingMinuteShardingjdbcPersistenceDAO.java deleted file mode 100644 index ecef0f2792fda19753e3c01e15bf913174f6d424..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ampp/ApplicationMappingMinuteShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ampp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author linjiaqi - */ -public class ApplicationMappingMinuteShardingjdbcPersistenceDAO extends AbstractApplicationMappingShardingjdbcPersistenceDAO implements IApplicationMappingMinutePersistenceDAO { - - public ApplicationMappingMinuteShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ampp/ApplicationMappingMonthShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ampp/ApplicationMappingMonthShardingjdbcPersistenceDAO.java deleted file mode 100644 index f467893cf9fc24e1ad7736d65359d358eaf3b9a3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ampp/ApplicationMappingMonthShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ampp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.ampp.IApplicationMappingMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMapping; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author linjiaqi - */ -public class ApplicationMappingMonthShardingjdbcPersistenceDAO extends AbstractApplicationMappingShardingjdbcPersistenceDAO implements IApplicationMappingMonthPersistenceDAO { - - public ApplicationMappingMonthShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/armp/AbstractApplicationReferenceMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/armp/AbstractApplicationReferenceMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 8ecea3dd7be1c8a1e5e36eeabe59721de3d77f1a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/armp/AbstractApplicationReferenceMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.armp; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.MetricTransformUtil; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractApplicationReferenceMetricShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO { - - AbstractApplicationReferenceMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return ApplicationReferenceMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final ApplicationReferenceMetric shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - ApplicationReferenceMetric applicationReferenceMetric = new ApplicationReferenceMetric(); - applicationReferenceMetric.setId(resultSet.getString(ApplicationReferenceMetricTable.ID.getName())); - applicationReferenceMetric.setMetricId(resultSet.getString(ApplicationReferenceMetricTable.METRIC_ID.getName())); - - applicationReferenceMetric.setFrontApplicationId(resultSet.getInt(ApplicationReferenceMetricTable.FRONT_APPLICATION_ID.getName())); - applicationReferenceMetric.setBehindApplicationId(resultSet.getInt(ApplicationReferenceMetricTable.BEHIND_APPLICATION_ID.getName())); - - MetricTransformUtil.INSTANCE.shardingjdbcDataToStreamData(resultSet, applicationReferenceMetric); - - applicationReferenceMetric.setSatisfiedCount(resultSet.getLong(ApplicationReferenceMetricTable.SATISFIED_COUNT.getName())); - applicationReferenceMetric.setToleratingCount(resultSet.getLong(ApplicationReferenceMetricTable.TOLERATING_COUNT.getName())); - applicationReferenceMetric.setFrustratedCount(resultSet.getLong(ApplicationReferenceMetricTable.FRUSTRATED_COUNT.getName())); - - return applicationReferenceMetric; - } - - @Override protected final Map streamDataToShardingjdbcData(ApplicationReferenceMetric streamData) { - Map target = new HashMap<>(); - target.put(ApplicationReferenceMetricTable.ID.getName(), streamData.getId()); - target.put(ApplicationReferenceMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(ApplicationReferenceMetricTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()); - target.put(ApplicationReferenceMetricTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()); - - MetricTransformUtil.INSTANCE.streamDataToShardingjdbcData(streamData, target); - - target.put(ApplicationReferenceMetricTable.SATISFIED_COUNT.getName(), streamData.getSatisfiedCount()); - target.put(ApplicationReferenceMetricTable.TOLERATING_COUNT.getName(), streamData.getToleratingCount()); - target.put(ApplicationReferenceMetricTable.FRUSTRATED_COUNT.getName(), streamData.getFrustratedCount()); - - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + ApplicationReferenceMetricTable.TABLE) - @Override public final ApplicationReferenceMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/armp/ApplicationReferenceDayMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/armp/ApplicationReferenceDayMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 8065d7614bdadf6b0afacf6c8163764dcd621f18..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/armp/ApplicationReferenceDayMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.armp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class ApplicationReferenceDayMetricShardingjdbcPersistenceDAO extends AbstractApplicationReferenceMetricShardingjdbcPersistenceDAO implements IApplicationReferenceDayMetricPersistenceDAO { - - public ApplicationReferenceDayMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/armp/ApplicationReferenceHourMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/armp/ApplicationReferenceHourMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 9267b5e7fc8da6658b654508b0307205730bfe3b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/armp/ApplicationReferenceHourMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.armp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class ApplicationReferenceHourMetricShardingjdbcPersistenceDAO extends AbstractApplicationReferenceMetricShardingjdbcPersistenceDAO implements IApplicationReferenceHourMetricPersistenceDAO { - - public ApplicationReferenceHourMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/armp/ApplicationReferenceMinuteMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/armp/ApplicationReferenceMinuteMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index c5089c7df5823d0f25678d17828049a92acb5419..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/armp/ApplicationReferenceMinuteMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.armp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class ApplicationReferenceMinuteMetricShardingjdbcPersistenceDAO extends AbstractApplicationReferenceMetricShardingjdbcPersistenceDAO implements IApplicationReferenceMinuteMetricPersistenceDAO { - - public ApplicationReferenceMinuteMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/armp/ApplicationReferenceMonthMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/armp/ApplicationReferenceMonthMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 26df6f4f058a56d36d2afb97711b6b63bef3b909..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/armp/ApplicationReferenceMonthMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.armp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.armp.IApplicationReferenceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class ApplicationReferenceMonthMetricShardingjdbcPersistenceDAO extends AbstractApplicationReferenceMetricShardingjdbcPersistenceDAO implements IApplicationReferenceMonthMetricPersistenceDAO { - - public ApplicationReferenceMonthMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cache/ApplicationShardingjdbcCacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cache/ApplicationShardingjdbcCacheDAO.java deleted file mode 100644 index 422c46646b05c6043fd6bee7bf494e354017e302..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cache/ApplicationShardingjdbcCacheDAO.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.cache; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.cache.IApplicationCacheDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.register.Application; -import org.apache.skywalking.apm.collector.storage.table.register.ApplicationTable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class ApplicationShardingjdbcCacheDAO extends ShardingjdbcDAO implements IApplicationCacheDAO { - - private static final Logger logger = LoggerFactory.getLogger(ApplicationShardingjdbcCacheDAO.class); - - private static final String GET_APPLICATION_ID_SQL = "select {0} from {1} where {2} = ? and {3} = ?"; - private static final String GET_APPLICATION_SQL = "select {0},{1} from {2} where {3} = ?"; - - public ApplicationShardingjdbcCacheDAO(ShardingjdbcClient client) { - super(client); - } - - @Override - public int getApplicationIdByCode(String applicationCode) { - logger.info("get the application id with application code = {}", applicationCode); - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(GET_APPLICATION_ID_SQL, ApplicationTable.APPLICATION_ID.getName(), ApplicationTable.TABLE, ApplicationTable.APPLICATION_CODE.getName(), ApplicationTable.IS_ADDRESS.getName()); - - Object[] params = new Object[] {applicationCode, false}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - return rs.getInt(1); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } - - @Override public Application getApplication(int applicationId) { - logger.debug("get application code, applicationId: {}", applicationId); - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(GET_APPLICATION_SQL, ApplicationTable.APPLICATION_CODE.getName(), ApplicationTable.IS_ADDRESS.getName(), ApplicationTable.TABLE, ApplicationTable.APPLICATION_ID.getName()); - Object[] params = new Object[] {applicationId}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - Application application = new Application(); - application.setApplicationId(applicationId); - application.setApplicationCode(rs.getString(1)); - application.setIsAddress(rs.getInt(2)); - return application; - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return null; - } - - @Override public int getApplicationIdByAddressId(int addressId) { - logger.info("get the application id with address id = {}", addressId); - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(GET_APPLICATION_ID_SQL, ApplicationTable.APPLICATION_ID.getName(), ApplicationTable.TABLE, ApplicationTable.ADDRESS_ID.getName(), ApplicationTable.IS_ADDRESS.getName()); - - Object[] params = new Object[] {addressId, true}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - return rs.getInt(1); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cache/InstanceShardingjdbcCacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cache/InstanceShardingjdbcCacheDAO.java deleted file mode 100644 index eeb748a9d8c4fa1266d23ba6653c8554422f701d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cache/InstanceShardingjdbcCacheDAO.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.cache; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.core.util.BooleanUtils; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.cache.IInstanceCacheDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class InstanceShardingjdbcCacheDAO extends ShardingjdbcDAO implements IInstanceCacheDAO { - - private static final Logger logger = LoggerFactory.getLogger(InstanceShardingjdbcCacheDAO.class); - - private static final String GET_APPLICATION_ID_SQL = "select {0} from {1} where {2} = ?"; - private static final String GET_INSTANCE_ID_SQL = "select {0} from {1} where {2} = ? and {3} = ? and {4} = ?"; - - public InstanceShardingjdbcCacheDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public int getApplicationId(int instanceId) { - logger.info("get the application id by instance id = {}", instanceId); - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(GET_APPLICATION_ID_SQL, InstanceTable.APPLICATION_ID.getName(), InstanceTable.TABLE, InstanceTable.INSTANCE_ID.getName()); - Object[] params = new Object[] {instanceId}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - return rs.getInt(InstanceTable.APPLICATION_ID.getName()); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } - - @Override public int getInstanceIdByAgentUUID(int applicationId, String agentUUID) { - logger.info("get the instance id by application id = {}, agentUUID = {}", applicationId, agentUUID); - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(GET_INSTANCE_ID_SQL, InstanceTable.INSTANCE_ID.getName(), InstanceTable.TABLE, InstanceTable.APPLICATION_ID.getName(), - InstanceTable.AGENT_UUID.getName(), InstanceTable.IS_ADDRESS.getName()); - Object[] params = new Object[] {applicationId, agentUUID, BooleanUtils.FALSE}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - return rs.getInt(InstanceTable.INSTANCE_ID.getName()); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } - - @Override public int getInstanceIdByAddressId(int applicationId, int addressId) { - logger.info("get the instance id by application id = {}, address id = {}", applicationId, addressId); - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(GET_INSTANCE_ID_SQL, InstanceTable.INSTANCE_ID.getName(), InstanceTable.TABLE, InstanceTable.APPLICATION_ID.getName(), - InstanceTable.ADDRESS_ID.getName(), InstanceTable.IS_ADDRESS.getName()); - Object[] params = new Object[] {applicationId, addressId, BooleanUtils.TRUE}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - return rs.getInt(InstanceTable.INSTANCE_ID.getName()); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cache/NetworkAddressShardingjdbcCacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cache/NetworkAddressShardingjdbcCacheDAO.java deleted file mode 100644 index a5d6864f58f35d391e3cde6409779ccda90335bf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cache/NetworkAddressShardingjdbcCacheDAO.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.cache; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.cache.INetworkAddressCacheDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddress; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddressTable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class NetworkAddressShardingjdbcCacheDAO extends ShardingjdbcDAO implements INetworkAddressCacheDAO { - - private static final Logger logger = LoggerFactory.getLogger(NetworkAddressShardingjdbcCacheDAO.class); - - private static final String GET_ADDRESS_ID_OR_CODE_SQL = "select {0} from {1} where {2} = ?"; - - public NetworkAddressShardingjdbcCacheDAO(ShardingjdbcClient client) { - super(client); - } - - @Override - public int getAddressId(String networkAddress) { - logger.info("get the address id with network address = {}", networkAddress); - ShardingjdbcClient client = getClient(); - - String sql = SqlBuilder.buildSql(GET_ADDRESS_ID_OR_CODE_SQL, NetworkAddressTable.ADDRESS_ID.getName(), NetworkAddressTable.TABLE, NetworkAddressTable.NETWORK_ADDRESS.getName()); - - Object[] params = new Object[] {networkAddress}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - return rs.getInt(1); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return Const.NONE; - } - - @Override public NetworkAddress getAddressById(int addressId) { - logger.debug("get network address, address id: {}", addressId); - ShardingjdbcClient client = getClient(); - - String dynamicSql = "select * from {0} where {1} = ?"; - String sql = SqlBuilder.buildSql(dynamicSql, NetworkAddressTable.TABLE, NetworkAddressTable.ADDRESS_ID.getName()); - Object[] params = new Object[] {addressId}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - NetworkAddress networkAddress = new NetworkAddress(); - networkAddress.setId(rs.getString(NetworkAddressTable.ID.getName())); - networkAddress.setAddressId(rs.getInt(NetworkAddressTable.ADDRESS_ID.getName())); - networkAddress.setNetworkAddress(rs.getString(NetworkAddressTable.NETWORK_ADDRESS.getName())); - networkAddress.setSrcSpanLayer(rs.getInt(NetworkAddressTable.SRC_SPAN_LAYER.getName())); - networkAddress.setServerType(rs.getInt(NetworkAddressTable.SERVER_TYPE.getName())); - return networkAddress; - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return null; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cache/ServiceNameShardingjdbcCacheDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cache/ServiceNameShardingjdbcCacheDAO.java deleted file mode 100644 index 594a3b9618315aca063ee54c4fa9f45f4eca071c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cache/ServiceNameShardingjdbcCacheDAO.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.cache; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.cache.IServiceNameCacheDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceNameTable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class ServiceNameShardingjdbcCacheDAO extends ShardingjdbcDAO implements IServiceNameCacheDAO { - - private static final Logger logger = LoggerFactory.getLogger(ServiceNameShardingjdbcCacheDAO.class); - - private static final String GET_SERVICE_NAME_SQL = "select {0},{1} from {2} where {3} = ?"; - private static final String GET_SERVICE_ID_SQL = "select {0} from {1} where {2} = ? and {3} = ? and {4} = ? limit 1"; - - public ServiceNameShardingjdbcCacheDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public ServiceName get(int serviceId) { - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(GET_SERVICE_NAME_SQL, ServiceNameTable.APPLICATION_ID.getName(), ServiceNameTable.SERVICE_NAME.getName(), - ServiceNameTable.TABLE, ServiceNameTable.SERVICE_ID.getName()); - Object[] params = new Object[] {serviceId}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - ServiceName serviceName = new ServiceName(); - serviceName.setServiceId(serviceId); - serviceName.setApplicationId(rs.getInt(ServiceNameTable.APPLICATION_ID.getName())); - serviceName.setServiceName(rs.getString(ServiceNameTable.SERVICE_NAME.getName())); - return serviceName; - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return null; - } - - @Override public int getServiceId(int applicationId, int srcSpanType, String serviceName) { - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(GET_SERVICE_ID_SQL, ServiceNameTable.SERVICE_ID.getName(), ServiceNameTable.TABLE, - ServiceNameTable.APPLICATION_ID.getName(), ServiceNameTable.SRC_SPAN_TYPE.getName(), ServiceNameTable.SERVICE_NAME.getName()); - - Object[] params = new Object[] {applicationId, srcSpanType, serviceName}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - return rs.getInt(ServiceNameTable.SERVICE_ID.getName()); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cpu/AbstractCpuMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cpu/AbstractCpuMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 93905f94d54c881614b01397b44aabaaa5dfc8a0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cpu/AbstractCpuMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.cpu; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractCpuMetricShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO { - - AbstractCpuMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return CpuMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final CpuMetric shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - CpuMetric cpuMetric = new CpuMetric(); - cpuMetric.setId(resultSet.getString(CpuMetricTable.ID.getName())); - cpuMetric.setMetricId(resultSet.getString(CpuMetricTable.METRIC_ID.getName())); - - cpuMetric.setInstanceId(resultSet.getInt(CpuMetricTable.INSTANCE_ID.getName())); - - cpuMetric.setUsagePercent(resultSet.getDouble(CpuMetricTable.USAGE_PERCENT.getName())); - cpuMetric.setTimes(resultSet.getLong(CpuMetricTable.TIMES.getName())); - cpuMetric.setTimeBucket(resultSet.getLong(CpuMetricTable.TIME_BUCKET.getName())); - - return cpuMetric; - } - - @Override protected final Map streamDataToShardingjdbcData(CpuMetric streamData) { - Map target = new HashMap<>(); - target.put(CpuMetricTable.ID.getName(), streamData.getId()); - target.put(CpuMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(CpuMetricTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - target.put(CpuMetricTable.USAGE_PERCENT.getName(), streamData.getUsagePercent()); - target.put(CpuMetricTable.TIMES.getName(), streamData.getTimes()); - target.put(CpuMetricTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + CpuMetricTable.TABLE) - @Override public final CpuMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cpu/CpuDayMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cpu/CpuDayMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 1d0a33d5bbab463fa6799fe38f1dfa09098c6944..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cpu/CpuDayMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.cpu; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author linjiaqi - */ -public class CpuDayMetricShardingjdbcPersistenceDAO extends AbstractCpuMetricShardingjdbcPersistenceDAO implements ICpuDayMetricPersistenceDAO { - - public CpuDayMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cpu/CpuHourMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cpu/CpuHourMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 3982dd1655650ab471cb9fca07b5c8314261834f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cpu/CpuHourMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.cpu; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author linjiaqi - */ -public class CpuHourMetricShardingjdbcPersistenceDAO extends AbstractCpuMetricShardingjdbcPersistenceDAO implements ICpuHourMetricPersistenceDAO { - - public CpuHourMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cpu/CpuMinuteMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cpu/CpuMinuteMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 546a30f1ef036038d3cd531f76299637941c8d01..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cpu/CpuMinuteMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.cpu; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author linjiaqi - */ -public class CpuMinuteMetricShardingjdbcPersistenceDAO extends AbstractCpuMetricShardingjdbcPersistenceDAO implements ICpuMinuteMetricPersistenceDAO { - - public CpuMinuteMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cpu/CpuMonthMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cpu/CpuMonthMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index cb3df78f3c82da4ff29a7fed70dfca82daa8c7b9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/cpu/CpuMonthMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.cpu; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.cpu.ICpuMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author linjiaqi - */ -public class CpuMonthMetricShardingjdbcPersistenceDAO extends AbstractCpuMetricShardingjdbcPersistenceDAO implements ICpuMonthMetricPersistenceDAO { - - public CpuMonthMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/gc/AbstractGCMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/gc/AbstractGCMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 8b3596018aa029a05ccf6c0f055b6edde9422a87..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/gc/AbstractGCMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.gc; - -import java.sql.*; -import java.util.*; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.*; - -/** - * @author linjiaqi - */ -public abstract class AbstractGCMetricShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO { - - AbstractGCMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return GCMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final GCMetric shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - GCMetric gcMetric = new GCMetric(); - gcMetric.setId(resultSet.getString(GCMetricTable.ID.getName())); - gcMetric.setMetricId(resultSet.getString(GCMetricTable.METRIC_ID.getName())); - - gcMetric.setInstanceId(resultSet.getInt(GCMetricTable.INSTANCE_ID.getName())); - gcMetric.setPhrase(resultSet.getInt(GCMetricTable.PHRASE.getName())); - - gcMetric.setCount(resultSet.getLong(GCMetricTable.COUNT.getName())); - gcMetric.setTimes(resultSet.getLong(GCMetricTable.TIMES.getName())); - gcMetric.setDuration(resultSet.getLong(GCMetricTable.DURATION.getName())); - - gcMetric.setTimeBucket(resultSet.getLong(GCMetricTable.TIME_BUCKET.getName())); - - return gcMetric; - } - - @Override protected final Map streamDataToShardingjdbcData(GCMetric streamData) { - Map target = new HashMap<>(); - target.put(GCMetricTable.ID.getName(), streamData.getId()); - target.put(GCMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(GCMetricTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - target.put(GCMetricTable.PHRASE.getName(), streamData.getPhrase()); - target.put(GCMetricTable.COUNT.getName(), streamData.getCount()); - target.put(GCMetricTable.TIMES.getName(), streamData.getTimes()); - target.put(GCMetricTable.DURATION.getName(), streamData.getDuration()); - target.put(GCMetricTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + GCMetricTable.TABLE) - @Override public final GCMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/gc/GCDayMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/gc/GCDayMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 46976348cdbf2115659fdcacbd08f6a496078ec5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/gc/GCDayMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.gc; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author linjiaqi - */ -public class GCDayMetricShardingjdbcPersistenceDAO extends AbstractGCMetricShardingjdbcPersistenceDAO implements IGCDayMetricPersistenceDAO { - - public GCDayMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/gc/GCHourMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/gc/GCHourMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index aeb539e591d31bfb33aaefc2e7d4c9708848c069..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/gc/GCHourMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.gc; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author linjiaqi - */ -public class GCHourMetricShardingjdbcPersistenceDAO extends AbstractGCMetricShardingjdbcPersistenceDAO implements IGCHourMetricPersistenceDAO { - - public GCHourMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/gc/GCMinuteMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/gc/GCMinuteMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index fa246702d0db7e7f54ab89c48f297d0de9f9445d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/gc/GCMinuteMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.gc; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author linjiaqi - */ -public class GCMinuteMetricShardingjdbcPersistenceDAO extends AbstractGCMetricShardingjdbcPersistenceDAO implements IGCMinuteMetricPersistenceDAO { - - public GCMinuteMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/gc/GCMonthMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/gc/GCMonthMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 52129bdc4f3b916b5b4f92ddc060d0448aa02960..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/gc/GCMonthMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.gc; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.gc.IGCMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author linjiaqi - */ -public class GCMonthMetricShardingjdbcPersistenceDAO extends AbstractGCMetricShardingjdbcPersistenceDAO implements IGCMonthMetricPersistenceDAO { - - public GCMonthMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/imp/AbstractInstanceMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/imp/AbstractInstanceMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index d1814cbe0d6b3a26345b3a5fdc4c1b3bc5377af4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/imp/AbstractInstanceMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.imp; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.MetricTransformUtil; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractInstanceMetricShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO { - - AbstractInstanceMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return InstanceMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final InstanceMetric shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - InstanceMetric instanceMetric = new InstanceMetric(); - - instanceMetric.setId(resultSet.getString(InstanceMetricTable.ID.getName())); - instanceMetric.setMetricId(resultSet.getString(InstanceMetricTable.METRIC_ID.getName())); - instanceMetric.setApplicationId(resultSet.getInt(InstanceMetricTable.APPLICATION_ID.getName())); - instanceMetric.setInstanceId(resultSet.getInt(InstanceMetricTable.INSTANCE_ID.getName())); - - MetricTransformUtil.INSTANCE.shardingjdbcDataToStreamData(resultSet, instanceMetric); - return instanceMetric; - } - - @Override protected final Map streamDataToShardingjdbcData(InstanceMetric streamData) { - Map target = new HashMap<>(); - target.put(InstanceMetricTable.ID.getName(), streamData.getId()); - target.put(InstanceMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(InstanceMetricTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - target.put(InstanceMetricTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - - MetricTransformUtil.INSTANCE.streamDataToShardingjdbcData(streamData, target); - - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + InstanceMetricTable.TABLE) - @Override public final InstanceMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/imp/InstanceDayMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/imp/InstanceDayMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index f81a0abb9de400c550abeca0065de2f2759811e2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/imp/InstanceDayMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.imp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author linjiaqi - */ -public class InstanceDayMetricShardingjdbcPersistenceDAO extends AbstractInstanceMetricShardingjdbcPersistenceDAO implements IInstanceDayMetricPersistenceDAO { - - public InstanceDayMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/imp/InstanceHourMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/imp/InstanceHourMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index f9a8998a0b098089c0a804bee5bb63705d869a3e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/imp/InstanceHourMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.imp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author linjiaqi - */ -public class InstanceHourMetricShardingjdbcPersistenceDAO extends AbstractInstanceMetricShardingjdbcPersistenceDAO implements IInstanceHourMetricPersistenceDAO { - - public InstanceHourMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/imp/InstanceMinuteMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/imp/InstanceMinuteMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 619ae20dae3473a0920eb82b45cc6229a2655120..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/imp/InstanceMinuteMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.imp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author linjiaqi - */ -public class InstanceMinuteMetricShardingjdbcPersistenceDAO extends AbstractInstanceMetricShardingjdbcPersistenceDAO implements IInstanceMinuteMetricPersistenceDAO { - - public InstanceMinuteMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/imp/InstanceMonthMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/imp/InstanceMonthMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 58bc59a6a45634ccc6f2a33473c9676454ed9eeb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/imp/InstanceMonthMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.imp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.imp.IInstanceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author linjiaqi - */ -public class InstanceMonthMetricShardingjdbcPersistenceDAO extends AbstractInstanceMetricShardingjdbcPersistenceDAO implements IInstanceMonthMetricPersistenceDAO { - - public InstanceMonthMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/impp/AbstractInstanceMappingShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/impp/AbstractInstanceMappingShardingjdbcPersistenceDAO.java deleted file mode 100644 index 476f6f3bfba5f89cc6b78307ca5a40e55bfc1b46..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/impp/AbstractInstanceMappingShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.impp; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractInstanceMappingShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO { - - AbstractInstanceMappingShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return InstanceMappingTable.TIME_BUCKET.getName(); - } - - @Override protected final InstanceMapping shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - InstanceMapping instanceMapping = new InstanceMapping(); - instanceMapping.setId(resultSet.getString(InstanceMappingTable.ID.getName())); - instanceMapping.setMetricId(resultSet.getString(InstanceMappingTable.METRIC_ID.getName())); - - instanceMapping.setApplicationId(resultSet.getInt(InstanceMappingTable.APPLICATION_ID.getName())); - instanceMapping.setInstanceId(resultSet.getInt(InstanceMappingTable.INSTANCE_ID.getName())); - instanceMapping.setAddressId(resultSet.getInt(InstanceMappingTable.ADDRESS_ID.getName())); - instanceMapping.setTimeBucket(resultSet.getLong(InstanceMappingTable.TIME_BUCKET.getName())); - return instanceMapping; - } - - @Override protected final Map streamDataToShardingjdbcData(InstanceMapping streamData) { - Map target = new HashMap<>(); - target.put(InstanceMappingTable.ID.getName(), streamData.getId()); - target.put(InstanceMappingTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(InstanceMappingTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - target.put(InstanceMappingTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - target.put(InstanceMappingTable.ADDRESS_ID.getName(), streamData.getAddressId()); - target.put(InstanceMappingTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + InstanceMappingTable.TABLE) - @Override public final InstanceMapping get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/impp/InstanceMappingDayShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/impp/InstanceMappingDayShardingjdbcPersistenceDAO.java deleted file mode 100644 index 007f4ceb489cc8ae75bc545df36400572bea1c1e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/impp/InstanceMappingDayShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.impp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author linjiaqi - */ -public class InstanceMappingDayShardingjdbcPersistenceDAO extends AbstractInstanceMappingShardingjdbcPersistenceDAO implements IInstanceMappingDayPersistenceDAO { - - public InstanceMappingDayShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/impp/InstanceMappingHourShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/impp/InstanceMappingHourShardingjdbcPersistenceDAO.java deleted file mode 100644 index 5d9ea4716555773051597c817fa9ff0d58794642..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/impp/InstanceMappingHourShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.impp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author linjiaqi - */ -public class InstanceMappingHourShardingjdbcPersistenceDAO extends AbstractInstanceMappingShardingjdbcPersistenceDAO implements IInstanceMappingHourPersistenceDAO { - - public InstanceMappingHourShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/impp/InstanceMappingMinuteShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/impp/InstanceMappingMinuteShardingjdbcPersistenceDAO.java deleted file mode 100644 index ff74bed90b6d56e799bc0fa642326240bb5a6d56..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/impp/InstanceMappingMinuteShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.impp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author linjiaqi - */ -public class InstanceMappingMinuteShardingjdbcPersistenceDAO extends AbstractInstanceMappingShardingjdbcPersistenceDAO implements IInstanceMappingMinutePersistenceDAO { - - public InstanceMappingMinuteShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/impp/InstanceMappingMonthShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/impp/InstanceMappingMonthShardingjdbcPersistenceDAO.java deleted file mode 100644 index 48a4e8fb8fa6b5bbedf0b8d4c5da40a8ea79eded..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/impp/InstanceMappingMonthShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.impp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.impp.IInstanceMappingMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author linjiaqi - */ -public class InstanceMappingMonthShardingjdbcPersistenceDAO extends AbstractInstanceMappingShardingjdbcPersistenceDAO implements IInstanceMappingMonthPersistenceDAO { - - public InstanceMappingMonthShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/irmp/AbstractInstanceReferenceMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/irmp/AbstractInstanceReferenceMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 55196a989f942e949d51c05a4492bf5267aa751c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/irmp/AbstractInstanceReferenceMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.irmp; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.MetricTransformUtil; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractInstanceReferenceMetricShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO { - - AbstractInstanceReferenceMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return InstanceReferenceMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final InstanceReferenceMetric shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - InstanceReferenceMetric instanceReferenceMetric = new InstanceReferenceMetric(); - instanceReferenceMetric.setId(resultSet.getString(InstanceReferenceMetricTable.ID.getName())); - instanceReferenceMetric.setMetricId(resultSet.getString(InstanceReferenceMetricTable.METRIC_ID.getName())); - - instanceReferenceMetric.setFrontApplicationId(resultSet.getInt(InstanceReferenceMetricTable.FRONT_APPLICATION_ID.getName())); - instanceReferenceMetric.setBehindApplicationId(resultSet.getInt(InstanceReferenceMetricTable.BEHIND_APPLICATION_ID.getName())); - instanceReferenceMetric.setFrontInstanceId(resultSet.getInt(InstanceReferenceMetricTable.FRONT_INSTANCE_ID.getName())); - instanceReferenceMetric.setBehindInstanceId(resultSet.getInt(InstanceReferenceMetricTable.BEHIND_INSTANCE_ID.getName())); - - MetricTransformUtil.INSTANCE.shardingjdbcDataToStreamData(resultSet, instanceReferenceMetric); - - return instanceReferenceMetric; - } - - @Override protected final Map streamDataToShardingjdbcData(InstanceReferenceMetric streamData) { - Map target = new HashMap<>(); - target.put(InstanceReferenceMetricTable.ID.getName(), streamData.getId()); - target.put(InstanceReferenceMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(InstanceReferenceMetricTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()); - target.put(InstanceReferenceMetricTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()); - target.put(InstanceReferenceMetricTable.FRONT_INSTANCE_ID.getName(), streamData.getFrontInstanceId()); - target.put(InstanceReferenceMetricTable.BEHIND_INSTANCE_ID.getName(), streamData.getBehindInstanceId()); - - MetricTransformUtil.INSTANCE.streamDataToShardingjdbcData(streamData, target); - - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + InstanceReferenceMetricTable.TABLE) - @Override public final InstanceReferenceMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/irmp/InstanceReferenceDayMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/irmp/InstanceReferenceDayMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 48ee4c5dcf1637ed159e11032b66f1ee554b1fe2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/irmp/InstanceReferenceDayMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.irmp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class InstanceReferenceDayMetricShardingjdbcPersistenceDAO extends AbstractInstanceReferenceMetricShardingjdbcPersistenceDAO implements IInstanceReferenceDayMetricPersistenceDAO { - - public InstanceReferenceDayMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/irmp/InstanceReferenceHourMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/irmp/InstanceReferenceHourMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 0fabe53e80386c6209e008315eb368acb88b46cc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/irmp/InstanceReferenceHourMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.irmp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class InstanceReferenceHourMetricShardingjdbcPersistenceDAO extends AbstractInstanceReferenceMetricShardingjdbcPersistenceDAO implements IInstanceReferenceHourMetricPersistenceDAO { - - public InstanceReferenceHourMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/irmp/InstanceReferenceMinuteMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/irmp/InstanceReferenceMinuteMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 43ff6a53697e468b1bb01338caaa25073dac6044..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/irmp/InstanceReferenceMinuteMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.irmp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class InstanceReferenceMinuteMetricShardingjdbcPersistenceDAO extends AbstractInstanceReferenceMetricShardingjdbcPersistenceDAO implements IInstanceReferenceMinuteMetricPersistenceDAO { - - public InstanceReferenceMinuteMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/irmp/InstanceReferenceMonthMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/irmp/InstanceReferenceMonthMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 7112dfa4513b0f9872b7e8b13c024f25a0485f77..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/irmp/InstanceReferenceMonthMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.irmp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.irmp.IInstanceReferenceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class InstanceReferenceMonthMetricShardingjdbcPersistenceDAO extends AbstractInstanceReferenceMetricShardingjdbcPersistenceDAO implements IInstanceReferenceMonthMetricPersistenceDAO { - - public InstanceReferenceMonthMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/memory/AbstractMemoryMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/memory/AbstractMemoryMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index b86b47f791fe650e498f4410ae7ad6535298946d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/memory/AbstractMemoryMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.memory; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractMemoryMetricShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO { - - AbstractMemoryMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return MemoryMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final MemoryMetric shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - MemoryMetric memoryMetric = new MemoryMetric(); - memoryMetric.setId(resultSet.getString(MemoryMetricTable.ID.getName())); - memoryMetric.setMetricId(resultSet.getString(MemoryMetricTable.METRIC_ID.getName())); - - memoryMetric.setInstanceId(resultSet.getInt(MemoryMetricTable.INSTANCE_ID.getName())); - memoryMetric.setIsHeap(resultSet.getInt(MemoryMetricTable.IS_HEAP.getName())); - - memoryMetric.setInit(resultSet.getLong(MemoryMetricTable.INIT.getName())); - memoryMetric.setMax(resultSet.getLong(MemoryMetricTable.MAX.getName())); - memoryMetric.setUsed(resultSet.getLong(MemoryMetricTable.USED.getName())); - memoryMetric.setCommitted(resultSet.getLong(MemoryMetricTable.COMMITTED.getName())); - memoryMetric.setTimes(resultSet.getLong(MemoryMetricTable.TIMES.getName())); - - memoryMetric.setTimeBucket(resultSet.getLong(MemoryMetricTable.TIME_BUCKET.getName())); - return memoryMetric; - } - - @Override protected final Map streamDataToShardingjdbcData(MemoryMetric streamData) { - Map target = new HashMap<>(); - target.put(MemoryMetricTable.ID.getName(), streamData.getId()); - target.put(MemoryMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(MemoryMetricTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - target.put(MemoryMetricTable.IS_HEAP.getName(), streamData.getIsHeap()); - target.put(MemoryMetricTable.INIT.getName(), streamData.getInit()); - target.put(MemoryMetricTable.MAX.getName(), streamData.getMax()); - target.put(MemoryMetricTable.USED.getName(), streamData.getUsed()); - target.put(MemoryMetricTable.COMMITTED.getName(), streamData.getCommitted()); - target.put(MemoryMetricTable.TIMES.getName(), streamData.getTimes()); - target.put(MemoryMetricTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + MemoryMetricTable.TABLE) - @Override public final MemoryMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/memory/MemoryDayMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/memory/MemoryDayMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index d979521c4a57529ae5d02776099b59fd5295db10..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/memory/MemoryDayMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.memory; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author linjiaqi - */ -public class MemoryDayMetricShardingjdbcPersistenceDAO extends AbstractMemoryMetricShardingjdbcPersistenceDAO implements IMemoryDayMetricPersistenceDAO { - - public MemoryDayMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/memory/MemoryHourMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/memory/MemoryHourMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 982f506178c6aceedc648ec6752fea70dac8d05e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/memory/MemoryHourMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.memory; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author linjiaqi - */ -public class MemoryHourMetricShardingjdbcPersistenceDAO extends AbstractMemoryMetricShardingjdbcPersistenceDAO implements IMemoryHourMetricPersistenceDAO { - - public MemoryHourMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/memory/MemoryMinuteMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/memory/MemoryMinuteMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index abf32bb3f439b1f177530a7edf3efeefe89b3a07..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/memory/MemoryMinuteMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.memory; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author linjiaqi - */ -public class MemoryMinuteMetricShardingjdbcPersistenceDAO extends AbstractMemoryMetricShardingjdbcPersistenceDAO implements IMemoryMinuteMetricPersistenceDAO { - - public MemoryMinuteMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/memory/MemoryMonthMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/memory/MemoryMonthMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index de3119eef09eeb40ebc850fef9d0612e5a4d6347..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/memory/MemoryMonthMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.memory; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.memory.IMemoryMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author linjiaqi - */ -public class MemoryMonthMetricShardingjdbcPersistenceDAO extends AbstractMemoryMetricShardingjdbcPersistenceDAO implements IMemoryMonthMetricPersistenceDAO { - - public MemoryMonthMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/mpool/AbstractMemoryPoolMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/mpool/AbstractMemoryPoolMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index d0a0dba9b9df8f407b9fddad401bf9c9e58e57ea..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/mpool/AbstractMemoryPoolMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.mpool; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractMemoryPoolMetricShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO { - - AbstractMemoryPoolMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override - protected final String timeBucketColumnNameForDelete() { - return MemoryPoolMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final MemoryPoolMetric shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - MemoryPoolMetric memoryPoolMetric = new MemoryPoolMetric(); - memoryPoolMetric.setId(resultSet.getString(MemoryPoolMetricTable.ID.getName())); - memoryPoolMetric.setMetricId(resultSet.getString(MemoryPoolMetricTable.METRIC_ID.getName())); - - memoryPoolMetric.setInstanceId(resultSet.getInt(MemoryPoolMetricTable.INSTANCE_ID.getName())); - memoryPoolMetric.setPoolType(resultSet.getInt(MemoryPoolMetricTable.POOL_TYPE.getName())); - - memoryPoolMetric.setInit(resultSet.getLong(MemoryPoolMetricTable.INIT.getName())); - memoryPoolMetric.setMax(resultSet.getLong(MemoryPoolMetricTable.MAX.getName())); - memoryPoolMetric.setUsed(resultSet.getLong(MemoryPoolMetricTable.USED.getName())); - memoryPoolMetric.setCommitted(resultSet.getLong(MemoryPoolMetricTable.COMMITTED.getName())); - memoryPoolMetric.setTimes(resultSet.getLong(MemoryPoolMetricTable.TIMES.getName())); - - memoryPoolMetric.setTimeBucket(resultSet.getLong(MemoryPoolMetricTable.TIME_BUCKET.getName())); - return memoryPoolMetric; - } - - @Override protected final Map streamDataToShardingjdbcData(MemoryPoolMetric streamData) { - Map target = new HashMap<>(); - target.put(MemoryPoolMetricTable.ID.getName(), streamData.getId()); - target.put(MemoryPoolMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(MemoryPoolMetricTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - target.put(MemoryPoolMetricTable.POOL_TYPE.getName(), streamData.getPoolType()); - target.put(MemoryPoolMetricTable.INIT.getName(), streamData.getInit()); - target.put(MemoryPoolMetricTable.MAX.getName(), streamData.getMax()); - target.put(MemoryPoolMetricTable.USED.getName(), streamData.getUsed()); - target.put(MemoryPoolMetricTable.COMMITTED.getName(), streamData.getCommitted()); - target.put(MemoryPoolMetricTable.TIMES.getName(), streamData.getTimes()); - target.put(MemoryPoolMetricTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + MemoryPoolMetricTable.TABLE) - @Override public final MemoryPoolMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/mpool/MemoryPoolDayMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/mpool/MemoryPoolDayMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index c4b2b16a19b79f77cd669bed3dd2f08fbc7328ee..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/mpool/MemoryPoolDayMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.mpool; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author linjiaqi - */ -public class MemoryPoolDayMetricShardingjdbcPersistenceDAO extends AbstractMemoryPoolMetricShardingjdbcPersistenceDAO implements IMemoryPoolDayMetricPersistenceDAO { - - public MemoryPoolDayMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/mpool/MemoryPoolHourMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/mpool/MemoryPoolHourMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 12dddd9a5f3a31b6dd3a61e2f3d06b2030ba3786..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/mpool/MemoryPoolHourMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.mpool; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author linjiaqi - */ -public class MemoryPoolHourMetricShardingjdbcPersistenceDAO extends AbstractMemoryPoolMetricShardingjdbcPersistenceDAO implements IMemoryPoolHourMetricPersistenceDAO { - - public MemoryPoolHourMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/mpool/MemoryPoolMinuteMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/mpool/MemoryPoolMinuteMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index beceadeb8484e2ea90120010ef64d4d09709f784..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/mpool/MemoryPoolMinuteMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.mpool; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author linjiaqi - */ -public class MemoryPoolMinuteMetricShardingjdbcPersistenceDAO extends AbstractMemoryPoolMetricShardingjdbcPersistenceDAO implements IMemoryPoolMinuteMetricPersistenceDAO { - - public MemoryPoolMinuteMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/mpool/MemoryPoolMonthMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/mpool/MemoryPoolMonthMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index a046798c20fdfe2aa86e849573a7b2214850ea67..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/mpool/MemoryPoolMonthMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.mpool; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.mpool.IMemoryPoolMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetric; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author linjiaqi - */ -public class MemoryPoolMonthMetricShardingjdbcPersistenceDAO extends AbstractMemoryPoolMetricShardingjdbcPersistenceDAO implements IMemoryPoolMonthMetricPersistenceDAO { - - public MemoryPoolMonthMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/register/ApplicationRegisterShardingjdbcDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/register/ApplicationRegisterShardingjdbcDAO.java deleted file mode 100644 index 5fce391a035d6d0031f54f8275daefe34c189e11..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/register/ApplicationRegisterShardingjdbcDAO.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.register; - -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.register.IApplicationRegisterDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.register.Application; -import org.apache.skywalking.apm.collector.storage.table.register.ApplicationTable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class ApplicationRegisterShardingjdbcDAO extends ShardingjdbcDAO implements IApplicationRegisterDAO { - - private static final Logger logger = LoggerFactory.getLogger(ApplicationRegisterShardingjdbcDAO.class); - - public ApplicationRegisterShardingjdbcDAO(ShardingjdbcClient client) { - super(client); - } - - @Override - public int getMaxApplicationId() { - return getMaxId(ApplicationTable.TABLE, ApplicationTable.APPLICATION_ID.getName()); - } - - @Override - public int getMinApplicationId() { - return getMinId(ApplicationTable.TABLE, ApplicationTable.APPLICATION_ID.getName()); - } - - @Override - public void save(Application application) { - ShardingjdbcClient client = getClient(); - - Map target = new HashMap<>(); - target.put(ApplicationTable.ID.getName(), application.getId()); - target.put(ApplicationTable.APPLICATION_CODE.getName(), application.getApplicationCode()); - target.put(ApplicationTable.APPLICATION_ID.getName(), application.getApplicationId()); - target.put(ApplicationTable.ADDRESS_ID.getName(), application.getAddressId()); - target.put(ApplicationTable.IS_ADDRESS.getName(), application.getIsAddress()); - - String sql = SqlBuilder.buildBatchInsertSql(ApplicationTable.TABLE, target.keySet()); - Object[] params = target.values().toArray(new Object[0]); - try { - client.execute(sql, params); - } catch (ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/register/InstanceRegisterShardingjdbcDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/register/InstanceRegisterShardingjdbcDAO.java deleted file mode 100644 index ec88fe82fd6ab375c523e59fd6e6a93fb9776ed5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/register/InstanceRegisterShardingjdbcDAO.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.register; - -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.register.IInstanceRegisterDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.register.Instance; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class InstanceRegisterShardingjdbcDAO extends ShardingjdbcDAO implements IInstanceRegisterDAO { - - private static final Logger logger = LoggerFactory.getLogger(InstanceRegisterShardingjdbcDAO.class); - - public InstanceRegisterShardingjdbcDAO(ShardingjdbcClient client) { - super(client); - } - - private static final String UPDATE_HEARTBEAT_TIME_SQL = "update {0} set {1} = ? where {2} = ?"; - - @Override public int getMaxInstanceId() { - return getMaxId(InstanceTable.TABLE, InstanceTable.INSTANCE_ID.getName()); - } - - @Override public int getMinInstanceId() { - return getMinId(InstanceTable.TABLE, InstanceTable.INSTANCE_ID.getName()); - } - - @Override public void save(Instance instance) { - ShardingjdbcClient client = getClient(); - Map target = new HashMap<>(); - target.put(InstanceTable.ID.getName(), instance.getId()); - target.put(InstanceTable.INSTANCE_ID.getName(), instance.getInstanceId()); - target.put(InstanceTable.APPLICATION_ID.getName(), instance.getApplicationId()); - target.put(InstanceTable.APPLICATION_CODE.getName(), instance.getApplicationCode()); - target.put(InstanceTable.AGENT_UUID.getName(), instance.getAgentUUID()); - target.put(InstanceTable.REGISTER_TIME.getName(), TimeBucketUtils.INSTANCE.getSecondTimeBucket(instance.getRegisterTime())); - target.put(InstanceTable.HEARTBEAT_TIME.getName(), TimeBucketUtils.INSTANCE.getSecondTimeBucket(instance.getHeartBeatTime())); - target.put(InstanceTable.OS_INFO.getName(), instance.getOsInfo()); - target.put(InstanceTable.ADDRESS_ID.getName(), instance.getAddressId()); - target.put(InstanceTable.IS_ADDRESS.getName(), instance.getIsAddress()); - - String sql = SqlBuilder.buildBatchInsertSql(InstanceTable.TABLE, target.keySet()); - Object[] params = target.values().toArray(new Object[0]); - try { - client.execute(sql, params); - } catch (ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - } - - @Override public void updateHeartbeatTime(int instanceId, long heartbeatTime) { - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(UPDATE_HEARTBEAT_TIME_SQL, InstanceTable.TABLE, InstanceTable.HEARTBEAT_TIME.getName(), - InstanceTable.ID.getName()); - Object[] params = new Object[] {TimeBucketUtils.INSTANCE.getSecondTimeBucket(heartbeatTime), instanceId}; - try { - client.execute(sql, params); - } catch (ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/register/NetworkAddressRegisterShardingjdbcDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/register/NetworkAddressRegisterShardingjdbcDAO.java deleted file mode 100644 index 900fe903a951ff489c99d224aeaec42bb17b5a0d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/register/NetworkAddressRegisterShardingjdbcDAO.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.register; - -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.register.INetworkAddressRegisterDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddress; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddressTable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class NetworkAddressRegisterShardingjdbcDAO extends ShardingjdbcDAO implements INetworkAddressRegisterDAO { - - private static final Logger logger = LoggerFactory.getLogger(NetworkAddressRegisterShardingjdbcDAO.class); - - public NetworkAddressRegisterShardingjdbcDAO(ShardingjdbcClient client) { - super(client); - } - - @Override - public int getMaxNetworkAddressId() { - return getMaxId(NetworkAddressTable.TABLE, NetworkAddressTable.ADDRESS_ID.getName()); - } - - @Override - public int getMinNetworkAddressId() { - return getMinId(NetworkAddressTable.TABLE, NetworkAddressTable.ADDRESS_ID.getName()); - } - - @Override - public void save(NetworkAddress networkAddress) { - ShardingjdbcClient client = getClient(); - - Map target = new HashMap<>(); - target.put(NetworkAddressTable.ID.getName(), networkAddress.getId()); - target.put(NetworkAddressTable.NETWORK_ADDRESS.getName(), networkAddress.getNetworkAddress()); - target.put(NetworkAddressTable.ADDRESS_ID.getName(), networkAddress.getAddressId()); - target.put(NetworkAddressTable.SRC_SPAN_LAYER.getName(), networkAddress.getSrcSpanLayer()); - target.put(NetworkAddressTable.SERVER_TYPE.getName(), networkAddress.getServerType()); - - String sql = SqlBuilder.buildBatchInsertSql(NetworkAddressTable.TABLE, target.keySet()); - Object[] params = target.values().toArray(new Object[0]); - try { - client.execute(sql, params); - } catch (ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - } - - @Override public void update(String id, int spanLayer, int serverType) { - ShardingjdbcClient client = getClient(); - - Map source = new HashMap<>(); - source.put(NetworkAddressTable.SRC_SPAN_LAYER.getName(), spanLayer); - source.put(NetworkAddressTable.SERVER_TYPE.getName(), serverType); - - String sql = SqlBuilder.buildBatchUpdateSql(InstanceTable.TABLE, source.keySet(), InstanceTable.INSTANCE_ID.getName()); - Object[] params = source.values().toArray(new Object[] {id}); - - try { - client.execute(sql, params); - } catch (ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/register/ServiceNameRegisterShardingjdbcDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/register/ServiceNameRegisterShardingjdbcDAO.java deleted file mode 100644 index be72cef517882344cb30c9c957f8496db76b5230..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/register/ServiceNameRegisterShardingjdbcDAO.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.register; - -import java.util.*; -import org.apache.skywalking.apm.collector.client.shardingjdbc.*; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.register.IServiceNameRegisterDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.register.*; -import org.slf4j.*; - -/** - * @author linjiaqi - */ -public class ServiceNameRegisterShardingjdbcDAO extends ShardingjdbcDAO implements IServiceNameRegisterDAO { - - private static final Logger logger = LoggerFactory.getLogger(ServiceNameRegisterShardingjdbcDAO.class); - - public ServiceNameRegisterShardingjdbcDAO(ShardingjdbcClient client) { - super(client); - } - - @Override - public int getMaxServiceId() { - return getMaxId(ServiceNameTable.TABLE, ServiceNameTable.SERVICE_ID.getName()); - } - - @Override - public int getMinServiceId() { - return getMinId(ServiceNameTable.TABLE, ServiceNameTable.SERVICE_ID.getName()); - } - - @Override - public void save(ServiceName serviceName) { - logger.debug("save service name register info, application getApplicationId: {}, service name: {}", serviceName.getId(), serviceName.getServiceName()); - ShardingjdbcClient client = getClient(); - Map target = new HashMap<>(); - target.put(ServiceNameTable.ID.getName(), serviceName.getId()); - target.put(ServiceNameTable.SERVICE_ID.getName(), serviceName.getServiceId()); - target.put(ServiceNameTable.APPLICATION_ID.getName(), serviceName.getApplicationId()); - target.put(ServiceNameTable.SERVICE_NAME.getName(), serviceName.getServiceName()); - target.put(ServiceNameTable.SERVICE_NAME_KEYWORD.getName(), serviceName.getServiceName()); - target.put(ServiceNameTable.SRC_SPAN_TYPE.getName(), serviceName.getSrcSpanType()); - target.put(ServiceNameTable.REGISTER_TIME.getName(), serviceName.getRegisterTime()); - target.put(ServiceNameTable.HEARTBEAT_TIME.getName(), serviceName.getHeartBeatTime()); - - String sql = SqlBuilder.buildBatchInsertSql(ServiceNameTable.TABLE, target.keySet()); - Object[] params = target.values().toArray(new Object[0]); - try { - client.execute(sql, params); - } catch (ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/rtd/AbstractResponseTimeDistributionShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/rtd/AbstractResponseTimeDistributionShardingjdbcPersistenceDAO.java deleted file mode 100644 index 07632c8efa6a3415832ac411cf83e31e0f49c64b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/rtd/AbstractResponseTimeDistributionShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.rtd; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractResponseTimeDistributionShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO { - - AbstractResponseTimeDistributionShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return ResponseTimeDistributionTable.TIME_BUCKET.getName(); - } - - @Override protected final ResponseTimeDistribution shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - ResponseTimeDistribution responseTimeDistribution = new ResponseTimeDistribution(); - responseTimeDistribution.setMetricId(resultSet.getString(ResponseTimeDistributionTable.METRIC_ID.getName())); - - responseTimeDistribution.setStep(resultSet.getInt(ResponseTimeDistributionTable.STEP.getName())); - - responseTimeDistribution.setCalls(resultSet.getLong(ResponseTimeDistributionTable.CALLS.getName())); - responseTimeDistribution.setErrorCalls(resultSet.getLong(ResponseTimeDistributionTable.ERROR_CALLS.getName())); - responseTimeDistribution.setSuccessCalls(resultSet.getLong(ResponseTimeDistributionTable.SUCCESS_CALLS.getName())); - - responseTimeDistribution.setTimeBucket(resultSet.getLong(ResponseTimeDistributionTable.TIME_BUCKET.getName())); - - return responseTimeDistribution; - } - - @Override protected final Map streamDataToShardingjdbcData(ResponseTimeDistribution streamData) { - Map target = new HashMap<>(); - target.put(ResponseTimeDistributionTable.ID.getName(), streamData.getId()); - target.put(ResponseTimeDistributionTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(ResponseTimeDistributionTable.STEP.getName(), streamData.getStep()); - - target.put(ResponseTimeDistributionTable.CALLS.getName(), streamData.getCalls()); - target.put(ResponseTimeDistributionTable.ERROR_CALLS.getName(), streamData.getErrorCalls()); - target.put(ResponseTimeDistributionTable.SUCCESS_CALLS.getName(), streamData.getSuccessCalls()); - - target.put(ResponseTimeDistributionTable.TIME_BUCKET.getName(), streamData.getTimeBucket()); - - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + ResponseTimeDistributionTable.TABLE) - @Override public final ResponseTimeDistribution get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/rtd/ResponseTimeDistributionDayShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/rtd/ResponseTimeDistributionDayShardingjdbcPersistenceDAO.java deleted file mode 100644 index 58780949171bdb2c91232bd360eae73c4ab98f97..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/rtd/ResponseTimeDistributionDayShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.rtd; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionDayPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author linjiaqi - */ -public class ResponseTimeDistributionDayShardingjdbcPersistenceDAO extends AbstractResponseTimeDistributionShardingjdbcPersistenceDAO implements IResponseTimeDistributionDayPersistenceDAO { - - public ResponseTimeDistributionDayShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/rtd/ResponseTimeDistributionHourShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/rtd/ResponseTimeDistributionHourShardingjdbcPersistenceDAO.java deleted file mode 100644 index d1c8aca501817edf18c9c1daa8debb9580f7bcb6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/rtd/ResponseTimeDistributionHourShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.rtd; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionHourPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author linjiaqi - */ -public class ResponseTimeDistributionHourShardingjdbcPersistenceDAO extends AbstractResponseTimeDistributionShardingjdbcPersistenceDAO implements IResponseTimeDistributionHourPersistenceDAO { - - public ResponseTimeDistributionHourShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/rtd/ResponseTimeDistributionMinuteShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/rtd/ResponseTimeDistributionMinuteShardingjdbcPersistenceDAO.java deleted file mode 100644 index 39aed0a9f44f72dc9f536fc5ad212decd695bec1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/rtd/ResponseTimeDistributionMinuteShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.rtd; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionMinutePersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author linjiaqi - */ -public class ResponseTimeDistributionMinuteShardingjdbcPersistenceDAO extends AbstractResponseTimeDistributionShardingjdbcPersistenceDAO implements IResponseTimeDistributionMinutePersistenceDAO { - - public ResponseTimeDistributionMinuteShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/rtd/ResponseTimeDistributionMonthShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/rtd/ResponseTimeDistributionMonthShardingjdbcPersistenceDAO.java deleted file mode 100644 index 66a2d1f89c4af012c3c431b2a8eb03fa15aa1261..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/rtd/ResponseTimeDistributionMonthShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.rtd; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.rtd.IResponseTimeDistributionMonthPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistribution; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author linjiaqi - */ -public class ResponseTimeDistributionMonthShardingjdbcPersistenceDAO extends AbstractResponseTimeDistributionShardingjdbcPersistenceDAO implements IResponseTimeDistributionMonthPersistenceDAO { - - public ResponseTimeDistributionMonthShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/smp/AbstractServiceMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/smp/AbstractServiceMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index f671eca236d3a0ec3eb9cdce13ad80f35765a74e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/smp/AbstractServiceMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.smp; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.MetricTransformUtil; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractServiceMetricShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO { - - AbstractServiceMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return ServiceMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final ServiceMetric shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - ServiceMetric serviceMetric = new ServiceMetric(); - serviceMetric.setId(resultSet.getString(ServiceMetricTable.ID.getName())); - serviceMetric.setMetricId(resultSet.getString(ServiceMetricTable.METRIC_ID.getName())); - - serviceMetric.setApplicationId(resultSet.getInt(ServiceMetricTable.APPLICATION_ID.getName())); - serviceMetric.setInstanceId(resultSet.getInt(ServiceMetricTable.INSTANCE_ID.getName())); - serviceMetric.setServiceId(resultSet.getInt(ServiceMetricTable.SERVICE_ID.getName())); - - MetricTransformUtil.INSTANCE.shardingjdbcDataToStreamData(resultSet, serviceMetric); - - return serviceMetric; - } - - @Override protected final Map streamDataToShardingjdbcData(ServiceMetric streamData) { - Map target = new HashMap<>(); - target.put(ServiceMetricTable.ID.getName(), streamData.getId()); - target.put(ServiceMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(ServiceMetricTable.APPLICATION_ID.getName(), streamData.getApplicationId()); - target.put(ServiceMetricTable.INSTANCE_ID.getName(), streamData.getInstanceId()); - target.put(ServiceMetricTable.SERVICE_ID.getName(), streamData.getServiceId()); - - MetricTransformUtil.INSTANCE.streamDataToShardingjdbcData(streamData, target); - - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + ServiceMetricTable.TABLE) - @Override public final ServiceMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/smp/ServiceDayMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/smp/ServiceDayMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 910e69cbe856bc4121fb26cb088855e0725d78d4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/smp/ServiceDayMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.smp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author linjiaqi - */ -public class ServiceDayMetricShardingjdbcPersistenceDAO extends AbstractServiceMetricShardingjdbcPersistenceDAO implements IServiceDayMetricPersistenceDAO { - - public ServiceDayMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/smp/ServiceHourMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/smp/ServiceHourMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 6d4d1e38de17137001fda8c74d68ed1de9b1b032..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/smp/ServiceHourMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.smp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author linjiaqi - */ -public class ServiceHourMetricShardingjdbcPersistenceDAO extends AbstractServiceMetricShardingjdbcPersistenceDAO implements IServiceHourMetricPersistenceDAO { - - public ServiceHourMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/smp/ServiceMinuteMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/smp/ServiceMinuteMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 94a914f8a7fba0c13f5064d80a96d3fd827beb28..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/smp/ServiceMinuteMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.smp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author linjiaqi - */ -public class ServiceMinuteMetricShardingjdbcPersistenceDAO extends AbstractServiceMetricShardingjdbcPersistenceDAO implements IServiceMinuteMetricPersistenceDAO { - - public ServiceMinuteMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/smp/ServiceMonthMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/smp/ServiceMonthMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index affd00c403c89ebfc74918d0209ed2d35e686161..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/smp/ServiceMonthMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.smp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.smp.IServiceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author linjiaqi - */ -public class ServiceMonthMetricShardingjdbcPersistenceDAO extends AbstractServiceMetricShardingjdbcPersistenceDAO implements IServiceMonthMetricPersistenceDAO { - - public ServiceMonthMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/srmp/AbstractServiceReferenceMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/srmp/AbstractServiceReferenceMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 1e0f5f94641f08dcd13ad877ceec7a997ec4357b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/srmp/AbstractServiceReferenceMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.srmp; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.MetricTransformUtil; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.AbstractPersistenceShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractServiceReferenceMetricShardingjdbcPersistenceDAO extends AbstractPersistenceShardingjdbcDAO { - - AbstractServiceReferenceMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected final String timeBucketColumnNameForDelete() { - return ServiceReferenceMetricTable.TIME_BUCKET.getName(); - } - - @Override protected final ServiceReferenceMetric shardingjdbcDataToStreamData(ResultSet resultSet) throws SQLException { - ServiceReferenceMetric serviceReferenceMetric = new ServiceReferenceMetric(); - serviceReferenceMetric.setId(resultSet.getString(ServiceReferenceMetricTable.ID.getName())); - serviceReferenceMetric.setMetricId(resultSet.getString(ServiceReferenceMetricTable.METRIC_ID.getName())); - - serviceReferenceMetric.setFrontApplicationId(resultSet.getInt(ServiceReferenceMetricTable.FRONT_APPLICATION_ID.getName())); - serviceReferenceMetric.setBehindApplicationId(resultSet.getInt(ServiceReferenceMetricTable.BEHIND_APPLICATION_ID.getName())); - serviceReferenceMetric.setFrontInstanceId(resultSet.getInt(ServiceReferenceMetricTable.FRONT_INSTANCE_ID.getName())); - serviceReferenceMetric.setBehindInstanceId(resultSet.getInt(ServiceReferenceMetricTable.BEHIND_INSTANCE_ID.getName())); - serviceReferenceMetric.setFrontServiceId(resultSet.getInt(ServiceReferenceMetricTable.FRONT_SERVICE_ID.getName())); - serviceReferenceMetric.setBehindServiceId(resultSet.getInt(ServiceReferenceMetricTable.BEHIND_SERVICE_ID.getName())); - - MetricTransformUtil.INSTANCE.shardingjdbcDataToStreamData(resultSet, serviceReferenceMetric); - - return serviceReferenceMetric; - } - - @Override protected final Map streamDataToShardingjdbcData(ServiceReferenceMetric streamData) { - Map target = new HashMap<>(); - target.put(ServiceReferenceMetricTable.ID.getName(), streamData.getId()); - target.put(ServiceReferenceMetricTable.METRIC_ID.getName(), streamData.getMetricId()); - - target.put(ServiceReferenceMetricTable.FRONT_APPLICATION_ID.getName(), streamData.getFrontApplicationId()); - target.put(ServiceReferenceMetricTable.BEHIND_APPLICATION_ID.getName(), streamData.getBehindApplicationId()); - target.put(ServiceReferenceMetricTable.FRONT_INSTANCE_ID.getName(), streamData.getFrontInstanceId()); - target.put(ServiceReferenceMetricTable.BEHIND_INSTANCE_ID.getName(), streamData.getBehindInstanceId()); - target.put(ServiceReferenceMetricTable.FRONT_SERVICE_ID.getName(), streamData.getFrontServiceId()); - target.put(ServiceReferenceMetricTable.BEHIND_SERVICE_ID.getName(), streamData.getBehindServiceId()); - - MetricTransformUtil.INSTANCE.streamDataToShardingjdbcData(streamData, target); - - return target; - } - - @GraphComputingMetric(name = "/persistence/get/" + ServiceReferenceMetricTable.TABLE) - @Override public final ServiceReferenceMetric get(String id) { - return super.get(id); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/srmp/ServiceReferenceDayMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/srmp/ServiceReferenceDayMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 1adb5e3cf60036d0a754eebd2e588ec4e1236eff..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/srmp/ServiceReferenceDayMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.srmp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceDayMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class ServiceReferenceDayMetricShardingjdbcPersistenceDAO extends AbstractServiceReferenceMetricShardingjdbcPersistenceDAO implements IServiceReferenceDayMetricPersistenceDAO { - - public ServiceReferenceDayMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/srmp/ServiceReferenceHourMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/srmp/ServiceReferenceHourMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index da4d37544cd4d0894cd662a49bd1dc79bbe128e0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/srmp/ServiceReferenceHourMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.srmp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceHourMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class ServiceReferenceHourMetricShardingjdbcPersistenceDAO extends AbstractServiceReferenceMetricShardingjdbcPersistenceDAO implements IServiceReferenceHourMetricPersistenceDAO { - - public ServiceReferenceHourMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/srmp/ServiceReferenceMinuteMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/srmp/ServiceReferenceMinuteMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index 7d3ff209ca7d5a16bf205425e8766123cb619c48..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/srmp/ServiceReferenceMinuteMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.srmp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMinuteMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class ServiceReferenceMinuteMetricShardingjdbcPersistenceDAO extends AbstractServiceReferenceMetricShardingjdbcPersistenceDAO implements IServiceReferenceMinuteMetricPersistenceDAO { - - public ServiceReferenceMinuteMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/srmp/ServiceReferenceMonthMetricShardingjdbcPersistenceDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/srmp/ServiceReferenceMonthMetricShardingjdbcPersistenceDAO.java deleted file mode 100644 index f6e632e0102d62f6deab46dff2dbd04d3aebd4df..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/srmp/ServiceReferenceMonthMetricShardingjdbcPersistenceDAO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.srmp; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMonthMetricPersistenceDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcSqlEntity; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class ServiceReferenceMonthMetricShardingjdbcPersistenceDAO extends AbstractServiceReferenceMetricShardingjdbcPersistenceDAO implements IServiceReferenceMonthMetricPersistenceDAO { - - public ServiceReferenceMonthMetricShardingjdbcPersistenceDAO(ShardingjdbcClient client) { - super(client); - } - - @Override protected String tableName() { - return ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ApplicationAlarmListShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ApplicationAlarmListShardingjdbcUIDAO.java deleted file mode 100644 index 0e7e6580132520fa888587725995adec5356f3b7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ApplicationAlarmListShardingjdbcUIDAO.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.LinkedList; -import java.util.List; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationAlarmListUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class ApplicationAlarmListShardingjdbcUIDAO extends ShardingjdbcDAO implements IApplicationAlarmListUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(ApplicationAlarmListShardingjdbcUIDAO.class); - private static final String APPLICATION_ALARM_LIST_SQL = "select {0}, {1}, count({1}) as cnt from {2} where {0} >= ? and {0} <= ? group by {0}, {1} limit 100"; - - public ApplicationAlarmListShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public List getAlarmedApplicationNum(Step step, long startTimeBucket, long endTimeBucket) { - ShardingjdbcClient client = getClient(); - - String tableName = TimePyramidTableNameBuilder.build(step, ApplicationAlarmListTable.TABLE); - - List alarmTrends = new LinkedList<>(); - String sql = SqlBuilder.buildSql(APPLICATION_ALARM_LIST_SQL, ApplicationAlarmListTable.TIME_BUCKET.getName(), - ApplicationAlarmListTable.APPLICATION_ID.getName(), tableName); - - Object[] params = new Object[] {startTimeBucket, endTimeBucket}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - long timeBucket = rs.getLong(ApplicationAlarmListTable.TIME_BUCKET.getName()); - int cnt = rs.getInt("cnt"); - - AlarmTrend alarmTrend = new AlarmTrend(); - alarmTrend.setTimeBucket(timeBucket); - alarmTrend.setNumberOfApplication(cnt); - alarmTrends.add(alarmTrend); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - - return alarmTrends; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ApplicationAlarmShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ApplicationAlarmShardingjdbcUIDAO.java deleted file mode 100644 index ecdeca8f87a887c4a20a7c0203087000c3821399..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ApplicationAlarmShardingjdbcUIDAO.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationAlarmUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmTable; -import org.apache.skywalking.apm.collector.storage.ui.alarm.Alarm; -import org.apache.skywalking.apm.collector.storage.ui.alarm.AlarmItem; -import org.apache.skywalking.apm.collector.storage.ui.alarm.AlarmType; -import org.apache.skywalking.apm.collector.storage.ui.alarm.CauseType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.text.ParseException; -import java.util.List; - -/** - * @author linjiaqi - */ -public class ApplicationAlarmShardingjdbcUIDAO extends ShardingjdbcDAO implements IApplicationAlarmUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(ApplicationAlarmShardingjdbcUIDAO.class); - private static final String APPLICATION_ALARM_SQL = "select {0}, {1}, {2}, {3} from {4} where {2} >= ? and {2} <= ? and {1} like ? and {0} in (?) limit ?, ?"; - - public ApplicationAlarmShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override - public Alarm loadAlarmList(String keyword, List applicationIds, long startTimeBucket, long endTimeBucket, int limit, int from) throws ParseException { - ShardingjdbcClient client = getClient(); - - String tableName = ApplicationAlarmTable.TABLE; - String sql = SqlBuilder.buildSql(APPLICATION_ALARM_SQL, ApplicationAlarmTable.APPLICATION_ID.getName(), ApplicationAlarmTable.ALARM_CONTENT.getName(), - ApplicationAlarmTable.LAST_TIME_BUCKET.getName(), ApplicationAlarmTable.ALARM_TYPE.getName(), tableName); - - String applicationIdsParam = applicationIds.toString().replace("[", "").replace("]", ""); - Object[] params = new Object[] {startTimeBucket, endTimeBucket, keyword == null ? "%%" : "%" + keyword + "%", applicationIdsParam, from, limit}; - Alarm alarm = new Alarm(); - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - int index = 0; - while (rs.next()) { - int applicationId = rs.getInt(ApplicationAlarmTable.APPLICATION_ID.getName()); - String alarmContent = rs.getString(ApplicationAlarmTable.ALARM_CONTENT.getName()); - long lastTimeBucket = rs.getLong(ApplicationAlarmTable.LAST_TIME_BUCKET.getName()); - int alarmType = rs.getInt(ApplicationAlarmTable.ALARM_TYPE.getName()); - - AlarmItem alarmItem = new AlarmItem(); - alarmItem.setId(applicationId); - alarmItem.setContent(alarmContent); - alarmItem.setStartTime(TimeBucketUtils.INSTANCE.formatMinuteTimeBucket(lastTimeBucket)); - alarmItem.setAlarmType(AlarmType.APPLICATION); - - if (org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType.SLOW_RTT.getValue() == alarmType) { - alarmItem.setCauseType(CauseType.SLOW_RESPONSE); - } else if (org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType.ERROR_RATE.getValue() == alarmType) { - alarmItem.setCauseType(CauseType.LOW_SUCCESS_RATE); - } - index++; - alarm.getItems().add(alarmItem); - } - alarm.setTotal(index); - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - - return alarm; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ApplicationComponentShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ApplicationComponentShardingjdbcUIDAO.java deleted file mode 100644 index c416bd69b7bd666d1c5befec0b9d06a806b6331c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ApplicationComponentShardingjdbcUIDAO.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.LinkedList; -import java.util.List; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationComponentUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class ApplicationComponentShardingjdbcUIDAO extends ShardingjdbcDAO implements IApplicationComponentUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(ApplicationComponentShardingjdbcUIDAO.class); - private static final String APPLICATION_COMPONENT_SQL = "select {0}, {1} from {2} where {3} >= ? and {3} <= ? group by {0}, {1} limit 100"; - - public ApplicationComponentShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public List load(Step step, long startTimeBucket, long endTimeBucket) { - ShardingjdbcClient client = getClient(); - - String tableName = TimePyramidTableNameBuilder.build(step, ApplicationComponentTable.TABLE); - - List applicationComponents = new LinkedList<>(); - String sql = SqlBuilder.buildSql(APPLICATION_COMPONENT_SQL, ApplicationComponentTable.COMPONENT_ID.getName(), ApplicationComponentTable.APPLICATION_ID.getName(), - tableName, ApplicationComponentTable.TIME_BUCKET.getName()); - - Object[] params = new Object[] {startTimeBucket, endTimeBucket}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - int applicationId = rs.getInt(ApplicationComponentTable.APPLICATION_ID.getName()); - int componentId = rs.getInt(ApplicationComponentTable.COMPONENT_ID.getName()); - - ApplicationComponent applicationComponent = new ApplicationComponent(); - applicationComponent.setComponentId(componentId); - applicationComponent.setApplicationId(applicationId); - applicationComponents.add(applicationComponent); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return applicationComponents; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ApplicationMappingShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ApplicationMappingShardingjdbcUIDAO.java deleted file mode 100644 index 34fb1f65bf2a738a17b84a76ed881ec0622b6ccd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ApplicationMappingShardingjdbcUIDAO.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.LinkedList; -import java.util.List; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMappingUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class ApplicationMappingShardingjdbcUIDAO extends ShardingjdbcDAO implements IApplicationMappingUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(ApplicationMappingShardingjdbcUIDAO.class); - private static final String APPLICATION_MAPPING_SQL = "select {0}, {1} from {2} where {3} >= ? and {3} <= ? group by {0}, {1} limit 100"; - - public ApplicationMappingShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public List load(Step step, long startTimeBucket, long endTimeBucket) { - String tableName = TimePyramidTableNameBuilder.build(step, ApplicationMappingTable.TABLE); - - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(APPLICATION_MAPPING_SQL, ApplicationMappingTable.APPLICATION_ID.getName(), - ApplicationMappingTable.MAPPING_APPLICATION_ID.getName(), tableName, ApplicationMappingTable.TIME_BUCKET.getName()); - - List applicationMappings = new LinkedList<>(); - Object[] params = new Object[] {startTimeBucket, endTimeBucket}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - int applicationId = rs.getInt(ApplicationMappingTable.APPLICATION_ID.getName()); - int addressId = rs.getInt(ApplicationMappingTable.MAPPING_APPLICATION_ID.getName()); - - ApplicationMapping applicationMapping = new ApplicationMapping(); - applicationMapping.setApplicationId(applicationId); - applicationMapping.setMappingApplicationId(addressId); - applicationMappings.add(applicationMapping); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - logger.debug("node mapping data: {}", applicationMappings.toString()); - return applicationMappings; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ApplicationMetricShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ApplicationMetricShardingjdbcUIDAO.java deleted file mode 100644 index 982ed88f708fdbd576b1364dd71ec7421db8e7b1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ApplicationMetricShardingjdbcUIDAO.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.ui.overview.ApplicationThroughput; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.LinkedList; -import java.util.List; - -/** - * @author linjiaqi - */ -public class ApplicationMetricShardingjdbcUIDAO extends ShardingjdbcDAO implements IApplicationMetricUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(ApplicationMetricShardingjdbcUIDAO.class); - private static final String APPLICATION_THROUGHPUT_TOPN_SQL = "select {0}, sum({1}) as {1} from {2} where {3} >= ? and {3} <= ? and {4} = ? group by {0} order by {1} desc limit ?"; - private static final String APPLICATION_GET_SQL = "select {0}, sum({1}) as {1}, sum({2}) as {2}, sum({3}) as {3}, sum({4}) as {4}, sum({5}) as {5}, sum({6}) as {6}, sum({7}) as {7} from {8} " + - "where {9} >= ? and {9} <= ? and {10} = ? group by {0} limit 100"; - - public ApplicationMetricShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override - public List getTopNApplicationThroughput(Step step, long startTimeBucket, long endTimeBucket, - int minutesBetween, int topN, MetricSource metricSource) { - ShardingjdbcClient client = getClient(); - - String tableName = TimePyramidTableNameBuilder.build(step, ApplicationMetricTable.TABLE); - - List applicationThroughputList = new LinkedList<>(); - String sql = SqlBuilder.buildSql(APPLICATION_THROUGHPUT_TOPN_SQL, ApplicationMetricTable.APPLICATION_ID.getName(), - ApplicationMetricTable.TRANSACTION_CALLS.getName(), tableName, ApplicationMetricTable.TIME_BUCKET.getName(), - ApplicationMetricTable.SOURCE_VALUE.getName()); - - Object[] params = new Object[]{startTimeBucket, endTimeBucket, metricSource.getValue(), topN}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - int applicationId = rs.getInt(ApplicationMetricTable.APPLICATION_ID.getName()); - long calls = rs.getLong(ApplicationMetricTable.TRANSACTION_CALLS.getName()); - int callsPerMinute = (int) (minutesBetween == 0 ? 0 : calls / minutesBetween); - - ApplicationThroughput applicationThroughput = new ApplicationThroughput(); - applicationThroughput.setApplicationId(applicationId); - applicationThroughput.setCpm(callsPerMinute); - applicationThroughputList.add(applicationThroughput); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - - return applicationThroughputList; - } - - @Override - public List getApplications(Step step, long startTimeBucket, - long endTimeBucket, MetricSource metricSource) { - ShardingjdbcClient client = getClient(); - - String tableName = TimePyramidTableNameBuilder.build(step, ApplicationMetricTable.TABLE); - - List applicationMetrics = new LinkedList<>(); - String sql = SqlBuilder.buildSql(APPLICATION_GET_SQL, ApplicationMetricTable.APPLICATION_ID.getName(), - ApplicationMetricTable.TRANSACTION_CALLS.getName(), ApplicationMetricTable.TRANSACTION_ERROR_CALLS.getName(), - ApplicationMetricTable.TRANSACTION_DURATION_SUM.getName(), ApplicationMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName(), - ApplicationMetricTable.SATISFIED_COUNT.getName(), ApplicationMetricTable.TOLERATING_COUNT.getName(), - ApplicationMetricTable.FRUSTRATED_COUNT.getName(), tableName, ApplicationMetricTable.TIME_BUCKET.getName(), - ApplicationMetricTable.SOURCE_VALUE.getName()); - - Object[] params = new Object[]{startTimeBucket, endTimeBucket, metricSource.getValue()}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - int applicationId = rs.getInt(ApplicationMetricTable.APPLICATION_ID.getName()); - long calls = rs.getLong(ApplicationMetricTable.TRANSACTION_CALLS.getName()); - long errorCalls = rs.getLong(ApplicationMetricTable.TRANSACTION_ERROR_CALLS.getName()); - long durations = rs.getLong(ApplicationMetricTable.TRANSACTION_DURATION_SUM.getName()); - long errorDurations = rs.getLong(ApplicationMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName()); - long satisfiedCount = rs.getLong(ApplicationMetricTable.SATISFIED_COUNT.getName()); - long toleratingCount = rs.getLong(ApplicationMetricTable.TOLERATING_COUNT.getName()); - long frustratedCount = rs.getLong(ApplicationMetricTable.FRUSTRATED_COUNT.getName()); - - ApplicationMetric applicationMetric = new ApplicationMetric(); - applicationMetric.setId(applicationId); - applicationMetric.setCalls(calls); - applicationMetric.setErrorCalls(errorCalls); - applicationMetric.setDurations(durations); - applicationMetric.setErrorDurations(errorDurations); - applicationMetric.setSatisfiedCount(satisfiedCount); - applicationMetric.setToleratingCount(toleratingCount); - applicationMetric.setFrustratedCount(frustratedCount); - applicationMetrics.add(applicationMetric); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - - return applicationMetrics; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ApplicationReferenceMetricShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ApplicationReferenceMetricShardingjdbcUIDAO.java deleted file mode 100644 index cb5690c2315bb2da80c211d7fc3a203bd04c0306..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ApplicationReferenceMetricShardingjdbcUIDAO.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationReferenceMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class ApplicationReferenceMetricShardingjdbcUIDAO extends ShardingjdbcDAO implements IApplicationReferenceMetricUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(ApplicationReferenceMetricShardingjdbcUIDAO.class); - private static final String APPLICATION_REFERENCE_SQL_ONE = "select {7}, {8}, sum({0}) as {0}, sum({1}) as {1}, sum({2}) as {2}, " + - "sum({3}) as {3} from {4} where {5} >= ? and {5} <= ? and {6} = ? and {7} in (?) group by {7}, {8} limit 100"; - private static final String APPLICATION_REFERENCE_SQL_TWO = "select {7}, {8}, sum({0}) as {0}, sum({1}) as {1}, sum({2}) as {2}, " + - "sum({3}) as {3} from {4} where {5} >= ? and {5} <= ? and {6} = ? and {8} in (?) group by {7}, {8} limit 100"; - - public ApplicationReferenceMetricShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public List getReferences(Step step, - long startTimeBucket, long endTimeBucket, MetricSource metricSource, Integer... applicationIds) { - ShardingjdbcClient client = getClient(); - - String tableName = TimePyramidTableNameBuilder.build(step, ApplicationReferenceMetricTable.TABLE); - - List referenceMetrics = new LinkedList<>(); - String sqlOne = SqlBuilder.buildSql(APPLICATION_REFERENCE_SQL_ONE, ApplicationReferenceMetricTable.TRANSACTION_CALLS.getName(), - ApplicationReferenceMetricTable.TRANSACTION_ERROR_CALLS.getName(), ApplicationReferenceMetricTable.TRANSACTION_DURATION_SUM.getName(), - ApplicationReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName(), tableName, ApplicationReferenceMetricTable.TIME_BUCKET.getName(), - ApplicationReferenceMetricTable.SOURCE_VALUE.getName(), ApplicationReferenceMetricTable.FRONT_APPLICATION_ID.getName(), - ApplicationReferenceMetricTable.BEHIND_APPLICATION_ID.getName()); - String sqlTwo = SqlBuilder.buildSql(APPLICATION_REFERENCE_SQL_TWO, ApplicationReferenceMetricTable.TRANSACTION_CALLS.getName(), - ApplicationReferenceMetricTable.TRANSACTION_ERROR_CALLS.getName(), ApplicationReferenceMetricTable.TRANSACTION_DURATION_SUM.getName(), - ApplicationReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName(), tableName, ApplicationReferenceMetricTable.TIME_BUCKET.getName(), - ApplicationReferenceMetricTable.SOURCE_VALUE.getName(), ApplicationReferenceMetricTable.FRONT_APPLICATION_ID.getName(), - ApplicationReferenceMetricTable.BEHIND_APPLICATION_ID.getName()); - - String applicationIdsParam = Arrays.toString(applicationIds).replace("[", "").replace("]", ""); - Object[] params = new Object[] {startTimeBucket, endTimeBucket, metricSource.getValue(), applicationIdsParam}; - - try ( - ResultSet rs = client.executeQuery(sqlOne, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - int sourceApplicationId = rs.getInt(ApplicationReferenceMetricTable.FRONT_APPLICATION_ID.getName()); - int targetApplicationId = rs.getInt(ApplicationReferenceMetricTable.BEHIND_APPLICATION_ID.getName()); - long calls = rs.getLong(ApplicationReferenceMetricTable.TRANSACTION_CALLS.getName()); - long errorCalls = rs.getLong(ApplicationReferenceMetricTable.TRANSACTION_ERROR_CALLS.getName()); - long durations = rs.getLong(ApplicationReferenceMetricTable.TRANSACTION_DURATION_SUM.getName()); - long errorDurations = rs.getLong(ApplicationReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName()); - - ApplicationReferenceMetric referenceMetric = new ApplicationReferenceMetric(); - referenceMetric.setSource(sourceApplicationId); - referenceMetric.setTarget(targetApplicationId); - referenceMetric.setCalls(calls); - referenceMetric.setErrorCalls(errorCalls); - referenceMetric.setDurations(durations); - referenceMetric.setErrorDurations(errorDurations); - referenceMetrics.add(referenceMetric); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - - try ( - ResultSet rs = client.executeQuery(sqlTwo, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - int sourceApplicationId = rs.getInt(ApplicationReferenceMetricTable.FRONT_APPLICATION_ID.getName()); - int targetApplicationId = rs.getInt(ApplicationReferenceMetricTable.BEHIND_APPLICATION_ID.getName()); - long calls = rs.getLong(ApplicationReferenceMetricTable.TRANSACTION_CALLS.getName()); - long errorCalls = rs.getLong(ApplicationReferenceMetricTable.TRANSACTION_ERROR_CALLS.getName()); - long durations = rs.getLong(ApplicationReferenceMetricTable.TRANSACTION_DURATION_SUM.getName()); - long errorDurations = rs.getLong(ApplicationReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName()); - - ApplicationReferenceMetric referenceMetric = new ApplicationReferenceMetric(); - referenceMetric.setSource(sourceApplicationId); - referenceMetric.setTarget(targetApplicationId); - referenceMetric.setCalls(calls); - referenceMetric.setErrorCalls(errorCalls); - referenceMetric.setDurations(durations); - referenceMetric.setErrorDurations(errorDurations); - referenceMetrics.add(referenceMetric); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - - return referenceMetrics.size() > 100 ? referenceMetrics.subList(0, 100) : referenceMetrics; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/CpuMetricShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/CpuMetricShardingjdbcUIDAO.java deleted file mode 100644 index 3fbc86ff9775ad7e49ebbea163129ad35809b0cf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/CpuMetricShardingjdbcUIDAO.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.LinkedList; -import java.util.List; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.ICpuMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class CpuMetricShardingjdbcUIDAO extends ShardingjdbcDAO implements ICpuMetricUIDAO { - private static final Logger logger = LoggerFactory.getLogger(CpuMetricShardingjdbcUIDAO.class); - private static final String GET_CPU_METRIC_SQL = "select * from {0} where {1} = ?"; - - public CpuMetricShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public List getCPUTrend(int instanceId, Step step, List durationPoints) { - ShardingjdbcClient client = getClient(); - String tableName = TimePyramidTableNameBuilder.build(step, CpuMetricTable.TABLE); - String sql = SqlBuilder.buildSql(GET_CPU_METRIC_SQL, tableName, CpuMetricTable.ID.getName()); - - List cpuTrends = new LinkedList<>(); - durationPoints.forEach(durationPoint -> { - String id = durationPoint.getPoint() + Const.ID_SPLIT + instanceId; - - try ( - ResultSet rs = client.executeQuery(sql, new String[] {id}); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - double cpuUsed = rs.getDouble(CpuMetricTable.USAGE_PERCENT.getName()); - long times = rs.getLong(CpuMetricTable.TIMES.getName()); - cpuTrends.add((int)((cpuUsed / times) * 100)); - } else { - cpuTrends.add(0); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - }); - - return cpuTrends; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/GCMetricShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/GCMetricShardingjdbcUIDAO.java deleted file mode 100644 index b7e86fcf0bdc93d8f1f9267e009f2fe2e141618c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/GCMetricShardingjdbcUIDAO.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import java.sql.*; -import java.util.*; -import org.apache.skywalking.apm.collector.client.shardingjdbc.*; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IGCMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.*; -import org.apache.skywalking.apm.network.language.agent.GCPhrase; -import org.slf4j.*; - -/** - * @author linjiaqi - */ -public class GCMetricShardingjdbcUIDAO extends ShardingjdbcDAO implements IGCMetricUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(GCMetricShardingjdbcUIDAO.class); - private static final String GET_GC_METRIC_SQL = "select * from {0} where {1} = ?"; - - public GCMetricShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public List getYoungGCTrend(int instanceId, Step step, List durationPoints) { - return getGCTrend(instanceId, step, durationPoints, GCPhrase.NEW_VALUE); - } - - @Override public List getOldGCTrend(int instanceId, Step step, List durationPoints) { - return getGCTrend(instanceId, step, durationPoints, GCPhrase.OLD_VALUE); - } - - private List getGCTrend(int instanceId, Step step, List durationPoints, int gcPhrase) { - String tableName = TimePyramidTableNameBuilder.build(step, GCMetricTable.TABLE); - - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(GET_GC_METRIC_SQL, tableName, GCMetricTable.ID.getName()); - - List gcTrends = new LinkedList<>(); - durationPoints.forEach(durationPoint -> { - String id = durationPoint.getPoint() + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + gcPhrase; - try ( - ResultSet rs = client.executeQuery(sql, new String[] {id}); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - long count = rs.getLong(GCMetricTable.COUNT.getName()); - long duration = rs.getLong(GCMetricTable.DURATION.getName()); - long times = rs.getLong(GCMetricTable.TIMES.getName()); - gcTrends.add(new Trend((int)count, (int)(duration / times))); - } else { - gcTrends.add(new Trend(0, 0)); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - gcTrends.add(new Trend(0, 0)); - } - }); - - return gcTrends; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/GlobalTraceShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/GlobalTraceShardingjdbcUIDAO.java deleted file mode 100644 index eebd39f120f7eac42e7d1b1c3fa8abe8ed8511e8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/GlobalTraceShardingjdbcUIDAO.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.ArrayList; -import java.util.List; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IGlobalTraceUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.global.GlobalTraceTable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class GlobalTraceShardingjdbcUIDAO extends ShardingjdbcDAO implements IGlobalTraceUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(GlobalTraceShardingjdbcUIDAO.class); - - private static final String GET_GLOBAL_TRACE_ID_SQL = "select {0} from {1} where {2} = ? limit 10"; - private static final String GET_SEGMENT_IDS_SQL = "select {0} from {1} where {2} = ? limit 10"; - - public GlobalTraceShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public List getGlobalTraceId(String segmentId) { - List globalTraceIds = new ArrayList<>(); - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(GET_GLOBAL_TRACE_ID_SQL, GlobalTraceTable.TRACE_ID.getName(), - GlobalTraceTable.TABLE, GlobalTraceTable.SEGMENT_ID.getName()); - Object[] params = new Object[] {segmentId}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - String globalTraceId = rs.getString(GlobalTraceTable.TRACE_ID.getName()); - logger.debug("segmentId: {}, global trace id: {}", segmentId, globalTraceId); - globalTraceIds.add(globalTraceId); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return globalTraceIds; - } - - @Override public List getSegmentIds(String globalTraceId) { - List segmentIds = new ArrayList<>(); - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(GET_SEGMENT_IDS_SQL, GlobalTraceTable.SEGMENT_ID.getName(), - GlobalTraceTable.TABLE, GlobalTraceTable.TRACE_ID); - Object[] params = new Object[] {globalTraceId}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - String segmentId = rs.getString(GlobalTraceTable.SEGMENT_ID.getName()); - logger.debug("segmentId: {}, global trace id: {}", segmentId, globalTraceId); - segmentIds.add(segmentId); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return segmentIds; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/InstanceAlarmShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/InstanceAlarmShardingjdbcUIDAO.java deleted file mode 100644 index 9f99a97494ab548b57d1a9320a6ebcbaa699542c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/InstanceAlarmShardingjdbcUIDAO.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.text.ParseException; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceAlarmUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmTable; -import org.apache.skywalking.apm.collector.storage.ui.alarm.Alarm; -import org.apache.skywalking.apm.collector.storage.ui.alarm.AlarmItem; -import org.apache.skywalking.apm.collector.storage.ui.alarm.AlarmType; -import org.apache.skywalking.apm.collector.storage.ui.alarm.CauseType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class InstanceAlarmShardingjdbcUIDAO extends ShardingjdbcDAO implements IInstanceAlarmUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(InstanceAlarmShardingjdbcUIDAO.class); - private static final String INSTANCE_ALARM_SQL = "select {0}, {1}, {2}, {3} from {4} where {2} >= ? and {2} <= ? and {1} like ? limit ?, ?"; - - - public InstanceAlarmShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public Alarm loadAlarmList(String keyword, long startTimeBucket, long endTimeBucket, int limit, int from) throws ParseException { - ShardingjdbcClient client = getClient(); - - String tableName = InstanceAlarmTable.TABLE; - String sql = SqlBuilder.buildSql(INSTANCE_ALARM_SQL, InstanceAlarmTable.INSTANCE_ID.getName(), InstanceAlarmTable.ALARM_CONTENT.getName(), - InstanceAlarmTable.LAST_TIME_BUCKET.getName(), InstanceAlarmTable.ALARM_TYPE.getName(), tableName); - - Object[] params = new Object[] {startTimeBucket, endTimeBucket, keyword == null ? "%%" : "%" + keyword + "%", from, limit}; - Alarm alarm = new Alarm(); - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - int index = 0; - while (rs.next()) { - int instanceId = rs.getInt(InstanceAlarmTable.INSTANCE_ID.getName()); - String alarmContent = rs.getString(InstanceAlarmTable.ALARM_CONTENT.getName()); - long lastTimeBucket = rs.getLong(InstanceAlarmTable.LAST_TIME_BUCKET.getName()); - int alarmType = rs.getInt(InstanceAlarmTable.ALARM_TYPE.getName()); - - AlarmItem alarmItem = new AlarmItem(); - alarmItem.setId(instanceId); - alarmItem.setContent(alarmContent); - alarmItem.setStartTime(TimeBucketUtils.INSTANCE.formatMinuteTimeBucket(lastTimeBucket)); - alarmItem.setAlarmType(AlarmType.SERVER); - - if (org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType.SLOW_RTT.getValue() == alarmType) { - alarmItem.setCauseType(CauseType.SLOW_RESPONSE); - } else if (org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType.ERROR_RATE.getValue() == alarmType) { - alarmItem.setCauseType(CauseType.LOW_SUCCESS_RATE); - } - index++; - alarm.getItems().add(alarmItem); - } - alarm.setTotal(index); - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - - return alarm; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/InstanceMetricShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/InstanceMetricShardingjdbcUIDAO.java deleted file mode 100644 index 7bbf36f2c92ddbd1f68add8d3c3ae9ddb20f2300..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/InstanceMetricShardingjdbcUIDAO.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.LinkedList; -import java.util.List; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class InstanceMetricShardingjdbcUIDAO extends ShardingjdbcDAO implements IInstanceMetricUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(InstanceMetricShardingjdbcUIDAO.class); - private static final String GET_THROUGHPUT_METRIC_SQL = "select {1}, sum({2}) as {2} from {3} where {4} >= ? and {4} <= ? and {5} = ? and {1} = ? group by {0} order by {2} desc limit ?"; - private static final String GET_TPS_METRIC_SQL = "select * from {0} where {1} = ?"; - - public InstanceMetricShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public List getServerThroughput(int applicationId, Step step, long startTimeBucket, long endTimeBucket, - int minutesBetween, int topN, MetricSource metricSource) { - ShardingjdbcClient client = getClient(); - - String tableName = TimePyramidTableNameBuilder.build(step, InstanceMetricTable.TABLE); - - List appServerInfos = new LinkedList<>(); - String sql = SqlBuilder.buildSql(GET_THROUGHPUT_METRIC_SQL, InstanceMetricTable.INSTANCE_ID.getName(), - InstanceMetricTable.APPLICATION_ID.getName(), InstanceMetricTable.TRANSACTION_CALLS.getName(), - tableName, InstanceMetricTable.TIME_BUCKET.getName(), InstanceMetricTable.SOURCE_VALUE.getName()); - - Object[] params = new Object[] {startTimeBucket, endTimeBucket, metricSource.getValue(), applicationId, topN}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - int instanceId = rs.getInt(InstanceMetricTable.INSTANCE_ID.getName()); - long calls = rs.getLong(InstanceMetricTable.TRANSACTION_CALLS.getName()); - int callsPerMinute = (int)(minutesBetween == 0 ? 0 : calls / minutesBetween); - - AppServerInfo appServerInfo = new AppServerInfo(); - appServerInfo.setId(instanceId); - appServerInfo.setCpm(callsPerMinute); - appServerInfos.add(appServerInfo); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - - return appServerInfos; - } - - @Override public List getServerThroughputTrend(int instanceId, Step step, List durationPoints) { - ShardingjdbcClient client = getClient(); - String tableName = TimePyramidTableNameBuilder.build(step, InstanceMetricTable.TABLE); - - String sql = SqlBuilder.buildSql(GET_TPS_METRIC_SQL, tableName, InstanceMetricTable.ID.getName()); - - List throughputTrend = new LinkedList<>(); - durationPoints.forEach(durationPoint -> { - String id = durationPoint.getPoint() + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + MetricSource.Callee.getValue(); - try ( - ResultSet rs = client.executeQuery(sql, new Object[] {id}); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - long callTimes = rs.getLong(InstanceMetricTable.TRANSACTION_CALLS.getName()); - throughputTrend.add((int)(callTimes / durationPoint.getSecondsBetween())); - } else { - throughputTrend.add(0); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - }); - - return throughputTrend; - } - - @Override public List getResponseTimeTrend(int instanceId, Step step, List durationPoints) { - ShardingjdbcClient client = getClient(); - - String tableName = TimePyramidTableNameBuilder.build(step, InstanceMetricTable.TABLE); - String sql = SqlBuilder.buildSql(GET_TPS_METRIC_SQL, tableName, InstanceMetricTable.ID.getName()); - - List responseTimeTrends = new LinkedList<>(); - durationPoints.forEach(durationPoint -> { - String id = durationPoint.getPoint() + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + MetricSource.Callee.getValue(); - try ( - ResultSet rs = client.executeQuery(sql, new Object[] {id}); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - long callTimes = rs.getLong(InstanceMetricTable.TRANSACTION_CALLS.getName()); - long durationSum = rs.getLong(InstanceMetricTable.TRANSACTION_DURATION_SUM.getName()); - responseTimeTrends.add((int) (durationSum / callTimes)); - } else { - responseTimeTrends.add(0); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - }); - return responseTimeTrends; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/InstanceShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/InstanceShardingjdbcUIDAO.java deleted file mode 100644 index b461c007a8176ab6d03813bf60a51da7acfc328f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/InstanceShardingjdbcUIDAO.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.core.util.BooleanUtils; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.register.Instance; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; -import org.apache.skywalking.apm.collector.storage.ui.application.Application; -import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class InstanceShardingjdbcUIDAO extends ShardingjdbcDAO implements IInstanceUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(InstanceShardingjdbcUIDAO.class); - - public InstanceShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - private static final String GET_INSTANCE_SQL = "select * from {0} where {1} = ?"; - private static final String GET_APPLICATIONS_SQL = "select {4}, count({0}) as cnt from {1} where {2} >= ? and {3} <= ? and {4} in (?) group by {4} limit 100"; - private static final String GET_REGISTER_TIME_SQL = "select {2} from {0} where {1} = ? order by {2} asc"; - private static final String GET_HEARTBEAT_TIME_SQL = "select {2} from {0} where {1} = ? order by {2} desc"; - - @Override - public List getApplications(long startSecondTimeBucket, long endSecondTimeBucket, - int... applicationIds) { - ShardingjdbcClient client = getClient(); - List applications = new LinkedList<>(); - String sqlOne = SqlBuilder.buildSql(GET_APPLICATIONS_SQL, InstanceTable.INSTANCE_ID.getName(), - InstanceTable.TABLE, InstanceTable.HEARTBEAT_TIME.getName(), InstanceTable.REGISTER_TIME.getName(), InstanceTable.APPLICATION_ID.getName()); - String sqlTwo = SqlBuilder.buildSql(GET_APPLICATIONS_SQL, InstanceTable.INSTANCE_ID.getName(), - InstanceTable.TABLE, InstanceTable.REGISTER_TIME.getName(), InstanceTable.HEARTBEAT_TIME.getName(), InstanceTable.APPLICATION_ID.getName()); - String applicationIdsParam = Arrays.toString(applicationIds).replace("[", "").replace("]", ""); - Object[] params = new Object[] {startSecondTimeBucket, endSecondTimeBucket, applicationIdsParam}; - try ( - ResultSet rs = client.executeQuery(sqlOne, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - Integer applicationId = rs.getInt(InstanceTable.APPLICATION_ID.getName()); - logger.debug("applicationId: {}", applicationId); - Application application = new Application(); - application.setId(applicationId); - application.setNumOfServer(rs.getInt("cnt")); - applications.add(application); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - try ( - ResultSet rs = client.executeQuery(sqlTwo, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - Integer applicationId = rs.getInt(InstanceTable.APPLICATION_ID.getName()); - logger.debug("applicationId: {}", applicationId); - Application application = new Application(); - application.setId(applicationId); - application.setNumOfServer(rs.getInt("cnt")); - applications.add(application); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return applications; - } - - @Override - public Instance getInstance(int instanceId) { - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(GET_INSTANCE_SQL, InstanceTable.TABLE, InstanceTable.INSTANCE_ID.getName()); - Object[] params = new Object[] {instanceId}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - Instance instance = new Instance(); - instance.setId(rs.getString(InstanceTable.ID.getName())); - instance.setApplicationId(rs.getInt(InstanceTable.APPLICATION_ID.getName())); - instance.setAgentUUID(rs.getString(InstanceTable.AGENT_UUID.getName())); - instance.setRegisterTime(rs.getLong(InstanceTable.REGISTER_TIME.getName())); - instance.setHeartBeatTime(rs.getLong(InstanceTable.HEARTBEAT_TIME.getName())); - instance.setOsInfo(rs.getString(InstanceTable.OS_INFO.getName())); - return instance; - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return null; - } - - @Override - public List searchServer(String keyword, long startSecondTimeBucket, long endSecondTimeBucket) { - logger.debug("get instances info, keyword: {}, start: {}, end: {}", keyword, startSecondTimeBucket, endSecondTimeBucket); - String dynamicSql = "select * from {0} where {1} like ? and {2} >= ? and {3} <= ? and {4} = ?"; - String sqlOne = SqlBuilder.buildSql(dynamicSql, InstanceTable.TABLE, InstanceTable.OS_INFO.getName(), InstanceTable.REGISTER_TIME.getName(), InstanceTable.HEARTBEAT_TIME.getName(), InstanceTable.IS_ADDRESS.getName()); - String sqlTwo = SqlBuilder.buildSql(dynamicSql, InstanceTable.TABLE, InstanceTable.OS_INFO.getName(), InstanceTable.HEARTBEAT_TIME.getName(), InstanceTable.REGISTER_TIME.getName(), InstanceTable.IS_ADDRESS.getName()); - Object[] params = new Object[] {keyword, startSecondTimeBucket, endSecondTimeBucket, BooleanUtils.FALSE}; - - List result = new LinkedList<>(); - result.addAll(buildAppServerInfo(sqlOne, params)); - result.addAll(buildAppServerInfo(sqlTwo, params)); - return result; - } - - @Override - public List getAllServer(int applicationId, long startSecondTimeBucket, long endSecondTimeBucket) { - logger.debug("get instances info, applicationId: {}, startSecondTimeBucket: {}, endSecondTimeBucket: {}", applicationId, startSecondTimeBucket, endSecondTimeBucket); - String dynamicSql = "select * from {0} where {1} = ? and {2} >= ? and {2} <= ? and {3} = ?"; - String sqlOne = SqlBuilder.buildSql(dynamicSql, InstanceTable.TABLE, InstanceTable.APPLICATION_ID.getName(), InstanceTable.REGISTER_TIME.getName(), InstanceTable.HEARTBEAT_TIME.getName(), InstanceTable.IS_ADDRESS.getName()); - String sqlTwo = SqlBuilder.buildSql(dynamicSql, InstanceTable.TABLE, InstanceTable.APPLICATION_ID.getName(), InstanceTable.HEARTBEAT_TIME.getName(), InstanceTable.REGISTER_TIME.getName(), InstanceTable.IS_ADDRESS.getName()); - Object[] params = new Object[] {applicationId, startSecondTimeBucket, endSecondTimeBucket, BooleanUtils.FALSE}; - - List result = new LinkedList<>(); - result.addAll(buildAppServerInfo(sqlOne, params)); - result.addAll(buildAppServerInfo(sqlTwo, params)); - return result; - } - - private List buildAppServerInfo(String sql, Object[] params) { - ShardingjdbcClient client = getClient(); - - List appServerInfos = new LinkedList<>(); - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - AppServerInfo appServerInfo = new AppServerInfo(); - appServerInfo.setId(rs.getInt(InstanceTable.INSTANCE_ID.getName())); - appServerInfo.setOsInfo(rs.getString(InstanceTable.OS_INFO.getName())); - appServerInfos.add(appServerInfo); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return appServerInfos; - } - - @Override public long getEarliestRegisterTime(int applicationId) { - ShardingjdbcClient client = getClient(); - - String sql = SqlBuilder.buildSql(GET_REGISTER_TIME_SQL, InstanceTable.TABLE, InstanceTable.APPLICATION_ID.getName(), InstanceTable.REGISTER_TIME.getName()); - Object[] params = new Object[] {applicationId}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - return rs.getLong(InstanceTable.REGISTER_TIME.getName()); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } - - @Override public long getLatestHeartBeatTime(int applicationId) { - ShardingjdbcClient client = getClient(); - - String sql = SqlBuilder.buildSql(GET_HEARTBEAT_TIME_SQL, InstanceTable.TABLE, InstanceTable.APPLICATION_ID.getName(), InstanceTable.HEARTBEAT_TIME.getName()); - Object[] params = new Object[] {applicationId}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - return rs.getLong(InstanceTable.HEARTBEAT_TIME.getName()); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/MemoryMetricShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/MemoryMetricShardingjdbcUIDAO.java deleted file mode 100644 index b290ca67c6243987799fe12c414c457bba279d38..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/MemoryMetricShardingjdbcUIDAO.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.List; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.core.util.BooleanUtils; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IMemoryMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class MemoryMetricShardingjdbcUIDAO extends ShardingjdbcDAO implements IMemoryMetricUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(MemoryMetricShardingjdbcUIDAO.class); - private static final String GET_MEMORY_METRIC_SQL = "select * from {0} where {1} = ?"; - - public MemoryMetricShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public Trend getHeapMemoryTrend(int instanceId, Step step, List durationPoints) { - return getMemoryTrend(instanceId, step, durationPoints, true); - } - - @Override public Trend getNoHeapMemoryTrend(int instanceId, Step step, List durationPoints) { - return getMemoryTrend(instanceId, step, durationPoints, false); - } - - private Trend getMemoryTrend(int instanceId, Step step, List durationPoints, - boolean isHeap) { - String tableName = TimePyramidTableNameBuilder.build(step, MemoryMetricTable.TABLE); - - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(GET_MEMORY_METRIC_SQL, tableName, MemoryMetricTable.ID.getName()); - - Trend trend = new Trend(); - durationPoints.forEach(durationPoint -> { - String id = durationPoint.getPoint() + Const.ID_SPLIT + instanceId + Const.ID_SPLIT + BooleanUtils.booleanToValue(isHeap); - try ( - ResultSet rs = client.executeQuery(sql, new String[] {id}); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - long max = rs.getLong(MemoryMetricTable.MAX.getName()); - long used = rs.getLong(MemoryMetricTable.USED.getName()); - long times = rs.getLong(MemoryMetricTable.TIMES.getName()); - trend.getMetrics().add((int)(used / times)); - - if (max < 0) { - trend.getMaxMetrics().add((int)(used / times)); - } else { - trend.getMaxMetrics().add((int)(max / times)); - } - } else { - trend.getMetrics().add(0); - trend.getMaxMetrics().add(0); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - }); - - return trend; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/NetworkAddressShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/NetworkAddressShardingjdbcUIDAO.java deleted file mode 100644 index e10928b5c02ca5db202eb4afbc54b1bc007881d5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/NetworkAddressShardingjdbcUIDAO.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.LinkedList; -import java.util.List; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.INetworkAddressUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddressTable; -import org.apache.skywalking.apm.collector.storage.ui.overview.ConjecturalApp; -import org.apache.skywalking.apm.network.language.agent.SpanLayer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class NetworkAddressShardingjdbcUIDAO extends ShardingjdbcDAO implements INetworkAddressUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(NetworkAddressShardingjdbcUIDAO.class); - - public NetworkAddressShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public int getNumOfSpanLayer(int srcSpanLayer) { - String dynamicSql = "select count({0}) as cnt from {1} where {2} = ?"; - String sql = SqlBuilder.buildSql(dynamicSql, NetworkAddressTable.NETWORK_ADDRESS.getName(), NetworkAddressTable.TABLE, NetworkAddressTable.SRC_SPAN_LAYER.getName()); - Object[] params = new Object[] {srcSpanLayer}; - - try ( - ResultSet rs = getClient().executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - return rs.getInt("cnt"); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } - - @Override public List getConjecturalApps() { - String dynamicSql = "select {0}, count({0}) as cnt from {1} where {2} in (?, ?, ?) group by {0} limit 100"; - String sql = SqlBuilder.buildSql(dynamicSql, NetworkAddressTable.SERVER_TYPE.getName(), NetworkAddressTable.TABLE, NetworkAddressTable.SRC_SPAN_LAYER.getName()); - Object[] params = new Object[] {SpanLayer.Database_VALUE, SpanLayer.Cache_VALUE, SpanLayer.MQ_VALUE}; - - List conjecturalApps = new LinkedList<>(); - try ( - ResultSet rs = getClient().executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - ConjecturalApp conjecturalApp = new ConjecturalApp(); - conjecturalApp.setId(rs.getInt(NetworkAddressTable.SERVER_TYPE.getName())); - conjecturalApp.setNum(rs.getInt("cnt")); - conjecturalApps.add(conjecturalApp); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return conjecturalApps; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ResponseTimeDistributionShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ResponseTimeDistributionShardingjdbcUIDAO.java deleted file mode 100644 index 53d9002d3739c5d85d76d0870d12786cf8b33498..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ResponseTimeDistributionShardingjdbcUIDAO.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.List; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IResponseTimeDistributionUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class ResponseTimeDistributionShardingjdbcUIDAO extends ShardingjdbcDAO implements IResponseTimeDistributionUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(ResponseTimeDistributionShardingjdbcUIDAO.class); - private static final String RESPONSE_TIME_DISTRIBUTION_SQL = "select {0}, {1}, {2} from {3} where {4} = ?"; - - public ResponseTimeDistributionShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public void loadMetrics(Step step, List responseTimeSteps) { - ShardingjdbcClient client = getClient(); - - String tableName = TimePyramidTableNameBuilder.build(step, ResponseTimeDistributionTable.TABLE); - String sql = SqlBuilder.buildSql(RESPONSE_TIME_DISTRIBUTION_SQL, ResponseTimeDistributionTable.CALLS.getName(), ResponseTimeDistributionTable.ERROR_CALLS.getName(), - ResponseTimeDistributionTable.SUCCESS_CALLS.getName(), tableName, ResponseTimeDistributionTable.ID.getName()); - - responseTimeSteps.forEach(responseTimeStep -> { - String id = responseTimeStep.getDurationPoint() + Const.ID_SPLIT + responseTimeStep.getStep(); - - try ( - ResultSet rs = client.executeQuery(sql, new String[] {id}); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - responseTimeStep.setCalls(rs.getLong(ResponseTimeDistributionTable.CALLS.getName())); - responseTimeStep.setErrorCalls(rs.getLong(ResponseTimeDistributionTable.ERROR_CALLS.getName())); - responseTimeStep.setSuccessCalls(rs.getLong(ResponseTimeDistributionTable.SUCCESS_CALLS.getName())); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - }); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/SegmentDurationShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/SegmentDurationShardingjdbcUIDAO.java deleted file mode 100644 index 8277ff71401fd5db9414e5da21f384279e6c04e3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/SegmentDurationShardingjdbcUIDAO.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; - -import com.google.gson.Gson; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.core.util.BooleanUtils; -import org.apache.skywalking.apm.collector.core.util.StringUtils; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentDurationUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentDurationTable; -import org.apache.skywalking.apm.collector.storage.ui.trace.BasicTrace; -import org.apache.skywalking.apm.collector.storage.ui.trace.QueryOrder; -import org.apache.skywalking.apm.collector.storage.ui.trace.TraceBrief; -import org.apache.skywalking.apm.collector.storage.ui.trace.TraceState; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class SegmentDurationShardingjdbcUIDAO extends ShardingjdbcDAO implements ISegmentDurationUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(SegmentDurationShardingjdbcUIDAO.class); - - private final Gson gson = new Gson(); - - public SegmentDurationShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override - public TraceBrief loadTop(long startSecondTimeBucket, long endSecondTimeBucket, long minDuration, long maxDuration, - String operationName, int applicationId, int limit, int from, TraceState traceState, QueryOrder queryOrder, String... segmentIds) { - ShardingjdbcClient client = getClient(); - String sql = "select * from {0} where {1} >= ? and {1} <= ?"; - List params = new ArrayList<>(); - List columns = new ArrayList<>(); - columns.add(SegmentDurationTable.TABLE); - columns.add(SegmentDurationTable.TIME_BUCKET.getName()); - params.add(startSecondTimeBucket); - params.add(endSecondTimeBucket); - int paramIndex = 1; - if (minDuration != -1 || maxDuration != -1) { - if (minDuration != -1) { - paramIndex++; - sql = sql + " and {" + paramIndex + "} >= ?"; - params.add(minDuration); - columns.add(SegmentDurationTable.DURATION.getName()); - } - if (maxDuration != -1) { - paramIndex++; - sql = sql + " and {" + paramIndex + "} <= ?"; - params.add(maxDuration); - columns.add(SegmentDurationTable.DURATION.getName()); - } - } - if (StringUtils.isNotEmpty(operationName)) { - paramIndex++; - sql = sql + " and {" + paramIndex + "} like ?"; - params.add("%" + operationName + "%"); - columns.add(SegmentDurationTable.SERVICE_NAME.getName()); - } - if (StringUtils.isNotEmpty(segmentIds)) { - paramIndex++; - sql = sql + " and {" + paramIndex + "} in (?)"; - String segmentIdsParam = Arrays.toString(segmentIds).replace("[", "").replace("]", ""); - params.add(segmentIdsParam); - columns.add(SegmentDurationTable.SEGMENT_ID.getName()); - } - if (applicationId != 0) { - paramIndex++; - sql = sql + " and {" + paramIndex + "} = ?"; - params.add(applicationId); - columns.add(SegmentDurationTable.APPLICATION_ID.getName()); - } - switch (traceState) { - case ERROR: - paramIndex++; - sql = sql + " and {" + paramIndex + "} = ?"; - params.add(BooleanUtils.TRUE); - columns.add(SegmentDurationTable.IS_ERROR.getName()); - break; - case SUCCESS: - paramIndex++; - sql = sql + " and {" + paramIndex + "} = ?"; - params.add(BooleanUtils.FALSE); - columns.add(SegmentDurationTable.IS_ERROR.getName()); - break; - } - switch (queryOrder) { - case BY_START_TIME: - paramIndex++; - sql = sql + " order by {" + paramIndex + "} desc"; - columns.add(SegmentDurationTable.START_TIME.getName()); - break; - case BY_DURATION: - paramIndex++; - sql = sql + " order by {" + paramIndex + "} desc"; - columns.add(SegmentDurationTable.DURATION.getName()); - break; - } - - sql = sql + " limit " + from + "," + limit; - sql = SqlBuilder.buildSql(sql, columns); - Object[] p = params.toArray(new Object[0]); - - TraceBrief traceBrief = new TraceBrief(); - - int cnt = 0; - try ( - ResultSet rs = client.executeQuery(sql, p); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - BasicTrace basicTrace = new BasicTrace(); - basicTrace.setSegmentId(rs.getString(SegmentDurationTable.SEGMENT_ID.getName())); - basicTrace.setDuration(rs.getInt(SegmentDurationTable.DURATION.getName())); - basicTrace.setStart(rs.getLong(SegmentDurationTable.START_TIME.getName())); - String serviceNameJsonStr = rs.getString(SegmentDurationTable.SERVICE_NAME.getName()); - if (StringUtils.isNotEmpty(serviceNameJsonStr)) { - List serviceNames = gson.fromJson(serviceNameJsonStr, LinkedList.class); - basicTrace.getOperationName().addAll(serviceNames); - } - basicTrace.setError(BooleanUtils.valueToBoolean(rs.getInt(SegmentDurationTable.IS_ERROR.getName()))); - traceBrief.getTraces().add(basicTrace); - cnt++; - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - traceBrief.setTotal(cnt); - return traceBrief; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/SegmentShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/SegmentShardingjdbcUIDAO.java deleted file mode 100644 index f38a010308acec7867a7dad5e147fefdf4a4a3c8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/SegmentShardingjdbcUIDAO.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import com.google.protobuf.InvalidProtocolBufferException; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentTable; -import org.apache.skywalking.apm.network.language.agent.TraceSegmentObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class SegmentShardingjdbcUIDAO extends ShardingjdbcDAO implements ISegmentUIDAO { - private static final Logger logger = LoggerFactory.getLogger(SegmentShardingjdbcUIDAO.class); - private static final String GET_SEGMENT_SQL = "select {0} from {1} where {2} = ?"; - - public SegmentShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public TraceSegmentObject load(String segmentId) { - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(GET_SEGMENT_SQL, SegmentTable.DATA_BINARY.getName(), - SegmentTable.TABLE, SegmentTable.ID.getName()); - Object[] params = new Object[] {segmentId}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - byte[] dataBinary = rs.getBytes(SegmentTable.DATA_BINARY.getName()); - try { - return TraceSegmentObject.parseFrom(dataBinary); - } catch (InvalidProtocolBufferException e) { - logger.error(e.getMessage(), e); - } - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return null; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ServiceAlarmShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ServiceAlarmShardingjdbcUIDAO.java deleted file mode 100644 index 4afb2145cdd595f53d1b1ed344403300ec98883d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ServiceAlarmShardingjdbcUIDAO.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.text.ParseException; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceAlarmUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmTable; -import org.apache.skywalking.apm.collector.storage.ui.alarm.Alarm; -import org.apache.skywalking.apm.collector.storage.ui.alarm.AlarmItem; -import org.apache.skywalking.apm.collector.storage.ui.alarm.AlarmType; -import org.apache.skywalking.apm.collector.storage.ui.alarm.CauseType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class ServiceAlarmShardingjdbcUIDAO extends ShardingjdbcDAO implements IServiceAlarmUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(ServiceAlarmShardingjdbcUIDAO.class); - private static final String SERVICE_ALARM_SQL = "select {0}, {1}, {2}, {3} from {4} where {2} >= ? and {2} <= ? and {1} like ? limit ?, ?"; - - public ServiceAlarmShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public Alarm loadAlarmList(String keyword, long startTimeBucket, long endTimeBucket, int limit, int from) throws ParseException { - ShardingjdbcClient client = getClient(); - - String tableName = ServiceAlarmTable.TABLE; - String sql = SqlBuilder.buildSql(SERVICE_ALARM_SQL, ServiceAlarmTable.SERVICE_ID.getName(), ServiceAlarmTable.ALARM_CONTENT.getName(), - ServiceAlarmTable.LAST_TIME_BUCKET.getName(), ServiceAlarmTable.ALARM_TYPE.getName(), tableName); - - Object[] params = new Object[] {startTimeBucket, endTimeBucket, keyword == null ? "%%" : "%" + keyword + "%", from, limit}; - Alarm alarm = new Alarm(); - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - int index = 0; - while (rs.next()) { - int serviceId = rs.getInt(ServiceAlarmTable.SERVICE_ID.getName()); - String alarmContent = rs.getString(ServiceAlarmTable.ALARM_CONTENT.getName()); - long lastTimeBucket = rs.getLong(ServiceAlarmTable.LAST_TIME_BUCKET.getName()); - int alarmType = rs.getInt(ServiceAlarmTable.ALARM_TYPE.getName()); - - AlarmItem alarmItem = new AlarmItem(); - alarmItem.setId(serviceId); - alarmItem.setTitle(alarmContent); - alarmItem.setContent(alarmContent); - alarmItem.setStartTime(TimeBucketUtils.INSTANCE.formatMinuteTimeBucket(lastTimeBucket)); - alarmItem.setAlarmType(AlarmType.SERVICE); - - if (org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType.SLOW_RTT.getValue() == alarmType) { - alarmItem.setCauseType(CauseType.SLOW_RESPONSE); - } else if (org.apache.skywalking.apm.collector.storage.table.alarm.AlarmType.ERROR_RATE.getValue() == alarmType) { - alarmItem.setCauseType(CauseType.LOW_SUCCESS_RATE); - } - index++; - alarm.getItems().add(alarmItem); - } - alarm.setTotal(index); - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - - return alarm; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ServiceMetricShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ServiceMetricShardingjdbcUIDAO.java deleted file mode 100644 index a1b0233af327b5c70bc290e806d51e533bb5f8a6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ServiceMetricShardingjdbcUIDAO.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.Collection; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Node; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.ui.service.ServiceMetric; -import org.apache.skywalking.apm.collector.storage.ui.service.ServiceNode; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class ServiceMetricShardingjdbcUIDAO extends ShardingjdbcDAO implements IServiceMetricUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(ServiceMetricShardingjdbcUIDAO.class); - private static final String SERVICE_METRIC_GET_SQL = "select {0}, sum({1}) as {1}, sum({2}) as {2} from {3} where {4} >= ? and {4} <= ? and {5} = ? and {0} in (?) group by {0} limit 100"; - private static final String SLOW_SERVICE_GET_SQL = "select {0}, {1}, {2} from {3} where {4} >= ? and {4} <= ? and {5} = ? and {6} = ? order by {2} desc limit ?"; - - public ServiceMetricShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override - public List getServiceResponseTimeTrend(int serviceId, Step step, List durationPoints) { - String tableName = TimePyramidTableNameBuilder.build(step, ServiceMetricTable.TABLE); - - ShardingjdbcClient client = getClient(); - String dynamicSql = "select * from {0} where {1} = ?"; - String sql = SqlBuilder.buildSql(dynamicSql, tableName, ServiceMetricTable.ID.getName()); - - List trends = new LinkedList<>(); - durationPoints.forEach(durationPoint -> { - String id = durationPoint.getPoint() + Const.ID_SPLIT + serviceId + Const.ID_SPLIT + MetricSource.Callee.getValue(); - - try ( - ResultSet rs = client.executeQuery(sql, new String[] {id}); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - long calls = rs.getLong(ServiceMetricTable.TRANSACTION_CALLS.getName()); - long durationSum = rs.getLong(ServiceMetricTable.TRANSACTION_DURATION_SUM.getName()); - trends.add((int) (durationSum / calls)); - } else { - trends.add(0); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - }); - - return trends; - } - - @Override public List getServiceThroughputTrend(int serviceId, Step step, List durationPoints) { - String tableName = TimePyramidTableNameBuilder.build(step, ServiceMetricTable.TABLE); - - ShardingjdbcClient client = getClient(); - String dynamicSql = "select * from {0} where {1} = ?"; - String sql = SqlBuilder.buildSql(dynamicSql, tableName, ServiceMetricTable.ID.getName()); - - List trends = new LinkedList<>(); - durationPoints.forEach(durationPoint -> { - String id = durationPoint.getPoint() + Const.ID_SPLIT + serviceId + Const.ID_SPLIT + MetricSource.Callee.getValue(); - - try ( - ResultSet rs = client.executeQuery(sql, new String[] {id}); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - long calls = rs.getLong(ServiceMetricTable.TRANSACTION_CALLS.getName()); - long secondsBetween = durationPoint.getSecondsBetween(); - trends.add(secondsBetween == 0 ? 0 : (int) (calls / secondsBetween)); - } else { - trends.add(0); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - }); - - return trends; - } - - @Override public List getServiceSLATrend(int serviceId, Step step, List durationPoints) { - String tableName = TimePyramidTableNameBuilder.build(step, ServiceMetricTable.TABLE); - - ShardingjdbcClient client = getClient(); - String dynamicSql = "select * from {0} where {1} = ?"; - String sql = SqlBuilder.buildSql(dynamicSql, tableName, ServiceMetricTable.ID); - - List trends = new LinkedList<>(); - durationPoints.forEach(durationPoint -> { - String id = durationPoint.getPoint() + Const.ID_SPLIT + serviceId + Const.ID_SPLIT + MetricSource.Callee.getValue(); - - try ( - ResultSet rs = client.executeQuery(sql, new String[] {id}); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - long calls = rs.getLong(ServiceMetricTable.TRANSACTION_CALLS.getName()); - long errorCalls = rs.getLong(ServiceMetricTable.TRANSACTION_ERROR_CALLS.getName()); - trends.add((int)(((calls - errorCalls) / calls)) * 10000); - } else { - trends.add(10000); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - }); - - return trends; - } - - @Override public List getServicesMetric(Step step, long startTimeBucket, long endTimeBucket, MetricSource metricSource, - Collection serviceIds) { - String tableName = TimePyramidTableNameBuilder.build(step, ServiceMetricTable.TABLE); - - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(SERVICE_METRIC_GET_SQL, ServiceMetricTable.SERVICE_ID.getName(), ServiceMetricTable.TRANSACTION_CALLS.getName(), - ServiceMetricTable.TRANSACTION_ERROR_CALLS.getName(), tableName, ServiceMetricTable.TIME_BUCKET.getName(), - ServiceMetricTable.SOURCE_VALUE.getName()); - - List nodes = new LinkedList<>(); - String serviceIdsParam = serviceIds.toString().replace("[", "").replace("]", ""); - Object[] params = new Object[] {startTimeBucket, endTimeBucket, metricSource.getValue(), serviceIdsParam}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - int serviceId = rs.getInt(ServiceMetricTable.SERVICE_ID.getName()); - long callsSum = rs.getLong(ServiceMetricTable.TRANSACTION_CALLS.getName()); - long errorCallsSum = rs.getLong(ServiceMetricTable.TRANSACTION_ERROR_CALLS.getName()); - - ServiceNode serviceNode = new ServiceNode(); - serviceNode.setId(serviceId); - serviceNode.setCalls(callsSum); - serviceNode.setSla((int)((callsSum - errorCallsSum) / callsSum * 10000)); - nodes.add(serviceNode); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - - return nodes; - } - - @Override public List getSlowService(int applicationId, Step step, long startTimeBucket, long endTimeBucket, Integer topN, - MetricSource metricSource) { - String tableName = TimePyramidTableNameBuilder.build(step, ServiceMetricTable.TABLE); - - ShardingjdbcClient client = getClient(); - String sql = SqlBuilder.buildSql(SLOW_SERVICE_GET_SQL, ServiceMetricTable.SERVICE_ID.getName(), ServiceMetricTable.TRANSACTION_CALLS.getName(), - ServiceMetricTable.TRANSACTION_AVERAGE_DURATION.getName(), tableName, ServiceMetricTable.TIME_BUCKET.getName(), - ServiceMetricTable.SOURCE_VALUE.getName(), ServiceMetricTable.APPLICATION_ID.getName()); - - Set serviceIds = new HashSet<>(); - List serviceMetrics = new LinkedList<>(); - Object[] params = new Object[] {startTimeBucket, endTimeBucket, metricSource.getValue(), applicationId, topN * 60}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - int serviceId = rs.getInt(ServiceMetricTable.SERVICE_ID.getName()); - if (!serviceIds.contains(serviceId)) { - ServiceMetric serviceMetric = new ServiceMetric(); - serviceMetric.getService().setId(serviceId); - serviceMetric.getService().setApplicationId(applicationId); - serviceMetric.setCalls(rs.getLong(ServiceMetricTable.TRANSACTION_CALLS.getName())); - serviceMetric.setAvgResponseTime(rs.getInt(ServiceMetricTable.TRANSACTION_AVERAGE_DURATION.getName())); - serviceMetrics.add(serviceMetric); - - serviceIds.add(serviceId); - } - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - - return serviceMetrics; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ServiceNameServiceShardingjdbcUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ServiceNameServiceShardingjdbcUIDAO.java deleted file mode 100644 index c8d368345c5ee3482810e6bcae9d07bcaf93bbd3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ServiceNameServiceShardingjdbcUIDAO.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.LinkedList; -import java.util.List; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceNameServiceUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceNameTable; -import org.apache.skywalking.apm.collector.storage.ui.service.ServiceInfo; -import org.apache.skywalking.apm.network.language.agent.SpanType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class ServiceNameServiceShardingjdbcUIDAO extends ShardingjdbcDAO implements IServiceNameServiceUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(ServiceNameServiceShardingjdbcUIDAO.class); - - public ServiceNameServiceShardingjdbcUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public int getCount(long startTimeMillis) { - String dynamicSql = "select count({0}) as cnt from {1} where {2} = ? and {3} >= ?"; - String sql = SqlBuilder.buildSql(dynamicSql, ServiceNameTable.SERVICE_ID.getName(), ServiceNameTable.TABLE, ServiceNameTable.SRC_SPAN_TYPE.getName(), ServiceNameTable.HEARTBEAT_TIME.getName()); - Object[] params = new Object[] {SpanType.Entry_VALUE, startTimeMillis}; - - try ( - ResultSet rs = getClient().executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - if (rs.next()) { - return rs.getInt("cnt"); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return 0; - } - - @Override public List searchService(String keyword, int applicationId, long startTimeMillis, int topN) { - String dynamicSql = "select {0},{1} from {2} where {3} like ? and {4} = ? and {5} = ? and {6} >= ? limit ?"; - String sql = SqlBuilder.buildSql(dynamicSql, ServiceNameTable.SERVICE_ID.getName(), ServiceNameTable.SERVICE_NAME.getName(), ServiceNameTable.TABLE, - ServiceNameTable.SERVICE_NAME.getName(), ServiceNameTable.SRC_SPAN_TYPE.getName(), ServiceNameTable.APPLICATION_ID.getName(), ServiceNameTable.HEARTBEAT_TIME.getName()); - Object[] params = new Object[] {keyword == null ? "%%" : "%" + keyword + "%", SpanType.Entry_VALUE, applicationId, startTimeMillis, topN}; - - List serviceInfos = new LinkedList<>(); - try ( - ResultSet rs = getClient().executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - ServiceInfo serviceInfo = new ServiceInfo(); - serviceInfo.setId(rs.getInt(ServiceNameTable.SERVICE_ID.getName())); - serviceInfo.setName(rs.getString(ServiceNameTable.SERVICE_NAME.getName())); - serviceInfos.add(serviceInfo); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - return serviceInfos; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ServiceReferenceShardingjdbcMetricUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ServiceReferenceShardingjdbcMetricUIDAO.java deleted file mode 100644 index b98109f6b0cb603e32788d8cfed1804d0a33f2bd..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/dao/ui/ServiceReferenceShardingjdbcMetricUIDAO.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.LinkedList; -import java.util.List; - -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClient; -import org.apache.skywalking.apm.collector.client.shardingjdbc.ShardingjdbcClientException; -import org.apache.skywalking.apm.collector.storage.base.sql.SqlBuilder; -import org.apache.skywalking.apm.collector.storage.dao.ui.IServiceReferenceMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.ShardingjdbcDAO; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author linjiaqi - */ -public class ServiceReferenceShardingjdbcMetricUIDAO extends ShardingjdbcDAO implements IServiceReferenceMetricUIDAO { - - private static final Logger logger = LoggerFactory.getLogger(ServiceReferenceShardingjdbcMetricUIDAO.class); - private static final String SERVICE_REFERENCE_FRONT_SQL = "select {0}, sum({1}) as {1}, sum({2}) as {2}, sum({3}) as {3}, sum({4}) as {4} from {5} where {6} >= ? and {6} <= ? and {7} = ? and {8} = ? group by {0} limit 100"; - private static final String SERVICE_REFERENCE_BEHIND_SQL = "select {0}, sum({1}) as {1}, sum({2}) as {2}, sum({3}) as {3}, sum({4}) as {4} from {5} where {6} >= ? and {6} <= ? and {7} = ? and {8} = ? group by {8} limit 100"; - - public ServiceReferenceShardingjdbcMetricUIDAO(ShardingjdbcClient client) { - super(client); - } - - @Override public List getFrontServices(Step step, long startTimeBucket, long endTimeBucket, - MetricSource metricSource, - int behindServiceId) { - ShardingjdbcClient client = getClient(); - - String tableName = TimePyramidTableNameBuilder.build(step, ServiceReferenceMetricTable.TABLE); - - List referenceMetrics = new LinkedList<>(); - String sql = SqlBuilder.buildSql(SERVICE_REFERENCE_FRONT_SQL, ServiceReferenceMetricTable.FRONT_SERVICE_ID.getName(), - ServiceReferenceMetricTable.TRANSACTION_CALLS.getName(), ServiceReferenceMetricTable.TRANSACTION_ERROR_CALLS.getName(), - ServiceReferenceMetricTable.TRANSACTION_DURATION_SUM.getName(), ServiceReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName(), - tableName, ServiceReferenceMetricTable.TIME_BUCKET.getName(), ServiceReferenceMetricTable.SOURCE_VALUE.getName(), - ServiceReferenceMetricTable.BEHIND_SERVICE_ID.getName()); - - Object[] params = new Object[] {startTimeBucket, endTimeBucket, metricSource.getValue(), behindServiceId}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - int frontServiceId = rs.getInt(ServiceReferenceMetricTable.FRONT_SERVICE_ID.getName()); - long callsSum = rs.getLong(ServiceReferenceMetricTable.TRANSACTION_CALLS.getName()); - long errorCallsSum = rs.getLong(ServiceReferenceMetricTable.TRANSACTION_ERROR_CALLS.getName()); - long durationSum = rs.getLong(ServiceReferenceMetricTable.TRANSACTION_DURATION_SUM.getName()); - long errorDurationSum = rs.getLong(ServiceReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName()); - - ServiceReferenceMetric referenceMetric = new ServiceReferenceMetric(); - referenceMetric.setSource(frontServiceId); - referenceMetric.setTarget(behindServiceId); - referenceMetric.setCalls(callsSum); - referenceMetric.setErrorCalls(errorCallsSum); - referenceMetric.setDurations(durationSum); - referenceMetric.setErrorDurations(errorDurationSum); - referenceMetrics.add(referenceMetric); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - - return referenceMetrics; - } - - @Override public List getBehindServices(Step step, long startTimeBucket, long endTimeBucket, - MetricSource metricSource, - int frontServiceId) { - ShardingjdbcClient client = getClient(); - - String tableName = TimePyramidTableNameBuilder.build(step, ServiceReferenceMetricTable.TABLE); - - List referenceMetrics = new LinkedList<>(); - String sql = SqlBuilder.buildSql(SERVICE_REFERENCE_BEHIND_SQL, ServiceReferenceMetricTable.BEHIND_SERVICE_ID.getName(), - ServiceReferenceMetricTable.TRANSACTION_CALLS.getName(), ServiceReferenceMetricTable.TRANSACTION_ERROR_CALLS.getName(), - ServiceReferenceMetricTable.TRANSACTION_DURATION_SUM.getName(), ServiceReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName(), - tableName, ServiceReferenceMetricTable.TIME_BUCKET.getName(), ServiceReferenceMetricTable.SOURCE_VALUE.getName(), - ServiceReferenceMetricTable.FRONT_SERVICE_ID.getName()); - - Object[] params = new Object[] {startTimeBucket, endTimeBucket, metricSource.getValue(), frontServiceId}; - try ( - ResultSet rs = client.executeQuery(sql, params); - Statement statement = rs.getStatement(); - Connection conn = statement.getConnection(); - ) { - while (rs.next()) { - int behindServiceId = rs.getInt(ServiceReferenceMetricTable.BEHIND_SERVICE_ID.getName()); - long callsSum = rs.getLong(ServiceReferenceMetricTable.TRANSACTION_CALLS.getName()); - long errorCallsSum = rs.getLong(ServiceReferenceMetricTable.TRANSACTION_ERROR_CALLS.getName()); - long durationSum = rs.getLong(ServiceReferenceMetricTable.TRANSACTION_DURATION_SUM.getName()); - long errorDurationSum = rs.getLong(ServiceReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM.getName()); - - ServiceReferenceMetric referenceMetric = new ServiceReferenceMetric(); - referenceMetric.setSource(frontServiceId); - referenceMetric.setTarget(behindServiceId); - referenceMetric.setCalls(callsSum); - referenceMetric.setErrorCalls(errorCallsSum); - referenceMetric.setDurations(durationSum); - referenceMetric.setErrorDurations(errorDurationSum); - referenceMetrics.add(referenceMetric); - } - } catch (SQLException | ShardingjdbcClientException e) { - logger.error(e.getMessage(), e); - } - - return referenceMetrics; - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/GlobalTraceShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/GlobalTraceShardingjdbcTableDefine.java deleted file mode 100644 index 89447cdb85b626371b7f3f29b1d630dc7b1a0b89..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/GlobalTraceShardingjdbcTableDefine.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.global.GlobalTraceTable; - -/** - * @author linjiaqi - */ -public class GlobalTraceShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - public GlobalTraceShardingjdbcTableDefine() { - super(GlobalTraceTable.TABLE, GlobalTraceTable.TIME_BUCKET.getName()); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(GlobalTraceTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(GlobalTraceTable.SEGMENT_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(GlobalTraceTable.TRACE_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(GlobalTraceTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/SegmentDurationShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/SegmentDurationShardingjdbcTableDefine.java deleted file mode 100644 index 36236bfe0f13965312162418bfbd14cd4da367cf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/SegmentDurationShardingjdbcTableDefine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentDurationTable; - -/** - * @author linjiaqi - */ -public class SegmentDurationShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - public SegmentDurationShardingjdbcTableDefine() { - super(SegmentDurationTable.TABLE, SegmentDurationTable.TIME_BUCKET.getName()); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(SegmentDurationTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(SegmentDurationTable.SEGMENT_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(SegmentDurationTable.APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(SegmentDurationTable.SERVICE_NAME, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(SegmentDurationTable.TRACE_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(SegmentDurationTable.DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(SegmentDurationTable.START_TIME, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(SegmentDurationTable.END_TIME, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(SegmentDurationTable.IS_ERROR, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(SegmentDurationTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/SegmentShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/SegmentShardingjdbcTableDefine.java deleted file mode 100644 index 79bed0731dcd7bff4aa163facbada89455cff37d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/SegmentShardingjdbcTableDefine.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentTable; - -/** - * @author linjiaqi - */ -public class SegmentShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - public SegmentShardingjdbcTableDefine() { - super(SegmentTable.TABLE, SegmentTable.TIME_BUCKET.getName()); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(SegmentTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(SegmentTable.DATA_BINARY, ShardingjdbcColumnDefine.Type.BLOB.name())); - addColumn(new ShardingjdbcColumnDefine(SegmentTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/acp/AbstractApplicationComponentShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/acp/AbstractApplicationComponentShardingjdbcTableDefine.java deleted file mode 100644 index 7b39043a3bb59f42a11b04f4eed72939389d792c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/acp/AbstractApplicationComponentShardingjdbcTableDefine.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.acp; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractApplicationComponentShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - AbstractApplicationComponentShardingjdbcTableDefine(String name) { - super(name, ApplicationComponentTable.TIME_BUCKET.getName()); - } - - @Override public final void initialize() { - addColumn(new ShardingjdbcColumnDefine(ApplicationComponentTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationComponentTable.METRIC_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationComponentTable.COMPONENT_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationComponentTable.APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationComponentTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/acp/ApplicationComponentDayShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/acp/ApplicationComponentDayShardingjdbcTableDefine.java deleted file mode 100644 index a38ba7d4d210aa7782b3176688adf289aff90050..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/acp/ApplicationComponentDayShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.acp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author linjiaqi - */ -public class ApplicationComponentDayShardingjdbcTableDefine extends AbstractApplicationComponentShardingjdbcTableDefine { - - public ApplicationComponentDayShardingjdbcTableDefine() { - super(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/acp/ApplicationComponentHourShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/acp/ApplicationComponentHourShardingjdbcTableDefine.java deleted file mode 100644 index aa2b6404a312be912d3dc48ed0d3ace491694c03..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/acp/ApplicationComponentHourShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.acp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author linjiaqi - */ -public class ApplicationComponentHourShardingjdbcTableDefine extends AbstractApplicationComponentShardingjdbcTableDefine { - - public ApplicationComponentHourShardingjdbcTableDefine() { - super(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/acp/ApplicationComponentMinuteShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/acp/ApplicationComponentMinuteShardingjdbcTableDefine.java deleted file mode 100644 index fc12f4fb4917721bac7bd95ebfaed546f1c032c9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/acp/ApplicationComponentMinuteShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.acp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author linjiaqi - */ -public class ApplicationComponentMinuteShardingjdbcTableDefine extends AbstractApplicationComponentShardingjdbcTableDefine { - - public ApplicationComponentMinuteShardingjdbcTableDefine() { - super(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/acp/ApplicationComponentMonthShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/acp/ApplicationComponentMonthShardingjdbcTableDefine.java deleted file mode 100644 index 4b90743f192d4d903fda88f87761c7544290d59a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/acp/ApplicationComponentMonthShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.acp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; - -/** - * @author linjiaqi - */ -public class ApplicationComponentMonthShardingjdbcTableDefine extends AbstractApplicationComponentShardingjdbcTableDefine { - - public ApplicationComponentMonthShardingjdbcTableDefine() { - super(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/AbstractApplicationAlarmListShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/AbstractApplicationAlarmListShardingjdbcTableDefine.java deleted file mode 100644 index 6f6de97f648421363bbf5fd316a2fe624dd14aef..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/AbstractApplicationAlarmListShardingjdbcTableDefine.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractApplicationAlarmListShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - AbstractApplicationAlarmListShardingjdbcTableDefine(String name) { - super(name, ApplicationAlarmListTable.TIME_BUCKET.getName()); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(ApplicationAlarmListTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationAlarmListTable.METRIC_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationAlarmListTable.ALARM_CONTENT, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationAlarmListTable.APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationAlarmListTable.SOURCE_VALUE, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationAlarmListTable.ALARM_TYPE, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationAlarmListTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationAlarmListDayShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationAlarmListDayShardingjdbcTableDefine.java deleted file mode 100644 index 67e5041c051f1f24da61ee8b14b2899128b517f8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationAlarmListDayShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author linjiaqi - */ -public class ApplicationAlarmListDayShardingjdbcTableDefine extends AbstractApplicationAlarmListShardingjdbcTableDefine { - - public ApplicationAlarmListDayShardingjdbcTableDefine() { - super(ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationAlarmListHourShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationAlarmListHourShardingjdbcTableDefine.java deleted file mode 100644 index 97752b41ba7111a9b6a34b458466d40831976793..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationAlarmListHourShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author linjiaqi - */ -public class ApplicationAlarmListHourShardingjdbcTableDefine extends AbstractApplicationAlarmListShardingjdbcTableDefine { - - public ApplicationAlarmListHourShardingjdbcTableDefine() { - super(ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationAlarmListMinuteShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationAlarmListMinuteShardingjdbcTableDefine.java deleted file mode 100644 index d10d7981822e5b20af30986d2b3411e1f4a64d24..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationAlarmListMinuteShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author linjiaqi - */ -public class ApplicationAlarmListMinuteShardingjdbcTableDefine extends AbstractApplicationAlarmListShardingjdbcTableDefine { - - public ApplicationAlarmListMinuteShardingjdbcTableDefine() { - super(ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationAlarmListMonthShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationAlarmListMonthShardingjdbcTableDefine.java deleted file mode 100644 index 40175b1b8e0d8c42e47bb64bca3ed78091c2d54a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationAlarmListMonthShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; - -/** - * @author linjiaqi - */ -public class ApplicationAlarmListMonthShardingjdbcTableDefine extends AbstractApplicationAlarmListShardingjdbcTableDefine { - - public ApplicationAlarmListMonthShardingjdbcTableDefine() { - super(ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationAlarmShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationAlarmShardingjdbcTableDefine.java deleted file mode 100644 index 2413911a6b2a63a085b1ca9ce2a301a2d235cdab..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationAlarmShardingjdbcTableDefine.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmTable; - -/** - * @author linjiaqi - */ -public class ApplicationAlarmShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - public ApplicationAlarmShardingjdbcTableDefine() { - super(ApplicationAlarmTable.TABLE, ApplicationAlarmTable.LAST_TIME_BUCKET.getName()); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(ApplicationAlarmTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationAlarmTable.APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(ApplicationAlarmTable.SOURCE_VALUE, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationAlarmTable.ALARM_TYPE, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(ApplicationAlarmTable.ALARM_CONTENT, ShardingjdbcColumnDefine.Type.Varchar.name())); - - addColumn(new ShardingjdbcColumnDefine(ApplicationAlarmTable.LAST_TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationReferenceAlarmListShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationReferenceAlarmListShardingjdbcTableDefine.java deleted file mode 100644 index 536cda34d3a8a9ce466fce5bb51f1c3db19669c8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationReferenceAlarmListShardingjdbcTableDefine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmListTable; - -/** - * @author linjiaqi - */ -public class ApplicationReferenceAlarmListShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - public ApplicationReferenceAlarmListShardingjdbcTableDefine() { - super(ApplicationReferenceAlarmListTable.TABLE, ApplicationReferenceAlarmListTable.TIME_BUCKET.getName()); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceAlarmListTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceAlarmListTable.FRONT_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceAlarmListTable.BEHIND_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceAlarmListTable.SOURCE_VALUE, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceAlarmListTable.ALARM_TYPE, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceAlarmListTable.ALARM_CONTENT, ShardingjdbcColumnDefine.Type.Varchar.name())); - - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceAlarmListTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationReferenceAlarmShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationReferenceAlarmShardingjdbcTableDefine.java deleted file mode 100644 index 44862a41710111881b46bd792792df36f9f79312..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ApplicationReferenceAlarmShardingjdbcTableDefine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmTable; - -/** - * @author linjiaqi - */ -public class ApplicationReferenceAlarmShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - public ApplicationReferenceAlarmShardingjdbcTableDefine() { - super(ApplicationReferenceAlarmTable.TABLE, ApplicationReferenceAlarmTable.LAST_TIME_BUCKET.getName()); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceAlarmTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceAlarmTable.FRONT_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceAlarmTable.BEHIND_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceAlarmTable.SOURCE_VALUE, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceAlarmTable.ALARM_TYPE, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceAlarmTable.ALARM_CONTENT, ShardingjdbcColumnDefine.Type.Varchar.name())); - - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceAlarmTable.LAST_TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/InstanceAlarmListShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/InstanceAlarmListShardingjdbcTableDefine.java deleted file mode 100644 index 63f93b688d121b2fa4edb95786e052f4234261ac..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/InstanceAlarmListShardingjdbcTableDefine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmListTable; - -/** - * @author linjiaqi - */ -public class InstanceAlarmListShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - public InstanceAlarmListShardingjdbcTableDefine() { - super(InstanceAlarmListTable.TABLE, InstanceAlarmListTable.TIME_BUCKET.getName()); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(InstanceAlarmListTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceAlarmListTable.APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceAlarmListTable.INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceAlarmListTable.SOURCE_VALUE, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceAlarmListTable.ALARM_TYPE, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceAlarmListTable.ALARM_CONTENT, ShardingjdbcColumnDefine.Type.Varchar.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceAlarmListTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/InstanceAlarmShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/InstanceAlarmShardingjdbcTableDefine.java deleted file mode 100644 index d70aa93b361b102c27bea0b5ad91961d1def5fc9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/InstanceAlarmShardingjdbcTableDefine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmTable; - -/** - * @author linjiaqi - */ -public class InstanceAlarmShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - public InstanceAlarmShardingjdbcTableDefine() { - super(InstanceAlarmTable.TABLE, InstanceAlarmTable.LAST_TIME_BUCKET.getName()); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(InstanceAlarmTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceAlarmTable.APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceAlarmTable.INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceAlarmTable.SOURCE_VALUE, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceAlarmTable.ALARM_TYPE, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceAlarmTable.ALARM_CONTENT, ShardingjdbcColumnDefine.Type.Varchar.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceAlarmTable.LAST_TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/InstanceReferenceAlarmListShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/InstanceReferenceAlarmListShardingjdbcTableDefine.java deleted file mode 100644 index b642a6289e37b62cacafad704e274e569743177f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/InstanceReferenceAlarmListShardingjdbcTableDefine.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmListTable; - -/** - * @author linjiaqi - */ -public class InstanceReferenceAlarmListShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - public InstanceReferenceAlarmListShardingjdbcTableDefine() { - super(InstanceReferenceAlarmListTable.TABLE, InstanceReferenceAlarmListTable.TIME_BUCKET.getName()); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceAlarmListTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceAlarmListTable.FRONT_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceAlarmListTable.BEHIND_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceAlarmListTable.FRONT_INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceAlarmListTable.BEHIND_INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceAlarmListTable.SOURCE_VALUE, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceAlarmListTable.ALARM_TYPE, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceAlarmListTable.ALARM_CONTENT, ShardingjdbcColumnDefine.Type.Varchar.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceAlarmListTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/InstanceReferenceAlarmShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/InstanceReferenceAlarmShardingjdbcTableDefine.java deleted file mode 100644 index a6d5951e1199f5bd8335475f0920571f063043d9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/InstanceReferenceAlarmShardingjdbcTableDefine.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmTable; - -/** - * @author linjiaqi - */ -public class InstanceReferenceAlarmShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - public InstanceReferenceAlarmShardingjdbcTableDefine() { - super(InstanceReferenceAlarmTable.TABLE, InstanceReferenceAlarmTable.LAST_TIME_BUCKET.getName()); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceAlarmTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceAlarmTable.FRONT_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceAlarmTable.BEHIND_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceAlarmTable.FRONT_INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceAlarmTable.BEHIND_INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceAlarmTable.SOURCE_VALUE, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceAlarmTable.ALARM_TYPE, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceAlarmTable.ALARM_CONTENT, ShardingjdbcColumnDefine.Type.Varchar.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceAlarmTable.LAST_TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ServiceAlarmListShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ServiceAlarmListShardingjdbcTableDefine.java deleted file mode 100644 index 40ecb4fb08c914dce68562b90695f58d247d9ea8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ServiceAlarmListShardingjdbcTableDefine.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmListTable; - -/** - * @author linjiaqi - */ -public class ServiceAlarmListShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - public ServiceAlarmListShardingjdbcTableDefine() { - super(ServiceAlarmListTable.TABLE, ServiceAlarmListTable.TIME_BUCKET.getName()); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(ServiceAlarmListTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceAlarmListTable.APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceAlarmListTable.INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceAlarmListTable.SERVICE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceAlarmListTable.SOURCE_VALUE, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceAlarmListTable.ALARM_TYPE, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceAlarmListTable.ALARM_CONTENT, ShardingjdbcColumnDefine.Type.Varchar.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceAlarmListTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ServiceAlarmShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ServiceAlarmShardingjdbcTableDefine.java deleted file mode 100644 index 65ff49c15eb76f5f469debe63ca3ee586c631418..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ServiceAlarmShardingjdbcTableDefine.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmTable; - -/** - * @author linjiaqi - */ -public class ServiceAlarmShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - public ServiceAlarmShardingjdbcTableDefine() { - super(ServiceAlarmTable.TABLE, ServiceAlarmTable.LAST_TIME_BUCKET.getName()); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(ServiceAlarmTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceAlarmTable.APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceAlarmTable.INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceAlarmTable.SERVICE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceAlarmTable.SOURCE_VALUE, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceAlarmTable.ALARM_TYPE, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceAlarmTable.ALARM_CONTENT, ShardingjdbcColumnDefine.Type.Varchar.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceAlarmTable.LAST_TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ServiceReferenceAlarmListShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ServiceReferenceAlarmListShardingjdbcTableDefine.java deleted file mode 100644 index 955e4722948b4da17a964b53d626077944b2c8ae..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ServiceReferenceAlarmListShardingjdbcTableDefine.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmListTable; - -/** - * @author linjiaqi - */ -public class ServiceReferenceAlarmListShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - public ServiceReferenceAlarmListShardingjdbcTableDefine() { - super(ServiceReferenceAlarmListTable.TABLE, ServiceReferenceAlarmListTable.TIME_BUCKET.getName()); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmListTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmListTable.FRONT_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmListTable.BEHIND_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmListTable.FRONT_INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmListTable.BEHIND_INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmListTable.FRONT_SERVICE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmListTable.BEHIND_SERVICE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmListTable.SOURCE_VALUE, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmListTable.ALARM_TYPE, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmListTable.ALARM_CONTENT, ShardingjdbcColumnDefine.Type.Varchar.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmListTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ServiceReferenceAlarmShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ServiceReferenceAlarmShardingjdbcTableDefine.java deleted file mode 100644 index 36b64f36a3ef4ed8ce72f7fc281cfb5a4eb78a98..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/alarm/ServiceReferenceAlarmShardingjdbcTableDefine.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmTable; - -/** - * @author linjiaqi - */ -public class ServiceReferenceAlarmShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - public ServiceReferenceAlarmShardingjdbcTableDefine() { - super(ServiceReferenceAlarmTable.TABLE, ServiceReferenceAlarmTable.LAST_TIME_BUCKET.getName()); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmTable.FRONT_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmTable.BEHIND_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmTable.FRONT_INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmTable.BEHIND_INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmTable.FRONT_SERVICE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmTable.BEHIND_SERVICE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmTable.SOURCE_VALUE, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmTable.ALARM_TYPE, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmTable.ALARM_CONTENT, ShardingjdbcColumnDefine.Type.Varchar.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceAlarmTable.LAST_TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/amp/AbstractApplicationMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/amp/AbstractApplicationMetricShardingjdbcTableDefine.java deleted file mode 100644 index 4e1d8f6b9a8010c1cf57549defc72761e4886202..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/amp/AbstractApplicationMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.amp; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractApplicationMetricShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - AbstractApplicationMetricShardingjdbcTableDefine(String name) { - super(name, ApplicationMetricTable.TIME_BUCKET.getName()); - } - - @Override public final void initialize() { - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.METRIC_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.SOURCE_VALUE, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.TRANSACTION_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.TRANSACTION_ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.TRANSACTION_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.TRANSACTION_ERROR_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.TRANSACTION_AVERAGE_DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.BUSINESS_TRANSACTION_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.MQ_TRANSACTION_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.MQ_TRANSACTION_ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.MQ_TRANSACTION_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.SATISFIED_COUNT, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.TOLERATING_COUNT, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.FRUSTRATED_COUNT, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(ApplicationMetricTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/amp/ApplicationDayMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/amp/ApplicationDayMetricShardingjdbcTableDefine.java deleted file mode 100644 index f72bd4e9a7268564329676c6b9b48570be8a08bc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/amp/ApplicationDayMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.amp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author linjiaqi - */ -public class ApplicationDayMetricShardingjdbcTableDefine extends AbstractApplicationMetricShardingjdbcTableDefine { - - public ApplicationDayMetricShardingjdbcTableDefine() { - super(ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/amp/ApplicationHourMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/amp/ApplicationHourMetricShardingjdbcTableDefine.java deleted file mode 100644 index 2e8f2ecee85452490f66aeb61d661b54556f0c5c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/amp/ApplicationHourMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.amp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author linjiaqi - */ -public class ApplicationHourMetricShardingjdbcTableDefine extends AbstractApplicationMetricShardingjdbcTableDefine { - - public ApplicationHourMetricShardingjdbcTableDefine() { - super(ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/amp/ApplicationMinuteMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/amp/ApplicationMinuteMetricShardingjdbcTableDefine.java deleted file mode 100644 index 67f82b342569e66da68abce564484f621f3e4b26..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/amp/ApplicationMinuteMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.amp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author linjiaqi - */ -public class ApplicationMinuteMetricShardingjdbcTableDefine extends AbstractApplicationMetricShardingjdbcTableDefine { - - public ApplicationMinuteMetricShardingjdbcTableDefine() { - super(ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/amp/ApplicationMonthMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/amp/ApplicationMonthMetricShardingjdbcTableDefine.java deleted file mode 100644 index 00af35289b33283293acd31c608a1809a3364c60..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/amp/ApplicationMonthMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.amp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; - -/** - * @author linjiaqi - */ -public class ApplicationMonthMetricShardingjdbcTableDefine extends AbstractApplicationMetricShardingjdbcTableDefine { - - public ApplicationMonthMetricShardingjdbcTableDefine() { - super(ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/ampp/AbstractApplicationMappingShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/ampp/AbstractApplicationMappingShardingjdbcTableDefine.java deleted file mode 100644 index 5acd65bf3578587f1f0ea418f846b801b5ae13fa..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/ampp/AbstractApplicationMappingShardingjdbcTableDefine.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.ampp; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractApplicationMappingShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - AbstractApplicationMappingShardingjdbcTableDefine(String name) { - super(name, ApplicationMappingTable.TIME_BUCKET.getName()); - } - - @Override public final void initialize() { - addColumn(new ShardingjdbcColumnDefine(ApplicationMappingTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMappingTable.METRIC_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMappingTable.APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMappingTable.MAPPING_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationMappingTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/ampp/ApplicationMappingDayShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/ampp/ApplicationMappingDayShardingjdbcTableDefine.java deleted file mode 100644 index 9da80346014ddfd6271ecc22e2bcb7e4551c0bb7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/ampp/ApplicationMappingDayShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.ampp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author linjiaqi - */ -public class ApplicationMappingDayShardingjdbcTableDefine extends AbstractApplicationMappingShardingjdbcTableDefine { - - public ApplicationMappingDayShardingjdbcTableDefine() { - super(ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/ampp/ApplicationMappingHourShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/ampp/ApplicationMappingHourShardingjdbcTableDefine.java deleted file mode 100644 index 9eb4d577e3212dd92f898ccc7cf489b4661b4150..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/ampp/ApplicationMappingHourShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.ampp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author linjiaqi - */ -public class ApplicationMappingHourShardingjdbcTableDefine extends AbstractApplicationMappingShardingjdbcTableDefine { - - public ApplicationMappingHourShardingjdbcTableDefine() { - super(ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/ampp/ApplicationMappingMinuteShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/ampp/ApplicationMappingMinuteShardingjdbcTableDefine.java deleted file mode 100644 index b2f3d2aa65c7871a43a72206907d5f085792a8e0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/ampp/ApplicationMappingMinuteShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.ampp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author linjiaqi - */ -public class ApplicationMappingMinuteShardingjdbcTableDefine extends AbstractApplicationMappingShardingjdbcTableDefine { - - public ApplicationMappingMinuteShardingjdbcTableDefine() { - super(ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/ampp/ApplicationMappingMonthShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/ampp/ApplicationMappingMonthShardingjdbcTableDefine.java deleted file mode 100644 index 1751db4ce672e29967f60fec84ab7bc6c0ec9ffc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/ampp/ApplicationMappingMonthShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.ampp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; - -/** - * @author linjiaqi - */ -public class ApplicationMappingMonthShardingjdbcTableDefine extends AbstractApplicationMappingShardingjdbcTableDefine { - - public ApplicationMappingMonthShardingjdbcTableDefine() { - super(ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/armp/AbstractApplicationReferenceMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/armp/AbstractApplicationReferenceMetricShardingjdbcTableDefine.java deleted file mode 100644 index 9c09a3e669a4d4ecbdc92979c34003e3221a6067..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/armp/AbstractApplicationReferenceMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.armp; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractApplicationReferenceMetricShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - AbstractApplicationReferenceMetricShardingjdbcTableDefine(String name) { - super(name, ApplicationReferenceMetricTable.TIME_BUCKET.getName()); - } - - @Override public final void initialize() { - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.METRIC_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.FRONT_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.BEHIND_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.SOURCE_VALUE, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.TRANSACTION_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.TRANSACTION_ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.TRANSACTION_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.TRANSACTION_AVERAGE_DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.MQ_TRANSACTION_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.MQ_TRANSACTION_ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.MQ_TRANSACTION_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.SATISFIED_COUNT, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.TOLERATING_COUNT, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.FRUSTRATED_COUNT, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationReferenceMetricTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/armp/ApplicationReferenceDayMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/armp/ApplicationReferenceDayMetricShardingjdbcTableDefine.java deleted file mode 100644 index ae80521a70abb14eb340732de9a6a2074f6f0430..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/armp/ApplicationReferenceDayMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.armp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class ApplicationReferenceDayMetricShardingjdbcTableDefine extends AbstractApplicationReferenceMetricShardingjdbcTableDefine { - - public ApplicationReferenceDayMetricShardingjdbcTableDefine() { - super(ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/armp/ApplicationReferenceHourMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/armp/ApplicationReferenceHourMetricShardingjdbcTableDefine.java deleted file mode 100644 index dab1979196a126147e1cf2fc4a7bb425d07598d1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/armp/ApplicationReferenceHourMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.armp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class ApplicationReferenceHourMetricShardingjdbcTableDefine extends AbstractApplicationReferenceMetricShardingjdbcTableDefine { - - public ApplicationReferenceHourMetricShardingjdbcTableDefine() { - super(ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/armp/ApplicationReferenceMinuteMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/armp/ApplicationReferenceMinuteMetricShardingjdbcTableDefine.java deleted file mode 100644 index cf99c47a3e0d4b67c6c1face083622de7b79a92d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/armp/ApplicationReferenceMinuteMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.armp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class ApplicationReferenceMinuteMetricShardingjdbcTableDefine extends AbstractApplicationReferenceMetricShardingjdbcTableDefine { - - public ApplicationReferenceMinuteMetricShardingjdbcTableDefine() { - super(ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/armp/ApplicationReferenceMonthMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/armp/ApplicationReferenceMonthMetricShardingjdbcTableDefine.java deleted file mode 100644 index 085e9d0917e24c60d26aaeca3ca15d9622fe4e9b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/armp/ApplicationReferenceMonthMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.armp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class ApplicationReferenceMonthMetricShardingjdbcTableDefine extends AbstractApplicationReferenceMetricShardingjdbcTableDefine { - - public ApplicationReferenceMonthMetricShardingjdbcTableDefine() { - super(ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/cpu/AbstractCpuMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/cpu/AbstractCpuMetricShardingjdbcTableDefine.java deleted file mode 100644 index d463bf8c3f8b4b7fcc93ab8aafdb57a09fc6e0d7..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/cpu/AbstractCpuMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.cpu; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractCpuMetricShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - AbstractCpuMetricShardingjdbcTableDefine(String name) { - super(name, CpuMetricTable.TIME_BUCKET.getName()); - } - - @Override public final void initialize() { - addColumn(new ShardingjdbcColumnDefine(CpuMetricTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(CpuMetricTable.METRIC_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(CpuMetricTable.INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(CpuMetricTable.USAGE_PERCENT, ShardingjdbcColumnDefine.Type.Double.name())); - addColumn(new ShardingjdbcColumnDefine(CpuMetricTable.TIMES, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(CpuMetricTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/cpu/CpuDayMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/cpu/CpuDayMetricShardingjdbcTableDefine.java deleted file mode 100644 index fe02a936af4f22e6e839a1958a2d647d80e5ebbc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/cpu/CpuDayMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.cpu; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author linjiaqi - */ -public class CpuDayMetricShardingjdbcTableDefine extends AbstractCpuMetricShardingjdbcTableDefine { - - public CpuDayMetricShardingjdbcTableDefine() { - super(CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/cpu/CpuHourMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/cpu/CpuHourMetricShardingjdbcTableDefine.java deleted file mode 100644 index 68406668114c79cb600d0e7b766bb17dd1e25c78..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/cpu/CpuHourMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.cpu; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author linjiaqi - */ -public class CpuHourMetricShardingjdbcTableDefine extends AbstractCpuMetricShardingjdbcTableDefine { - - public CpuHourMetricShardingjdbcTableDefine() { - super(CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/cpu/CpuMinuteMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/cpu/CpuMinuteMetricShardingjdbcTableDefine.java deleted file mode 100644 index 0a1044101316e660ed4c68f734782260a6d8d471..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/cpu/CpuMinuteMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.cpu; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author linjiaqi - */ -public class CpuMinuteMetricShardingjdbcTableDefine extends AbstractCpuMetricShardingjdbcTableDefine { - - public CpuMinuteMetricShardingjdbcTableDefine() { - super(CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/cpu/CpuMonthMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/cpu/CpuMonthMetricShardingjdbcTableDefine.java deleted file mode 100644 index 234ab3b82a2baf169a35865fe6c9c1aa1f46d823..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/cpu/CpuMonthMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.cpu; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; - -/** - * @author linjiaqi - */ -public class CpuMonthMetricShardingjdbcTableDefine extends AbstractCpuMetricShardingjdbcTableDefine { - - public CpuMonthMetricShardingjdbcTableDefine() { - super(CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/gc/AbstractGCMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/gc/AbstractGCMetricShardingjdbcTableDefine.java deleted file mode 100644 index 3761fb41929f64c620046d13544548be12d62d0b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/gc/AbstractGCMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.gc; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.*; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractGCMetricShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - AbstractGCMetricShardingjdbcTableDefine(String name) { - super(name, GCMetricTable.TIME_BUCKET.getName()); - } - - @Override public final void initialize() { - addColumn(new ShardingjdbcColumnDefine(GCMetricTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(GCMetricTable.METRIC_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(GCMetricTable.INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(GCMetricTable.PHRASE, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(GCMetricTable.COUNT, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(GCMetricTable.DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(GCMetricTable.TIMES, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(GCMetricTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/gc/GCDayMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/gc/GCDayMetricShardingjdbcTableDefine.java deleted file mode 100644 index 0586c177f594bf89cb26fd5a37254160501322f5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/gc/GCDayMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.gc; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author linjiaqi - */ -public class GCDayMetricShardingjdbcTableDefine extends AbstractGCMetricShardingjdbcTableDefine { - - public GCDayMetricShardingjdbcTableDefine() { - super(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/gc/GCHourMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/gc/GCHourMetricShardingjdbcTableDefine.java deleted file mode 100644 index 74002e02c03b826d021ab32e43dee375ef691897..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/gc/GCHourMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.gc; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author linjiaqi - */ -public class GCHourMetricShardingjdbcTableDefine extends AbstractGCMetricShardingjdbcTableDefine { - - public GCHourMetricShardingjdbcTableDefine() { - super(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/gc/GCMinuteMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/gc/GCMinuteMetricShardingjdbcTableDefine.java deleted file mode 100644 index d26e50af205dda6275c2e55a2f94f7c1962926ae..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/gc/GCMinuteMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.gc; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author linjiaqi - */ -public class GCMinuteMetricShardingjdbcTableDefine extends AbstractGCMetricShardingjdbcTableDefine { - - public GCMinuteMetricShardingjdbcTableDefine() { - super(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/gc/GCMonthMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/gc/GCMonthMetricShardingjdbcTableDefine.java deleted file mode 100644 index d88cb01b6fb6097e75d18bae66ae18151c10ee11..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/gc/GCMonthMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.gc; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; - -/** - * @author linjiaqi - */ -public class GCMonthMetricShardingjdbcTableDefine extends AbstractGCMetricShardingjdbcTableDefine { - - public GCMonthMetricShardingjdbcTableDefine() { - super(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/imp/AbstractInstanceMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/imp/AbstractInstanceMetricShardingjdbcTableDefine.java deleted file mode 100644 index eade78d45fa9b79665123afd5cda4d082967075c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/imp/AbstractInstanceMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.imp; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractInstanceMetricShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - AbstractInstanceMetricShardingjdbcTableDefine(String name) { - super(name, InstanceMetricTable.TIME_BUCKET.getName()); - } - - @Override public final void initialize() { - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.METRIC_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.SOURCE_VALUE, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.TRANSACTION_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.TRANSACTION_ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.TRANSACTION_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.TRANSACTION_ERROR_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.TRANSACTION_AVERAGE_DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.BUSINESS_TRANSACTION_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.MQ_TRANSACTION_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.MQ_TRANSACTION_ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.MQ_TRANSACTION_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceMetricTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/imp/InstanceDayMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/imp/InstanceDayMetricShardingjdbcTableDefine.java deleted file mode 100644 index 5da2b9dc67c5346e2dd68f200cc24bff3fe13420..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/imp/InstanceDayMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.imp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author linjiaqi - */ -public class InstanceDayMetricShardingjdbcTableDefine extends AbstractInstanceMetricShardingjdbcTableDefine { - - public InstanceDayMetricShardingjdbcTableDefine() { - super(InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/imp/InstanceHourMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/imp/InstanceHourMetricShardingjdbcTableDefine.java deleted file mode 100644 index 62a35508d08a3a814aa85f55ea4003481eb14bea..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/imp/InstanceHourMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.imp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author linjiaqi - */ -public class InstanceHourMetricShardingjdbcTableDefine extends AbstractInstanceMetricShardingjdbcTableDefine { - - public InstanceHourMetricShardingjdbcTableDefine() { - super(InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/imp/InstanceMinuteMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/imp/InstanceMinuteMetricShardingjdbcTableDefine.java deleted file mode 100644 index 8d70a8395876aca71714888cbd5dbb8aa651cf8c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/imp/InstanceMinuteMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.imp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author linjiaqi - */ -public class InstanceMinuteMetricShardingjdbcTableDefine extends AbstractInstanceMetricShardingjdbcTableDefine { - - public InstanceMinuteMetricShardingjdbcTableDefine() { - super(InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/imp/InstanceMonthMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/imp/InstanceMonthMetricShardingjdbcTableDefine.java deleted file mode 100644 index fc7cc498192c5d6d243760eaab844035bce30b7d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/imp/InstanceMonthMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.imp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; - -/** - * @author linjiaqi - */ -public class InstanceMonthMetricShardingjdbcTableDefine extends AbstractInstanceMetricShardingjdbcTableDefine { - - public InstanceMonthMetricShardingjdbcTableDefine() { - super(InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/impp/AbstractInstanceMappingShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/impp/AbstractInstanceMappingShardingjdbcTableDefine.java deleted file mode 100644 index 3d61ad06b0b9b0bbb11373c25a9027bb23ac9263..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/impp/AbstractInstanceMappingShardingjdbcTableDefine.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.impp; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractInstanceMappingShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - AbstractInstanceMappingShardingjdbcTableDefine(String name) { - super(name, InstanceMappingTable.TIME_BUCKET.getName()); - } - - @Override public final void initialize() { - addColumn(new ShardingjdbcColumnDefine(InstanceMappingTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMappingTable.METRIC_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMappingTable.APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMappingTable.INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMappingTable.ADDRESS_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceMappingTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/impp/InstanceMappingDayShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/impp/InstanceMappingDayShardingjdbcTableDefine.java deleted file mode 100644 index 45a7d588d2e0fa1ae8c027ebe37ed8fa30411d6c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/impp/InstanceMappingDayShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.impp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author linjiaqi - */ -public class InstanceMappingDayShardingjdbcTableDefine extends AbstractInstanceMappingShardingjdbcTableDefine { - - public InstanceMappingDayShardingjdbcTableDefine() { - super(InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/impp/InstanceMappingHourShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/impp/InstanceMappingHourShardingjdbcTableDefine.java deleted file mode 100644 index ad139b6f53b3178cb8193eaed2d5da8bb0008d47..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/impp/InstanceMappingHourShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.impp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author linjiaqi - */ -public class InstanceMappingHourShardingjdbcTableDefine extends AbstractInstanceMappingShardingjdbcTableDefine { - - public InstanceMappingHourShardingjdbcTableDefine() { - super(InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/impp/InstanceMappingMinuteShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/impp/InstanceMappingMinuteShardingjdbcTableDefine.java deleted file mode 100644 index e6755d2acf15df871b08f734b8452a2534e809f4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/impp/InstanceMappingMinuteShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.impp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author linjiaqi - */ -public class InstanceMappingMinuteShardingjdbcTableDefine extends AbstractInstanceMappingShardingjdbcTableDefine { - - public InstanceMappingMinuteShardingjdbcTableDefine() { - super(InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/impp/InstanceMappingMonthShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/impp/InstanceMappingMonthShardingjdbcTableDefine.java deleted file mode 100644 index d7acad88db518e50d1116c2a77cfbd900ff72f86..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/impp/InstanceMappingMonthShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.impp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; - -/** - * @author linjiaqi - */ -public class InstanceMappingMonthShardingjdbcTableDefine extends AbstractInstanceMappingShardingjdbcTableDefine { - - public InstanceMappingMonthShardingjdbcTableDefine() { - super(InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/irmp/AbstractInstanceReferenceMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/irmp/AbstractInstanceReferenceMetricShardingjdbcTableDefine.java deleted file mode 100644 index eaf95b21c314d177d7dfd27a44f2eda933b0fe01..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/irmp/AbstractInstanceReferenceMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.irmp; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractInstanceReferenceMetricShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - AbstractInstanceReferenceMetricShardingjdbcTableDefine(String name) { - super(name, InstanceReferenceMetricTable.TIME_BUCKET.getName()); - } - - @Override public final void initialize() { - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.METRIC_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.FRONT_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.FRONT_INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.BEHIND_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.BEHIND_INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.SOURCE_VALUE, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.TRANSACTION_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.TRANSACTION_ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.TRANSACTION_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.TRANSACTION_AVERAGE_DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.MQ_TRANSACTION_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.MQ_TRANSACTION_ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.MQ_TRANSACTION_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(InstanceReferenceMetricTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/irmp/InstanceReferenceDayMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/irmp/InstanceReferenceDayMetricShardingjdbcTableDefine.java deleted file mode 100644 index 0479d7e246b6e8e5102397a2a67c17c3e92fb8cc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/irmp/InstanceReferenceDayMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.irmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class InstanceReferenceDayMetricShardingjdbcTableDefine extends AbstractInstanceReferenceMetricShardingjdbcTableDefine { - - public InstanceReferenceDayMetricShardingjdbcTableDefine() { - super(InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } - -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/irmp/InstanceReferenceHourMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/irmp/InstanceReferenceHourMetricShardingjdbcTableDefine.java deleted file mode 100644 index 6798667d8b49d2b89bbe6b90cccd8a1a330dbdba..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/irmp/InstanceReferenceHourMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.irmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class InstanceReferenceHourMetricShardingjdbcTableDefine extends AbstractInstanceReferenceMetricShardingjdbcTableDefine { - - public InstanceReferenceHourMetricShardingjdbcTableDefine() { - super(InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } - -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/irmp/InstanceReferenceMinuteMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/irmp/InstanceReferenceMinuteMetricShardingjdbcTableDefine.java deleted file mode 100644 index 928f0a28b3e119874bd8213edfa7417e956650a0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/irmp/InstanceReferenceMinuteMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.irmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class InstanceReferenceMinuteMetricShardingjdbcTableDefine extends AbstractInstanceReferenceMetricShardingjdbcTableDefine { - - public InstanceReferenceMinuteMetricShardingjdbcTableDefine() { - super(InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } - -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/irmp/InstanceReferenceMonthMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/irmp/InstanceReferenceMonthMetricShardingjdbcTableDefine.java deleted file mode 100644 index fb04b3cf1c653ca2d6a447442c848a03ba3b25ba..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/irmp/InstanceReferenceMonthMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.irmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class InstanceReferenceMonthMetricShardingjdbcTableDefine extends AbstractInstanceReferenceMetricShardingjdbcTableDefine { - - public InstanceReferenceMonthMetricShardingjdbcTableDefine() { - super(InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } - -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/memory/AbstractMemoryMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/memory/AbstractMemoryMetricShardingjdbcTableDefine.java deleted file mode 100644 index 9d300276bd6d340045ff0ba34154d8e8e9e6cc8b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/memory/AbstractMemoryMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.memory; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractMemoryMetricShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - AbstractMemoryMetricShardingjdbcTableDefine(String name) { - super(name, MemoryMetricTable.TIME_BUCKET.getName()); - } - - @Override public final void initialize() { - addColumn(new ShardingjdbcColumnDefine(MemoryMetricTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(MemoryMetricTable.METRIC_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(MemoryMetricTable.INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(MemoryMetricTable.IS_HEAP, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(MemoryMetricTable.INIT, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(MemoryMetricTable.MAX, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(MemoryMetricTable.USED, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(MemoryMetricTable.COMMITTED, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(MemoryMetricTable.TIMES, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(MemoryMetricTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/memory/MemoryDayMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/memory/MemoryDayMetricShardingjdbcTableDefine.java deleted file mode 100644 index cc70694f9fc207801ad4c26415e531b60e31e4f0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/memory/MemoryDayMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.memory; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author linjiaqi - */ -public class MemoryDayMetricShardingjdbcTableDefine extends AbstractMemoryMetricShardingjdbcTableDefine { - - public MemoryDayMetricShardingjdbcTableDefine() { - super(MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/memory/MemoryHourMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/memory/MemoryHourMetricShardingjdbcTableDefine.java deleted file mode 100644 index 08fcd5797a8fd80e6768caf743b2d4bbd10e1652..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/memory/MemoryHourMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.memory; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author linjiaqi - */ -public class MemoryHourMetricShardingjdbcTableDefine extends AbstractMemoryMetricShardingjdbcTableDefine { - - public MemoryHourMetricShardingjdbcTableDefine() { - super(MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/memory/MemoryMinuteMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/memory/MemoryMinuteMetricShardingjdbcTableDefine.java deleted file mode 100644 index dbec45ee5d7bf218cf3ebc71c95710e81b1ce762..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/memory/MemoryMinuteMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.memory; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author linjiaqi - */ -public class MemoryMinuteMetricShardingjdbcTableDefine extends AbstractMemoryMetricShardingjdbcTableDefine { - - public MemoryMinuteMetricShardingjdbcTableDefine() { - super(MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/memory/MemoryMonthMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/memory/MemoryMonthMetricShardingjdbcTableDefine.java deleted file mode 100644 index 3ba098bd55c2e6235735e1cf6487ce468189698a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/memory/MemoryMonthMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.memory; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; - -/** - * @author linjiaqi - */ -public class MemoryMonthMetricShardingjdbcTableDefine extends AbstractMemoryMetricShardingjdbcTableDefine { - - public MemoryMonthMetricShardingjdbcTableDefine() { - super(MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/mpool/AbstractMemoryPoolMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/mpool/AbstractMemoryPoolMetricShardingjdbcTableDefine.java deleted file mode 100644 index 91d53663e006f2701f26156df567d26fe5c11c10..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/mpool/AbstractMemoryPoolMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.mpool; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractMemoryPoolMetricShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - AbstractMemoryPoolMetricShardingjdbcTableDefine(String name) { - super(name, MemoryPoolMetricTable.TIME_BUCKET.getName()); - } - - @Override public final void initialize() { - addColumn(new ShardingjdbcColumnDefine(MemoryPoolMetricTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(MemoryPoolMetricTable.METRIC_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(MemoryPoolMetricTable.INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(MemoryPoolMetricTable.POOL_TYPE, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(MemoryPoolMetricTable.INIT, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(MemoryPoolMetricTable.MAX, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(MemoryPoolMetricTable.USED, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(MemoryPoolMetricTable.COMMITTED, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(MemoryPoolMetricTable.TIMES, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(MemoryPoolMetricTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/mpool/MemoryPoolDayMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/mpool/MemoryPoolDayMetricShardingjdbcTableDefine.java deleted file mode 100644 index 17b5fb1fa097d2a2240b6d60d3f2ce79566e7408..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/mpool/MemoryPoolDayMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.mpool; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author linjiaqi - */ -public class MemoryPoolDayMetricShardingjdbcTableDefine extends AbstractMemoryPoolMetricShardingjdbcTableDefine { - - public MemoryPoolDayMetricShardingjdbcTableDefine() { - super(MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/mpool/MemoryPoolHourMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/mpool/MemoryPoolHourMetricShardingjdbcTableDefine.java deleted file mode 100644 index 1b7c64fca96fbe4c3ac4467b2afa40b48b31329d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/mpool/MemoryPoolHourMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.mpool; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author linjiaqi - */ -public class MemoryPoolHourMetricShardingjdbcTableDefine extends AbstractMemoryPoolMetricShardingjdbcTableDefine { - - public MemoryPoolHourMetricShardingjdbcTableDefine() { - super(MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/mpool/MemoryPoolMinuteMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/mpool/MemoryPoolMinuteMetricShardingjdbcTableDefine.java deleted file mode 100644 index 6b7a6af66ec4d9aad0efaca7a2a10ff6a329dd47..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/mpool/MemoryPoolMinuteMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.mpool; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author linjiaqi - */ -public class MemoryPoolMinuteMetricShardingjdbcTableDefine extends AbstractMemoryPoolMetricShardingjdbcTableDefine { - - public MemoryPoolMinuteMetricShardingjdbcTableDefine() { - super(MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/mpool/MemoryPoolMonthMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/mpool/MemoryPoolMonthMetricShardingjdbcTableDefine.java deleted file mode 100644 index 38a427d100e65b3aa22bb632604a8643d201eb3a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/mpool/MemoryPoolMonthMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.mpool; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; - -/** - * @author linjiaqi - */ -public class MemoryPoolMonthMetricShardingjdbcTableDefine extends AbstractMemoryPoolMetricShardingjdbcTableDefine { - - public MemoryPoolMonthMetricShardingjdbcTableDefine() { - super(MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/register/ApplicationShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/register/ApplicationShardingjdbcTableDefine.java deleted file mode 100644 index 101a5d6af37526aa78b15227a585152b81f9fc2e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/register/ApplicationShardingjdbcTableDefine.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.register; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.register.ApplicationTable; - -/** - * @author linjiaqi - */ -public class ApplicationShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - public ApplicationShardingjdbcTableDefine() { - super(ApplicationTable.TABLE, null); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(ApplicationTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationTable.APPLICATION_CODE, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationTable.APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationTable.ADDRESS_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ApplicationTable.IS_ADDRESS, ShardingjdbcColumnDefine.Type.Int.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/register/InstanceShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/register/InstanceShardingjdbcTableDefine.java deleted file mode 100644 index 2b1e77a9105f9601a237aa2b3d27abe25f04d06f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/register/InstanceShardingjdbcTableDefine.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.register; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; - -/** - * @author linjiaqi - */ -public class InstanceShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - public InstanceShardingjdbcTableDefine() { - super(InstanceTable.TABLE, null); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(InstanceTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceTable.APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceTable.APPLICATION_CODE, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceTable.AGENT_UUID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceTable.REGISTER_TIME, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceTable.INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceTable.HEARTBEAT_TIME, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceTable.OS_INFO, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceTable.ADDRESS_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(InstanceTable.IS_ADDRESS, ShardingjdbcColumnDefine.Type.Int.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/register/NetworkAddressShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/register/NetworkAddressShardingjdbcTableDefine.java deleted file mode 100644 index 312a9b839ae1ccef0a5a7a4e3ef09c9cdeb0b149..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/register/NetworkAddressShardingjdbcTableDefine.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.register; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddressTable; - -/** - * @author linjiaqi - */ -public class NetworkAddressShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - public NetworkAddressShardingjdbcTableDefine() { - super(NetworkAddressTable.TABLE, null); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(NetworkAddressTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(NetworkAddressTable.NETWORK_ADDRESS, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(NetworkAddressTable.ADDRESS_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(NetworkAddressTable.SRC_SPAN_LAYER, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(NetworkAddressTable.SERVER_TYPE, ShardingjdbcColumnDefine.Type.Int.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/register/ServiceNameShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/register/ServiceNameShardingjdbcTableDefine.java deleted file mode 100644 index 38abae7a44f203b3e19a560f1bd04e09c4de4d2d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/register/ServiceNameShardingjdbcTableDefine.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.register; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceNameTable; - -/** - * @author linjiaqi - */ -public class ServiceNameShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - public ServiceNameShardingjdbcTableDefine() { - super(ServiceNameTable.TABLE, null); - } - - @Override public void initialize() { - addColumn(new ShardingjdbcColumnDefine(ServiceNameTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceNameTable.APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceNameTable.SERVICE_NAME, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceNameTable.SERVICE_NAME_KEYWORD, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceNameTable.SERVICE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceNameTable.SRC_SPAN_TYPE, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceNameTable.REGISTER_TIME, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceNameTable.HEARTBEAT_TIME, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/rtd/AbstractResponseTimeDistributionShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/rtd/AbstractResponseTimeDistributionShardingjdbcTableDefine.java deleted file mode 100644 index 1688df962feecb01ae132c96f8ef3e91c7e27f31..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/rtd/AbstractResponseTimeDistributionShardingjdbcTableDefine.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.rtd; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractResponseTimeDistributionShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - AbstractResponseTimeDistributionShardingjdbcTableDefine(String name) { - super(name, ResponseTimeDistributionTable.TIME_BUCKET.getName()); - } - - @Override public final void initialize() { - addColumn(new ShardingjdbcColumnDefine(ResponseTimeDistributionTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ResponseTimeDistributionTable.METRIC_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ResponseTimeDistributionTable.STEP, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ResponseTimeDistributionTable.CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ResponseTimeDistributionTable.ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ResponseTimeDistributionTable.SUCCESS_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ResponseTimeDistributionTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/rtd/ResponseTimeDistributionDayShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/rtd/ResponseTimeDistributionDayShardingjdbcTableDefine.java deleted file mode 100644 index c14e17d7f37bc6f4adc44f1a760d89cf2a51a86c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/rtd/ResponseTimeDistributionDayShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.rtd; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author linjiaqi - */ -public class ResponseTimeDistributionDayShardingjdbcTableDefine extends AbstractResponseTimeDistributionShardingjdbcTableDefine { - - public ResponseTimeDistributionDayShardingjdbcTableDefine() { - super(ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/rtd/ResponseTimeDistributionHourShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/rtd/ResponseTimeDistributionHourShardingjdbcTableDefine.java deleted file mode 100644 index 37068073188dc9db7e8a7c4b9235c956458b0886..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/rtd/ResponseTimeDistributionHourShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.rtd; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author linjiaqi - */ -public class ResponseTimeDistributionHourShardingjdbcTableDefine extends AbstractResponseTimeDistributionShardingjdbcTableDefine { - - public ResponseTimeDistributionHourShardingjdbcTableDefine() { - super(ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/rtd/ResponseTimeDistributionMinuteShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/rtd/ResponseTimeDistributionMinuteShardingjdbcTableDefine.java deleted file mode 100644 index 467d5efdf82496edbd211c9e071f7da1e3478fa4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/rtd/ResponseTimeDistributionMinuteShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.rtd; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author linjiaqi - */ -public class ResponseTimeDistributionMinuteShardingjdbcTableDefine extends AbstractResponseTimeDistributionShardingjdbcTableDefine { - - public ResponseTimeDistributionMinuteShardingjdbcTableDefine() { - super(ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/rtd/ResponseTimeDistributionMonthShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/rtd/ResponseTimeDistributionMonthShardingjdbcTableDefine.java deleted file mode 100644 index e703ba25b42d9a67d7b2a41fbdbc892338b5b002..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/rtd/ResponseTimeDistributionMonthShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.rtd; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; - -/** - * @author linjiaqi - */ -public class ResponseTimeDistributionMonthShardingjdbcTableDefine extends AbstractResponseTimeDistributionShardingjdbcTableDefine { - - public ResponseTimeDistributionMonthShardingjdbcTableDefine() { - super(ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/smp/AbstractServiceMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/smp/AbstractServiceMetricShardingjdbcTableDefine.java deleted file mode 100644 index 44a8837212d6526cf81f5cca0229d0b6a1605d34..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/smp/AbstractServiceMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.smp; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractServiceMetricShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - AbstractServiceMetricShardingjdbcTableDefine(String name) { - super(name, ServiceMetricTable.TIME_BUCKET.getName()); - } - - @Override public final void initialize() { - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.METRIC_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.SERVICE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.SOURCE_VALUE, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.TRANSACTION_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.TRANSACTION_ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.TRANSACTION_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.TRANSACTION_ERROR_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.TRANSACTION_AVERAGE_DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.BUSINESS_TRANSACTION_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.MQ_TRANSACTION_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.MQ_TRANSACTION_ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.MQ_TRANSACTION_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceMetricTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/smp/ServiceDayMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/smp/ServiceDayMetricShardingjdbcTableDefine.java deleted file mode 100644 index b76bb5b2cf89dcf2858ea07f75f8131fc3ad07f0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/smp/ServiceDayMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.smp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author linjiaqi - */ -public class ServiceDayMetricShardingjdbcTableDefine extends AbstractServiceMetricShardingjdbcTableDefine { - - public ServiceDayMetricShardingjdbcTableDefine() { - super(ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/smp/ServiceHourMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/smp/ServiceHourMetricShardingjdbcTableDefine.java deleted file mode 100644 index 6787b2d8820804a710c80eaf55ae159515fc0d44..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/smp/ServiceHourMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.smp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author linjiaqi - */ -public class ServiceHourMetricShardingjdbcTableDefine extends AbstractServiceMetricShardingjdbcTableDefine { - - public ServiceHourMetricShardingjdbcTableDefine() { - super(ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/smp/ServiceMinuteMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/smp/ServiceMinuteMetricShardingjdbcTableDefine.java deleted file mode 100644 index cd274c9a8b9368b48c67a5a11b062c32f4561e86..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/smp/ServiceMinuteMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.smp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author linjiaqi - */ -public class ServiceMinuteMetricShardingjdbcTableDefine extends AbstractServiceMetricShardingjdbcTableDefine { - - public ServiceMinuteMetricShardingjdbcTableDefine() { - super(ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/smp/ServiceMonthMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/smp/ServiceMonthMetricShardingjdbcTableDefine.java deleted file mode 100644 index 347c2efb5366fb25f533a9985b54de0d7228ee70..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/smp/ServiceMonthMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.smp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; - -/** - * @author linjiaqi - */ -public class ServiceMonthMetricShardingjdbcTableDefine extends AbstractServiceMetricShardingjdbcTableDefine { - - public ServiceMonthMetricShardingjdbcTableDefine() { - super(ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/srmp/AbstractServiceReferenceMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/srmp/AbstractServiceReferenceMetricShardingjdbcTableDefine.java deleted file mode 100644 index 5d44d057c846433d73d04d4416ef64f77015e21f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/srmp/AbstractServiceReferenceMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.srmp; - -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcColumnDefine; -import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcTableDefine; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public abstract class AbstractServiceReferenceMetricShardingjdbcTableDefine extends ShardingjdbcTableDefine { - - AbstractServiceReferenceMetricShardingjdbcTableDefine(String name) { - super(name, ServiceReferenceMetricTable.TIME_BUCKET.getName()); - } - - @Override public final void initialize() { - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.METRIC_ID, ShardingjdbcColumnDefine.Type.Varchar.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.FRONT_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.FRONT_INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.FRONT_SERVICE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.BEHIND_APPLICATION_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.BEHIND_INSTANCE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.BEHIND_SERVICE_ID, ShardingjdbcColumnDefine.Type.Int.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.SOURCE_VALUE, ShardingjdbcColumnDefine.Type.Int.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.TRANSACTION_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.TRANSACTION_ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.TRANSACTION_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.TRANSACTION_ERROR_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.TRANSACTION_AVERAGE_DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_ERROR_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.BUSINESS_TRANSACTION_AVERAGE_DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.MQ_TRANSACTION_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.MQ_TRANSACTION_ERROR_CALLS, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.MQ_TRANSACTION_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.MQ_TRANSACTION_ERROR_DURATION_SUM, ShardingjdbcColumnDefine.Type.Bigint.name())); - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.MQ_TRANSACTION_AVERAGE_DURATION, ShardingjdbcColumnDefine.Type.Bigint.name())); - - addColumn(new ShardingjdbcColumnDefine(ServiceReferenceMetricTable.TIME_BUCKET, ShardingjdbcColumnDefine.Type.Bigint.name())); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/srmp/ServiceReferenceDayMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/srmp/ServiceReferenceDayMetricShardingjdbcTableDefine.java deleted file mode 100644 index d88efe5a738d4ab916178d789db31fc1dfa3253a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/srmp/ServiceReferenceDayMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.srmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class ServiceReferenceDayMetricShardingjdbcTableDefine extends AbstractServiceReferenceMetricShardingjdbcTableDefine { - - public ServiceReferenceDayMetricShardingjdbcTableDefine() { - super(ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/srmp/ServiceReferenceHourMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/srmp/ServiceReferenceHourMetricShardingjdbcTableDefine.java deleted file mode 100644 index 1bf3c04f1c17413ecbeda83b16b3ded26f4ce1a0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/srmp/ServiceReferenceHourMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.srmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class ServiceReferenceHourMetricShardingjdbcTableDefine extends AbstractServiceReferenceMetricShardingjdbcTableDefine { - - public ServiceReferenceHourMetricShardingjdbcTableDefine() { - super(ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/srmp/ServiceReferenceMinuteMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/srmp/ServiceReferenceMinuteMetricShardingjdbcTableDefine.java deleted file mode 100644 index 77ef2ec9294cebaa4dc4b494c1b044fb8d5def2e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/srmp/ServiceReferenceMinuteMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.srmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class ServiceReferenceMinuteMetricShardingjdbcTableDefine extends AbstractServiceReferenceMetricShardingjdbcTableDefine { - - public ServiceReferenceMinuteMetricShardingjdbcTableDefine() { - super(ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/srmp/ServiceReferenceMonthMetricShardingjdbcTableDefine.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/srmp/ServiceReferenceMonthMetricShardingjdbcTableDefine.java deleted file mode 100644 index cbb6616812668194afe28e897a7af6deba4af766..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/define/srmp/ServiceReferenceMonthMetricShardingjdbcTableDefine.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.define.srmp; - -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -/** - * @author linjiaqi - */ -public class ServiceReferenceMonthMetricShardingjdbcTableDefine extends AbstractServiceReferenceMetricShardingjdbcTableDefine { - - public ServiceReferenceMonthMetricShardingjdbcTableDefine() { - super(ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName()); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/strategy/ShardingjdbcStrategy.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/strategy/ShardingjdbcStrategy.java deleted file mode 100644 index 06d1b2579a7875b6e70030163b4d30939df78a17..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/strategy/ShardingjdbcStrategy.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.storage.shardingjdbc.strategy; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.skywalking.apm.collector.core.data.CommonTable; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmListTable; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmTable; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmListTable; -import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationReferenceAlarmTable; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmListTable; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceAlarmTable; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmListTable; -import org.apache.skywalking.apm.collector.storage.table.alarm.InstanceReferenceAlarmTable; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmListTable; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceAlarmTable; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmListTable; -import org.apache.skywalking.apm.collector.storage.table.alarm.ServiceReferenceAlarmTable; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationComponentTable; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMappingTable; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable; -import org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetricTable; -import org.apache.skywalking.apm.collector.storage.table.global.GlobalTraceTable; -import org.apache.skywalking.apm.collector.storage.table.global.ResponseTimeDistributionTable; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMappingTable; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetricTable; -import org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetricTable; -import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable; -import org.apache.skywalking.apm.collector.storage.table.jvm.GCMetricTable; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryMetricTable; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; -import org.apache.skywalking.apm.collector.storage.table.register.ApplicationTable; -import org.apache.skywalking.apm.collector.storage.table.register.InstanceTable; -import org.apache.skywalking.apm.collector.storage.table.register.NetworkAddressTable; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceNameTable; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentDurationTable; -import org.apache.skywalking.apm.collector.storage.table.segment.SegmentTable; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceMetricTable; -import org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetricTable; - -import io.shardingjdbc.core.api.config.TableRuleConfiguration; -import io.shardingjdbc.core.api.config.strategy.InlineShardingStrategyConfiguration; -import io.shardingjdbc.core.api.config.strategy.ShardingStrategyConfiguration; - -/** - * @author linjiaqi - */ -public class ShardingjdbcStrategy { - - public final static String SHARDING_DS_PREFIX = "skywalking_ds_"; - - private int shardingNodeSize; - - private String actualDataNodesPrefix; - - private String strategyConfigPrefix; - - private List tableRules = new ArrayList(); - - public ShardingjdbcStrategy(int shardingNodeSize) { - this.shardingNodeSize = shardingNodeSize; - this.actualDataNodesPrefix = SHARDING_DS_PREFIX + "${0.." + (shardingNodeSize - 1) + "}."; - this.strategyConfigPrefix = SHARDING_DS_PREFIX + "${"; - - tableRules.add(tableRule(GlobalTraceTable.TABLE, CommonTable.ID.getName())); - tableRules.add(tableRule(SegmentDurationTable.TABLE, CommonTable.ID.getName())); - tableRules.add(tableRule(SegmentTable.TABLE, CommonTable.ID.getName())); - // acp - tableRules.add(tableRule(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ApplicationComponentTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(), CommonTable.ID.getName())); - // alarm - tableRules.add(tableRule(ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ApplicationAlarmListTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ApplicationAlarmTable.TABLE, CommonTable.ID.getName())); - tableRules.add(tableRule(ApplicationReferenceAlarmListTable.TABLE, CommonTable.ID.getName())); - tableRules.add(tableRule(ApplicationReferenceAlarmTable.TABLE, CommonTable.ID.getName())); - tableRules.add(tableRule(InstanceAlarmListTable.TABLE, CommonTable.ID.getName())); - tableRules.add(tableRule(InstanceAlarmTable.TABLE, CommonTable.ID.getName())); - tableRules.add(tableRule(InstanceReferenceAlarmListTable.TABLE, CommonTable.ID.getName())); - tableRules.add(tableRule(InstanceReferenceAlarmTable.TABLE, CommonTable.ID.getName())); - tableRules.add(tableRule(ServiceAlarmListTable.TABLE, CommonTable.ID.getName())); - tableRules.add(tableRule(ServiceAlarmTable.TABLE, CommonTable.ID.getName())); - tableRules.add(tableRule(ServiceReferenceAlarmListTable.TABLE, CommonTable.ID.getName())); - tableRules.add(tableRule(ServiceReferenceAlarmTable.TABLE, CommonTable.ID.getName())); - // amp - tableRules.add(tableRule(ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ApplicationMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(), CommonTable.ID.getName())); - // ampp - tableRules.add(tableRule(ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ApplicationMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(), CommonTable.ID.getName())); - // armp - tableRules.add(tableRule(ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ApplicationReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(), CommonTable.ID.getName())); - // cpu - tableRules.add(tableRule(CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(CpuMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(), CommonTable.ID.getName())); - // gc - tableRules.add(tableRule(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(GCMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(), CommonTable.ID.getName())); - // imp - tableRules.add(tableRule(InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(InstanceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(), CommonTable.ID.getName())); - // impp - tableRules.add(tableRule(InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(InstanceMappingTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(), CommonTable.ID.getName())); - // irmp - tableRules.add(tableRule(InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(InstanceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(), CommonTable.ID.getName())); - // memory - tableRules.add(tableRule(MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(MemoryMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(), CommonTable.ID.getName())); - // mpool - tableRules.add(tableRule(MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(), CommonTable.ID.getName())); - // register - tableRules.add(tableRule(ApplicationTable.TABLE, CommonTable.ID.getName())); - tableRules.add(tableRule(InstanceTable.TABLE, CommonTable.ID.getName())); - tableRules.add(tableRule(NetworkAddressTable.TABLE, CommonTable.ID.getName())); - tableRules.add(tableRule(ServiceNameTable.TABLE, CommonTable.ID.getName())); - // rtd - tableRules.add(tableRule(ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ResponseTimeDistributionTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(), CommonTable.ID.getName())); - // smp - tableRules.add(tableRule(ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ServiceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(), CommonTable.ID.getName())); - // srmp - tableRules.add(tableRule(ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Day.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Hour.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName(), CommonTable.ID.getName())); - tableRules.add(tableRule(ServiceReferenceMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Month.getName(), CommonTable.ID.getName())); - } - - private TableRuleConfiguration tableRule(String tableName, String columnName) { - TableRuleConfiguration tableRuleConfiguration = new TableRuleConfiguration(); - tableRuleConfiguration.setLogicTable(tableName); - tableRuleConfiguration.setActualDataNodes(actualDataNodesPrefix + tableName); - ShardingStrategyConfiguration configuration = new InlineShardingStrategyConfiguration(columnName, strategyConfigPrefix + columnName.hashCode() + " % " + shardingNodeSize + "}"); - tableRuleConfiguration.setDatabaseShardingStrategyConfig(configuration); - return tableRuleConfiguration; - } - - public List tableRules() { - return tableRules; - } - - public ShardingStrategyConfiguration defaultDatabaseSharding() { - return new InlineShardingStrategyConfiguration(CommonTable.ID.getName(), strategyConfigPrefix + CommonTable.ID.getName().hashCode() + " % " + shardingNodeSize + "}"); - } -} diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/resources/META-INF/defines/storage.define b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/resources/META-INF/defines/storage.define deleted file mode 100644 index 3a5436f723f21d36d98260029d0517a38370e6e2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/resources/META-INF/defines/storage.define +++ /dev/null @@ -1,117 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.register.NetworkAddressShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.register.ApplicationShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.register.InstanceShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.register.ServiceNameShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.cpu.CpuMinuteMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.cpu.CpuHourMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.cpu.CpuDayMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.cpu.CpuMonthMetricShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.gc.GCMinuteMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.gc.GCHourMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.gc.GCDayMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.gc.GCMonthMetricShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.memory.MemoryMinuteMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.memory.MemoryHourMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.memory.MemoryDayMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.memory.MemoryMonthMetricShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.mpool.MemoryPoolMinuteMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.mpool.MemoryPoolHourMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.mpool.MemoryPoolDayMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.mpool.MemoryPoolMonthMetricShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.acp.ApplicationComponentMinuteShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.acp.ApplicationComponentHourShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.acp.ApplicationComponentDayShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.acp.ApplicationComponentMonthShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.ampp.ApplicationMappingMinuteShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.ampp.ApplicationMappingHourShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.ampp.ApplicationMappingDayShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.ampp.ApplicationMappingMonthShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.impp.InstanceMappingMinuteShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.impp.InstanceMappingHourShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.impp.InstanceMappingDayShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.impp.InstanceMappingMonthShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.GlobalTraceShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.rtd.ResponseTimeDistributionMinuteShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.rtd.ResponseTimeDistributionHourShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.rtd.ResponseTimeDistributionDayShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.rtd.ResponseTimeDistributionMonthShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.SegmentDurationShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.SegmentShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.amp.ApplicationMinuteMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.amp.ApplicationHourMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.amp.ApplicationDayMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.amp.ApplicationMonthMetricShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.armp.ApplicationReferenceMinuteMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.armp.ApplicationReferenceHourMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.armp.ApplicationReferenceDayMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.armp.ApplicationReferenceMonthMetricShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.imp.InstanceMinuteMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.imp.InstanceHourMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.imp.InstanceDayMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.imp.InstanceMonthMetricShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.irmp.InstanceReferenceMinuteMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.irmp.InstanceReferenceHourMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.irmp.InstanceReferenceDayMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.irmp.InstanceReferenceMonthMetricShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.smp.ServiceMinuteMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.smp.ServiceHourMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.smp.ServiceDayMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.smp.ServiceMonthMetricShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.srmp.ServiceReferenceMinuteMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.srmp.ServiceReferenceHourMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.srmp.ServiceReferenceDayMetricShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.srmp.ServiceReferenceMonthMetricShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm.ApplicationAlarmShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm.ApplicationAlarmListMinuteShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm.ApplicationAlarmListHourShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm.ApplicationAlarmListDayShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm.ApplicationAlarmListMonthShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm.ApplicationReferenceAlarmShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm.ApplicationReferenceAlarmListShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm.InstanceAlarmShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm.InstanceAlarmListShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm.InstanceReferenceAlarmShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm.InstanceReferenceAlarmListShardingjdbcTableDefine - -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm.ServiceAlarmShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm.ServiceAlarmListShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm.ServiceReferenceAlarmShardingjdbcTableDefine -org.apache.skywalking.apm.collector.storage.shardingjdbc.define.alarm.ServiceReferenceAlarmListShardingjdbcTableDefine \ No newline at end of file diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index a1208f39801e75d00a57756b16b538424f73d9fc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.storage.shardingjdbc.StorageModuleShardingjdbcProvider \ No newline at end of file diff --git a/apm-collector/apm-collector-storage/pom.xml b/apm-collector/apm-collector-storage/pom.xml deleted file mode 100644 index 97ffd788a951a3e986b9d45b310c156f84dd6f22..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-storage/pom.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - apm-collector - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - apm-collector-storage - pom - - collector-storage-define - collector-storage-es-provider - collector-storage-h2-provider - collector-storage-shardingjdbc-provider - - - - - org.apache.skywalking - apm-collector-core - ${project.version} - - - org.apache.skywalking - client-component - ${project.version} - - - org.apache.skywalking - collector-configuration-define - ${project.version} - - - org.apache.skywalking - collector-remote-define - ${project.version} - - - diff --git a/apm-collector/apm-collector-thirdparty-receiver/pom.xml b/apm-collector/apm-collector-thirdparty-receiver/pom.xml deleted file mode 100644 index 5a2add6b406f9277257f9da4fae6b17a8988af74..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - apm-collector - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - apm-collector-thirdparty-receiver - pom - - receiver-zipkin - - - diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/docs/README-CN.md b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/docs/README-CN.md deleted file mode 100644 index ca1025bf57f25d999de3f175000edf491bee4386..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/docs/README-CN.md +++ /dev/null @@ -1,23 +0,0 @@ -# Zipkin接收器 -[Zipkin](http://zipkin.io/)接收器提供了接受Zipkin格式的span数据功能。SkyWalking可以分析、聚合并且将数据展示到可视化界面。因此,用户不需要了解SkyWalking的自动采集探针(Java, .NET, node.js)是如何工作的,或者这些用户因为某些原因不想改变已有的采集方式,例如在Zipkin的集成工作已经完成的情况下。 - -Zipkin接受器在SkyWalking中仅仅只是一个可选特性,即使到目前为止它依然是[孵化特性](../../../../docs/cn/Incubating/Abstract-CN.md)。 - -## 局限性 -作为孵化功能,它仍是一个原型。所以它包含以下几点局限: - -1. 不要在同一分布式系统中使用SkyWalking原生探针和Zipkin的类库。考虑到Zipkin和SkyWalking的HEADER不是共享/可互操作的,它们两者之间不会相互传播context。这会导致已跟踪的链路中断。 -2. 不支持集群模式。 -3. 在进行链路分析时,由于链路会在指定时间内结束。默认链路执行时间不超过2分钟。SkyWalking使用了更复杂的header和context结构,来避免zipkin分析时的这个问题。 - -## 开启Zipkin接收器 -Zipkin接收器是一个可选模块,默认是关闭的。在collector的application.yml配置文件中修改下面的配置项来开启此功能: -```yaml -receiver_zipkin: - default: - host: localhost - port: 9411 - contextPath: / - expireTime: 20 # 单位为秒 - maxCacheSize: 1000000 # traces buffer的大小 -``` diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/docs/README.md b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/docs/README.md deleted file mode 100644 index a1c5c6cf6e5bc94654744b3b69d764c632d071f3..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/docs/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# Zipkin receiver -[Zipkin](http://zipkin.io/) receiver provides the feature to receive span data in Zipkin formats. SkyWalking backend provides -analysis, aggregation and visualization. So the user will not need to learn how SkyWalking auto instrumentation -agents(Java, .NET, node.js) work, or they don't want to change for some reasons, such as Zipkin integration has been completed. - -Zipkin receiver is only an optional features in SkyWalking, even now it is [an incubating feature](../../../../docs/en/Incubating/Abstract.md). - -## Limits -As an incubating feature, it is a prototype. So it has following limits: - -1. Don't try to use SkyWalking native agents and Zipkin's libs in the same distributed system. Considering HEADERs of Zipkin and SkyWalking aren't shared/interoperable, their two will not propagate context for each other. Trace will not continue. -1. Don't support cluster mode. -1. Analysis based on trace will be finished in the certain and given duration. The default assumption is 2 min most. SkyWalking used more complex header and context to avoid this in analysis stage. - -## Open Zipkin receiver -Zipkin receiver is an optional module, and default closed. For open it, add these settings in your `application.yml` in collector -```yaml -receiver_zipkin: - default: - host: localhost - port: 9411 - contextPath: / - expireTime: 20 # Unit is seconds - maxCacheSize: 1000000 # The number of traces in buffer -``` diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/pom.xml b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/pom.xml deleted file mode 100644 index 1c22efb754c62c6e85c3f7c3f637c700ccb1bcde..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - apm-collector-thirdparty-receiver - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - receiver-zipkin - pom - - receiver-zipkin-define - receiver-zipkin-provider - - - - - org.apache.skywalking - apm-collector-core - ${project.version} - - - diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-define/pom.xml b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-define/pom.xml deleted file mode 100644 index 4c28b6ae067a47bb9e2531592410753a71cfe248..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-define/pom.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - receiver-zipkin - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - receiver-zipkin-define - - - diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-define/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/define/ZipkinReceiverModule.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-define/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/define/ZipkinReceiverModule.java deleted file mode 100644 index c93c1929c733e17e01bbfd3a2e46cb23f432b9cc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-define/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/define/ZipkinReceiverModule.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.receiver.zipkin.define; - -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; - -/** - * Zipkin receiver module provides the HTTP, protoc serve for any SDK or agent by following Zipkin format. - * - * At this moment, Zipkin format is not compatible with SkyWalking, especially HEADERs. - * Please don't consider this as a Zipkin-SkyWalking integration, - * it is provided for adding analysis, aggregation and visualization capabilities to zipkin backend. - * - * @author wusheng - */ -public class ZipkinReceiverModule extends ModuleDefine { - public static final String NAME = "receiver_zipkin"; - - @Override public String name() { - return NAME; - } - - @Override public Class[] services() { - return new Class[0]; - } -} diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine deleted file mode 100644 index c8608bcc7626369e2be767236301d0beee6a1225..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.receiver.zipkin.define.ZipkinReceiverModule diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/pom.xml b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/pom.xml deleted file mode 100644 index d6d7f98e2a84150602aa09daf1706361cd89763a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/pom.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - receiver-zipkin - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - receiver-zipkin-provider - - - org.apache.skywalking - receiver-zipkin-define - ${project.version} - - - org.apache.skywalking - collector-jetty-manager-define - ${project.version} - - - org.apache.skywalking - segment-parser-define - ${project.version} - - - org.apache.skywalking - register-define - ${project.version} - - - org.apache.skywalking - metric-define - ${project.version} - - - com.github.ben-manes.caffeine - caffeine - - - io.zipkin.zipkin2 - zipkin - - - - - diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/Receiver2AnalysisBridge.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/Receiver2AnalysisBridge.java deleted file mode 100644 index 5ef103628338fdd74d483688fd169cacc717ec3f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/Receiver2AnalysisBridge.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.receiver.zipkin.provider; - -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.service.ISegmentParseService; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.data.SkyWalkingTrace; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.transform.SegmentListener; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.transform.Zipkin2SkyWalkingTransfer; - -/** - * Send the segments to Analysis module, like receiving segments from native SkyWalking agents. - */ -public class Receiver2AnalysisBridge implements SegmentListener { - private ISegmentParseService segmentParseService; - - public Receiver2AnalysisBridge(ISegmentParseService segmentParseService) { - this.segmentParseService = segmentParseService; - } - - /** - * Add this bridge as listener to Zipkin span transfer. - */ - public void build() { - Zipkin2SkyWalkingTransfer.INSTANCE.addListener(this); - } - - @Override - public void notify(SkyWalkingTrace trace) { - trace.toUpstreamSegment().forEach(upstream -> segmentParseService.parse(upstream.build(), ISegmentParseService.Source.Agent)); - - } -} diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/RegisterServices.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/RegisterServices.java deleted file mode 100644 index 0d3fcc8b75825e4eba22d017ff2f6649cb6a565d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/RegisterServices.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.receiver.zipkin.provider; - -import org.apache.skywalking.apm.collector.analysis.register.define.service.AgentOsInfo; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IApplicationIDService; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IInstanceIDService; -import org.apache.skywalking.apm.collector.analysis.register.define.service.INetworkAddressIDService; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IServiceNameService; - -/** - * @author wusheng - */ -public class RegisterServices { - private IApplicationIDService applicationIDService; - - private IInstanceIDService instanceIDService; - - private INetworkAddressIDService networkAddressIDService; - - private IServiceNameService serviceNameService; - - public RegisterServices( - IApplicationIDService applicationIDService, - IInstanceIDService instanceIDService, - INetworkAddressIDService networkAddressIDService, - IServiceNameService serviceNameService) { - this.applicationIDService = applicationIDService; - this.instanceIDService = instanceIDService; - this.networkAddressIDService = networkAddressIDService; - this.serviceNameService = serviceNameService; - } - - public IApplicationIDService getApplicationIDService() { - return applicationIDService; - } - - public IInstanceIDService getInstanceIDService() { - return instanceIDService; - } - - public INetworkAddressIDService getNetworkAddressIDService() { - return networkAddressIDService; - } - - public IServiceNameService getServiceNameService() { - return serviceNameService; - } - - /** - * @param applicationId - * @param agentUUID in zipkin translation, always means application code. Because no UUID for each process. - * @return - */ - public int getOrCreateApplicationInstanceId(int applicationId, String agentUUID) { - AgentOsInfo agentOsInfo = new AgentOsInfo(); - agentOsInfo.setHostname("N/A"); - agentOsInfo.setOsName("N/A"); - agentOsInfo.setProcessNo(-1); - return getInstanceIDService().getOrCreateByAgentUUID(applicationId, agentUUID, System.currentTimeMillis(), agentOsInfo); - } -} diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/ZipkinReceiverConfig.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/ZipkinReceiverConfig.java deleted file mode 100644 index 6e261e907392e308b02f50c714445fda805e240e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/ZipkinReceiverConfig.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.receiver.zipkin.provider; - -import org.apache.skywalking.apm.collector.server.jetty.JettyServerConfig; - -/** - * @author wusheng - */ -public class ZipkinReceiverConfig extends JettyServerConfig { - private int expireTime = 20; - - private int maxCacheSize = 1_000_000; - - public int getExpireTime() { - return expireTime; - } - - public void setExpireTime(int expireTime) { - this.expireTime = expireTime; - } - - public int getMaxCacheSize() { - return maxCacheSize; - } - - public void setMaxCacheSize(int maxCacheSize) { - this.maxCacheSize = maxCacheSize; - } -} diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/ZipkinReceiverProvider.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/ZipkinReceiverProvider.java deleted file mode 100644 index 0ef45e4b851e05777959433efd33264b19ffbfe6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/ZipkinReceiverProvider.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.receiver.zipkin.provider; - -import org.apache.skywalking.apm.collector.analysis.metric.define.AnalysisMetricModule; -import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService; -import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IApplicationIDService; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IInstanceIDService; -import org.apache.skywalking.apm.collector.analysis.register.define.service.INetworkAddressIDService; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IServiceNameService; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.AnalysisSegmentParserModule; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.service.ISegmentParseService; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.jetty.manager.JettyManagerModule; -import org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService; -import org.apache.skywalking.apm.collector.receiver.zipkin.define.ZipkinReceiverModule; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.handler.SpanV1JettyHandler; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.handler.SpanV2JettyHandler; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.transform.Zipkin2SkyWalkingTransfer; -import org.apache.skywalking.apm.collector.server.jetty.JettyServer; - -/** - * @author wusheng - */ -public class ZipkinReceiverProvider extends ModuleProvider { - public static final String NAME = "default"; - private ZipkinReceiverConfig config; - - public ZipkinReceiverProvider() { - config = new ZipkinReceiverConfig(); - } - - @Override public String name() { - return NAME; - } - - @Override public Class module() { - return ZipkinReceiverModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() throws ServiceNotProvidedException { - - } - - @Override public void start() throws ServiceNotProvidedException, ModuleStartException { - ModuleDefine moduleDefine = getManager().find(AnalysisRegisterModule.NAME); - RegisterServices registerServices = new RegisterServices(moduleDefine.getService(IApplicationIDService.class), - moduleDefine.getService(IInstanceIDService.class), - moduleDefine.getService(INetworkAddressIDService.class), - moduleDefine.getService(IServiceNameService.class)); - IInstanceHeartBeatService instanceHeartBeatService = getManager().find(AnalysisMetricModule.NAME).getService(IInstanceHeartBeatService.class); - Zipkin2SkyWalkingTransfer.INSTANCE.setRegisterServices(registerServices); - Zipkin2SkyWalkingTransfer.INSTANCE.setInstanceHeartBeatService(instanceHeartBeatService); - - JettyManagerService managerService = getManager().find(JettyManagerModule.NAME).getService(JettyManagerService.class); - JettyServer jettyServer = managerService.createIfAbsent(config.getHost(), config.getPort(), config.getContextPath()); - jettyServer.addHandler(new SpanV1JettyHandler(config, registerServices)); - jettyServer.addHandler(new SpanV2JettyHandler(config, registerServices)); - - ISegmentParseService segmentParseService = getManager().find(AnalysisSegmentParserModule.NAME).getService(ISegmentParseService.class); - Receiver2AnalysisBridge bridge = new Receiver2AnalysisBridge(segmentParseService); - Zipkin2SkyWalkingTransfer.INSTANCE.addListener(bridge); - } - - @Override public void notifyAfterCompleted() throws ServiceNotProvidedException { - - } - - @Override public String[] requiredModules() { - return new String[] {JettyManagerModule.NAME, AnalysisSegmentParserModule.NAME, AnalysisMetricModule.NAME}; - } -} diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/cache/CacheFactory.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/cache/CacheFactory.java deleted file mode 100644 index 450f82c114d166995db03eb3d78373ba49c98b7c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/cache/CacheFactory.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.receiver.zipkin.provider.cache; - -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.ZipkinReceiverConfig; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.cache.caffeine.CaffeineSpanCache; - -/** - * @author wusheng - */ -public class CacheFactory { - public static final CacheFactory INSTANCE = new CacheFactory(); - - private ISpanCache implementor; - - private CacheFactory() { - } - - public ISpanCache get(ZipkinReceiverConfig config) { - if (implementor == null) { - synchronized (INSTANCE) { - if (implementor == null) { - implementor = new CaffeineSpanCache(config); - } - } - } - return implementor; - } -} diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/cache/ISpanCache.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/cache/ISpanCache.java deleted file mode 100644 index 2af5afcbb3300bfc030a5ca155bd452648c6db9c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/cache/ISpanCache.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.receiver.zipkin.provider.cache; - -import zipkin2.Span; - -/** - * @author wusheng - */ -public interface ISpanCache { - void addSpan(Span span); -} diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/cache/caffeine/CaffeineSpanCache.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/cache/caffeine/CaffeineSpanCache.java deleted file mode 100644 index 06a9a016bdd613936caaf84b94774596614005b5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/cache/caffeine/CaffeineSpanCache.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.receiver.zipkin.provider.cache.caffeine; - -import com.github.benmanes.caffeine.cache.Cache; -import com.github.benmanes.caffeine.cache.Caffeine; -import com.github.benmanes.caffeine.cache.RemovalCause; -import com.github.benmanes.caffeine.cache.RemovalListener; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.ZipkinReceiverConfig; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.cache.ISpanCache; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.data.ZipkinTrace; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.transform.Zipkin2SkyWalkingTransfer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import zipkin2.Span; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.locks.ReentrantLock; - -/** - * NOTICE: FROM my test, Caffeine cache triggers/checks expire only face write/read op. - * In order to make trace finish in time, I have to set a timer to write a meaningless trace, for active expire. - * - * @author wusheng - */ -public class CaffeineSpanCache implements ISpanCache, RemovalListener { - private static final Logger logger = LoggerFactory.getLogger(CaffeineSpanCache.class); - private Cache inProcessSpanCache; - private ReentrantLock newTraceLock; - - public CaffeineSpanCache(ZipkinReceiverConfig config) { - newTraceLock = new ReentrantLock(); - inProcessSpanCache = Caffeine.newBuilder() - .expireAfterWrite(config.getExpireTime(), TimeUnit.SECONDS) - .maximumSize(config.getMaxCacheSize()) - .removalListener(this) - .build(); - Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(() -> { - inProcessSpanCache.put("ACTIVE", new ZipkinTrace.TriggerTrace()); - }, 2, 3, TimeUnit.SECONDS); - } - - /** - * Zipkin trace finished by the expired rule. - * - * @param key - * @param trace - * @param cause - */ - @Override - public void onRemoval(@Nullable String key, @Nullable ZipkinTrace trace, @Nonnull RemovalCause cause) { - if (trace instanceof ZipkinTrace.TriggerTrace) { - return; - } - try { - Zipkin2SkyWalkingTransfer.INSTANCE.transfer(trace); - } catch (Exception e) { - logger.error(e.getMessage(), e); - logger.warn("Zipkin trace:" + trace); - } - } - - @Override - public void addSpan(Span span) { - ZipkinTrace trace = inProcessSpanCache.getIfPresent(span.traceId()); - if (trace == null) { - newTraceLock.lock(); - try { - trace = inProcessSpanCache.getIfPresent(span.traceId()); - if (trace == null) { - trace = new ZipkinTrace(); - inProcessSpanCache.put(span.traceId(), trace); - } - } finally { - newTraceLock.unlock(); - } - } - trace.addSpan(span); - } -} diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/data/SkyWalkingTrace.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/data/SkyWalkingTrace.java deleted file mode 100644 index d02b0caab5c3198ae63bc0c1f541c81a2412469b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/data/SkyWalkingTrace.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.receiver.zipkin.provider.data; - -import org.apache.skywalking.apm.network.language.agent.TraceSegmentObject; -import org.apache.skywalking.apm.network.language.agent.UniqueId; -import org.apache.skywalking.apm.network.language.agent.UpstreamSegment; - -import java.util.LinkedList; -import java.util.List; - -/** - * Each SkyWalkingTrace consists of segments in each application, original from {@link ZipkinTrace}s - */ -public class SkyWalkingTrace { - private UniqueId globalTraceId; - private List segmentList; - - public SkyWalkingTrace(UniqueId globalTraceId, List segmentList) { - this.globalTraceId = globalTraceId; - this.segmentList = segmentList; - } - - public List toUpstreamSegment() { - List newUpstreamList = new LinkedList<>(); - segmentList.forEach(segment -> { - UpstreamSegment.Builder builder = UpstreamSegment.newBuilder(); - builder.addGlobalTraceIds(globalTraceId); - builder.setSegment(segment.build().toByteString()); - newUpstreamList.add(builder); - }); - return newUpstreamList; - } - - public UniqueId getGlobalTraceId() { - return globalTraceId; - } - - public List getSegmentList() { - return segmentList; - } -} diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/data/ZipkinTrace.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/data/ZipkinTrace.java deleted file mode 100644 index 7708453e36e22b96cde28e40ba9854aa23c63425..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/data/ZipkinTrace.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.receiver.zipkin.provider.data; - -import zipkin2.Span; - -import java.util.LinkedList; -import java.util.List; -import java.util.concurrent.locks.ReentrantLock; - -/** - * @author wusheng - */ -public class ZipkinTrace { - private List spans; - private ReentrantLock spanWriteLock; - - public ZipkinTrace() { - spans = new LinkedList<>(); - spanWriteLock = new ReentrantLock(); - } - - public void addSpan(Span span) { - spanWriteLock.lock(); - try { - spans.add(span); - } finally { - spanWriteLock.unlock(); - } - } - - public List getSpans() { - return spans; - } - - @Override - public String toString() { - return "ZipkinTrace{" + - "spans=" + spans + - '}'; - } - - public static class TriggerTrace extends ZipkinTrace { - - - } -} diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/handler/SpanProcessor.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/handler/SpanProcessor.java deleted file mode 100644 index 7564ab1f87a5825c94d6cc188b3c9cf242252939..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/handler/SpanProcessor.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.receiver.zipkin.provider.handler; - -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.RegisterServices; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.ZipkinReceiverConfig; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.cache.CacheFactory; -import zipkin2.Span; -import zipkin2.codec.SpanBytesDecoder; - -import javax.servlet.http.HttpServletRequest; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.List; -import java.util.zip.GZIPInputStream; - -public class SpanProcessor { - void convert(ZipkinReceiverConfig config, SpanBytesDecoder decoder, HttpServletRequest request, RegisterServices registerServices) throws IOException { - InputStream inputStream = getInputStream(request); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - byte[] buffer = new byte[2048]; - int readCntOnce; - - while ((readCntOnce = inputStream.read(buffer)) >= 0) { - out.write(buffer, 0, readCntOnce); - } - - List spanList = decoder.decodeList(out.toByteArray()); - - spanList.forEach(span -> { - // In Zipkin, the local service name represents the application owner. - String applicationCode = span.localServiceName(); - if (applicationCode != null) { - int applicationId = registerServices.getApplicationIDService().getOrCreateForApplicationCode(applicationCode); - if (applicationId != 0) { - registerServices.getOrCreateApplicationInstanceId(applicationId, applicationCode); - } - } - - CacheFactory.INSTANCE.get(config).addSpan(span); - }); - } - - private InputStream getInputStream(HttpServletRequest request) throws IOException { - InputStream requestInStream; - - String headEncoding = request.getHeader("accept-encoding"); - if (headEncoding != null && (headEncoding.indexOf("gzip") != -1)) { - requestInStream = new GZIPInputStream(request.getInputStream()); - } else { - requestInStream = request.getInputStream(); - } - - return requestInStream; - } -} diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/handler/SpanV1JettyHandler.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/handler/SpanV1JettyHandler.java deleted file mode 100644 index a75c12d108cf629430d6a91ebf0e2112eaa2122e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/handler/SpanV1JettyHandler.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.receiver.zipkin.provider.handler; - -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.RegisterServices; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.ZipkinReceiverConfig; -import org.apache.skywalking.apm.collector.server.jetty.JettyHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import zipkin2.codec.SpanBytesDecoder; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public class SpanV1JettyHandler extends JettyHandler { - private static final Logger logger = LoggerFactory.getLogger(SpanV2JettyHandler.class); - - private ZipkinReceiverConfig config; - private RegisterServices registerServices; - - public SpanV1JettyHandler(ZipkinReceiverConfig config, - RegisterServices registerServices) { - this.config = config; - this.registerServices = registerServices; - } - - @Override - public String pathSpec() { - return "/api/v1/spans"; - } - - @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) { - response.setContentType("application/json"); - response.setCharacterEncoding("utf-8"); - - try { - String type = request.getHeader("Content-Type"); - - SpanBytesDecoder decoder = type != null && type.contains("/x-thrift") - ? SpanBytesDecoder.THRIFT - : SpanBytesDecoder.JSON_V1; - - SpanProcessor processor = new SpanProcessor(); - processor.convert(config, decoder, request, registerServices); - - response.setStatus(202); - } catch (Exception e) { - response.setStatus(500); - - logger.error(e.getMessage(), e); - } - } - -} diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/handler/SpanV2JettyHandler.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/handler/SpanV2JettyHandler.java deleted file mode 100644 index 7e044d448b99bc853ce7586c6ee6bae9bca59733..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/handler/SpanV2JettyHandler.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.receiver.zipkin.provider.handler; - -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.RegisterServices; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.ZipkinReceiverConfig; -import org.apache.skywalking.apm.collector.server.jetty.JettyHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import zipkin2.codec.SpanBytesDecoder; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * @author wusheng - */ -public class SpanV2JettyHandler extends JettyHandler { - private static final Logger logger = LoggerFactory.getLogger(SpanV2JettyHandler.class); - - private ZipkinReceiverConfig config; - private RegisterServices registerServices; - - public SpanV2JettyHandler(ZipkinReceiverConfig config, - RegisterServices registerServices) { - this.config = config; - this.registerServices = registerServices; - } - - @Override - public String pathSpec() { - return "/api/v2/spans"; - } - - @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) { - response.setContentType("application/json"); - response.setCharacterEncoding("utf-8"); - - try { - String type = request.getHeader("Content-Type"); - - SpanBytesDecoder decoder = type != null && type.contains("/x-protobuf") - ? SpanBytesDecoder.PROTO3 - : SpanBytesDecoder.JSON_V2; - - SpanProcessor processor = new SpanProcessor(); - processor.convert(config, decoder, request, registerServices); - - response.setStatus(202); - } catch (Exception e) { - response.setStatus(500); - - logger.error(e.getMessage(), e); - } - } -} diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/transform/SegmentBuilder.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/transform/SegmentBuilder.java deleted file mode 100644 index 56217bf437cf1c0ea4c1adef52d7aa1fb8b5090d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/transform/SegmentBuilder.java +++ /dev/null @@ -1,480 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.receiver.zipkin.provider.transform; - -import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService; -import org.apache.skywalking.apm.collector.core.util.StringUtils; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.RegisterServices; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.data.SkyWalkingTrace; -import org.apache.skywalking.apm.network.language.agent.*; -import org.eclipse.jetty.util.StringUtil; -import zipkin2.Endpoint; -import zipkin2.Span; - -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.Callable; -import java.util.concurrent.ThreadLocalRandom; -import java.util.concurrent.TimeoutException; -import java.util.concurrent.atomic.AtomicReference; - -/** - * @author wusheng - */ -public class SegmentBuilder { - private Context context; - private LinkedList segments; - private Map clientPartSpan; - - private SegmentBuilder() { - segments = new LinkedList<>(); - context = new Context(); - clientPartSpan = new HashMap<>(); - } - - public static SkyWalkingTrace build(List traceSpans, - RegisterServices registerServices, - IInstanceHeartBeatService instanceHeartBeatService) throws Exception { - SegmentBuilder builder = new SegmentBuilder(); - // This map groups the spans by their parent id, in order to assist to build tree. - // key: parentId - // value: span - Map> childSpanMap = new HashMap<>(); - AtomicReference root = new AtomicReference<>(); - traceSpans.forEach(span -> { - if (span.parentId() == null) { - root.set(span); - } - List spanList = childSpanMap.get(span.parentId()); - if (spanList == null) { - spanList = new LinkedList<>(); - spanList.add(span); - childSpanMap.put(span.parentId(), spanList); - } else { - spanList.add(span); - } - }); - - Span rootSpan = root.get(); - if (rootSpan != null) { - String applicationCode = rootSpan.localServiceName(); - // If root span doesn't include applicationCode, a.k.a local service name, - // Segment can't be built - // Ignore the whole trace. - // :P Hope anyone could provide better solution. - // Wu Sheng. - if (StringUtils.isNotEmpty(applicationCode)) { - builder.context.addApp(applicationCode, registerServices); - - SpanObject.Builder rootSpanBuilder = builder.initSpan(null, null, rootSpan, true); - builder.context.currentSegment().addSpan(rootSpanBuilder); - builder.scanSpansFromRoot(rootSpanBuilder, rootSpan, childSpanMap, registerServices); - - builder.segments.add(builder.context.removeApp()); - } - } - - List segmentBuilders = new LinkedList<>(); - builder.segments.forEach(segment -> { - TraceSegmentObject.Builder traceSegmentBuilder = segment.freeze(); - segmentBuilders.add(traceSegmentBuilder); - instanceHeartBeatService.heartBeat(traceSegmentBuilder.getApplicationInstanceId(), segment.getEndTime()); - }); - return new SkyWalkingTrace(builder.generateTraceOrSegmentId(), segmentBuilders); - } - - private void scanSpansFromRoot(SpanObject.Builder parentSegmentSpan, Span parent, - Map> childSpanMap, - RegisterServices registerServices) throws Exception { - String parentId = parent.id(); - // get child spans by parent span id - List spanList = childSpanMap.get(parentId); - if (spanList == null) { - return; - } - for (Span childSpan : spanList) { - String localServiceName = childSpan.localServiceName(); - boolean isNewApp = false; - if (StringUtil.isNotBlank(localServiceName)) { - if (context.isAppChanged(localServiceName)) { - isNewApp = true; - } - } - - try { - if (isNewApp) { - context.addApp(localServiceName, registerServices); - } - SpanObject.Builder childSpanBuilder = initSpan(parentSegmentSpan, parent, childSpan, isNewApp); - - context.currentSegment().addSpan(childSpanBuilder); - scanSpansFromRoot(childSpanBuilder, childSpan, childSpanMap, registerServices); - - } finally { - if (isNewApp) { - segments.add(context.removeApp()); - } - } - } - } - - private SpanObject.Builder initSpan(SpanObject.Builder parentSegmentSpan, Span parentSpan, Span span, - boolean isSegmentRoot) { - SpanObject.Builder spanBuilder = SpanObject.newBuilder(); - spanBuilder.setSpanId(context.currentIDs().nextSpanId()); - if (isSegmentRoot) { - // spanId = -1, means no parent span - // spanId is considered unique, and from a positive sequence in each segment. - spanBuilder.setParentSpanId(-1); - } - if (!isSegmentRoot && parentSegmentSpan != null) { - spanBuilder.setParentSpanId(parentSegmentSpan.getSpanId()); - } - Span.Kind kind = span.kind(); - spanBuilder.setOperationName(span.name()); - ClientSideSpan clientSideSpan; - switch (kind) { - case CLIENT: - spanBuilder.setSpanType(SpanType.Exit); - String peer = endpoint2Peer(span.remoteEndpoint()); - if (peer != null) { - spanBuilder.setPeer(peer); - } - clientSideSpan = new ClientSideSpan(span, spanBuilder); - clientPartSpan.put(span.id(), clientSideSpan); - break; - case SERVER: - spanBuilder.setSpanType(SpanType.Entry); - this.buildRef(spanBuilder, span, parentSegmentSpan, parentSpan); - break; - case CONSUMER: - spanBuilder.setSpanType(SpanType.Entry); - this.buildRef(spanBuilder, span, parentSegmentSpan, parentSpan); - break; - case PRODUCER: - spanBuilder.setSpanType(SpanType.Exit); - peer = endpoint2Peer(span.remoteEndpoint()); - if (peer != null) { - spanBuilder.setPeer(peer); - } - clientSideSpan = new ClientSideSpan(span, spanBuilder); - clientPartSpan.put(span.id(), clientSideSpan); - break; - default: - spanBuilder.setSpanType(SpanType.Local); - } - // microseconds in Zipkin -> milliseconds in SkyWalking - long startTime = span.timestamp() / 1000; - // Some implement of zipkin client not include duration field in its report - // package when duration's value be 0ms, Causing a null pointer exception here. - Long durationObj = span.duration(); - long duration = (durationObj == null) ? 0 : durationObj.longValue() / 1000; - spanBuilder.setStartTime(startTime); - spanBuilder.setEndTime(startTime + duration); - - span.tags().forEach((tagKey, tagValue) -> spanBuilder.addTags( - KeyWithStringValue.newBuilder().setKey(tagKey).setValue(tagValue).build()) - ); - - span.annotations().forEach(annotation -> - spanBuilder.addLogs(LogMessage.newBuilder().setTime(annotation.timestamp() / 1000).addData( - KeyWithStringValue.newBuilder().setKey("zipkin.annotation").setValue(annotation.value()).build() - )) - ); - - return spanBuilder; - } - - private String endpoint2Peer(Endpoint endpoint) { - if (endpoint == null) { - return null; - } - String ip = null; - if (StringUtils.isNotEmpty(endpoint.ipv4())) { - ip = endpoint.ipv4(); - } else if (StringUtils.isNotEmpty(endpoint.ipv6())) { - ip = endpoint.ipv6(); - } - if (StringUtils.isEmpty(ip)) { - return null; - } - int port = endpoint.port(); - return port == 0 ? ip : ip + ":" + port; - } - - private void buildRef(SpanObject.Builder spanBuilder, Span span, SpanObject.Builder parentSegmentSpan, - Span parentSpan) { - Segment parentSegment = context.parentSegment(); - if (parentSegment == null) { - return; - } - Segment rootSegment = context.rootSegment(); - if (rootSegment == null) { - return; - } - - if (span.shared() != null && span.shared()) { - // using same span id in client and server for RPC - // SkyWalking will build both sides of span - ClientSideSpan clientSideSpan = clientPartSpan.get(span.id()); - parentSegmentSpan = clientSideSpan.getBuilder(); - parentSpan = clientSideSpan.getSpan(); - } - - String ip = null; - int port = 0; - Endpoint serverEndpoint = span.localEndpoint(); - Endpoint clientEndpoint = parentSpan.remoteEndpoint(); - if (clientEndpoint != null) { - if (StringUtil.isBlank(ip)) { - if (StringUtils.isNotEmpty(clientEndpoint.ipv4())) { - ip = clientEndpoint.ipv4(); - } else if (StringUtils.isNotEmpty(clientEndpoint.ipv6())) { - ip = clientEndpoint.ipv6(); - } - port = clientEndpoint.port(); - } - } - if (serverEndpoint != null) { - if (StringUtils.isNotEmpty(serverEndpoint.ipv4())) { - ip = serverEndpoint.ipv4(); - } else if (StringUtils.isNotEmpty(serverEndpoint.ipv6())) { - ip = serverEndpoint.ipv6(); - } - } - - if (StringUtil.isBlank(ip)) { - //The IP is the most important for building the ref at both sides. - return; - } - - TraceSegmentReference.Builder refBuilder = TraceSegmentReference.newBuilder(); - refBuilder.setEntryApplicationInstanceId(rootSegment.builder().getApplicationInstanceId()); - int serviceId = rootSegment.getEntryServiceId(); - if (serviceId == 0) { - refBuilder.setEntryServiceName(rootSegment.getEntryServiceName()); - } else { - refBuilder.setEntryServiceId(serviceId); - } - refBuilder.setEntryApplicationInstanceId(rootSegment.builder().getApplicationInstanceId()); - - // parent ref info - refBuilder.setNetworkAddress(port == 0 ? ip : ip + ":" + port); - parentSegmentSpan.setPeer(refBuilder.getNetworkAddress()); - refBuilder.setParentApplicationInstanceId(parentSegment.builder().getApplicationInstanceId()); - refBuilder.setParentSpanId(parentSegmentSpan.getSpanId()); - refBuilder.setParentTraceSegmentId(parentSegment.builder().getTraceSegmentId()); - int parentServiceId = parentSegment.getEntryServiceId(); - if (parentServiceId == 0) { - refBuilder.setParentServiceName(parentSegment.getEntryServiceName()); - } else { - refBuilder.setParentServiceId(parentServiceId); - } - refBuilder.setRefType(RefType.CrossProcess); - - spanBuilder.addRefs(refBuilder); - } - - /** - * Context holds the values in build process. - */ - private class Context { - private LinkedList segmentsStack = new LinkedList<>(); - - private boolean isAppChanged(String applicationCode) { - return StringUtils.isNotEmpty(applicationCode) && !applicationCode.equals(currentIDs().applicationCode); - } - - private Segment addApp(String applicationCode, - RegisterServices registerServices) throws Exception { - int applicationId = waitForExchange(() -> - registerServices.getApplicationIDService().getOrCreateForApplicationCode(applicationCode), - 10 - ); - - int appInstanceId = waitForExchange(() -> - registerServices.getOrCreateApplicationInstanceId(applicationId, applicationCode), - 10 - ); - - Segment segment = new Segment(applicationCode, applicationId, appInstanceId); - segmentsStack.add(segment); - return segment; - } - - private IDCollection currentIDs() { - return segmentsStack.getLast().ids; - } - - private Segment currentSegment() { - return segmentsStack.getLast(); - } - - private Segment parentSegment() { - if (segmentsStack.size() < 2) { - return null; - } else { - return segmentsStack.get(segmentsStack.size() - 2); - } - - } - - private Segment rootSegment() { - if (segmentsStack.size() < 2) { - return null; - } else { - return segmentsStack.getFirst(); - } - } - - private Segment removeApp() { - return segmentsStack.removeLast(); - } - - private int waitForExchange(Callable callable, int retry) throws Exception { - for (int i = 0; i < retry; i++) { - Integer id = callable.call(); - if (id == 0) { - Thread.sleep(1000L); - } else { - return id; - } - } - throw new TimeoutException("ID exchange costs more than expected."); - } - } - - private class Segment { - private TraceSegmentObject.Builder segmentBuilder; - private IDCollection ids; - private int entryServiceId = 0; - private String entryServiceName = null; - private List spans; - private long endTime = 0; - - private Segment(String applicationCode, int applicationId, int appInstanceId) { - ids = new IDCollection(applicationCode, applicationId, appInstanceId); - spans = new LinkedList<>(); - segmentBuilder = TraceSegmentObject.newBuilder(); - segmentBuilder.setApplicationId(applicationId); - segmentBuilder.setApplicationInstanceId(appInstanceId); - segmentBuilder.setTraceSegmentId(generateTraceOrSegmentId()); - } - - private TraceSegmentObject.Builder builder() { - return segmentBuilder; - } - - private void addSpan(SpanObject.Builder spanBuilder) { - String operationName = spanBuilder.getOperationName(); - if (entryServiceId == 0 && StringUtils.isNotEmpty(operationName)) { - if (SpanType.Entry == spanBuilder.getSpanType()) { - if (StringUtils.isNotEmpty(operationName)) { - entryServiceName = operationName; - } else { - entryServiceId = spanBuilder.getOperationNameId(); - } - } - } - - // init by root span - if (spanBuilder.getSpanId() == 1 && entryServiceId == 0) { - if (StringUtils.isNotEmpty(operationName)) { - entryServiceName = operationName; - } else { - entryServiceId = spanBuilder.getOperationNameId(); - } - } - - spans.add(spanBuilder); - if (spanBuilder.getEndTime() > endTime) { - endTime = spanBuilder.getEndTime(); - } - } - - public int getEntryServiceId() { - return entryServiceId; - } - - public String getEntryServiceName() { - return entryServiceName; - } - - private IDCollection ids() { - return ids; - } - - public TraceSegmentObject.Builder freeze() { - for (SpanObject.Builder span : spans) { - segmentBuilder.addSpans(span); - } - return segmentBuilder; - } - - public long getEndTime() { - return endTime; - } - } - - private class IDCollection { - private String applicationCode; - private int appId; - private int instanceId; - private int spanIdSeq; - - private IDCollection(String applicationCode, int appId, int instanceId) { - this.applicationCode = applicationCode; - this.appId = appId; - this.instanceId = instanceId; - this.spanIdSeq = 0; - } - - private int nextSpanId() { - return spanIdSeq++; - } - } - - private UniqueId generateTraceOrSegmentId() { - return UniqueId.newBuilder() - .addIdParts(ThreadLocalRandom.current().nextLong()) - .addIdParts(ThreadLocalRandom.current().nextLong()) - .addIdParts(ThreadLocalRandom.current().nextLong()) - .build(); - } - - private class ClientSideSpan { - private Span span; - private SpanObject.Builder builder; - - public ClientSideSpan(Span span, SpanObject.Builder builder) { - this.span = span; - this.builder = builder; - } - - public Span getSpan() { - return span; - } - - public SpanObject.Builder getBuilder() { - return builder; - } - } -} diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/transform/SegmentListener.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/transform/SegmentListener.java deleted file mode 100644 index 72623e0877d63dc5c83f982cedfbaece9ecb9c8f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/transform/SegmentListener.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.receiver.zipkin.provider.transform; - -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.data.SkyWalkingTrace; - -public interface SegmentListener { - void notify(SkyWalkingTrace trace); -} diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/transform/Zipkin2SkyWalkingTransfer.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/transform/Zipkin2SkyWalkingTransfer.java deleted file mode 100644 index 174903b9596da3f909132e87d06e11c07b61d030..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/transform/Zipkin2SkyWalkingTransfer.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.receiver.zipkin.provider.transform; - -import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.RegisterServices; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.data.SkyWalkingTrace; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.data.ZipkinTrace; -import zipkin2.Span; - -import java.util.LinkedList; -import java.util.List; - -/** - * @author wusheng - */ -public class Zipkin2SkyWalkingTransfer { - public static Zipkin2SkyWalkingTransfer INSTANCE = new Zipkin2SkyWalkingTransfer(); - private RegisterServices registerServices; - private IInstanceHeartBeatService instanceHeartBeatService; - private List listeners = new LinkedList<>(); - - private Zipkin2SkyWalkingTransfer() { - } - - public void setRegisterServices( - RegisterServices registerServices) { - this.registerServices = registerServices; - } - - public void setInstanceHeartBeatService(IInstanceHeartBeatService instanceHeartBeatService) { - this.instanceHeartBeatService = instanceHeartBeatService; - } - - public void addListener(SegmentListener listener) { - listeners.add(listener); - } - - public void transfer(ZipkinTrace trace) throws Exception { - List traceSpans = trace.getSpans(); - - if (traceSpans.size() > 0) { - SkyWalkingTrace skyWalkingTrace = SegmentBuilder.build(traceSpans, registerServices, instanceHeartBeatService); - - listeners.forEach(listener -> - listener.notify(skyWalkingTrace) - ); - - } - } -} diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index 9046f755eef3816b799c18af899456c39b918137..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,19 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - -org.apache.skywalking.apm.collector.receiver.zipkin.provider.ZipkinReceiverProvider diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/test/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/transform/SpringSleuthSegmentBuilderTest.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/test/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/transform/SpringSleuthSegmentBuilderTest.java deleted file mode 100644 index 16a673a32fd2b155e5e9149c3ec5ec3f32f3a82c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/test/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/transform/SpringSleuthSegmentBuilderTest.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.receiver.zipkin.provider.transform; - -import org.apache.skywalking.apm.collector.analysis.metric.define.service.IInstanceHeartBeatService; -import org.apache.skywalking.apm.collector.analysis.register.define.service.AgentOsInfo; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IApplicationIDService; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IInstanceIDService; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.RegisterServices; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.data.SkyWalkingTrace; -import org.apache.skywalking.apm.collector.receiver.zipkin.provider.data.ZipkinTrace; -import org.apache.skywalking.apm.network.language.agent.SpanObject; -import org.apache.skywalking.apm.network.language.agent.SpanType; -import org.apache.skywalking.apm.network.language.agent.TraceSegmentObject; -import org.apache.skywalking.apm.network.language.agent.TraceSegmentReference; -import org.junit.Assert; -import org.junit.Test; -import zipkin2.Span; -import zipkin2.codec.SpanBytesDecoder; - -import java.io.UnsupportedEncodingException; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -/** - * @author wusheng - */ -public class SpringSleuthSegmentBuilderTest implements SegmentListener { - private Map applicationInstRegister = new HashMap<>(); - private Map applicationRegister = new HashMap<>(); - private int appIdSeg = 1; - private int appInstIdSeq = 1; - - @Test - public void testTransform() throws Exception { - - IApplicationIDService applicationIDService = new IApplicationIDService() { - @Override - public int getOrCreateForApplicationCode(String applicationCode) { - String key = "AppCode:" + applicationCode; - if (applicationRegister.containsKey(key)) { - return applicationRegister.get(key); - } else { - int id = appIdSeg++; - applicationRegister.put(key, id); - return id; - } - } - - @Override - public int getOrCreateForAddressId(int addressId, String networkAddress) { - String key = "Address:" + networkAddress; - if (applicationRegister.containsKey(key)) { - return applicationRegister.get(key); - } else { - int id = appIdSeg++; - applicationRegister.put(key, id); - return id; - } - } - }; - - IInstanceIDService instanceIDService = new IInstanceIDService() { - @Override - public int getOrCreateByAgentUUID(int applicationId, String agentUUID, long registerTime, AgentOsInfo osInfo) { - String key = "AppCode:" + applicationId + ",UUID:" + agentUUID; - if (applicationInstRegister.containsKey(key)) { - return applicationInstRegister.get(key); - } else { - int id = appInstIdSeq++; - applicationInstRegister.put(key, id); - return id; - } - } - - @Override - public int getOrCreateByAddressId(int applicationId, int addressId, long registerTime) { - String key = "VitualAppCode:" + applicationId + ",address:" + addressId; - if (applicationInstRegister.containsKey(key)) { - return applicationInstRegister.get(key); - } else { - int id = appInstIdSeq++; - applicationInstRegister.put(key, id); - return id; - } - } - }; - RegisterServices services = new RegisterServices(applicationIDService, instanceIDService, null, null); - - Zipkin2SkyWalkingTransfer.INSTANCE.addListener(this); - Zipkin2SkyWalkingTransfer.INSTANCE.setRegisterServices(services); - Zipkin2SkyWalkingTransfer.INSTANCE.setInstanceHeartBeatService(new IInstanceHeartBeatService() { - @Override - public void heartBeat(int instanceId, long heartBeatTime) { - - } - }); - - List spanList = buildSpringSleuthExampleTrace(); - Assert.assertEquals(3, spanList.size()); - - ZipkinTrace trace = new ZipkinTrace(); - spanList.forEach(span -> trace.addSpan(span)); - - Zipkin2SkyWalkingTransfer.INSTANCE.transfer(trace); - } - - private List buildSpringSleuthExampleTrace() throws UnsupportedEncodingException { - List spans = new LinkedList<>(); - String span = "{\"traceId\":\"5b0e64354eea4fa71a8a1b5bdd791b8a\",\"id\":\"1a8a1b5bdd791b8a\",\"kind\":\"SERVER\",\"name\":\"get /\",\"timestamp\":1527669813700123,\"duration\":11295,\"localEndpoint\":{\"serviceName\":\"frontend\",\"ipv4\":\"192.168.72.220\"},\"remoteEndpoint\":{\"ipv6\":\"::1\",\"port\":55146},\"tags\":{\"http.method\":\"GET\",\"http.path\":\"/\",\"mvc.controller.class\":\"Frontend\",\"mvc.controller.method\":\"callBackend\"}}"; - spans.add(SpanBytesDecoder.JSON_V2.decodeOne(span.getBytes("UTF-8"))); - span = "{\"traceId\":\"5b0e64354eea4fa71a8a1b5bdd791b8a\",\"parentId\":\"1a8a1b5bdd791b8a\",\"id\":\"d7d5b93dcda767c8\",\"kind\":\"CLIENT\",\"name\":\"get\",\"timestamp\":1527669813702456,\"duration\":6672,\"localEndpoint\":{\"serviceName\":\"frontend\",\"ipv4\":\"192.168.72.220\"},\"tags\":{\"http.method\":\"GET\",\"http.path\":\"/api\"}}"; - spans.add(SpanBytesDecoder.JSON_V2.decodeOne(span.getBytes("UTF-8"))); - span = "{\"traceId\":\"5b0e64354eea4fa71a8a1b5bdd791b8a\",\"parentId\":\"1a8a1b5bdd791b8a\",\"id\":\"d7d5b93dcda767c8\",\"kind\":\"SERVER\",\"name\":\"get /api\",\"timestamp\":1527669813705106,\"duration\":4802,\"localEndpoint\":{\"serviceName\":\"backend\",\"ipv4\":\"192.168.72.220\"},\"remoteEndpoint\":{\"ipv4\":\"127.0.0.1\",\"port\":55147},\"tags\":{\"http.method\":\"GET\",\"http.path\":\"/api\",\"mvc.controller.class\":\"Backend\",\"mvc.controller.method\":\"printDate\"},\"shared\":true}"; - spans.add(SpanBytesDecoder.JSON_V2.decodeOne(span.getBytes("UTF-8"))); - - return SpanBytesDecoder.JSON_V2.decodeList(spans.toString().getBytes("UTF-8")); - } - - @Override - public void notify(SkyWalkingTrace trace) { - List segments = trace.getSegmentList(); - Assert.assertEquals(2, segments.size()); - TraceSegmentObject.Builder builder = segments.get(0); - TraceSegmentObject.Builder builder1 = segments.get(1); - TraceSegmentObject.Builder front, end; - if (builder.getApplicationId() == applicationRegister.get("AppCode:frontend")) { - front = builder; - end = builder1; - Assert.assertEquals(applicationRegister.get("AppCode:backend").longValue(), builder1.getApplicationId()); - } else if (builder.getApplicationId() == applicationRegister.get("AppCode:backend")) { - end = builder; - front = builder1; - Assert.assertEquals(applicationRegister.get("AppCode:frontend").longValue(), builder1.getApplicationId()); - } else { - Assert.fail("Can't find frontend and backend applications. "); - return; - } - - Assert.assertEquals(2, front.getSpansCount()); - Assert.assertEquals(1, end.getSpansCount()); - - front.getSpansList().forEach(spanObject -> { - if (spanObject.getSpanId() == 0) { - // span id = 1, means incoming http of frontend - Assert.assertEquals(SpanType.Entry, spanObject.getSpanType()); - Assert.assertEquals("get /", spanObject.getOperationName()); - Assert.assertEquals(0, spanObject.getSpanId()); - Assert.assertEquals(-1, spanObject.getParentSpanId()); - } else if (spanObject.getSpanId() == 1) { - Assert.assertEquals("192.168.72.220", spanObject.getPeer()); - Assert.assertEquals(SpanType.Exit, spanObject.getSpanType()); - Assert.assertEquals(1, spanObject.getSpanId()); - Assert.assertEquals(0, spanObject.getParentSpanId()); - } else { - Assert.fail("Only two spans expected"); - } - Assert.assertTrue(spanObject.getTagsCount() > 0); - }); - - SpanObject spanObject = end.getSpans(0); - - Assert.assertEquals(1, spanObject.getRefsCount()); - TraceSegmentReference spanObjectRef = spanObject.getRefs(0); - Assert.assertEquals("get", spanObjectRef.getEntryServiceName()); - Assert.assertEquals("get", spanObjectRef.getParentServiceName()); - //Assert.assertEquals("192.168.72.220", spanObjectRef.getNetworkAddress()); - Assert.assertEquals(1, spanObjectRef.getParentSpanId()); - Assert.assertEquals(front.getTraceSegmentId(), spanObjectRef.getParentTraceSegmentId()); - - Assert.assertTrue(spanObject.getTagsCount() > 0); - - Assert.assertEquals("get /api", spanObject.getOperationName()); - Assert.assertEquals(0, spanObject.getSpanId()); - Assert.assertEquals(-1, spanObject.getParentSpanId()); - Assert.assertEquals(SpanType.Entry, spanObject.getSpanType()); - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-define/pom.xml b/apm-collector/apm-collector-ui/collector-ui-define/pom.xml deleted file mode 100644 index ecc5a76e8f6e803a63eabe77799a001d7064109e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-define/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - apm-collector-ui - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-ui-define - jar - diff --git a/apm-collector/apm-collector-ui/collector-ui-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-ui/collector-ui-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine deleted file mode 100644 index 08d6f9add074b59f791f1df4ed870498318bfd76..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.ui.UIModule diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/pom.xml b/apm-collector/apm-collector-ui/collector-ui-graphql/pom.xml deleted file mode 100644 index 2b6374de3ba86e860aa6b6da01df254a9d1ebc7c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-graphql/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - apm-collector-ui - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-ui-graphql - jar - - - - com.graphql-java - graphql-java-tools - - - org.apache.skywalking - apm-ui-protocol - ${project.version} - - - diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/Mutation.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/Mutation.java deleted file mode 100644 index 6967911aa5a70f3e6f6448f80ea8f33b3486894e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/Mutation.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.graphql; - -import com.coxautodev.graphql.tools.GraphQLMutationResolver; - -/** - * @author peng-yongsheng - */ -public interface Mutation extends GraphQLMutationResolver { -} diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/Query.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/Query.java deleted file mode 100644 index 735089000560591c5864fd3ea707228a7dba2ba6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/Query.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.graphql; - -import com.coxautodev.graphql.tools.GraphQLQueryResolver; - -/** - * @author peng-yongsheng - */ -public interface Query extends GraphQLQueryResolver { -} diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/VersionMutation.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/VersionMutation.java deleted file mode 100644 index 3b4295c186296f0cb63b9efdc77655b1044d0ecb..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/VersionMutation.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.graphql; - -/** - * @author peng-yongsheng - */ -public class VersionMutation implements Mutation { - private String version; -} diff --git a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/VersionQuery.java b/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/VersionQuery.java deleted file mode 100644 index bba61bc8fccecd8a3a6bfc454af6ad32a99e97a5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-graphql/src/main/java/org/apache/skywalking/apm/collector/ui/graphql/VersionQuery.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.graphql; - -/** - * @author peng-yongsheng - */ -public class VersionQuery implements Query { - private String version; -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/pom.xml b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/pom.xml deleted file mode 100644 index 4f8c78567118fa54bbcf713f219b27bf619efc01..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/pom.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - apm-collector-ui - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - collector-ui-jetty-provider - jar - - - - org.apache.skywalking - collector-configuration-define - ${project.version} - - - org.apache.skywalking - collector-ui-define - ${project.version} - - - org.apache.skywalking - collector-ui-graphql - ${project.version} - - - org.apache.skywalking - collector-cluster-define - ${project.version} - - - org.apache.skywalking - collector-jetty-manager-define - ${project.version} - - - org.apache.skywalking - collector-naming-define - ${project.version} - - - org.apache.skywalking - collector-storage-define - ${project.version} - - - org.apache.skywalking - collector-cache-define - ${project.version} - - - diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyConfig.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyConfig.java deleted file mode 100644 index 4d5473d63b7490dcf8e979dd1f3558a269b8d0d9..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.jetty; - -import org.apache.skywalking.apm.collector.server.jetty.JettyServerConfig; - -/** - * @author peng-yongsheng - */ -class UIModuleJettyConfig extends JettyServerConfig { -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyProvider.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyProvider.java deleted file mode 100644 index b2ef65ddff2378bef6bbf9fe2ebc482831f68475..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyProvider.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.jetty; - -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cluster.ClusterModule; -import org.apache.skywalking.apm.collector.cluster.service.ModuleListenerService; -import org.apache.skywalking.apm.collector.cluster.service.ModuleRegisterService; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; -import org.apache.skywalking.apm.collector.core.module.ModuleConfig; -import org.apache.skywalking.apm.collector.core.module.ModuleProvider; -import org.apache.skywalking.apm.collector.jetty.manager.JettyManagerModule; -import org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService; -import org.apache.skywalking.apm.collector.naming.NamingModule; -import org.apache.skywalking.apm.collector.naming.service.NamingHandlerRegisterService; -import org.apache.skywalking.apm.collector.server.jetty.JettyServer; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.ui.UIModule; -import org.apache.skywalking.apm.collector.ui.jetty.handler.GraphQLHandler; -import org.apache.skywalking.apm.collector.ui.jetty.handler.naming.UIJettyNamingHandler; -import org.apache.skywalking.apm.collector.ui.jetty.handler.naming.UIJettyNamingListener; - -/** - * @author peng-yongsheng - */ -public class UIModuleJettyProvider extends ModuleProvider { - - public static final String NAME = "jetty"; - private final UIModuleJettyConfig config; - - public UIModuleJettyProvider() { - super(); - this.config = new UIModuleJettyConfig(); - } - - @Override public String name() { - return NAME; - } - - @Override public Class module() { - return UIModule.class; - } - - @Override public ModuleConfig createConfigBeanIfAbsent() { - return config; - } - - @Override public void prepare() { - } - - @Override public void start() { - ModuleRegisterService moduleRegisterService = getManager().find(ClusterModule.NAME).getService(ModuleRegisterService.class); - moduleRegisterService.register(UIModule.NAME, this.name(), new UIModuleJettyRegistration(config.getHost(), config.getPort(), config.getContextPath())); - - UIJettyNamingListener namingListener = new UIJettyNamingListener(); - ModuleListenerService moduleListenerService = getManager().find(ClusterModule.NAME).getService(ModuleListenerService.class); - moduleListenerService.addListener(namingListener); - - NamingHandlerRegisterService namingHandlerRegisterService = getManager().find(NamingModule.NAME).getService(NamingHandlerRegisterService.class); - namingHandlerRegisterService.register(new UIJettyNamingHandler(namingListener)); - - JettyManagerService managerService = getManager().find(JettyManagerModule.NAME).getService(JettyManagerService.class); - JettyServer jettyServer = managerService.createIfAbsent(config.getHost(), config.getPort(), config.getContextPath()); - addHandlers(jettyServer); - } - - @Override public void notifyAfterCompleted() { - } - - @Override public String[] requiredModules() { - return new String[] {ConfigurationModule.NAME, ClusterModule.NAME, JettyManagerModule.NAME, NamingModule.NAME, CacheModule.NAME, StorageModule.NAME}; - } - - private void addHandlers(JettyServer jettyServer) { - jettyServer.addHandler(new GraphQLHandler(getManager())); - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyRegistration.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyRegistration.java deleted file mode 100644 index 823ed3b1681f8a4d8559fbf0937622e18280820b..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyRegistration.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.jetty; - -import org.apache.skywalking.apm.collector.cluster.ModuleRegistration; - -/** - * @author peng-yongsheng - */ -public class UIModuleJettyRegistration extends ModuleRegistration { - - private final String host; - private final int port; - private final String contextPath; - - public UIModuleJettyRegistration(String host, int port, String contextPath) { - this.host = host; - this.port = port; - this.contextPath = contextPath; - } - - @Override public Value buildValue() { - return new Value(host, port, contextPath); - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java deleted file mode 100644 index 2b4ea520bfb5746790d75b1190fad0fc7c547e9a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandler.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.jetty.handler; - -import com.coxautodev.graphql.tools.SchemaParser; -import com.google.gson.*; -import com.google.gson.reflect.TypeToken; -import graphql.*; -import graphql.schema.GraphQLSchema; -import java.io.*; -import java.util.*; -import javax.servlet.http.HttpServletRequest; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.CollectionUtils; -import org.apache.skywalking.apm.collector.server.jetty.JettyJsonHandler; -import org.apache.skywalking.apm.collector.storage.ui.application.*; -import org.apache.skywalking.apm.collector.storage.ui.common.VisualUserNode; -import org.apache.skywalking.apm.collector.storage.ui.service.ServiceNode; -import org.apache.skywalking.apm.collector.ui.graphql.*; -import org.apache.skywalking.apm.collector.ui.mutation.ConfigMutation; -import org.apache.skywalking.apm.collector.ui.query.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class GraphQLHandler extends JettyJsonHandler { - - private static final Logger logger = LoggerFactory.getLogger(GraphQLHandler.class); - - private final Gson gson = new Gson(); - private final GraphQL graphQL; - private static final String QUERY = "query"; - private static final String VARIABLES = "variables"; - private static final String DATA = "data"; - private static final String ERRORS = "errors"; - private static final String MESSAGE = "message"; - - public GraphQLHandler(ModuleManager moduleManager) { - GraphQLSchema schema = SchemaParser.newParser() - .file("ui-graphql/alarm.graphqls") - .file("ui-graphql/application-layer.graphqls") - .file("ui-graphql/common.graphqls") - .file("ui-graphql/config.graphqls") - .file("ui-graphql/overview-layer.graphqls") - .file("ui-graphql/server-layer.graphqls") - .file("ui-graphql/service-layer.graphqls") - .file("ui-graphql/trace.graphqls") - .resolvers(new VersionQuery(), new VersionMutation(), new AlarmQuery(moduleManager), new ApplicationQuery(moduleManager)) - .resolvers(new OverViewLayerQuery(moduleManager), new ServerQuery(moduleManager), new ServiceQuery(moduleManager), new TraceQuery(moduleManager)) - .resolvers(new ConfigQuery(), new ConfigMutation()) - .dictionary(ConjecturalNode.class, VisualUserNode.class, ApplicationNode.class, ServiceNode.class) - .build() - .makeExecutableSchema(); - - this.graphQL = GraphQL.newGraphQL(schema).build(); - } - - @Override public String pathSpec() { - return "/graphql"; - } - - @Override protected JsonElement doGet(HttpServletRequest req) { - return execute(req.getParameter(QUERY), null); - } - - @Override protected JsonElement doPost(HttpServletRequest req) throws IOException { - BufferedReader reader = new BufferedReader(new InputStreamReader(req.getInputStream())); - String line; - StringBuilder request = new StringBuilder(); - while ((line = reader.readLine()) != null) { - request.append(line); - } - - JsonObject requestJson = gson.fromJson(request.toString(), JsonObject.class); - - return execute(requestJson.get(QUERY).getAsString(), gson.fromJson(requestJson.get(VARIABLES), new TypeToken>() { - }.getType())); - } - - private JsonObject execute(String request, Map variables) { - try { - ExecutionInput executionInput = ExecutionInput.newExecutionInput().query(request).variables(variables).build(); - ExecutionResult executionResult = graphQL.execute(executionInput); - logger.debug("Execution result is {}", executionResult); - Object data = executionResult.getData(); - List errors = executionResult.getErrors(); - - JsonObject jsonObject = new JsonObject(); - if (data != null) { - jsonObject.add(DATA, gson.fromJson(gson.toJson(data), JsonObject.class)); - } - - if (CollectionUtils.isNotEmpty(errors)) { - JsonArray errorArray = new JsonArray(); - errors.forEach(error -> { - JsonObject errorJson = new JsonObject(); - errorJson.addProperty(MESSAGE, error.getMessage()); - errorArray.add(errorJson); - }); - - jsonObject.add(ERRORS, errorArray); - } - - return jsonObject; - } catch (Throwable e) { - logger.error(e.getMessage(), e); - JsonObject jsonObject = new JsonObject(); - - JsonArray errorArray = new JsonArray(); - JsonObject errorJson = new JsonObject(); - errorJson.addProperty(MESSAGE, e.getMessage()); - errorArray.add(errorJson); - - jsonObject.add(ERRORS, errorArray); - return jsonObject; - } - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/naming/UIJettyNamingHandler.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/naming/UIJettyNamingHandler.java deleted file mode 100644 index e9920dd56656ce2bcae3bd302168d84bfe8d57f5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/naming/UIJettyNamingHandler.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.jetty.handler.naming; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import java.util.Set; -import javax.servlet.http.HttpServletRequest; -import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException; -import org.apache.skywalking.apm.collector.server.jetty.JettyJsonHandler; - -/** - * @author peng-yongsheng - */ -public class UIJettyNamingHandler extends JettyJsonHandler { - - private final UIJettyNamingListener namingListener; - - public UIJettyNamingHandler(UIJettyNamingListener namingListener) { - this.namingListener = namingListener; - } - - @Override public String pathSpec() { - return "/ui/jetty"; - } - - @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException { - Set servers = namingListener.getAddresses(); - JsonArray serverArray = new JsonArray(); - servers.forEach(serverArray::add); - return serverArray; - } - - @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException { - throw new UnsupportedOperationException(); - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/naming/UIJettyNamingListener.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/naming/UIJettyNamingListener.java deleted file mode 100644 index 33ffc2e3f63868d529256c6cc411596e7ddb6609..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/jetty/handler/naming/UIJettyNamingListener.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.jetty.handler.naming; - -import org.apache.skywalking.apm.collector.cluster.ClusterModuleListener; -import org.apache.skywalking.apm.collector.ui.jetty.UIModuleJettyProvider; -import org.apache.skywalking.apm.collector.ui.UIModule; - -/** - * @author peng-yongsheng - */ -public class UIJettyNamingListener extends ClusterModuleListener { - - public static final String PATH = "/" + UIModule.NAME + "/" + UIModuleJettyProvider.NAME; - - @Override public String path() { - return PATH; - } - - @Override public void serverJoinNotify(String serverAddress) { - - } - - @Override public void serverQuitNotify(String serverAddress) { - - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/mutation/ConfigMutation.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/mutation/ConfigMutation.java deleted file mode 100644 index ab2d80a092cc5ceee494ac66dee7b2c92ec713b0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/mutation/ConfigMutation.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.mutation; - -import java.util.List; -import org.apache.skywalking.apm.collector.storage.ui.config.AlarmThreshold; -import org.apache.skywalking.apm.collector.storage.ui.config.TTLConfigItem; -import org.apache.skywalking.apm.collector.ui.graphql.Mutation; - -/** - * @author peng-yongsheng - */ -public class ConfigMutation implements Mutation { - - public Boolean setDataTTLConfigs(List ttl) { - return null; - } - - public Boolean setAlarmThreshold(List thresholds) { - return null; - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/AlarmQuery.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/AlarmQuery.java deleted file mode 100644 index 204b5e907450885f6bc43b99899c42a47088bf21..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/AlarmQuery.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.query; - -import java.text.ParseException; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.ui.alarm.*; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.apache.skywalking.apm.collector.ui.graphql.Query; -import org.apache.skywalking.apm.collector.ui.service.AlarmService; -import org.apache.skywalking.apm.collector.ui.utils.*; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class AlarmQuery implements Query { - - private final ModuleManager moduleManager; - private AlarmService alarmService; - - public AlarmQuery(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private AlarmService getAlarmService() { - if (isNull(alarmService)) { - this.alarmService = new AlarmService(moduleManager); - } - return alarmService; - } - - public Alarm loadAlarmList(String keyword, AlarmType alarmType, Duration duration, - Pagination paging) throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()) / 100; - long endTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()) / 100; - - PaginationUtils.Page page = PaginationUtils.INSTANCE.exchange(paging); - - switch (alarmType) { - case APPLICATION: - return getAlarmService().loadApplicationAlarmList(keyword, 0, duration.getStep(), startTimeBucket, endTimeBucket, page.getLimit(), page.getFrom()); - case SERVER: - return getAlarmService().loadInstanceAlarmList(keyword, duration.getStep(), startTimeBucket, endTimeBucket, page.getLimit(), page.getFrom()); - case SERVICE: - return getAlarmService().loadServiceAlarmList(keyword, duration.getStep(), startTimeBucket, endTimeBucket, page.getLimit(), page.getFrom()); - default: - return new Alarm(); - } - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQuery.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQuery.java deleted file mode 100644 index 359f5b5c27627a9b9d0080c152e140a9adaa6e25..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQuery.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.query; - -import java.text.ParseException; -import java.util.List; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.ui.application.Application; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo; -import org.apache.skywalking.apm.collector.storage.ui.service.ServiceMetric; -import org.apache.skywalking.apm.collector.ui.graphql.Query; -import org.apache.skywalking.apm.collector.ui.service.*; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class ApplicationQuery implements Query { - - private final ModuleManager moduleManager; - private ApplicationService applicationService; - private ApplicationTopologyService applicationTopologyService; - private ServerService serverService; - - public ApplicationQuery(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private ApplicationService getApplicationService() { - if (isNull(applicationService)) { - this.applicationService = new ApplicationService(moduleManager); - } - return applicationService; - } - - private ApplicationTopologyService getApplicationTopologyService() { - if (isNull(applicationTopologyService)) { - this.applicationTopologyService = new ApplicationTopologyService(moduleManager); - } - return applicationTopologyService; - } - - private ServerService getServerService() { - if (isNull(serverService)) { - this.serverService = new ServerService(moduleManager); - } - return serverService; - } - - public List getAllApplication(Duration duration) { - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - - return getApplicationService().getApplications(startSecondTimeBucket, endSecondTimeBucket); - } - - public Topology getApplicationTopology(int applicationId, Duration duration) throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - - return getApplicationTopologyService().getApplicationTopology(duration.getStep(), applicationId, startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket); - } - - public List getSlowService(int applicationId, Duration duration, - Integer topN) { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - - return getApplicationService().getSlowService(applicationId, duration.getStep(), startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket, topN); - } - - public List getServerThroughput(int applicationId, Duration duration, - Integer topN) throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - - return getServerService().getServerThroughput(applicationId, duration.getStep(), startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket, topN); - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ConfigQuery.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ConfigQuery.java deleted file mode 100644 index ce1d8d31f258e940c07ac6ec97f59d749c984ecf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ConfigQuery.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.query; - -import org.apache.skywalking.apm.collector.ui.graphql.Query; -import org.apache.skywalking.apm.collector.storage.ui.alarm.AlarmType; -import org.apache.skywalking.apm.collector.storage.ui.config.ExistedAlarmThresholds; -import org.apache.skywalking.apm.collector.storage.ui.config.ExistedTTLConfigs; - -/** - * @author peng-yongsheng - */ -public class ConfigQuery implements Query { - - public ExistedTTLConfigs queryAllDataTTLConfigs() { - return null; - } - - public ExistedAlarmThresholds queryAlarmThresholds(AlarmType alarmType) { - return null; - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/OverViewLayerQuery.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/OverViewLayerQuery.java deleted file mode 100644 index b2ad2354b9e8ab15a3ad519b5b7a2d7ad0a077c0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/OverViewLayerQuery.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.query; - -import java.text.ParseException; -import java.util.List; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.apache.skywalking.apm.collector.storage.ui.overview.*; -import org.apache.skywalking.apm.collector.storage.ui.service.ServiceMetric; -import org.apache.skywalking.apm.collector.ui.graphql.Query; -import org.apache.skywalking.apm.collector.ui.service.*; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class OverViewLayerQuery implements Query { - - private final ModuleManager moduleManager; - private ClusterTopologyService clusterTopologyService; - private ApplicationService applicationService; - private NetworkAddressService networkAddressService; - private ServiceNameService serviceNameService; - private AlarmService alarmService; - private ResponseTimeDistributionService timeDistributionService; - - public OverViewLayerQuery(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private ClusterTopologyService getClusterTopologyService() { - if (isNull(clusterTopologyService)) { - this.clusterTopologyService = new ClusterTopologyService(moduleManager); - } - return clusterTopologyService; - } - - private ApplicationService getApplicationService() { - if (isNull(applicationService)) { - this.applicationService = new ApplicationService(moduleManager); - } - return applicationService; - } - - private NetworkAddressService getNetworkAddressService() { - if (isNull(networkAddressService)) { - this.networkAddressService = new NetworkAddressService(moduleManager); - } - return networkAddressService; - } - - private ServiceNameService getServiceNameService() { - if (isNull(serviceNameService)) { - this.serviceNameService = new ServiceNameService(moduleManager); - } - return serviceNameService; - } - - private AlarmService getAlarmService() { - if (isNull(alarmService)) { - this.alarmService = new AlarmService(moduleManager); - } - return alarmService; - } - - private ResponseTimeDistributionService getTimeDistributionService() { - if (isNull(timeDistributionService)) { - this.timeDistributionService = new ResponseTimeDistributionService(moduleManager); - } - return timeDistributionService; - } - - public Topology getClusterTopology(Duration duration) { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - - return getClusterTopologyService().getClusterTopology(duration.getStep(), startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket); - } - - public ClusterBrief getClusterBrief(Duration duration) { - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - - ClusterBrief clusterBrief = new ClusterBrief(); - clusterBrief.setNumOfApplication(getApplicationService().getApplications(startSecondTimeBucket, endSecondTimeBucket).size()); - clusterBrief.setNumOfDatabase(getNetworkAddressService().getNumOfDatabase()); - clusterBrief.setNumOfCache(getNetworkAddressService().getNumOfCache()); - clusterBrief.setNumOfMQ(getNetworkAddressService().getNumOfMQ()); - clusterBrief.setNumOfService(getServiceNameService().getCount()); - return clusterBrief; - } - - public AlarmTrend getAlarmTrend(Duration duration) throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - - return getAlarmService().getApplicationAlarmTrend(duration.getStep(), startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket); - } - - public ConjecturalAppBrief getConjecturalApps(Duration duration) { - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - - return getApplicationService().getConjecturalApps(duration.getStep(), startSecondTimeBucket, endSecondTimeBucket); - } - - public List getTopNSlowService(Duration duration, int topN) { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - - return getServiceNameService().getSlowService(duration.getStep(), startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket, topN); - } - - public List getTopNApplicationThroughput(Duration duration, - int topN) throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - - return getApplicationService().getTopNApplicationThroughput(duration.getStep(), startTimeBucket, endTimeBucket, topN); - } - - public Thermodynamic getThermodynamic(Duration duration, ValueType type) throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - - return getTimeDistributionService().getThermodynamic(duration.getStep(), startTimeBucket, endTimeBucket, type); - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServerQuery.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServerQuery.java deleted file mode 100644 index b8f1b9d8c08a70d76bcbc3a900279f57293da60c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServerQuery.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.query; - -import java.text.ParseException; -import java.util.List; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.apache.skywalking.apm.collector.storage.ui.server.*; -import org.apache.skywalking.apm.collector.ui.graphql.Query; -import org.apache.skywalking.apm.collector.ui.service.ServerService; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class ServerQuery implements Query { - - private final ModuleManager moduleManager; - private ServerService serverService; - - public ServerQuery(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private ServerService getServerService() { - if (isNull(serverService)) { - this.serverService = new ServerService(moduleManager); - } - return serverService; - } - - public List searchServer(String keyword, Duration duration) { - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - return getServerService().searchServer(keyword, startSecondTimeBucket, endSecondTimeBucket); - } - - public List getAllServer(int applicationId, Duration duration) { - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - return getServerService().getAllServer(applicationId, startSecondTimeBucket, endSecondTimeBucket); - } - - public ResponseTimeTrend getServerResponseTimeTrend(int serverId, Duration duration) throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - return getServerService().getServerResponseTimeTrend(serverId, duration.getStep(), startTimeBucket, endTimeBucket); - } - - public ThroughputTrend getServerThroughputTrend(int serverId, Duration duration) throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - return getServerService().getServerThroughputTrend(serverId, duration.getStep(), startTimeBucket, endTimeBucket); - } - - public CPUTrend getCPUTrend(int serverId, Duration duration) throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - return getServerService().getCPUTrend(serverId, duration.getStep(), startTimeBucket, endTimeBucket); - } - - public GCTrend getGCTrend(int serverId, Duration duration) throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - return getServerService().getGCTrend(serverId, duration.getStep(), startTimeBucket, endTimeBucket); - } - - public MemoryTrend getMemoryTrend(int serverId, Duration duration) throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - return getServerService().getMemoryTrend(serverId, duration.getStep(), startTimeBucket, endTimeBucket); - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServiceQuery.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServiceQuery.java deleted file mode 100644 index c4f848fd2e42651e89b54a01e81711ed3b4bf313..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServiceQuery.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.query; - -import java.text.ParseException; -import java.util.List; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.apache.skywalking.apm.collector.storage.ui.service.ServiceInfo; -import org.apache.skywalking.apm.collector.ui.graphql.Query; -import org.apache.skywalking.apm.collector.ui.service.*; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; - -import static java.util.Objects.isNull; - -/** - * @author peng-yongsheng - */ -public class ServiceQuery implements Query { - - private final ModuleManager moduleManager; - private ServiceNameService serviceNameService; - private ServiceTopologyService serviceTopologyService; - - public ServiceQuery(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private ServiceNameService getServiceNameService() { - if (isNull(serviceNameService)) { - this.serviceNameService = new ServiceNameService(moduleManager); - } - return serviceNameService; - } - - private ServiceTopologyService getServiceTopologyService() { - if (isNull(serviceTopologyService)) { - this.serviceTopologyService = new ServiceTopologyService(moduleManager); - } - return serviceTopologyService; - } - - public List searchService(String keyword, int applicationId, int topN) { - return getServiceNameService().searchService(keyword, applicationId, topN); - } - - public ResponseTimeTrend getServiceResponseTimeTrend(int serviceId, Duration duration) throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - return getServiceNameService().getServiceResponseTimeTrend(serviceId, duration.getStep(), startTimeBucket, endTimeBucket); - } - - public ThroughputTrend getServiceThroughputTrend(int serviceId, Duration duration) throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - - return getServiceNameService().getServiceThroughputTrend(serviceId, duration.getStep(), startTimeBucket, endTimeBucket); - } - - public SLATrend getServiceSLATrend(int serviceId, Duration duration) throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - return getServiceNameService().getServiceSLATrend(serviceId, duration.getStep(), startTimeBucket, endTimeBucket); - } - - public Topology getServiceTopology(int serviceId, Duration duration) { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - - return getServiceTopologyService().getServiceTopology(duration.getStep(), serviceId, startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket); - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/TraceQuery.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/TraceQuery.java deleted file mode 100644 index 39ef052b1e359abf536293ab0d55f8f97d35ee72..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/TraceQuery.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.query; - -import org.apache.skywalking.apm.collector.core.UnexpectedException; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.*; -import org.apache.skywalking.apm.collector.storage.ui.trace.*; -import org.apache.skywalking.apm.collector.ui.graphql.Query; -import org.apache.skywalking.apm.collector.ui.service.*; -import org.apache.skywalking.apm.collector.ui.utils.*; - -import static java.util.Objects.*; - -/** - * @author peng-yongsheng - */ -public class TraceQuery implements Query { - - private final ModuleManager moduleManager; - private SegmentTopService segmentTopService; - private TraceStackService traceStackService; - - public TraceQuery(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - } - - private SegmentTopService getSegmentTopService() { - if (isNull(segmentTopService)) { - this.segmentTopService = new SegmentTopService(moduleManager); - } - return segmentTopService; - } - - private TraceStackService getTraceStackService() { - if (isNull(traceStackService)) { - this.traceStackService = new TraceStackService(moduleManager); - } - return traceStackService; - } - - public TraceBrief queryBasicTraces(TraceQueryCondition condition) { - long startSecondTimeBucket = 0; - long endSecondTimeBucket = 0; - String traceId = Const.EMPTY_STRING; - - if (StringUtils.isNotEmpty(condition.getTraceId())) { - traceId = condition.getTraceId(); - } else if (nonNull(condition.getQueryDuration())) { - startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(condition.getQueryDuration().getStep(), condition.getQueryDuration().getStart()); - endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(condition.getQueryDuration().getStep(), condition.getQueryDuration().getEnd()); - } else { - throw new UnexpectedException("The condition must contains either queryDuration or traceId."); - } - - long minDuration = condition.getMinTraceDuration(); - long maxDuration = condition.getMaxTraceDuration(); - String operationName = condition.getOperationName(); - int applicationId = condition.getApplicationId(); - TraceState traceState = condition.getTraceState(); - QueryOrder queryOrder = condition.getQueryOrder(); - - PaginationUtils.Page page = PaginationUtils.INSTANCE.exchange(condition.getPaging()); - return getSegmentTopService().loadTop(startSecondTimeBucket, endSecondTimeBucket, minDuration, maxDuration, operationName, traceId, applicationId, page.getLimit(), page.getFrom(), traceState, queryOrder); - } - - public Trace queryTrace(String traceId) { - return getTraceStackService().load(traceId); - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/AlarmService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/AlarmService.java deleted file mode 100644 index b10449fb965ec40df7dcd78ec44e1df04eb5a6a8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/AlarmService.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import com.google.gson.*; -import java.text.ParseException; -import java.util.*; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.table.register.*; -import org.apache.skywalking.apm.collector.storage.ui.alarm.Alarm; -import org.apache.skywalking.apm.collector.storage.ui.application.Application; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.ui.overview.AlarmTrend; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class AlarmService { - - private static final Logger logger = LoggerFactory.getLogger(AlarmService.class); - - private final Gson gson = new Gson(); - private final IInstanceUIDAO instanceDAO; - private final IApplicationAlarmUIDAO applicationAlarmUIDAO; - private final IApplicationMappingUIDAO applicationMappingUIDAO; - private final IInstanceAlarmUIDAO instanceAlarmUIDAO; - private final IServiceAlarmUIDAO serviceAlarmUIDAO; - private final IApplicationAlarmListUIDAO applicationAlarmListUIDAO; - private final ApplicationCacheService applicationCacheService; - private final ServiceNameCacheService serviceNameCacheService; - private static final String RESPONSE_TIME_ALARM = " response time alarm."; - private static final String SUCCESS_RATE_ALARM = " success rate alarm."; - - public AlarmService(ModuleManager moduleManager) { - this.instanceDAO = moduleManager.find(StorageModule.NAME).getService(IInstanceUIDAO.class); - this.applicationAlarmUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationAlarmUIDAO.class); - this.applicationMappingUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationMappingUIDAO.class); - this.instanceAlarmUIDAO = moduleManager.find(StorageModule.NAME).getService(IInstanceAlarmUIDAO.class); - this.serviceAlarmUIDAO = moduleManager.find(StorageModule.NAME).getService(IServiceAlarmUIDAO.class); - this.applicationAlarmListUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationAlarmListUIDAO.class); - this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class); - this.serviceNameCacheService = moduleManager.find(CacheModule.NAME).getService(ServiceNameCacheService.class); - } - - public Alarm loadApplicationAlarmList(String keyword, int applicationId, Step step, long startTimeBucket, - long endTimeBucket, int limit, int from) throws ParseException { - logger.debug("keyword: {}, startTimeBucket: {}, endTimeBucket: {}, limit: {}, from: {}", keyword, startTimeBucket, endTimeBucket, limit, from); - List applicationMappings = applicationMappingUIDAO.load(step, startTimeBucket, endTimeBucket); - Map mappings = new HashMap<>(); - - List applicationIds = new LinkedList<>(); - if (applicationId != 0) { - applicationIds.add(applicationId); - } - applicationMappings.forEach(applicationMapping -> { - mappings.put(applicationMapping.getMappingApplicationId(), applicationMapping.getApplicationId()); - if (applicationMapping.getApplicationId() == applicationId) { - applicationIds.add(applicationMapping.getMappingApplicationId()); - } - }); - - Alarm alarm = applicationAlarmUIDAO.loadAlarmList(keyword, applicationIds, startTimeBucket, endTimeBucket, limit, from); - - alarm.getItems().forEach(item -> { - String applicationCode = applicationCacheService.getApplicationById(mappings.getOrDefault(item.getId(), item.getId())).getApplicationCode(); - switch (item.getCauseType()) { - case SLOW_RESPONSE: - item.setTitle("Application " + applicationCode + RESPONSE_TIME_ALARM); - break; - case LOW_SUCCESS_RATE: - item.setTitle("Application " + applicationCode + SUCCESS_RATE_ALARM); - break; - } - }); - return alarm; - } - - public Alarm loadInstanceAlarmList(String keyword, Step step, long startTimeBucket, long endTimeBucket, - int limit, int from) throws ParseException { - logger.debug("keyword: {}, startTimeBucket: {}, endTimeBucket: {}, limit: {}, from: {}", keyword, startTimeBucket, endTimeBucket, limit, from); - Alarm alarm = instanceAlarmUIDAO.loadAlarmList(keyword, startTimeBucket, endTimeBucket, limit, from); - - List applicationMappings = applicationMappingUIDAO.load(step, startTimeBucket, endTimeBucket); - Map mappings = new HashMap<>(); - applicationMappings.forEach(applicationMapping -> mappings.put(applicationMapping.getMappingApplicationId(), applicationMapping.getApplicationId())); - - alarm.getItems().forEach(item -> { - Instance instance = instanceDAO.getInstance(item.getId()); - String applicationCode = applicationCacheService.getApplicationById(mappings.getOrDefault(instance.getApplicationId(), instance.getApplicationId())).getApplicationCode(); - String serverName = buildServerName(instance.getOsInfo()); - switch (item.getCauseType()) { - case SLOW_RESPONSE: - item.setTitle("Server " + serverName + " of Application " + applicationCode + RESPONSE_TIME_ALARM); - break; - case LOW_SUCCESS_RATE: - item.setTitle("Server " + serverName + " of Application " + applicationCode + SUCCESS_RATE_ALARM); - break; - } - }); - - return alarm; - } - - public Alarm loadServiceAlarmList(String keyword, Step step, long startTimeBucket, long endTimeBucket, - int limit, int from) throws ParseException { - logger.debug("keyword: {}, startTimeBucket: {}, endTimeBucket: {}, limit: {}, from: {}", keyword, startTimeBucket, endTimeBucket, limit, from); - Alarm alarm = serviceAlarmUIDAO.loadAlarmList(keyword, startTimeBucket, endTimeBucket, limit, from); - - List applicationMappings = applicationMappingUIDAO.load(step, startTimeBucket, endTimeBucket); - Map mappings = new HashMap<>(); - applicationMappings.forEach(applicationMapping -> mappings.put(applicationMapping.getMappingApplicationId(), applicationMapping.getApplicationId())); - - alarm.getItems().forEach(item -> { - ServiceName serviceName = serviceNameCacheService.get(item.getId()); - String applicationCode = applicationCacheService.getApplicationById(mappings.getOrDefault(serviceName.getApplicationId(), serviceName.getApplicationId())).getApplicationCode(); - switch (item.getCauseType()) { - case SLOW_RESPONSE: - item.setTitle("Service " + serviceName.getServiceName() + " of Application " + applicationCode + RESPONSE_TIME_ALARM); - break; - case LOW_SUCCESS_RATE: - item.setTitle("Service " + serviceName.getServiceName() + " of Application " + applicationCode + SUCCESS_RATE_ALARM); - break; - } - }); - return alarm; - } - - public AlarmTrend getApplicationAlarmTrend(Step step, long startTimeBucket, long endTimeBucket, - long startSecondTimeBucket, - long endSecondTimeBucket) throws ParseException { - List applications = instanceDAO.getApplications(startSecondTimeBucket, endSecondTimeBucket); - - List durationPoints = DurationUtils.INSTANCE.getDurationPoints(step, startTimeBucket, endTimeBucket); - - List alarmTrends = applicationAlarmListUIDAO.getAlarmedApplicationNum(step, startTimeBucket, endTimeBucket); - - Map trendsMap = new HashMap<>(); - alarmTrends.forEach(alarmTrend -> trendsMap.put(alarmTrend.getTimeBucket(), alarmTrend.getNumberOfApplication())); - - AlarmTrend alarmTrend = new AlarmTrend(); - durationPoints.forEach(durationPoint -> { - if (applications.size() == 0) { - alarmTrend.getNumOfAlarmRate().add(0); - } else { - alarmTrend.getNumOfAlarmRate().add((trendsMap.getOrDefault(durationPoint.getPoint(), 0) * 10000) / (applications.size())); - } - }); - return alarmTrend; - } - - private String buildServerName(String osInfoJson) { - JsonObject osInfo = gson.fromJson(osInfoJson, JsonObject.class); - String serverName = Const.UNKNOWN; - if (osInfo.has("hostName")) { - serverName = osInfo.get("hostName").getAsString(); - } - return serverName; - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationService.java deleted file mode 100644 index 36cfb25fa6173b0a1b7b3ccbf74e3e2530f19b73..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationService.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import java.text.ParseException; -import java.util.List; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.*; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IComponentLibraryCatalogService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; -import org.apache.skywalking.apm.collector.storage.ui.application.Application; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.ui.overview.*; -import org.apache.skywalking.apm.collector.storage.ui.service.ServiceMetric; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class ApplicationService { - - private static final Logger logger = LoggerFactory.getLogger(ApplicationService.class); - - private final IInstanceUIDAO instanceDAO; - private final IServiceMetricUIDAO serviceMetricUIDAO; - private final IApplicationMetricUIDAO applicationMetricUIDAO; - private final INetworkAddressUIDAO networkAddressUIDAO; - private final ApplicationCacheService applicationCacheService; - private final ServiceNameCacheService serviceNameCacheService; - private final DateBetweenService dateBetweenService; - private final IComponentLibraryCatalogService componentLibraryCatalogService; - - public ApplicationService(ModuleManager moduleManager) { - this.instanceDAO = moduleManager.find(StorageModule.NAME).getService(IInstanceUIDAO.class); - this.serviceMetricUIDAO = moduleManager.find(StorageModule.NAME).getService(IServiceMetricUIDAO.class); - this.applicationMetricUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationMetricUIDAO.class); - this.networkAddressUIDAO = moduleManager.find(StorageModule.NAME).getService(INetworkAddressUIDAO.class); - this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class); - this.serviceNameCacheService = moduleManager.find(CacheModule.NAME).getService(ServiceNameCacheService.class); - this.componentLibraryCatalogService = moduleManager.find(ConfigurationModule.NAME).getService(IComponentLibraryCatalogService.class); - this.dateBetweenService = new DateBetweenService(moduleManager); - } - - public List getApplications(long startSecondTimeBucket, long endSecondTimeBucket, - int... applicationIds) { - List applications = instanceDAO.getApplications(startSecondTimeBucket, endSecondTimeBucket, applicationIds); - - for (int i = applications.size() - 1; i >= 0; i--) { - Application application = applications.get(i); - if (application.getId() == Const.NONE_APPLICATION_ID) { - applications.remove(i); - } - } - - applications.forEach(application -> { - String applicationCode = applicationCacheService.getApplicationById(application.getId()).getApplicationCode(); - application.setName(applicationCode); - }); - return applications; - } - - public List getSlowService(int applicationId, Step step, long startTimeBucket, long endTimeBucket, - long startSecondTimeBucket, long endSecondTimeBucket, Integer topN) { - List slowServices = serviceMetricUIDAO.getSlowService(applicationId, step, startTimeBucket, endTimeBucket, topN, MetricSource.Callee); - slowServices.forEach(slowService -> { - ServiceName serviceName = serviceNameCacheService.get(slowService.getService().getId()); - - try { - slowService.setCpm((int)(slowService.getCalls() / dateBetweenService.minutesBetween(serviceName.getApplicationId(), startSecondTimeBucket, endSecondTimeBucket))); - } catch (ParseException e) { - logger.error(e.getMessage(), e); - } - slowService.getService().setApplicationId(serviceName.getApplicationId()); - slowService.getService().setApplicationName(applicationCacheService.getApplicationById(serviceName.getApplicationId()).getApplicationCode()); - slowService.getService().setName(serviceName.getServiceName()); - }); - return slowServices; - } - - public List getTopNApplicationThroughput(Step step, long startTimeBucket, long endTimeBucket, - int topN) throws ParseException { - int minutesBetween = DurationUtils.INSTANCE.minutesBetween(step, startTimeBucket, endTimeBucket); - List applicationThroughputList = applicationMetricUIDAO.getTopNApplicationThroughput(step, startTimeBucket, endTimeBucket, minutesBetween, topN, MetricSource.Callee); - applicationThroughputList.forEach(applicationThroughput -> { - String applicationCode = applicationCacheService.getApplicationById(applicationThroughput.getApplicationId()).getApplicationCode(); - applicationThroughput.setApplicationCode(applicationCode); - }); - return applicationThroughputList; - } - - public ConjecturalAppBrief getConjecturalApps(Step step, long startSecondTimeBucket, - long endSecondTimeBucket) { - List conjecturalApps = networkAddressUIDAO.getConjecturalApps(); - conjecturalApps.forEach(conjecturalApp -> { - String serverType = componentLibraryCatalogService.getServerName(conjecturalApp.getId()); - conjecturalApp.setName(serverType); - }); - - ConjecturalAppBrief conjecturalAppBrief = new ConjecturalAppBrief(); - conjecturalAppBrief.setApps(conjecturalApps); - return conjecturalAppBrief; - } - -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationTopologyService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationTopologyService.java deleted file mode 100644 index 535f49cede57bd96c9bc43522091e0b3ea4af01c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationTopologyService.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import java.util.*; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IComponentLibraryCatalogService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class ApplicationTopologyService { - - private static final Logger logger = LoggerFactory.getLogger(ApplicationTopologyService.class); - - private final IApplicationComponentUIDAO applicationComponentUIDAO; - private final IApplicationMappingUIDAO applicationMappingUIDAO; - private final IApplicationMetricUIDAO applicationMetricUIDAO; - private final IApplicationReferenceMetricUIDAO applicationReferenceMetricUIDAO; - private final IComponentLibraryCatalogService componentLibraryCatalogService; - private final ModuleManager moduleManager; - - public ApplicationTopologyService(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - this.applicationComponentUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationComponentUIDAO.class); - this.applicationMappingUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationMappingUIDAO.class); - this.applicationMetricUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationMetricUIDAO.class); - this.applicationReferenceMetricUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationReferenceMetricUIDAO.class); - this.componentLibraryCatalogService = moduleManager.find(ConfigurationModule.NAME).getService(IComponentLibraryCatalogService.class); - } - - public Topology getApplicationTopology(Step step, int applicationId, long startTimeBucket, - long endTimeBucket, long startSecondTimeBucket, long endSecondTimeBucket) { - logger.debug("startTimeBucket: {}, endTimeBucket: {}", startTimeBucket, endTimeBucket); - List applicationComponents = applicationComponentUIDAO.load(step, startTimeBucket, endTimeBucket); - List applicationMappings = applicationMappingUIDAO.load(step, startTimeBucket, endTimeBucket); - - Set applicationIds = new HashSet<>(); - applicationIds.add(applicationId); - applicationMappings.forEach(mapping -> { - if (mapping.getApplicationId() == applicationId) { - applicationIds.add(mapping.getMappingApplicationId()); - } - }); - - Map components = new HashMap<>(); - applicationComponents.forEach(component -> components.put(component.getApplicationId(), this.componentLibraryCatalogService.getComponentName(component.getComponentId()))); - - List applicationMetrics = applicationMetricUIDAO.getApplications(step, startTimeBucket, endTimeBucket, MetricSource.Callee); - - List callerReferenceMetric = applicationReferenceMetricUIDAO.getReferences(step, startTimeBucket, endTimeBucket, MetricSource.Caller, applicationIds.toArray(new Integer[0])); - List calleeReferenceMetric = applicationReferenceMetricUIDAO.getReferences(step, startTimeBucket, endTimeBucket, MetricSource.Callee, applicationIds.toArray(new Integer[0])); - - TopologyBuilder builder = new TopologyBuilder(moduleManager); - - Topology topology = builder.build(applicationComponents, applicationMappings, applicationMetrics, callerReferenceMetric, calleeReferenceMetric, startSecondTimeBucket, endSecondTimeBucket); - - Set nodeIds = new HashSet<>(); - topology.getCalls().forEach(call -> { - nodeIds.add(call.getSource()); - nodeIds.add(call.getTarget()); - }); - - for (int i = topology.getNodes().size() - 1; i >= 0; i--) { - if (!nodeIds.contains(topology.getNodes().get(i).getId())) { - topology.getNodes().remove(i); - } - } - - return topology; - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ClusterTopologyService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ClusterTopologyService.java deleted file mode 100644 index d0d1f0494fa72f1d4556475302ef33cf7201330f..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ClusterTopologyService.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import java.util.*; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IComponentLibraryCatalogService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class ClusterTopologyService { - - private static final Logger logger = LoggerFactory.getLogger(ClusterTopologyService.class); - - private final IApplicationComponentUIDAO applicationComponentUIDAO; - private final IApplicationMappingUIDAO applicationMappingUIDAO; - private final IApplicationMetricUIDAO applicationMetricUIDAO; - private final IApplicationReferenceMetricUIDAO applicationReferenceMetricUIDAO; - private final IComponentLibraryCatalogService componentLibraryCatalogService; - private final ModuleManager moduleManager; - - public ClusterTopologyService(ModuleManager moduleManager) { - this.moduleManager = moduleManager; - this.applicationComponentUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationComponentUIDAO.class); - this.applicationMappingUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationMappingUIDAO.class); - this.applicationMetricUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationMetricUIDAO.class); - this.applicationReferenceMetricUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationReferenceMetricUIDAO.class); - this.componentLibraryCatalogService = moduleManager.find(ConfigurationModule.NAME).getService(IComponentLibraryCatalogService.class); - } - - public Topology getClusterTopology(Step step, long startTimeBucket, long endTimeBucket, long startSecondTimeBucket, - long endSecondTimeBucket) { - logger.debug("startTimeBucket: {}, endTimeBucket: {}, startSecondTimeBucket: {}, endSecondTimeBucket: {}", startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket); - List applicationComponents = applicationComponentUIDAO.load(step, startTimeBucket, endTimeBucket); - List applicationMappings = applicationMappingUIDAO.load(step, startTimeBucket, endTimeBucket); - - Map components = new HashMap<>(); - applicationComponents.forEach(component -> components.put(component.getApplicationId(), this.componentLibraryCatalogService.getComponentName(component.getComponentId()))); - - List applicationMetrics = applicationMetricUIDAO.getApplications(step, startTimeBucket, endTimeBucket, MetricSource.Callee); - - List callerReferenceMetric = applicationReferenceMetricUIDAO.getReferences(step, startTimeBucket, endTimeBucket, MetricSource.Caller); - List calleeReferenceMetric = applicationReferenceMetricUIDAO.getReferences(step, startTimeBucket, endTimeBucket, MetricSource.Callee); - - TopologyBuilder builder = new TopologyBuilder(moduleManager); - - return builder.build(applicationComponents, applicationMappings, applicationMetrics, callerReferenceMetric, calleeReferenceMetric, startSecondTimeBucket, endSecondTimeBucket); - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/DateBetweenService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/DateBetweenService.java deleted file mode 100644 index 140073fd8e1ee51f203238fbed2c1e02e66245ae..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/DateBetweenService.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import java.text.*; -import java.util.Date; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceUIDAO; -import org.joda.time.*; - -/** - * @author peng-yongsheng - */ -class DateBetweenService { - - private final IInstanceUIDAO instanceUIDAO; - - DateBetweenService(ModuleManager moduleManager) { - this.instanceUIDAO = moduleManager.find(StorageModule.NAME).getService(IInstanceUIDAO.class); - } - - int secondsBetween(int applicationId, long startSecondTimeBucket, - long endSecondTimeBucket) throws ParseException { - long registerTime = instanceUIDAO.getEarliestRegisterTime(applicationId); - if (startSecondTimeBucket < registerTime) { - startSecondTimeBucket = registerTime; - } - - long heartBeatTime = instanceUIDAO.getLatestHeartBeatTime(applicationId); - if (endSecondTimeBucket > heartBeatTime) { - endSecondTimeBucket = heartBeatTime; - } - - Date startDate = new SimpleDateFormat("yyyyMMddHHmmss").parse(String.valueOf(startSecondTimeBucket)); - Date endDate = new SimpleDateFormat("yyyyMMddHHmmss").parse(String.valueOf(endSecondTimeBucket)); - - int seconds = Seconds.secondsBetween(new DateTime(startDate), new DateTime(endDate)).getSeconds(); - if (seconds == 0) { - seconds = 1; - } - return seconds; - } - - int minutesBetween(int applicationId, long startSecondTimeBucket, - long endSecondTimeBucket) throws ParseException { - long registerTime = instanceUIDAO.getEarliestRegisterTime(applicationId); - if (startSecondTimeBucket < registerTime) { - startSecondTimeBucket = registerTime; - } - - long heartBeatTime = instanceUIDAO.getLatestHeartBeatTime(applicationId); - if (endSecondTimeBucket > heartBeatTime) { - endSecondTimeBucket = heartBeatTime; - } - - Date startDate = new SimpleDateFormat("yyyyMMddHHmmss").parse(String.valueOf(startSecondTimeBucket)); - Date endDate = new SimpleDateFormat("yyyyMMddHHmmss").parse(String.valueOf(endSecondTimeBucket)); - - int minutes = Minutes.minutesBetween(new DateTime(startDate), new DateTime(endDate)).getMinutes(); - if (minutes == 0) { - minutes = 1; - } - return minutes; - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/NetworkAddressService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/NetworkAddressService.java deleted file mode 100644 index a9317128a0741e7b08c432678c75cc04f25d2749..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/NetworkAddressService.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.ui.INetworkAddressUIDAO; -import org.apache.skywalking.apm.network.language.agent.SpanLayer; - -/** - * @author peng-yongsheng - */ -public class NetworkAddressService { - - private final INetworkAddressUIDAO networkAddressUIDAO; - - public NetworkAddressService(ModuleManager moduleManager) { - this.networkAddressUIDAO = moduleManager.find(StorageModule.NAME).getService(INetworkAddressUIDAO.class); - } - - public int getNumOfDatabase() { - return networkAddressUIDAO.getNumOfSpanLayer(SpanLayer.Database_VALUE); - } - - public int getNumOfCache() { - return networkAddressUIDAO.getNumOfSpanLayer(SpanLayer.Cache_VALUE); - } - - public int getNumOfMQ() { - return networkAddressUIDAO.getNumOfSpanLayer(SpanLayer.MQ_VALUE); - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ResponseTimeDistributionService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ResponseTimeDistributionService.java deleted file mode 100644 index 51dd45bb36d7430de48c320b9f82244dcd06690c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ResponseTimeDistributionService.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import java.text.ParseException; -import java.util.LinkedList; -import java.util.List; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IResponseTimeDistributionConfigService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.ui.IResponseTimeDistributionUIDAO; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.ui.common.ValueType; -import org.apache.skywalking.apm.collector.storage.ui.overview.Thermodynamic; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; - -/** - * @author peng-yongsheng - */ -public class ResponseTimeDistributionService { - - private final IResponseTimeDistributionConfigService responseTimeDistributionConfigService; - private final IResponseTimeDistributionUIDAO responseTimeDistributionUIDAO; - - public ResponseTimeDistributionService(ModuleManager moduleManager) { - this.responseTimeDistributionConfigService = moduleManager.find(ConfigurationModule.NAME).getService(IResponseTimeDistributionConfigService.class); - this.responseTimeDistributionUIDAO = moduleManager.find(StorageModule.NAME).getService(IResponseTimeDistributionUIDAO.class); - } - - public Thermodynamic getThermodynamic(Step step, long startTimeBucket, long endTimeBucket, - ValueType type) throws ParseException { - List durationPoints = DurationUtils.INSTANCE.getDurationPoints(step, startTimeBucket, endTimeBucket); - - List responseTimeSteps = new LinkedList<>(); - for (int i = 0; i < durationPoints.size(); i++) { - for (int j = 0; j < responseTimeDistributionConfigService.getCountOfResponseTimeSteps(); j++) { - responseTimeSteps.add(new IResponseTimeDistributionUIDAO.ResponseTimeStep(durationPoints.get(i).getPoint(), i, j)); - } - } - - responseTimeDistributionUIDAO.loadMetrics(step, responseTimeSteps); - - Thermodynamic thermodynamic = new Thermodynamic(); - thermodynamic.setResponseTimeStep(responseTimeDistributionConfigService.getResponseTimeStep()); - responseTimeSteps.forEach(responseTimeStep -> { - long calls = 0; - switch (type) { - case ALL: - calls = responseTimeStep.getCalls(); - break; - case RIGHT: - calls = responseTimeStep.getSuccessCalls(); - break; - case WRONG: - calls = responseTimeStep.getErrorCalls(); - break; - } - - List metric = trans(responseTimeStep.getyAxis(), responseTimeStep.getStep(), calls); - thermodynamic.getNodes().add(metric); - }); - - return thermodynamic; - } - - private List trans(long xAxis, long yAxis, long calls) { - List metric = new LinkedList<>(); - metric.add(xAxis); - metric.add(yAxis); - metric.add(calls); - return metric; - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/SegmentTopService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/SegmentTopService.java deleted file mode 100644 index b6ee0cfe713bc0ed7caa84f10cde9f2661ec6eed..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/SegmentTopService.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import java.util.List; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.*; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.ui.trace.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class SegmentTopService { - - private static final Logger logger = LoggerFactory.getLogger(SegmentTopService.class); - - private final ISegmentDurationUIDAO segmentDurationUIDAO; - private final IGlobalTraceUIDAO globalTraceUIDAO; - - public SegmentTopService(ModuleManager moduleManager) { - this.segmentDurationUIDAO = moduleManager.find(StorageModule.NAME).getService(ISegmentDurationUIDAO.class); - this.globalTraceUIDAO = moduleManager.find(StorageModule.NAME).getService(IGlobalTraceUIDAO.class); - } - - public TraceBrief loadTop(long startSecondTimeBucket, long endSecondTimeBucket, long minDuration, long maxDuration, - String operationName, - String traceId, int applicationId, int limit, int from, TraceState traceState, QueryOrder queryOrder) { - logger.debug("startSecondTimeBucket: {}, endSecondTimeBucket: {}, minDuration: {}, " + - "maxDuration: {}, operationName: {}, traceId: {}, applicationId: {}, limit: {}, from: {}, traceState: {}, queryOrder: {}", - startSecondTimeBucket, endSecondTimeBucket, minDuration, - maxDuration, operationName, traceId, applicationId, limit, from, traceState, queryOrder); - - TraceBrief traceBrief; - if (StringUtils.isNotEmpty(traceId)) { - List segmentIds = globalTraceUIDAO.getSegmentIds(traceId); - if (CollectionUtils.isEmpty(segmentIds)) { - return new TraceBrief(); - } - traceBrief = segmentDurationUIDAO.loadTop(startSecondTimeBucket, endSecondTimeBucket, minDuration, maxDuration, operationName, applicationId, limit, from, traceState, queryOrder, segmentIds.toArray(new String[0])); - } else { - traceBrief = segmentDurationUIDAO.loadTop(startSecondTimeBucket, endSecondTimeBucket, minDuration, maxDuration, operationName, applicationId, limit, from, traceState, queryOrder); - } - - traceBrief.getTraces().forEach(trace -> { - List traceIds = globalTraceUIDAO.getGlobalTraceId(trace.getSegmentId()); - trace.getTraceIds().addAll(traceIds); - }); - - return traceBrief; - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServerService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServerService.java deleted file mode 100644 index 9e67813657ff3ae42267d93e8908320b89d0bdb2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServerService.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import com.google.gson.*; -import java.text.ParseException; -import java.util.*; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.*; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.register.Instance; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.apache.skywalking.apm.collector.storage.ui.server.*; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; - -/** - * @author peng-yongsheng - */ -public class ServerService { - - private final Gson gson = new Gson(); - private final IInstanceUIDAO instanceUIDAO; - private final IInstanceMetricUIDAO instanceMetricUIDAO; - private final ICpuMetricUIDAO cpuMetricUIDAO; - private final IGCMetricUIDAO gcMetricUIDAO; - private final IMemoryMetricUIDAO memoryMetricUIDAO; - private final ApplicationCacheService applicationCacheService; - private final InstanceCacheService instanceCacheService; - private final DateBetweenService dateBetweenService; - - public ServerService(ModuleManager moduleManager) { - this.instanceUIDAO = moduleManager.find(StorageModule.NAME).getService(IInstanceUIDAO.class); - this.instanceMetricUIDAO = moduleManager.find(StorageModule.NAME).getService(IInstanceMetricUIDAO.class); - this.cpuMetricUIDAO = moduleManager.find(StorageModule.NAME).getService(ICpuMetricUIDAO.class); - this.gcMetricUIDAO = moduleManager.find(StorageModule.NAME).getService(IGCMetricUIDAO.class); - this.memoryMetricUIDAO = moduleManager.find(StorageModule.NAME).getService(IMemoryMetricUIDAO.class); - this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class); - this.instanceCacheService = moduleManager.find(CacheModule.NAME).getService(InstanceCacheService.class); - this.dateBetweenService = new DateBetweenService(moduleManager); - } - - public List searchServer(String keyword, long startSecondTimeBucket, long endSecondTimeBucket) { - List serverInfos = instanceUIDAO.searchServer(keyword, startSecondTimeBucket, endSecondTimeBucket); - - for (int i = serverInfos.size() - 1; i >= 0; i--) { - if (serverInfos.get(i).getId() == Const.NONE_INSTANCE_ID) { - serverInfos.remove(i); - } - } - - buildAppServerInfo(serverInfos); - return serverInfos; - } - - public List getAllServer(int applicationId, long startSecondTimeBucket, long endSecondTimeBucket) { - List serverInfos = instanceUIDAO.getAllServer(applicationId, startSecondTimeBucket, endSecondTimeBucket); - buildAppServerInfo(serverInfos); - return serverInfos; - } - - public ResponseTimeTrend getServerResponseTimeTrend(int instanceId, Step step, long startTimeBucket, - long endTimeBucket) throws ParseException { - ResponseTimeTrend responseTimeTrend = new ResponseTimeTrend(); - List durationPoints = DurationUtils.INSTANCE.getDurationPoints(step, startTimeBucket, endTimeBucket); - List trends = instanceMetricUIDAO.getResponseTimeTrend(instanceId, step, durationPoints); - responseTimeTrend.setTrendList(trends); - return responseTimeTrend; - } - - public List getServerThroughput(int applicationId, Step step, long startTimeBucket, - long endTimeBucket, long startSecondTimeBucket, long endSecondTimeBucket, Integer topN) throws ParseException { - int minutesBetween = dateBetweenService.minutesBetween(applicationId, startSecondTimeBucket, endSecondTimeBucket); - - List serverThroughput = instanceMetricUIDAO.getServerThroughput(applicationId, step, startTimeBucket, endTimeBucket, minutesBetween, topN, MetricSource.Callee); - serverThroughput.forEach(appServerInfo -> { - appServerInfo.setApplicationId(instanceCacheService.getApplicationId(appServerInfo.getId())); - String applicationCode = applicationCacheService.getApplicationById(appServerInfo.getApplicationId()).getApplicationCode(); - appServerInfo.setApplicationCode(applicationCode); - Instance instance = instanceUIDAO.getInstance(appServerInfo.getId()); - appServerInfo.setOsInfo(instance.getOsInfo()); - }); - - buildAppServerInfo(serverThroughput); - return serverThroughput; - } - - public ThroughputTrend getServerThroughputTrend(int instanceId, Step step, long startTimeBucket, - long endTimeBucket) throws ParseException { - ThroughputTrend throughputTrend = new ThroughputTrend(); - List durationPoints = DurationUtils.INSTANCE.getDurationPoints(step, startTimeBucket, endTimeBucket); - List trends = instanceMetricUIDAO.getServerThroughputTrend(instanceId, step, durationPoints); - throughputTrend.setTrendList(trends); - return throughputTrend; - } - - public CPUTrend getCPUTrend(int instanceId, Step step, long startTimeBucket, - long endTimeBucket) throws ParseException { - CPUTrend cpuTrend = new CPUTrend(); - List durationPoints = DurationUtils.INSTANCE.getDurationPoints(step, startTimeBucket, endTimeBucket); - List trends = cpuMetricUIDAO.getCPUTrend(instanceId, step, durationPoints); - cpuTrend.setCost(trends); - return cpuTrend; - } - - public GCTrend getGCTrend(int instanceId, Step step, long startTimeBucket, - long endTimeBucket) throws ParseException { - GCTrend gcTrend = new GCTrend(); - List durationPoints = DurationUtils.INSTANCE.getDurationPoints(step, startTimeBucket, endTimeBucket); - List youngGCTrend = gcMetricUIDAO.getYoungGCTrend(instanceId, step, durationPoints); - youngGCTrend.forEach(young -> { - gcTrend.getYoungGCCount().add(young.getAverageCount()); - gcTrend.getYoungGCTime().add(young.getAverageDuration()); - }); - - List oldGCTrend = gcMetricUIDAO.getOldGCTrend(instanceId, step, durationPoints); - oldGCTrend.forEach(old -> { - gcTrend.getOldGCount().add(old.getAverageCount()); - gcTrend.getOldGCTime().add(old.getAverageDuration()); - }); - - return gcTrend; - } - - public MemoryTrend getMemoryTrend(int instanceId, Step step, long startTimeBucket, - long endTimeBucket) throws ParseException { - MemoryTrend memoryTrend = new MemoryTrend(); - List durationPoints = DurationUtils.INSTANCE.getDurationPoints(step, startTimeBucket, endTimeBucket); - IMemoryMetricUIDAO.Trend heapMemoryTrend = memoryMetricUIDAO.getHeapMemoryTrend(instanceId, step, durationPoints); - memoryTrend.setHeap(heapMemoryTrend.getMetrics()); - memoryTrend.setMaxHeap(heapMemoryTrend.getMaxMetrics()); - - IMemoryMetricUIDAO.Trend noHeapMemoryTrend = memoryMetricUIDAO.getNoHeapMemoryTrend(instanceId, step, durationPoints); - memoryTrend.setNoheap(noHeapMemoryTrend.getMetrics()); - memoryTrend.setMaxNoheap(noHeapMemoryTrend.getMaxMetrics()); - - return memoryTrend; - } - - private void buildAppServerInfo(List serverInfos) { - serverInfos.forEach(serverInfo -> { - serverInfo.setApplicationCode(applicationCacheService.getApplicationById(serverInfo.getApplicationId()).getApplicationCode()); - if (StringUtils.isNotEmpty(serverInfo.getOsInfo())) { - JsonObject osInfoJson = gson.fromJson(serverInfo.getOsInfo(), JsonObject.class); - if (osInfoJson.has("osName")) { - serverInfo.setOsName(osInfoJson.get("osName").getAsString()); - } - if (osInfoJson.has("hostName")) { - serverInfo.setHost(osInfoJson.get("hostName").getAsString()); - } - if (osInfoJson.has("processId")) { - serverInfo.setPid(osInfoJson.get("processId").getAsInt()); - } - - if (osInfoJson.has("ipv4s")) { - JsonArray ipv4Array = osInfoJson.get("ipv4s").getAsJsonArray(); - - List ipv4s = new LinkedList<>(); - ipv4Array.forEach(ipv4 -> ipv4s.add(ipv4.getAsString())); - serverInfo.setIpv4(ipv4s); - } - } - }); - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServiceNameService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServiceNameService.java deleted file mode 100644 index 28830fa3329f7cb7c45b2682e28d9493b92cfd39..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServiceNameService.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import java.text.ParseException; -import java.util.*; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.register.*; -import org.apache.skywalking.apm.collector.storage.ttl.ITTLConfigService; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.apache.skywalking.apm.collector.storage.ui.service.*; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class ServiceNameService { - - private static final Logger logger = LoggerFactory.getLogger(ServiceNameService.class); - - private final ApplicationCacheService applicationCacheService; - private final IServiceNameServiceUIDAO serviceNameServiceUIDAO; - private final IServiceMetricUIDAO serviceMetricUIDAO; - private final ServiceNameCacheService serviceNameCacheService; - private final DateBetweenService dateBetweenService; - private final ITTLConfigService configService; - - public ServiceNameService(ModuleManager moduleManager) { - this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class); - this.serviceNameServiceUIDAO = moduleManager.find(StorageModule.NAME).getService(IServiceNameServiceUIDAO.class); - this.serviceMetricUIDAO = moduleManager.find(StorageModule.NAME).getService(IServiceMetricUIDAO.class); - this.serviceNameCacheService = moduleManager.find(CacheModule.NAME).getService(ServiceNameCacheService.class); - this.configService = moduleManager.find(StorageModule.NAME).getService(ITTLConfigService.class); - this.dateBetweenService = new DateBetweenService(moduleManager); - } - - public int getCount() { - return serviceNameServiceUIDAO.getCount(startTimeMillis()); - } - - public List searchService(String keyword, int applicationId, int topN) { - List services = serviceNameServiceUIDAO.searchService(keyword, applicationId, startTimeMillis(), topN); - services.forEach(service -> { - Application application = applicationCacheService.getApplicationById(service.getApplicationId()); - if (Objects.nonNull(application)) { - service.setApplicationName(application.getApplicationCode()); - } else { - service.setApplicationName(Const.EMPTY_STRING); - } - }); - return services; - } - - private long startTimeMillis() { - int minuteMetricDataTTL = configService.minuteMetricDataTTL(); - return System.currentTimeMillis() - minuteMetricDataTTL * 60 * 1000L; - } - - public ThroughputTrend getServiceThroughputTrend(int serviceId, Step step, long startTimeBucket, - long endTimeBucket) throws ParseException { - ThroughputTrend throughputTrend = new ThroughputTrend(); - List durationPoints = DurationUtils.INSTANCE.getDurationPoints(step, startTimeBucket, endTimeBucket); - List throughputTrends = serviceMetricUIDAO.getServiceThroughputTrend(serviceId, step, durationPoints); - throughputTrend.setTrendList(throughputTrends); - return throughputTrend; - } - - public ResponseTimeTrend getServiceResponseTimeTrend(int serviceId, Step step, long startTimeBucket, - long endTimeBucket) throws ParseException { - ResponseTimeTrend responseTimeTrend = new ResponseTimeTrend(); - List durationPoints = DurationUtils.INSTANCE.getDurationPoints(step, startTimeBucket, endTimeBucket); - responseTimeTrend.setTrendList(serviceMetricUIDAO.getServiceResponseTimeTrend(serviceId, step, durationPoints)); - return responseTimeTrend; - } - - public SLATrend getServiceSLATrend(int serviceId, Step step, long startTimeBucket, - long endTimeBucket) throws ParseException { - SLATrend slaTrend = new SLATrend(); - List durationPoints = DurationUtils.INSTANCE.getDurationPoints(step, startTimeBucket, endTimeBucket); - slaTrend.setTrendList(serviceMetricUIDAO.getServiceSLATrend(serviceId, step, durationPoints)); - return slaTrend; - } - - public List getSlowService(Step step, long startTimeBucket, long endTimeBucket, - long startSecondTimeBucket, long endSecondTimeBucket, Integer topN) { - List slowServices = serviceMetricUIDAO.getSlowService(0, step, startTimeBucket, endTimeBucket, topN, MetricSource.Callee); - slowServices.forEach(slowService -> { - ServiceName serviceName = serviceNameCacheService.get(slowService.getService().getId()); - slowService.getService().setName(serviceName.getServiceName()); - slowService.getService().setApplicationId(serviceName.getApplicationId()); - slowService.getService().setApplicationName(applicationCacheService.getApplicationById(serviceName.getApplicationId()).getApplicationCode()); - try { - slowService.setCpm((int)(slowService.getCalls() / dateBetweenService.minutesBetween(serviceName.getApplicationId(), startSecondTimeBucket, endSecondTimeBucket))); - } catch (ParseException e) { - logger.error(e.getMessage(), e); - } - }); - return slowServices; - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServiceTopologyService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServiceTopologyService.java deleted file mode 100644 index 7e7ba8d194fd98b183328f22974765abd6044b89..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServiceTopologyService.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import java.text.ParseException; -import java.util.*; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IComponentLibraryCatalogService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.table.MetricSource; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -public class ServiceTopologyService { - - private static final Logger logger = LoggerFactory.getLogger(ServiceTopologyService.class); - - private final IApplicationComponentUIDAO applicationComponentUIDAO; - private final IServiceMetricUIDAO serviceMetricUIDAO; - private final IServiceReferenceMetricUIDAO serviceReferenceMetricUIDAO; - private final ServiceNameCacheService serviceNameCacheService; - private final DateBetweenService dateBetweenService; - private final IComponentLibraryCatalogService componentLibraryCatalogService; - - public ServiceTopologyService(ModuleManager moduleManager) { - this.serviceMetricUIDAO = moduleManager.find(StorageModule.NAME).getService(IServiceMetricUIDAO.class); - this.serviceReferenceMetricUIDAO = moduleManager.find(StorageModule.NAME).getService(IServiceReferenceMetricUIDAO.class); - this.applicationComponentUIDAO = moduleManager.find(StorageModule.NAME).getService(IApplicationComponentUIDAO.class); - this.serviceNameCacheService = moduleManager.find(CacheModule.NAME).getService(ServiceNameCacheService.class); - this.dateBetweenService = new DateBetweenService(moduleManager); - this.componentLibraryCatalogService = moduleManager.find(ConfigurationModule.NAME).getService(IComponentLibraryCatalogService.class); - } - - public Topology getServiceTopology(Step step, int serviceId, long startTimeBucket, - long endTimeBucket, long startSecondTimeBucket, long endSecondTimeBucket) { - logger.debug("startTimeBucket: {}, endTimeBucket: {}", startTimeBucket, endTimeBucket); - List applicationComponents = applicationComponentUIDAO.load(step, startTimeBucket, endTimeBucket); - - Map components = new HashMap<>(); - applicationComponents.forEach(component -> components.put(component.getApplicationId(), this.componentLibraryCatalogService.getComponentName(component.getComponentId()))); - - List referenceMetrics = serviceReferenceMetricUIDAO.getFrontServices(step, startTimeBucket, endTimeBucket, MetricSource.Callee, serviceId); - referenceMetrics.addAll(serviceReferenceMetricUIDAO.getBehindServices(step, startTimeBucket, endTimeBucket, MetricSource.Caller, serviceId)); - - Set nodeIds = new HashSet<>(); - - List calls = new LinkedList<>(); - referenceMetrics.forEach(referenceMetric -> { - nodeIds.add(referenceMetric.getSource()); - nodeIds.add(referenceMetric.getTarget()); - - Call call = new Call(); - call.setSource(referenceMetric.getSource()); - call.setTarget(referenceMetric.getTarget()); - call.setAvgResponseTime(referenceMetric.getDurations() / referenceMetric.getCalls()); - call.setCallType(components.getOrDefault(serviceNameCacheService.get(referenceMetric.getTarget()).getApplicationId(), Const.UNKNOWN)); - try { - int applicationId = serviceNameCacheService.get(referenceMetric.getTarget()).getApplicationId(); - call.setCpm(referenceMetric.getCalls() / dateBetweenService.minutesBetween(applicationId, startSecondTimeBucket, endSecondTimeBucket)); - } catch (ParseException e) { - logger.error(e.getMessage(), e); - } - call.setAlert(false); - calls.add(call); - }); - - List serviceNodes = serviceMetricUIDAO.getServicesMetric(step, startTimeBucket, endTimeBucket, MetricSource.Callee, nodeIds); - - Set gotNodes = new HashSet<>(); - serviceNodes.forEach(serviceNode -> gotNodes.add(serviceNode.getId())); - - Set callerNodeIds = new HashSet<>(); - nodeIds.forEach(nodeId -> { - if (!gotNodes.contains(nodeId)) { - callerNodeIds.add(nodeId); - } - }); - - serviceNodes.addAll(serviceMetricUIDAO.getServicesMetric(step, startTimeBucket, endTimeBucket, MetricSource.Caller, callerNodeIds)); - - serviceNodes.forEach(serviceNode -> { - ServiceName serviceName = serviceNameCacheService.get(serviceNode.getId()); - serviceNode.setName(serviceName.getServiceName()); - }); - - if (callerNodeIds.contains(Const.NONE_SERVICE_ID)) { - VisualUserNode userNode = new VisualUserNode(); - userNode.setId(Const.NONE_SERVICE_ID); - userNode.setName(Const.USER_CODE); - userNode.setType(Const.USER_CODE.toUpperCase()); - serviceNodes.add(userNode); - } - - Topology topology = new Topology(); - topology.setCalls(calls); - topology.setNodes(serviceNodes); - return topology; - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/SpanService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/SpanService.java deleted file mode 100644 index 5508eb080725966e8d173645d585c0162c8d705a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/SpanService.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import java.util.List; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService; -import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IComponentLibraryCatalogService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.StringUtils; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentUIDAO; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; -import org.apache.skywalking.apm.network.language.agent.KeyWithStringValue; -import org.apache.skywalking.apm.network.language.agent.LogMessage; -import org.apache.skywalking.apm.network.language.agent.SpanObject; -import org.apache.skywalking.apm.network.language.agent.TraceSegmentObject; - -/** - * @author peng-yongsheng - */ -public class SpanService { - - private final ISegmentUIDAO segmentDAO; - private final ServiceNameCacheService serviceNameCacheService; - private final ApplicationCacheService applicationCacheService; - private final IComponentLibraryCatalogService componentLibraryCatalogService; - - public SpanService(ModuleManager moduleManager) { - this.segmentDAO = moduleManager.find(StorageModule.NAME).getService(ISegmentUIDAO.class); - this.serviceNameCacheService = moduleManager.find(CacheModule.NAME).getService(ServiceNameCacheService.class); - this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class); - this.componentLibraryCatalogService = moduleManager.find(ConfigurationModule.NAME).getService(IComponentLibraryCatalogService.class); - } - - public JsonObject load(String segmentId, int spanId) { - TraceSegmentObject segmentObject = segmentDAO.load(segmentId); - - JsonObject spanJson = new JsonObject(); - List spans = segmentObject.getSpansList(); - for (SpanObject spanObject : spans) { - if (spanId == spanObject.getSpanId()) { - String operationName = spanObject.getOperationName(); - if (spanObject.getOperationNameId() != 0) { - ServiceName serviceName = serviceNameCacheService.get(spanObject.getOperationNameId()); - if (StringUtils.isNotEmpty(serviceName)) { - operationName = serviceName.getServiceName(); - } - } - spanJson.addProperty("operationName", operationName); - spanJson.addProperty("startTime", spanObject.getStartTime()); - spanJson.addProperty("endTime", spanObject.getEndTime()); - - JsonArray logsArray = new JsonArray(); - List logs = spanObject.getLogsList(); - for (LogMessage logMessage : logs) { - JsonObject logJson = new JsonObject(); - logJson.addProperty("time", logMessage.getTime()); - - JsonArray logInfoArray = new JsonArray(); - for (KeyWithStringValue value : logMessage.getDataList()) { - JsonObject valueJson = new JsonObject(); - valueJson.addProperty("key", value.getKey()); - valueJson.addProperty("value", value.getValue()); - logInfoArray.add(valueJson); - } - logJson.add("logInfo", logInfoArray); - logsArray.add(logJson); - } - spanJson.add("logMessage", logsArray); - - JsonArray tagsArray = new JsonArray(); - - JsonObject spanTypeJson = new JsonObject(); - spanTypeJson.addProperty("key", "span type"); - spanTypeJson.addProperty("value", spanObject.getSpanType().name()); - tagsArray.add(spanTypeJson); - - JsonObject componentJson = new JsonObject(); - componentJson.addProperty("key", "component"); - if (spanObject.getComponentId() == 0) { - componentJson.addProperty("value", spanObject.getComponent()); - } else { - componentJson.addProperty("value", this.componentLibraryCatalogService.getComponentName(spanObject.getComponentId())); - } - tagsArray.add(componentJson); - - JsonObject peerJson = new JsonObject(); - peerJson.addProperty("key", "peer"); - if (spanObject.getPeerId() == 0) { - peerJson.addProperty("value", spanObject.getPeer()); - } else { - peerJson.addProperty("value", applicationCacheService.getApplicationById(spanObject.getPeerId()).getApplicationCode()); - } - tagsArray.add(peerJson); - - for (KeyWithStringValue tagValue : spanObject.getTagsList()) { - JsonObject tagJson = new JsonObject(); - tagJson.addProperty("key", tagValue.getKey()); - tagJson.addProperty("value", tagValue.getValue()); - tagsArray.add(tagJson); - } - - JsonObject isErrorJson = new JsonObject(); - isErrorJson.addProperty("key", "is error"); - isErrorJson.addProperty("value", spanObject.getIsError()); - tagsArray.add(isErrorJson); - - spanJson.add("tags", tagsArray); - } - } - - return spanJson; - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilder.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilder.java deleted file mode 100644 index c23f579bc97b1f1d8696409c0e960192d921d139..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilder.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import java.text.ParseException; -import java.util.*; -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IComponentLibraryCatalogService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.*; -import org.apache.skywalking.apm.collector.storage.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.table.register.Application; -import org.apache.skywalking.apm.collector.storage.ui.application.*; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.apache.skywalking.apm.collector.ui.utils.*; -import org.slf4j.*; - -/** - * @author peng-yongsheng - */ -class TopologyBuilder { - - private static final Logger logger = LoggerFactory.getLogger(TopologyBuilder.class); - - private final ApplicationCacheService applicationCacheService; - private final ServerService serverService; - private final DateBetweenService dateBetweenService; - private final IComponentLibraryCatalogService componentLibraryCatalogService; - - TopologyBuilder(ModuleManager moduleManager) { - this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class); - this.serverService = new ServerService(moduleManager); - this.dateBetweenService = new DateBetweenService(moduleManager); - this.componentLibraryCatalogService = moduleManager.find(ConfigurationModule.NAME).getService(IComponentLibraryCatalogService.class); - } - - Topology build(List applicationComponents, - List applicationMappings, - List applicationMetrics, - List callerReferenceMetric, - List calleeReferenceMetric, - long startSecondTimeBucket, long endSecondTimeBucket) { - Map nodeCompMap = buildNodeCompMap(applicationComponents); - Map conjecturalNodeCompMap = buildConjecturalNodeCompMap(applicationComponents); - Map mappings = changeMapping2Map(applicationMappings); - filterZeroSourceOrTargetReference(callerReferenceMetric); - filterZeroSourceOrTargetReference(calleeReferenceMetric); - calleeReferenceMetric = calleeReferenceMetricFilter(calleeReferenceMetric); - - List nodes = new LinkedList<>(); - Map applicationMinuteBetweenMap = new HashMap<>(); - Map numberOfServer = new HashMap<>(); - applicationMetrics.forEach(applicationMetric -> { - int applicationId = applicationMetric.getId(); - Application application = applicationCacheService.getApplicationById(applicationId); - ApplicationNode applicationNode = new ApplicationNode(); - applicationNode.setId(applicationId); - applicationNode.setName(application.getApplicationCode()); - applicationNode.setType(nodeCompMap.getOrDefault(application.getApplicationId(), Const.UNKNOWN)); - - applicationNode.setSla(SLACalculator.INSTANCE.calculate(applicationMetric.getErrorCalls(), applicationMetric.getCalls())); - try { - applicationNode.setCpm(applicationMetric.getCalls() / getApplicationMinuteBetween(applicationMinuteBetweenMap, applicationId, startSecondTimeBucket, endSecondTimeBucket)); - } catch (ParseException e) { - logger.error(e.getMessage(), e); - } - applicationNode.setAvgResponseTime(applicationMetric.getDurations() / applicationMetric.getCalls()); - applicationNode.setApdex(ApdexCalculator.INSTANCE.calculate(applicationMetric.getSatisfiedCount(), applicationMetric.getToleratingCount(), applicationMetric.getFrustratedCount())); - applicationNode.setAlarm(false); - applicationNode.setNumOfServer(getNumberOfServer(numberOfServer, applicationId, startSecondTimeBucket, endSecondTimeBucket)); - nodes.add(applicationNode); - }); - - List calls = new LinkedList<>(); - Set nodeIds = new HashSet<>(); - callerReferenceMetric.forEach(referenceMetric -> { - Application source = applicationCacheService.getApplicationById(referenceMetric.getSource()); - Application target = applicationCacheService.getApplicationById(referenceMetric.getTarget()); - - if (BooleanUtils.valueToBoolean(target.getIsAddress()) && !mappings.containsKey(target.getApplicationId())) { - if (!nodeIds.contains(target.getApplicationId())) { - ConjecturalNode conjecturalNode = new ConjecturalNode(); - conjecturalNode.setId(target.getApplicationId()); - conjecturalNode.setName(target.getApplicationCode()); - conjecturalNode.setType(conjecturalNodeCompMap.getOrDefault(target.getApplicationId(), Const.UNKNOWN)); - nodes.add(conjecturalNode); - nodeIds.add(target.getApplicationId()); - } - } - - Set applicationNodeIds = buildNodeIds(nodes); - if (!applicationNodeIds.contains(source.getApplicationId())) { - ApplicationNode applicationNode = new ApplicationNode(); - applicationNode.setId(source.getApplicationId()); - applicationNode.setName(source.getApplicationCode()); - applicationNode.setType(nodeCompMap.getOrDefault(source.getApplicationId(), Const.UNKNOWN)); - applicationNode.setApdex(100); - applicationNode.setSla(100); - nodes.add(applicationNode); - } - - Call call = new Call(); - call.setSource(source.getApplicationId()); - call.setSourceName(source.getApplicationCode()); - - int actualTargetId = mappings.getOrDefault(target.getApplicationId(), target.getApplicationId()); - call.setTarget(actualTargetId); - call.setTargetName(applicationCacheService.getApplicationById(actualTargetId).getApplicationCode()); - call.setAlert(false); - call.setCallType(nodeCompMap.get(referenceMetric.getTarget())); - try { - call.setCpm(referenceMetric.getCalls() / getApplicationMinuteBetween(applicationMinuteBetweenMap, source.getApplicationId(), startSecondTimeBucket, endSecondTimeBucket)); - } catch (ParseException e) { - logger.error(e.getMessage(), e); - } - call.setAvgResponseTime(referenceMetric.getDurations() / referenceMetric.getCalls()); - calls.add(call); - }); - - calleeReferenceMetric.forEach(referenceMetric -> { - Application source = applicationCacheService.getApplicationById(referenceMetric.getSource()); - Application target = applicationCacheService.getApplicationById(referenceMetric.getTarget()); - - if (source.getApplicationId() == Const.NONE_APPLICATION_ID) { - if (!nodeIds.contains(source.getApplicationId())) { - VisualUserNode visualUserNode = new VisualUserNode(); - visualUserNode.setId(source.getApplicationId()); - visualUserNode.setName(Const.USER_CODE); - visualUserNode.setType(Const.USER_CODE.toUpperCase()); - nodes.add(visualUserNode); - nodeIds.add(source.getApplicationId()); - } - } - - if (BooleanUtils.valueToBoolean(source.getIsAddress())) { - if (!nodeIds.contains(source.getApplicationId())) { - ConjecturalNode conjecturalNode = new ConjecturalNode(); - conjecturalNode.setId(source.getApplicationId()); - conjecturalNode.setName(source.getApplicationCode()); - conjecturalNode.setType(conjecturalNodeCompMap.getOrDefault(target.getApplicationId(), Const.UNKNOWN)); - nodeIds.add(source.getApplicationId()); - nodes.add(conjecturalNode); - } - } - - Call call = new Call(); - call.setSource(source.getApplicationId()); - call.setSourceName(source.getApplicationCode()); - call.setTarget(target.getApplicationId()); - call.setTargetName(target.getApplicationCode()); - call.setAlert(false); - - if (source.getApplicationId() == Const.NONE_APPLICATION_ID) { - call.setCallType(Const.EMPTY_STRING); - } else { - call.setCallType(nodeCompMap.get(referenceMetric.getTarget())); - } - try { - call.setCpm(referenceMetric.getCalls() / getApplicationMinuteBetween(applicationMinuteBetweenMap, target.getApplicationId(), startSecondTimeBucket, endSecondTimeBucket)); - } catch (ParseException e) { - logger.error(e.getMessage(), e); - } - call.setAvgResponseTime(referenceMetric.getDurations() / referenceMetric.getCalls()); - calls.add(call); - }); - - Topology topology = new Topology(); - topology.setCalls(calls); - topology.setNodes(nodes); - return topology; - } - - private Set buildNodeIds(List nodes) { - Set nodeIds = new HashSet<>(); - nodes.forEach(node -> nodeIds.add(node.getId())); - return nodeIds; - } - - private List calleeReferenceMetricFilter( - List calleeReferenceMetric) { - List filteredMetrics = new LinkedList<>(); - - calleeReferenceMetric.forEach(referenceMetric -> { - Application source = applicationCacheService.getApplicationById(referenceMetric.getSource()); - if (BooleanUtils.valueToBoolean(source.getIsAddress()) || source.getApplicationId() == Const.NONE_APPLICATION_ID) { - filteredMetrics.add(referenceMetric); - } - }); - - return filteredMetrics; - } - - private Map changeMapping2Map( - List applicationMappings) { - Map mappings = new HashMap<>(); - applicationMappings.forEach(applicationMapping -> mappings.put(applicationMapping.getMappingApplicationId(), applicationMapping.getApplicationId())); - return mappings; - } - - private Map buildConjecturalNodeCompMap( - List applicationComponents) { - Map components = new HashMap<>(); - applicationComponents.forEach(applicationComponent -> { - int componentServerId = this.componentLibraryCatalogService.getServerIdBasedOnComponent(applicationComponent.getComponentId()); - String componentName = this.componentLibraryCatalogService.getServerName(componentServerId); - components.put(applicationComponent.getApplicationId(), componentName); - }); - return components; - } - - private Map buildNodeCompMap( - List applicationComponents) { - Map components = new HashMap<>(); - applicationComponents.forEach(applicationComponent -> { - String componentName = this.componentLibraryCatalogService.getComponentName(applicationComponent.getComponentId()); - components.put(applicationComponent.getApplicationId(), componentName); - }); - return components; - } - - private void filterZeroSourceOrTargetReference( - List referenceMetric) { - for (int i = referenceMetric.size() - 1; i >= 0; i--) { - IApplicationReferenceMetricUIDAO.ApplicationReferenceMetric applicationReferenceMetric = referenceMetric.get(i); - if (applicationReferenceMetric.getSource() == 0 || applicationReferenceMetric.getTarget() == 0) { - referenceMetric.remove(i); - } - } - } - - private int getApplicationMinuteBetween(Map applicationMinuteBetweenMap, int applicationId, - long startSecondTimeBucket, - long endSecondTimeBucket) throws ParseException { - if (applicationMinuteBetweenMap.containsKey(applicationId)) { - return applicationMinuteBetweenMap.get(applicationId); - } else { - int applicationMinuteBetween = dateBetweenService.minutesBetween(applicationId, startSecondTimeBucket, endSecondTimeBucket); - applicationMinuteBetweenMap.put(applicationId, applicationMinuteBetween); - return applicationMinuteBetween; - } - } - - private int getNumberOfServer(Map numberOfServerMap, int applicationId, - long startSecondTimeBucket, - long endSecondTimeBucket) { - if (numberOfServerMap.containsKey(applicationId)) { - return numberOfServerMap.get(applicationId); - } else { - int numberOfServer = serverService.getAllServer(applicationId, startSecondTimeBucket, endSecondTimeBucket).size(); - numberOfServerMap.put(applicationId, numberOfServer); - return numberOfServer; - } - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceStackService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceStackService.java deleted file mode 100644 index 7aaa11395e246f0b69ac37716c7401816e007280..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceStackService.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import org.apache.skywalking.apm.collector.cache.CacheModule; -import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService; -import org.apache.skywalking.apm.collector.cache.service.NetworkAddressCacheService; -import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IComponentLibraryCatalogService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.CollectionUtils; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.StorageModule; -import org.apache.skywalking.apm.collector.storage.dao.ui.IGlobalTraceUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentUIDAO; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; -import org.apache.skywalking.apm.collector.storage.ui.trace.*; -import org.apache.skywalking.apm.network.language.agent.SpanObject; -import org.apache.skywalking.apm.network.language.agent.TraceSegmentObject; -import org.apache.skywalking.apm.network.language.agent.UniqueId; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -import static java.util.Objects.nonNull; - -/** - * @author peng-yongsheng - */ -public class TraceStackService { - - private final IGlobalTraceUIDAO globalTraceDAO; - private final ISegmentUIDAO segmentDAO; - private final ApplicationCacheService applicationCacheService; - private final ServiceNameCacheService serviceNameCacheService; - private final NetworkAddressCacheService networkAddressCacheService; - private final IComponentLibraryCatalogService componentLibraryCatalogService; - - public TraceStackService(ModuleManager moduleManager) { - this.globalTraceDAO = moduleManager.find(StorageModule.NAME).getService(IGlobalTraceUIDAO.class); - this.segmentDAO = moduleManager.find(StorageModule.NAME).getService(ISegmentUIDAO.class); - this.applicationCacheService = moduleManager.find(CacheModule.NAME).getService(ApplicationCacheService.class); - this.serviceNameCacheService = moduleManager.find(CacheModule.NAME).getService(ServiceNameCacheService.class); - this.networkAddressCacheService = moduleManager.find(CacheModule.NAME).getService(NetworkAddressCacheService.class); - this.componentLibraryCatalogService = moduleManager.find(ConfigurationModule.NAME).getService(IComponentLibraryCatalogService.class); - } - - public Trace load(String traceId) { - Trace trace = new Trace(); - List segmentIds = globalTraceDAO.getSegmentIds(traceId); - if (CollectionUtils.isNotEmpty(segmentIds)) { - for (String segmentId : segmentIds) { - TraceSegmentObject segment = segmentDAO.load(segmentId); - if (nonNull(segment)) { - trace.getSpans().addAll(buildSpanList(traceId, segmentId, segment.getApplicationId(), segment.getSpansList())); - } - } - } - - List sortedSpans = new LinkedList<>(); - if (CollectionUtils.isNotEmpty(trace.getSpans())) { - List rootSpans = findRoot(trace.getSpans()); - - if (CollectionUtils.isNotEmpty(rootSpans)) { - rootSpans.forEach(span -> { - List childrenSpan = new ArrayList<>(); - childrenSpan.add(span); - findChildren(trace.getSpans(), span, childrenSpan); - sortedSpans.addAll(childrenSpan); - }); - } - } - - trace.setSpans(sortedSpans); - return trace; - } - - private List buildSpanList(String traceId, String segmentId, int applicationId, - List spanObjects) { - List spans = new ArrayList<>(); - - spanObjects.forEach(spanObject -> { - Span span = new Span(); - span.setTraceId(traceId); - span.setSegmentId(segmentId); - span.setSpanId(spanObject.getSpanId()); - span.setParentSpanId(spanObject.getParentSpanId()); - span.setStartTime(spanObject.getStartTime()); - span.setEndTime(spanObject.getEndTime()); - span.setError(spanObject.getIsError()); - span.setLayer(spanObject.getSpanLayer().name()); - span.setType(spanObject.getSpanType().name()); - - String segmentSpanId = segmentId + Const.SEGMENT_SPAN_SPLIT + String.valueOf(spanObject.getSpanId()); - span.setSegmentSpanId(segmentSpanId); - - String segmentParentSpanId = segmentId + Const.SEGMENT_SPAN_SPLIT + String.valueOf(spanObject.getParentSpanId()); - span.setSegmentParentSpanId(segmentParentSpanId); - - if (spanObject.getPeerId() == 0) { - span.setPeer(spanObject.getPeer()); - } else { - span.setPeer(networkAddressCacheService.getAddress(spanObject.getPeerId()).getNetworkAddress()); - } - - String operationName = spanObject.getOperationName(); - if (spanObject.getOperationNameId() != 0) { - ServiceName serviceName = serviceNameCacheService.get(spanObject.getOperationNameId()); - if (nonNull(serviceName)) { - operationName = serviceName.getServiceName(); - } else { - operationName = Const.EMPTY_STRING; - } - } - span.setOperationName(operationName); - - String applicationCode = applicationCacheService.getApplicationById(applicationId).getApplicationCode(); - span.setApplicationCode(applicationCode); - - if (spanObject.getComponentId() == 0) { - span.setComponent(spanObject.getComponent()); - } else { - span.setComponent(this.componentLibraryCatalogService.getComponentName(spanObject.getComponentId())); - } - - spanObject.getRefsList().forEach(reference -> { - Ref ref = new Ref(); - ref.setTraceId(traceId); - - switch (reference.getRefType()) { - case CrossThread: - ref.setType(RefType.CROSS_THREAD); - break; - case CrossProcess: - ref.setType(RefType.CROSS_PROCESS); - break; - } - ref.setParentSpanId(reference.getParentSpanId()); - - UniqueId uniqueId = reference.getParentTraceSegmentId(); - StringBuilder segmentIdBuilder = new StringBuilder(); - for (int i = 0; i < uniqueId.getIdPartsList().size(); i++) { - if (i == 0) { - segmentIdBuilder.append(String.valueOf(uniqueId.getIdPartsList().get(i))); - } else { - segmentIdBuilder.append(".").append(String.valueOf(uniqueId.getIdPartsList().get(i))); - } - } - ref.setParentSegmentId(segmentIdBuilder.toString()); - - span.setSegmentParentSpanId(ref.getParentSegmentId() + Const.SEGMENT_SPAN_SPLIT + String.valueOf(ref.getParentSpanId())); - - span.getRefs().add(ref); - }); - - spanObject.getTagsList().forEach(tag -> { - KeyValue keyValue = new KeyValue(); - keyValue.setKey(tag.getKey()); - keyValue.setValue(tag.getValue()); - span.getTags().add(keyValue); - }); - - spanObject.getLogsList().forEach(log -> { - LogEntity logEntity = new LogEntity(); - logEntity.setTime(log.getTime()); - - log.getDataList().forEach(data -> { - KeyValue keyValue = new KeyValue(); - keyValue.setKey(data.getKey()); - keyValue.setValue(data.getValue()); - logEntity.getData().add(keyValue); - }); - - span.getLogs().add(logEntity); - }); - - spans.add(span); - }); - - return spans; - } - - private List findRoot(List spans) { - List rootSpans = new ArrayList<>(); - spans.forEach(span -> { - String segmentParentSpanId = span.getSegmentParentSpanId(); - - boolean hasParent = false; - for (Span subSpan : spans) { - if (segmentParentSpanId.equals(subSpan.getSegmentSpanId())) { - hasParent = true; - } - } - - if (!hasParent) { - span.setRoot(true); - rootSpans.add(span); - } - }); - return rootSpans; - } - - private void findChildren(List spans, Span parentSpan, List childrenSpan) { - spans.forEach(span -> { - if (span.getSegmentParentSpanId().equals(parentSpan.getSegmentSpanId())) { - childrenSpan.add(span); - findChildren(spans, span, childrenSpan); - } - }); - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/utils/ApdexCalculator.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/utils/ApdexCalculator.java deleted file mode 100644 index 33e9cf0594f20413b9b071b4bb0d609d07c953a8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/utils/ApdexCalculator.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.utils; - -/** - * @author peng-yongsheng - */ -public enum ApdexCalculator { - INSTANCE; - - public int calculate(long satisfiedCount, long toleratingCount, long frustratedCount) { - if (satisfiedCount + toleratingCount + frustratedCount == 0) { - return 100; - } else { - return (int)(((satisfiedCount + toleratingCount / 2) * 100) / (satisfiedCount + toleratingCount + frustratedCount)); - } - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/utils/DurationUtils.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/utils/DurationUtils.java deleted file mode 100644 index 9f84306a34bc2f806462ce048c376c20c0824c89..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/utils/DurationUtils.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.utils; - -import java.text.*; -import java.util.*; -import org.apache.skywalking.apm.collector.core.UnexpectedException; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; -import org.joda.time.*; - -/** - * @author peng-yongsheng - */ -public enum DurationUtils { - INSTANCE; - - public long exchangeToTimeBucket(String dateStr) { - dateStr = dateStr.replaceAll("-", Const.EMPTY_STRING); - dateStr = dateStr.replaceAll(" ", Const.EMPTY_STRING); - return Long.valueOf(dateStr); - } - - public long startTimeDurationToSecondTimeBucket(Step step, String dateStr) { - long secondTimeBucket = 0; - switch (step) { - case MONTH: - secondTimeBucket = exchangeToTimeBucket(dateStr) * 100 * 100 * 100 * 100; - break; - case DAY: - secondTimeBucket = exchangeToTimeBucket(dateStr) * 100 * 100 * 100; - break; - case HOUR: - secondTimeBucket = exchangeToTimeBucket(dateStr) * 100 * 100; - break; - case MINUTE: - secondTimeBucket = exchangeToTimeBucket(dateStr) * 100; - break; - case SECOND: - secondTimeBucket = exchangeToTimeBucket(dateStr); - break; - } - return secondTimeBucket; - } - - public long endTimeDurationToSecondTimeBucket(Step step, String dateStr) { - long secondTimeBucket = 0; - switch (step) { - case MONTH: - secondTimeBucket = (((exchangeToTimeBucket(dateStr) * 100 + 99) * 100 + 99) * 100 + 99) * 100 + 99; - break; - case DAY: - secondTimeBucket = ((exchangeToTimeBucket(dateStr) * 100 + 99) * 100 + 99) * 100 + 99; - break; - case HOUR: - secondTimeBucket = (exchangeToTimeBucket(dateStr) * 100 + 99) * 100 + 99; - break; - case MINUTE: - secondTimeBucket = exchangeToTimeBucket(dateStr) * 100 + 99; - break; - case SECOND: - secondTimeBucket = exchangeToTimeBucket(dateStr); - break; - } - return secondTimeBucket; - } - - public int minutesBetween(Step step, long startTimeBucket, long endTimeBucket) throws ParseException { - Date startDate = formatDate(step, startTimeBucket); - Date endDate = formatDate(step, endTimeBucket); - - return Minutes.minutesBetween(new DateTime(startDate), new DateTime(endDate)).getMinutes(); - } - - public int minutesBetween(Step step, DateTime dateTime) { - switch (step) { - case MONTH: - return dateTime.dayOfMonth().getMaximumValue() * 24 * 60; - case DAY: - return 24 * 60; - case HOUR: - return 60; - case MINUTE: - return 1; - case SECOND: - return 1; - default: - return 1; - } - } - - public int secondsBetween(Step step, long startTimeBucket, long endTimeBucket) throws ParseException { - Date startDate = formatDate(step, startTimeBucket); - Date endDate = formatDate(step, endTimeBucket); - - return Seconds.secondsBetween(new DateTime(startDate), new DateTime(endDate)).getSeconds(); - } - - public int secondsBetween(Step step, DateTime dateTime) { - switch (step) { - case MONTH: - return dateTime.dayOfMonth().getMaximumValue() * 24 * 60 * 60; - case DAY: - return 24 * 60 * 60; - case HOUR: - return 60 * 60; - case MINUTE: - return 60; - case SECOND: - return 1; - default: - return 1; - } - } - - private Date formatDate(Step step, long timeBucket) throws ParseException { - Date date = null; - switch (step) { - case MONTH: - date = new SimpleDateFormat("yyyyMM").parse(String.valueOf(timeBucket)); - break; - case DAY: - date = new SimpleDateFormat("yyyyMMdd").parse(String.valueOf(timeBucket)); - break; - case HOUR: - date = new SimpleDateFormat("yyyyMMddHH").parse(String.valueOf(timeBucket)); - break; - case MINUTE: - date = new SimpleDateFormat("yyyyMMddHHmm").parse(String.valueOf(timeBucket)); - break; - case SECOND: - date = new SimpleDateFormat("yyyyMMddHHmmss").parse(String.valueOf(timeBucket)); - break; - } - return date; - } - - public DateTime parseToDateTime(Step step, long time) throws ParseException { - DateTime dateTime = null; - - switch (step) { - case MONTH: - Date date = new SimpleDateFormat("yyyyMM").parse(String.valueOf(time)); - dateTime = new DateTime(date); - break; - case DAY: - date = new SimpleDateFormat("yyyyMMdd").parse(String.valueOf(time)); - dateTime = new DateTime(date); - break; - case HOUR: - date = new SimpleDateFormat("yyyyMMddHH").parse(String.valueOf(time)); - dateTime = new DateTime(date); - break; - case MINUTE: - date = new SimpleDateFormat("yyyyMMddHHmm").parse(String.valueOf(time)); - dateTime = new DateTime(date); - break; - case SECOND: - date = new SimpleDateFormat("yyyyMMddHHmmss").parse(String.valueOf(time)); - dateTime = new DateTime(date); - break; - } - - return dateTime; - } - - public List getDurationPoints(Step step, long startTimeBucket, - long endTimeBucket) throws ParseException { - DateTime dateTime = parseToDateTime(step, startTimeBucket); - - List durations = new LinkedList<>(); - durations.add(new DurationPoint(startTimeBucket, secondsBetween(step, dateTime), minutesBetween(step, dateTime))); - - int i = 0; - do { - switch (step) { - case MONTH: - dateTime = dateTime.plusMonths(1); - String timeBucket = new SimpleDateFormat("yyyyMM").format(dateTime.toDate()); - durations.add(new DurationPoint(Long.valueOf(timeBucket), secondsBetween(step, dateTime), minutesBetween(step, dateTime))); - break; - case DAY: - dateTime = dateTime.plusDays(1); - timeBucket = new SimpleDateFormat("yyyyMMdd").format(dateTime.toDate()); - durations.add(new DurationPoint(Long.valueOf(timeBucket), secondsBetween(step, dateTime), minutesBetween(step, dateTime))); - break; - case HOUR: - dateTime = dateTime.plusHours(1); - timeBucket = new SimpleDateFormat("yyyyMMddHH").format(dateTime.toDate()); - durations.add(new DurationPoint(Long.valueOf(timeBucket), secondsBetween(step, dateTime), minutesBetween(step, dateTime))); - break; - case MINUTE: - dateTime = dateTime.plusMinutes(1); - timeBucket = new SimpleDateFormat("yyyyMMddHHmm").format(dateTime.toDate()); - durations.add(new DurationPoint(Long.valueOf(timeBucket), secondsBetween(step, dateTime), minutesBetween(step, dateTime))); - break; - case SECOND: - dateTime = dateTime.plusSeconds(1); - timeBucket = new SimpleDateFormat("yyyyMMddHHmmss").format(dateTime.toDate()); - durations.add(new DurationPoint(Long.valueOf(timeBucket), secondsBetween(step, dateTime), minutesBetween(step, dateTime))); - break; - } - i++; - if (i > 500) { - throw new UnexpectedException("Duration data error, step: " + step.name() + ", start: " + startTimeBucket + ", end: " + endTimeBucket); - } - } - while (endTimeBucket != durations.get(durations.size() - 1).getPoint()); - - return durations; - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/utils/PaginationUtils.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/utils/PaginationUtils.java deleted file mode 100644 index 3bf00a36abb46f6ecdc9884a22c09ff8a9463ab8..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/utils/PaginationUtils.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.utils; - -import org.apache.skywalking.apm.collector.storage.ui.common.Pagination; - -/** - * @author peng-yongsheng - */ -public enum PaginationUtils { - INSTANCE; - - public Page exchange(Pagination paging) { - int limit = paging.getPageSize(); - int from = paging.getPageSize() * ((paging.getPageNum() == 0 ? 1 : paging.getPageNum()) - 1); - - return new Page(from, limit); - } - - public class Page { - private int from; - private int limit; - - Page(int from, int limit) { - this.from = from; - this.limit = limit; - } - - public int getFrom() { - return from; - } - - public int getLimit() { - return limit; - } - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/utils/SLACalculator.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/utils/SLACalculator.java deleted file mode 100644 index 8fe220f868c0273dbbf96b2a34dd0914598738e4..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/utils/SLACalculator.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.utils; - -/** - * @author peng-yongsheng - */ -public enum SLACalculator { - INSTANCE; - - public int calculate(long errorCalls, long calls) { - return (int)(((calls - errorCalls) * 100) / calls); - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider deleted file mode 100644 index 5500d075e5cd18ad1eef5295499b2244d5e93572..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider +++ /dev/null @@ -1,20 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -# - - -org.apache.skywalking.apm.collector.ui.jetty.UIModuleJettyProvider diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/core/module/MockModule.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/core/module/MockModule.java deleted file mode 100644 index d60a89b76aadc93a8d80ab96d3dd8bed1613e6f1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/core/module/MockModule.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.core.module; - -import com.google.common.collect.Lists; -import org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService; -import org.apache.skywalking.apm.collector.server.jetty.JettyServer; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -import java.util.LinkedList; - -import static org.mockito.Matchers.*; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -public class MockModule extends ModuleDefine { - - public MockModule() throws ServiceNotProvidedException { - ModuleProvider moduleProvider = Mockito.mock(ModuleProvider.class); - LinkedList linkedList = Lists.newLinkedList(); - linkedList.add(moduleProvider); - Whitebox.setInternalState(this, "loadedProviders", linkedList); - when(moduleProvider.getService(any())).then(invocation -> { - Class argumentAt = invocation.getArgumentAt(0, Class.class); - Object mock = Mockito.mock(argumentAt); - if (mock instanceof JettyManagerService) { - when(((JettyManagerService) mock).createIfAbsent(anyString(), anyInt(), anyString())).then(invocation1 -> { - JettyServer jettyServer = new JettyServer("127.0.0.1", 10805, "/"); - jettyServer.initialize(); - return jettyServer; - }); - - } - return mock; - }); - } - - @Override - public String name() { - return null; - } - - @Override - public Class[] services() { - return new Class[0]; - } - - -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/DelegatingServletInputStream.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/DelegatingServletInputStream.java deleted file mode 100644 index d5c016e29686f72ac28d4e94911772c60a9410f0..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/DelegatingServletInputStream.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui; - -import org.junit.Assert; - -import javax.servlet.ReadListener; -import javax.servlet.ServletInputStream; -import java.io.IOException; -import java.io.InputStream; - -/** - * @author lican - */ -public class DelegatingServletInputStream extends ServletInputStream { - - private final InputStream sourceStream; - - - /** - * Create a DelegatingServletInputStream for the given source stream. - * @param sourceStream the source stream (never null) - */ - public DelegatingServletInputStream(InputStream sourceStream) { - Assert.assertNotNull("Source InputStream must not be null",sourceStream); - this.sourceStream = sourceStream; - } - - /** - * Return the underlying source stream (never null). - */ - public final InputStream getSourceStream() { - return this.sourceStream; - } - - - public int read() throws IOException { - return this.sourceStream.read(); - } - - public void close() throws IOException { - super.close(); - this.sourceStream.close(); - } - - @Override - public boolean isFinished() { - return false; - } - - @Override - public boolean isReady() { - return false; - } - - @Override - public void setReadListener(ReadListener readListener) { - - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyProviderTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyProviderTest.java deleted file mode 100644 index 86d27ce2822931573215fb4d33079d0a4515bc88..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyProviderTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.jetty; - -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -import static org.mockito.Matchers.anyString; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -public class UIModuleJettyProviderTest { - private UIModuleJettyProvider uiModuleJettyProvider; - - @Before - public void setUp() { - uiModuleJettyProvider = new UIModuleJettyProvider(); - ModuleManager moduleManager = Mockito.mock(ModuleManager.class); - Whitebox.setInternalState(uiModuleJettyProvider, "manager", moduleManager); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - } - - @Test - public void name() { - Assert.assertEquals(uiModuleJettyProvider.name(), "jetty"); - } - - @Test - public void module() { - Assert.assertNotNull(uiModuleJettyProvider.module()); - } - - @Test - public void createConfigBeanIfAbsent() { - Assert.assertNotNull(uiModuleJettyProvider.createConfigBeanIfAbsent()); - } - - @Test - public void prepare() { - uiModuleJettyProvider.prepare(); - } - - @Test - public void start() { - uiModuleJettyProvider.start(); - } - - @Test - public void notifyAfterCompleted() { - uiModuleJettyProvider.notifyAfterCompleted(); - } - - @Test - public void requiredModules() { - Assert.assertTrue(uiModuleJettyProvider.requiredModules().length > 0); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyRegistrationTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyRegistrationTest.java deleted file mode 100644 index 6f3ee946c722a24237f685ab1bda5b452753b83d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/jetty/UIModuleJettyRegistrationTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.jetty; - -import org.apache.skywalking.apm.collector.cluster.ModuleRegistration; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -/** - * @author lican - */ -public class UIModuleJettyRegistrationTest { - - private UIModuleJettyRegistration uiModuleJettyRegistration; - - @Before - public void setUp() throws Exception { - uiModuleJettyRegistration = new UIModuleJettyRegistration("127.0.0.1", 8080, "/"); - } - - @Test - public void buildValue() { - ModuleRegistration.Value value = uiModuleJettyRegistration.buildValue(); - Assert.assertEquals(value.getHostPort(), "127.0.0.1:8080"); - - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandlerTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandlerTest.java deleted file mode 100644 index 4e3251d33ed83166f8c572c77e3ae6975ff01dd6..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/jetty/handler/GraphQLHandlerTest.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.jetty.handler; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import graphql.ExecutionInput; -import graphql.ExecutionResultImpl; -import graphql.GraphQL; -import graphql.GraphQLError; -import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException; -import org.apache.skywalking.apm.collector.ui.DelegatingServletInputStream; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -import javax.servlet.http.HttpServletRequest; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.util.Collections; -import java.util.Map; - -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -/** - * @author lican - */ -public class GraphQLHandlerTest { - - private GraphQLHandler graphQLHandler; - private GraphQL graphQL; - private String mockParams = "{\"query\":\"query\" }"; - private static final String DATA = "data"; - private static final String ERRORS = "errors"; - private Map stringStringMap = Collections.singletonMap("something", "test"); - - - @Before - public void setUp() { - //test if the constructor is well - graphQLHandler = new GraphQLHandler(null); - //stub graphQL - graphQL = Mockito.mock(GraphQL.class); - Whitebox.setInternalState(graphQLHandler, "graphQL", graphQL); - } - - @Test - public void pathSpec() { - Assert.assertEquals("/graphql", graphQLHandler.pathSpec()); - } - - @Test - public void doGet() throws ArgumentsParseException { - HttpServletRequest req = mock(HttpServletRequest.class); - when(req.getParameter(anyString())).then(invocation -> mockParams); - when(graphQL.execute((ExecutionInput) anyObject())).then(invocation -> new ExecutionResultImpl(stringStringMap, null, Collections.emptyMap())); - JsonElement jsonElement = graphQLHandler.doGet(req); - Assert.assertNotNull(((JsonObject) jsonElement).get(DATA)); - } - - @Test - public void doPost() throws IOException, ArgumentsParseException { - HttpServletRequest req = mock(HttpServletRequest.class); - when(req.getInputStream()).then(invocation -> new DelegatingServletInputStream(new ByteArrayInputStream(mockParams.getBytes()))); - when(graphQL.execute((ExecutionInput) anyObject())).then(invocation -> new ExecutionResultImpl(stringStringMap, null, Collections.emptyMap())); - JsonElement jsonElement = graphQLHandler.doPost(req); - Assert.assertNotNull(((JsonObject) jsonElement).get(DATA)); - Assert.assertNull(((JsonObject) jsonElement).get(ERRORS)); - when(graphQL.execute((ExecutionInput) anyObject())).then(invocation -> { - GraphQLError graphQLError = Mockito.mock(GraphQLError.class); - return new ExecutionResultImpl(stringStringMap, Collections.singletonList(graphQLError), Collections.emptyMap()); - }); - jsonElement = graphQLHandler.doPost(req); - Assert.assertNotNull(((JsonObject) jsonElement).get(ERRORS)); - //test exception; - when(graphQL.execute((ExecutionInput) anyObject())).then(invocation -> { - throw new IllegalArgumentException("unit test exception when execute"); - }); - jsonElement = graphQLHandler.doPost(req); - Assert.assertNotNull(((JsonObject) jsonElement).get(ERRORS)); - - - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/jetty/handler/naming/UIJettyNamingHandlerTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/jetty/handler/naming/UIJettyNamingHandlerTest.java deleted file mode 100644 index 1bfc84f87555e4873aac4bffe7507f6093d047de..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/jetty/handler/naming/UIJettyNamingHandlerTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.jetty.handler.naming; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import javax.servlet.http.HttpServletRequest; - -import static org.mockito.Mockito.mock; - -/** - * @author lican - */ -public class UIJettyNamingHandlerTest { - - private UIJettyNamingHandler uiJettyNamingHandler; - - @Before - public void setUp() { - UIJettyNamingListener uiJettyNamingListener = new UIJettyNamingListener(); - uiJettyNamingListener.addAddress("127.0.0.1:10800"); - uiJettyNamingHandler = new UIJettyNamingHandler(uiJettyNamingListener); - } - - @Test - public void pathSpec() { - Assert.assertEquals(uiJettyNamingHandler.pathSpec(), "/ui/jetty"); - } - - @Test - public void doGet() throws ArgumentsParseException { - HttpServletRequest request = mock(HttpServletRequest.class); - JsonElement jsonElement = uiJettyNamingHandler.doGet(request); - Assert.assertTrue(jsonElement instanceof JsonArray); - Assert.assertTrue(((JsonArray) jsonElement).size() > 0); - - } - - @Test(expected = UnsupportedOperationException.class) - public void doPost() throws ArgumentsParseException { - HttpServletRequest request = mock(HttpServletRequest.class); - uiJettyNamingHandler.doPost(request); - - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/jetty/handler/naming/UIJettyNamingListenerTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/jetty/handler/naming/UIJettyNamingListenerTest.java deleted file mode 100644 index 76cf33462875ef8022175fd1c0185bfaf689a2bc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/jetty/handler/naming/UIJettyNamingListenerTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.jetty.handler.naming; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -/** - * @author lican - */ -public class UIJettyNamingListenerTest { - - private UIJettyNamingListener uiJettyNamingListener; - - @Before - public void setUp() throws Exception { - uiJettyNamingListener = new UIJettyNamingListener(); - } - - @Test - public void path() { - Assert.assertEquals("/ui/jetty", uiJettyNamingListener.path()); - } - - @Test - public void serverJoinNotify() { - uiJettyNamingListener.serverJoinNotify(null); - } - - @Test - public void serverQuitNotify() { - uiJettyNamingListener.serverQuitNotify(null); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/mutation/ConfigMutationTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/mutation/ConfigMutationTest.java deleted file mode 100644 index 4b45fd79f200d53ca9f654c48d1f2e8cd9e4eff2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/mutation/ConfigMutationTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.mutation; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -/** - * this class may not be implemented ,so just test if it's null - * if update the class ,please update the testcase - * @author lican - */ -public class ConfigMutationTest { - - @Before - public void setUp() throws Exception { - } - - @Test - public void setDataTTLConfigs() { - ConfigMutation configMutation = new ConfigMutation(); - Boolean aBoolean = configMutation.setDataTTLConfigs(null); - Assert.assertNull(aBoolean); - } - - @Test - public void setAlarmThreshold() { - ConfigMutation configMutation = new ConfigMutation(); - Boolean aBoolean = configMutation.setAlarmThreshold(null); - Assert.assertNull(aBoolean); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/AlarmQueryTestCase.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/AlarmQueryTestCase.java deleted file mode 100644 index 8fd6b9eca47b50c34db4fddea50aa44a90b1603d..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/AlarmQueryTestCase.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.query; - -import java.text.ParseException; -import org.apache.skywalking.apm.collector.storage.ui.alarm.AlarmType; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.apache.skywalking.apm.collector.ui.service.AlarmService; -import org.junit.*; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -/** - * @author lican - */ -public class AlarmQueryTestCase { - - @Test - public void testLoadAlarmList() throws ParseException { - AlarmQuery query = new AlarmQuery(null); - AlarmService alarmService = Mockito.mock(AlarmService.class); - Whitebox.setInternalState(query, "alarmService", alarmService); - Mockito.when(alarmService.loadApplicationAlarmList( - Mockito.anyString(), Mockito.anyInt(), Mockito.anyObject(), - Mockito.anyLong(), Mockito.anyLong(), Mockito.anyInt(), Mockito.anyInt() - )).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701000000L, arguments[3]); - Assert.assertEquals(201701999999L, arguments[4]); - return null; - }); - - Mockito.when(alarmService.loadInstanceAlarmList( - Mockito.anyString(), Mockito.anyObject(), - Mockito.anyLong(), Mockito.anyLong(), Mockito.anyInt(), Mockito.anyInt() - )).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701000000L, arguments[2]); - Assert.assertEquals(201701999999L, arguments[3]); - return null; - }); - - Mockito.when(alarmService.loadServiceAlarmList( - Mockito.anyString(), Mockito.anyObject(), - Mockito.anyLong(), Mockito.anyLong(), Mockito.anyInt(), Mockito.anyInt() - )).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701000000L, arguments[2]); - Assert.assertEquals(201701999999L, arguments[3]); - return null; - }); - - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-01"); - duration.setStep(Step.MONTH); - Pagination pagination = new Pagination(); - query.loadAlarmList("keyword", AlarmType.APPLICATION, duration, pagination); - query.loadAlarmList("keyword", AlarmType.SERVER, duration, pagination); - query.loadAlarmList("keyword", AlarmType.SERVICE, duration, pagination); - } - -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQueryTestCase.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQueryTestCase.java deleted file mode 100644 index 827a91762ddeea5ccb62ded8c8ac1506d1f70627..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQueryTestCase.java +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.query; - -import org.apache.skywalking.apm.collector.storage.ui.common.Duration; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.ui.service.ApplicationService; -import org.apache.skywalking.apm.collector.ui.service.ApplicationTopologyService; -import org.apache.skywalking.apm.collector.ui.service.ServerService; -import org.junit.Assert; -import org.junit.Test; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -import java.text.ParseException; - -/** - * @author peng-yongsheng - */ -public class ApplicationQueryTestCase { - - @Test - public void testGetAllApplicationByMonthDuration() throws ParseException { - ApplicationQuery query = new ApplicationQuery(null); - ApplicationService applicationService = Mockito.mock(ApplicationService.class); - Whitebox.setInternalState(query, "applicationService", applicationService); - Mockito.when(applicationService.getApplications(Mockito.anyLong(), Mockito.anyLong())).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(20170100000000L, arguments[0]); - Assert.assertEquals(20170199999999L, arguments[1]); - return null; - }); - - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-01"); - duration.setStep(Step.MONTH); - - query.getAllApplication(duration); - } - - @Test - public void testGetAllApplicationByDayDuration() throws ParseException { - ApplicationQuery query = new ApplicationQuery(null); - ApplicationService applicationService = Mockito.mock(ApplicationService.class); - Whitebox.setInternalState(query, "applicationService", applicationService); - - Mockito.when(applicationService.getApplications(Mockito.anyLong(), Mockito.anyLong())).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(20170101000000L, arguments[0]); - Assert.assertEquals(20170101999999L, arguments[1]); - return null; - }); - - Duration duration = new Duration(); - duration.setStart("2017-01-01"); - duration.setEnd("2017-01-01"); - duration.setStep(Step.DAY); - - query.getAllApplication(duration); - } - - @Test - public void testGetAllApplicationByHourDuration() throws ParseException { - ApplicationQuery query = new ApplicationQuery(null); - ApplicationService applicationService = Mockito.mock(ApplicationService.class); - Whitebox.setInternalState(query, "applicationService", applicationService); - - Mockito.when(applicationService.getApplications(Mockito.anyLong(), Mockito.anyLong())).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(20170101010000L, arguments[0]); - Assert.assertEquals(20170101019999L, arguments[1]); - return null; - }); - - Duration duration = new Duration(); - duration.setStart("2017-01-01 01"); - duration.setEnd("2017-01-01 01"); - duration.setStep(Step.HOUR); - - query.getAllApplication(duration); - } - - @Test - public void testGetAllApplicationByMinuteDuration() throws ParseException { - ApplicationQuery query = new ApplicationQuery(null); - ApplicationService applicationService = Mockito.mock(ApplicationService.class); - Whitebox.setInternalState(query, "applicationService", applicationService); - - Mockito.when(applicationService.getApplications(Mockito.anyLong(), Mockito.anyLong())).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(20170101010100L, arguments[0]); - Assert.assertEquals(20170101010199L, arguments[1]); - return null; - }); - - Duration duration = new Duration(); - duration.setStart("2017-01-01 0101"); - duration.setEnd("2017-01-01 0101"); - duration.setStep(Step.MINUTE); - - query.getAllApplication(duration); - } - - @Test - public void testGetAllApplicationBySecondDuration() throws ParseException { - ApplicationQuery query = new ApplicationQuery(null); - ApplicationService applicationService = Mockito.mock(ApplicationService.class); - Whitebox.setInternalState(query, "applicationService", applicationService); - - Mockito.when(applicationService.getApplications(Mockito.anyLong(), Mockito.anyLong())).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(20170101010101L, arguments[0]); - Assert.assertEquals(20170101010101L, arguments[1]); - return null; - }); - - Duration duration = new Duration(); - duration.setStart("2017-01-01 010101"); - duration.setEnd("2017-01-01 010101"); - duration.setStep(Step.SECOND); - - query.getAllApplication(duration); - } - - - @Test - public void testGetSlowByMonthDuration() throws ParseException { - ApplicationQuery query = new ApplicationQuery(null); - ApplicationService applicationService = Mockito.mock(ApplicationService.class); - Whitebox.setInternalState(query, "applicationService", applicationService); - Mockito.when(applicationService.getSlowService( - Mockito.anyInt(), Mockito.anyObject(), - Mockito.anyLong(), Mockito.anyLong(), - Mockito.anyLong(), Mockito.anyLong(), - Mockito.anyInt()) - ).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701L, arguments[2]); - Assert.assertEquals(201701L, arguments[3]); - Assert.assertEquals(20170100000000L, arguments[4]); - Assert.assertEquals(20170199999999L, arguments[5]); - return null; - }); - - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-01"); - // the step in exchangeToTimeBucket and startTimeDurationToSecondTimeBucket and endTimeDurationToSecondTimeBucket has its own testcase,so here wo give - // one step is enough. - duration.setStep(Step.MONTH); - - query.getSlowService(-1, duration, -1); - } - - @Test - public void testGetServerThroughput() throws ParseException { - ApplicationQuery query = new ApplicationQuery(null); - ServerService serverService = Mockito.mock(ServerService.class); - Whitebox.setInternalState(query, "serverService", serverService); - - Mockito.when(serverService.getServerThroughput( - Mockito.anyInt(), Mockito.anyObject(), - Mockito.anyLong(), Mockito.anyLong(), - Mockito.anyLong(), Mockito.anyLong(), - Mockito.anyInt()) - ).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701L, arguments[2]); - Assert.assertEquals(201702L, arguments[3]); - Assert.assertEquals(20170100000000L, arguments[4]); - Assert.assertEquals(20170299999999L, arguments[5]); - return null; - }); - - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - - query.getServerThroughput(-1, duration, -1); - } - - @Test - public void testGetApplicationTopology() throws ParseException { - ApplicationQuery query = new ApplicationQuery(null); - ApplicationTopologyService applicationTopologyService = Mockito.mock(ApplicationTopologyService.class); - Whitebox.setInternalState(query, "applicationTopologyService", applicationTopologyService); - - Mockito.when( - applicationTopologyService.getApplicationTopology( - Mockito.anyObject(), Mockito.anyInt(), - Mockito.anyLong(), Mockito.anyLong(), - Mockito.anyLong(), Mockito.anyLong()) - ).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701L, arguments[2]); - Assert.assertEquals(201703L, arguments[3]); - Assert.assertEquals(20170100000000L, arguments[4]); - Assert.assertEquals(20170399999999L, arguments[5]); - return null; - }); - - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-03"); - duration.setStep(Step.MONTH); - - query.getApplicationTopology(-1, duration); - } - -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ConfigQueryTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ConfigQueryTest.java deleted file mode 100644 index 1b736b4492a8264a242f6b1231cc08d7a1adbcde..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ConfigQueryTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.query; - -import org.apache.skywalking.apm.collector.storage.ui.config.ExistedAlarmThresholds; -import org.apache.skywalking.apm.collector.storage.ui.config.ExistedTTLConfigs; -import org.junit.Assert; -import org.junit.Test; - -/** - * target code may not implement yet - * - * @author lican - */ -public class ConfigQueryTest { - - - @Test - public void queryAllDataTTLConfigs() { - ConfigQuery configQuery = new ConfigQuery(); - ExistedTTLConfigs existedTTLConfigs = configQuery.queryAllDataTTLConfigs(); - Assert.assertNull(existedTTLConfigs); - } - - @Test - public void queryAlarmThresholds() { - ConfigQuery configQuery = new ConfigQuery(); - ExistedAlarmThresholds existedAlarmThresholds = configQuery.queryAlarmThresholds(null); - Assert.assertNull(existedAlarmThresholds); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/OverViewLayerQueryTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/OverViewLayerQueryTest.java deleted file mode 100644 index bc819d4ef2c26da1a2a65a0c3ed1aec4b1dda7d5..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/OverViewLayerQueryTest.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.query; - -import org.apache.skywalking.apm.collector.storage.ui.common.Duration; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.ui.overview.ClusterBrief; -import org.apache.skywalking.apm.collector.ui.service.*; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -import java.text.ParseException; -import java.util.Collections; - -/** - * @author lican - */ -public class OverViewLayerQueryTest { - - - private ClusterTopologyService clusterTopologyService; - private ApplicationService applicationService; - private NetworkAddressService networkAddressService; - private ServiceNameService serviceNameService; - private AlarmService alarmService; - private OverViewLayerQuery overViewLayerQuery; - - @Before - public void setUp() throws Exception { - overViewLayerQuery = new OverViewLayerQuery(null); - alarmService = Mockito.mock(AlarmService.class); - serviceNameService = Mockito.mock(ServiceNameService.class); - networkAddressService = Mockito.mock(NetworkAddressService.class); - applicationService = Mockito.mock(ApplicationService.class); - clusterTopologyService = Mockito.mock(ClusterTopologyService.class); - Whitebox.setInternalState(overViewLayerQuery, "alarmService", alarmService); - Whitebox.setInternalState(overViewLayerQuery, "serviceNameService", serviceNameService); - Whitebox.setInternalState(overViewLayerQuery, "networkAddressService", networkAddressService); - Whitebox.setInternalState(overViewLayerQuery, "applicationService", applicationService); - Whitebox.setInternalState(overViewLayerQuery, "clusterTopologyService", clusterTopologyService); - } - - @Test - public void getClusterTopology() throws ParseException { - Mockito.when( - clusterTopologyService.getClusterTopology( - Mockito.anyObject(), - Mockito.anyLong(), Mockito.anyLong(), Mockito.anyLong(), - Mockito.anyLong()) - ).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701L, arguments[1]); - Assert.assertEquals(201702L, arguments[2]); - Assert.assertEquals(20170100000000L, arguments[3]); - Assert.assertEquals(20170299999999L, arguments[4]); - return null; - }); - - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - - overViewLayerQuery.getClusterTopology(duration); - } - - @Test - public void getClusterBrief() throws ParseException { - - Mockito.when(applicationService.getApplications(Mockito.anyLong(), Mockito.anyLong())).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(20170100000000L, arguments[0]); - Assert.assertEquals(20170299999999L, arguments[1]); - return Collections.emptyList(); - }); - - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - ClusterBrief clusterBrief = overViewLayerQuery.getClusterBrief(duration); - Assert.assertNotNull(clusterBrief); - - } - - @Test - public void getAlarmTrend() throws ParseException { - Mockito.when( - alarmService.getApplicationAlarmTrend( - Mockito.anyObject(), - Mockito.anyLong(), Mockito.anyLong(), - Mockito.anyLong(), Mockito.anyLong()) - ).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701L, arguments[1]); - Assert.assertEquals(201702L, arguments[2]); - Assert.assertEquals(20170100000000L, arguments[3]); - Assert.assertEquals(20170299999999L, arguments[4]); - return null; - }); - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - overViewLayerQuery.getAlarmTrend(duration); - } - - @Test - public void getConjecturalApps() throws ParseException { - Mockito.when( - applicationService.getConjecturalApps( - Mockito.anyObject(), - Mockito.anyLong(), Mockito.anyLong()) - ).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(20170100000000L, arguments[1]); - Assert.assertEquals(20170299999999L, arguments[2]); - return null; - }); - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - overViewLayerQuery.getConjecturalApps(duration); - } - - @Test - public void getTopNSlowService() throws ParseException { - Mockito.when(serviceNameService.getSlowService( - Mockito.anyObject(), - Mockito.anyLong(), Mockito.anyLong(), - Mockito.anyLong(), Mockito.anyLong(), - Mockito.anyInt() - )).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701L, arguments[1]); - Assert.assertEquals(201702L, arguments[2]); - Assert.assertEquals(20170100000000L, arguments[3]); - Assert.assertEquals(20170299999999L, arguments[4]); - return null; - }); - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - overViewLayerQuery.getTopNSlowService(duration, -1); - } - - @Test - public void getTopNApplicationThroughput() throws ParseException { - Mockito.when(applicationService.getTopNApplicationThroughput( - Mockito.anyObject(), - Mockito.anyLong(), Mockito.anyLong(), - Mockito.anyInt() - )).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701L, arguments[1]); - Assert.assertEquals(201702L, arguments[2]); - return null; - }); - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - overViewLayerQuery.getTopNApplicationThroughput(duration, -1); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ServerQueryTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ServerQueryTest.java deleted file mode 100644 index e4b28b9d43ab43f8b505aac30b166fb4df884dca..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ServerQueryTest.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.query; - -import org.apache.skywalking.apm.collector.storage.ui.common.Duration; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.ui.service.ServerService; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -import java.text.ParseException; - -/** - * @author lican - */ -public class ServerQueryTest { - - private ServerService serverService; - private ServerQuery serverQuery; - - @Before - public void setUp() { - serverQuery = new ServerQuery(null); - serverService = Mockito.mock(ServerService.class); - Whitebox.setInternalState(serverQuery, "serverService", serverService); - } - - @Test - public void searchServer() throws ParseException { - - Mockito.when(serverService.searchServer(Mockito.anyString(), Mockito.anyLong(), Mockito.anyLong())).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(20170100000000L, arguments[1]); - Assert.assertEquals(20170299999999L, arguments[2]); - return null; - }); - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - - serverQuery.searchServer("keyword", duration); - } - - @Test - public void getAllServer() throws ParseException { - Mockito.when(serverService.getAllServer(Mockito.anyInt(), Mockito.anyLong(), Mockito.anyLong())).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(20170100000000L, arguments[1]); - Assert.assertEquals(20170299999999L, arguments[2]); - return null; - }); - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - - serverQuery.getAllServer(-1, duration); - } - - @Test - public void getServerResponseTimeTrend() throws ParseException { - Mockito.when(serverService.getServerResponseTimeTrend(Mockito.anyInt(), Mockito.anyObject(), Mockito.anyLong(), Mockito.anyLong())).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701L, arguments[2]); - Assert.assertEquals(201702L, arguments[3]); - return null; - }); - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - - serverQuery.getServerResponseTimeTrend(-1, duration); - } - - @Test - public void getServerThroughputTrend() throws ParseException { - Mockito.when(serverService.getServerThroughputTrend(Mockito.anyInt(), Mockito.anyObject(), Mockito.anyLong(), Mockito.anyLong())).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701L, arguments[2]); - Assert.assertEquals(201702L, arguments[3]); - return null; - }); - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - - serverQuery.getServerThroughputTrend(-1, duration); - } - - @Test - public void getCPUTrend() throws ParseException { - Mockito.when(serverService.getCPUTrend(Mockito.anyInt(), Mockito.anyObject(), Mockito.anyLong(), Mockito.anyLong())).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701L, arguments[2]); - Assert.assertEquals(201702L, arguments[3]); - return null; - }); - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - - serverQuery.getCPUTrend(-1, duration); - } - - @Test - public void getGCTrend() throws ParseException { - Mockito.when(serverService.getGCTrend(Mockito.anyInt(), Mockito.anyObject(), Mockito.anyLong(), Mockito.anyLong())).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701L, arguments[2]); - Assert.assertEquals(201702L, arguments[3]); - return null; - }); - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - - serverQuery.getGCTrend(-1, duration); - } - - @Test - public void getMemoryTrend() throws ParseException { - Mockito.when(serverService.getMemoryTrend(Mockito.anyInt(), Mockito.anyObject(), Mockito.anyLong(), Mockito.anyLong())).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701L, arguments[2]); - Assert.assertEquals(201702L, arguments[3]); - return null; - }); - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - - serverQuery.getMemoryTrend(-1, duration); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ServiceQueryTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ServiceQueryTest.java deleted file mode 100644 index b615842418f70bbf165caad31bf93036de1c3960..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/ServiceQueryTest.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.query; - -import java.text.ParseException; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.apache.skywalking.apm.collector.ui.service.*; -import org.junit.*; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -/** - * @author lican - */ -public class ServiceQueryTest { - - private ServiceNameService serviceNameService; - private ServiceTopologyService serviceTopologyService; - private ServiceQuery serviceQuery; - - @Before - public void setUp() throws Exception { - serviceQuery = new ServiceQuery(null); - serviceNameService = Mockito.mock(ServiceNameService.class); - serviceTopologyService = Mockito.mock(ServiceTopologyService.class); - Whitebox.setInternalState(serviceQuery, "serviceNameService", serviceNameService); - Whitebox.setInternalState(serviceQuery, "serviceTopologyService", serviceTopologyService); - } - - @Test - public void searchService() throws ParseException { - serviceQuery.searchService("keyword", 0, -1); - } - - @Test - public void getServiceResponseTimeTrend() throws ParseException { - Mockito.when(serviceNameService.getServiceResponseTimeTrend( - Mockito.anyInt(), Mockito.anyObject(), - Mockito.anyLong(), Mockito.anyLong()) - ).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701L, arguments[2]); - Assert.assertEquals(201702L, arguments[3]); - return null; - }); - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - serviceQuery.getServiceResponseTimeTrend(-1, duration); - } - - @Test - public void getServiceThroughputTrend() throws ParseException { - Mockito.when(serviceNameService.getServiceThroughputTrend( - Mockito.anyInt(), Mockito.anyObject(), - Mockito.anyLong(), Mockito.anyLong()) - ).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701L, arguments[2]); - Assert.assertEquals(201702L, arguments[3]); - return null; - }); - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - serviceQuery.getServiceThroughputTrend(-1, duration); - } - - @Test - public void getServiceSLATrend() throws ParseException { - Mockito.when(serviceNameService.getServiceSLATrend( - Mockito.anyInt(), Mockito.anyObject(), - Mockito.anyLong(), Mockito.anyLong()) - ).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701L, arguments[2]); - Assert.assertEquals(201702L, arguments[3]); - return null; - }); - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - serviceQuery.getServiceSLATrend(-1, duration); - } - - @Test - public void getServiceTopology() throws ParseException { - Mockito.when(serviceTopologyService.getServiceTopology( - Mockito.anyObject(), Mockito.anyInt(), - Mockito.anyLong(), Mockito.anyLong(), - Mockito.anyLong(), Mockito.anyLong()) - ).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(201701L, arguments[2]); - Assert.assertEquals(201702L, arguments[3]); - Assert.assertEquals(20170100000000L, arguments[4]); - Assert.assertEquals(20170299999999L, arguments[5]); - return null; - }); - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - serviceQuery.getServiceTopology(-1, duration); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/TraceQueryTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/TraceQueryTest.java deleted file mode 100644 index 1368af3ac2440ce55e02c1e2f9defa2b642448cf..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/TraceQueryTest.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.query; - -import org.apache.commons.lang3.StringUtils; -import org.apache.skywalking.apm.collector.storage.ui.common.Duration; -import org.apache.skywalking.apm.collector.storage.ui.common.Pagination; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.ui.trace.QueryOrder; -import org.apache.skywalking.apm.collector.storage.ui.trace.TraceQueryCondition; -import org.apache.skywalking.apm.collector.storage.ui.trace.TraceState; -import org.apache.skywalking.apm.collector.ui.service.SegmentTopService; -import org.apache.skywalking.apm.collector.ui.service.TraceStackService; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -import java.text.ParseException; - -/** - * @author lican - */ -public class TraceQueryTest { - - private SegmentTopService segmentTopService; - private TraceStackService traceStackService; - private TraceQuery traceQuery; - - @Before - public void setUp() throws Exception { - traceQuery = new TraceQuery(null); - segmentTopService = Mockito.mock(SegmentTopService.class); - traceStackService = Mockito.mock(TraceStackService.class); - Whitebox.setInternalState(traceQuery, "segmentTopService", segmentTopService); - Whitebox.setInternalState(traceQuery, "traceStackService", traceStackService); - } - - @Test - public void queryBasicTraces() throws ParseException { - - TraceQueryCondition traceQueryCondition = new TraceQueryCondition(); - traceQueryCondition.setApplicationId(-1); - traceQueryCondition.setOperationName("operationName"); - Duration duration = new Duration(); - duration.setStart("2017-01"); - duration.setEnd("2017-02"); - duration.setStep(Step.MONTH); - traceQueryCondition.setQueryDuration(duration); - traceQueryCondition.setQueryOrder(QueryOrder.BY_START_TIME); - traceQueryCondition.setTraceState(TraceState.ALL); - traceQueryCondition.setPaging(new Pagination()); - Mockito.when(segmentTopService.loadTop( - Mockito.anyLong(), Mockito.anyLong(), - Mockito.anyLong(), Mockito.anyLong(), - Mockito.anyString(), Mockito.anyString(), - Mockito.anyInt(), Mockito.anyInt(), Mockito.anyInt(), Mockito.anyObject(), Mockito.anyObject() - ) - ).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(arguments[5], StringUtils.trimToEmpty(traceQueryCondition.getTraceId())); - if (StringUtils.isBlank(traceQueryCondition.getTraceId())) { - Assert.assertEquals(20170100000000L, arguments[0]); - Assert.assertEquals(20170299999999L, arguments[1]); - } else { - Assert.assertEquals(0L, arguments[0]); - Assert.assertEquals(0L, arguments[1]); - } - return null; - }); - traceQuery.queryBasicTraces(traceQueryCondition); - traceQueryCondition.setTraceId("12.12"); - traceQuery.queryBasicTraces(traceQueryCondition); - } - - @Test - public void queryTrace() { - String traceId = "12.12"; - Mockito.when(traceStackService.load(Mockito.anyString()) - ).then(invocation -> { - Object[] arguments = invocation.getArguments(); - Assert.assertEquals(arguments[0], traceId); - return null; - }); - traceQuery.queryTrace(traceId); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/AlarmServiceTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/AlarmServiceTest.java deleted file mode 100644 index 14516c20da76326ceec97e387f23a317087eb323..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/AlarmServiceTest.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import com.google.gson.*; -import java.text.ParseException; -import java.util.Collections; -import org.apache.skywalking.apm.collector.cache.service.*; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.storage.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.table.register.*; -import org.apache.skywalking.apm.collector.storage.ui.alarm.*; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.apache.skywalking.apm.collector.storage.ui.overview.AlarmTrend; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; -import org.junit.*; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -import static org.mockito.Matchers.*; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -public class AlarmServiceTest { - - private AlarmService alarmService; - - private IInstanceUIDAO instanceDAO; - private IApplicationAlarmUIDAO applicationAlarmUIDAO; - private IApplicationMappingUIDAO applicationMappingUIDAO; - private IInstanceAlarmUIDAO instanceAlarmUIDAO; - private IServiceAlarmUIDAO serviceAlarmUIDAO; - private IApplicationAlarmListUIDAO applicationAlarmListUIDAO; - private ApplicationCacheService applicationCacheService; - private ServiceNameCacheService serviceNameCacheService; - private Duration duration; - - @Before - public void setUp() { - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - alarmService = new AlarmService(moduleManager); - instanceDAO = mock(IInstanceUIDAO.class); - applicationAlarmUIDAO = mock(IApplicationAlarmUIDAO.class); - applicationMappingUIDAO = mock(IApplicationMappingUIDAO.class); - instanceAlarmUIDAO = mock(IInstanceAlarmUIDAO.class); - serviceAlarmUIDAO = mock(IServiceAlarmUIDAO.class); - applicationAlarmListUIDAO = mock(IApplicationAlarmListUIDAO.class); - applicationCacheService = mock(ApplicationCacheService.class); - serviceNameCacheService = mock(ServiceNameCacheService.class); - Whitebox.setInternalState(alarmService, "instanceDAO", instanceDAO); - Whitebox.setInternalState(alarmService, "applicationAlarmUIDAO", applicationAlarmUIDAO); - Whitebox.setInternalState(alarmService, "applicationMappingUIDAO", applicationMappingUIDAO); - Whitebox.setInternalState(alarmService, "instanceAlarmUIDAO", instanceAlarmUIDAO); - Whitebox.setInternalState(alarmService, "serviceAlarmUIDAO", serviceAlarmUIDAO); - Whitebox.setInternalState(alarmService, "applicationAlarmListUIDAO", applicationAlarmListUIDAO); - Whitebox.setInternalState(alarmService, "applicationCacheService", applicationCacheService); - Whitebox.setInternalState(alarmService, "serviceNameCacheService", serviceNameCacheService); - duration = new Duration(); - duration.setEnd("2018-02"); - duration.setStart("2018-01"); - duration.setStep(Step.MONTH); - } - - @Test - public void loadApplicationAlarmList() throws ParseException { - Mockito.when(applicationAlarmUIDAO.loadAlarmList(anyString(), anyList(), anyLong(), anyLong(), anyInt(), anyInt())).then(invocation -> { - return testAlarm(); - }); - long startTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()) / 100; - long endTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()) / 100; - Mockito.when(applicationMappingUIDAO.load(anyObject(), anyLong(), anyLong())).then(invocation -> { - IApplicationMappingUIDAO.ApplicationMapping applicationMapping = new IApplicationMappingUIDAO.ApplicationMapping(); - applicationMapping.setMappingApplicationId(1); - applicationMapping.setApplicationId(1); - return Collections.singletonList(applicationMapping); - }); - mockCache(); - Alarm alarm = alarmService.loadApplicationAlarmList("keyword", 0, Step.MONTH, startTimeBucket, endTimeBucket, 10, 0); - Assert.assertTrue(alarm.getItems().size() == 1); - Assert.assertNotNull(alarm.getItems().get(0).getTitle()); - } - - @Test - public void loadInstanceAlarmList() throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()) / 100; - long endTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()) / 100; - Mockito.when(instanceAlarmUIDAO.loadAlarmList(anyString(), anyLong(), anyLong(), anyInt(), anyInt())).then(invocation -> testAlarm()); - mockCache(); - when(instanceDAO.getInstance(anyInt())).then(invocation -> { - Instance instance = new Instance(); - JsonObject jsonObject = new JsonObject(); - Gson gson = new Gson(); - jsonObject.addProperty("hostName", "testHost"); - instance.setOsInfo(gson.toJson(jsonObject)); - return instance; - }); - Alarm alarm = alarmService.loadInstanceAlarmList("keyword", Step.MONTH, startTimeBucket, endTimeBucket, 10, 0); - Assert.assertNotNull(alarm.getItems().get(0).getTitle()); - } - - private Alarm testAlarm() { - Alarm alarm = new Alarm(); - AlarmItem alarmItem = new AlarmItem(); - alarmItem.setId(1); - alarmItem.setTitle("test"); - alarmItem.setCauseType(CauseType.SLOW_RESPONSE); - alarmItem.setAlarmType(AlarmType.APPLICATION); - alarmItem.setStartTime("2018-01-02 00:00:00"); - alarm.setItems(Collections.singletonList(alarmItem)); - alarm.setTotal(100); - return alarm; - } - - @Test - public void loadServiceAlarmList() throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()) / 100; - long endTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()) / 100; - Mockito.when(serviceAlarmUIDAO.loadAlarmList(anyString(), anyLong(), anyLong(), anyInt(), anyInt())).then(invocation -> testAlarm()); - mockCache(); - when(serviceNameCacheService.get(anyInt())).then(invocation -> { - ServiceName serviceName = new ServiceName(); - serviceName.setServiceName("serviceName"); - return serviceName; - }); - alarmService.loadServiceAlarmList("keyword", Step.MONTH, startTimeBucket, endTimeBucket, 10, 0); - } - - private void mockCache() { - Mockito.when(applicationCacheService.getApplicationById(anyInt())).then(invocation -> { - Application application = new Application(); - application.setApplicationId(1); - application.setApplicationCode("test"); - return application; - }); - } - - @Test - public void getApplicationAlarmTrend() throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - when(instanceDAO.getApplications(anyLong(), anyLong())).then(invocation -> { - org.apache.skywalking.apm.collector.storage.ui.application.Application application = new org.apache.skywalking.apm.collector.storage.ui.application.Application(); - application.setId(1); - application.setName("test"); - application.setNumOfServer(1); - return Collections.singletonList(application); - }); - when(applicationAlarmListUIDAO.getAlarmedApplicationNum(anyObject(), anyLong(), anyLong())).then(invocation -> { - IApplicationAlarmListUIDAO.AlarmTrend alarmTrend = new IApplicationAlarmListUIDAO.AlarmTrend(); - alarmTrend.setNumberOfApplication(1); - alarmTrend.setTimeBucket(20170108L); - return Collections.singletonList(alarmTrend); - }); - AlarmTrend applicationAlarmTrend = alarmService.getApplicationAlarmTrend(duration.getStep(), startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket); - Assert.assertTrue(applicationAlarmTrend.getNumOfAlarmRate().size() > 0); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/ApplicationServiceTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/ApplicationServiceTest.java deleted file mode 100644 index c02ea58af2146d92edd9af63ead6f21b2fec2db1..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/ApplicationServiceTest.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import java.text.ParseException; -import java.util.*; -import org.apache.skywalking.apm.collector.cache.service.*; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.storage.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; -import org.apache.skywalking.apm.collector.storage.ui.application.Application; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.apache.skywalking.apm.collector.storage.ui.overview.*; -import org.apache.skywalking.apm.collector.storage.ui.service.ServiceMetric; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; -import org.junit.*; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -import static org.mockito.Matchers.*; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -public class ApplicationServiceTest { - - private IInstanceUIDAO instanceDAO; - private IServiceMetricUIDAO serviceMetricUIDAO; - private IApplicationMetricUIDAO applicationMetricUIDAO; - private INetworkAddressUIDAO networkAddressUIDAO; - private ApplicationCacheService applicationCacheService; - private ServiceNameCacheService serviceNameCacheService; - private DateBetweenService dateBetweenService; - private ApplicationService applicationService; - private Duration duration; - - @Before - public void setUp() throws Exception { - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - applicationService = new ApplicationService(moduleManager); - instanceDAO = mock(IInstanceUIDAO.class); - serviceMetricUIDAO = mock(IServiceMetricUIDAO.class); - applicationMetricUIDAO = mock(IApplicationMetricUIDAO.class); - networkAddressUIDAO = mock(INetworkAddressUIDAO.class); - applicationCacheService = mock(ApplicationCacheService.class); - serviceNameCacheService = mock(ServiceNameCacheService.class); - dateBetweenService = mock(DateBetweenService.class); - Whitebox.setInternalState(applicationService, "instanceDAO", instanceDAO); - Whitebox.setInternalState(applicationService, "serviceMetricUIDAO", serviceMetricUIDAO); - Whitebox.setInternalState(applicationService, "applicationMetricUIDAO", applicationMetricUIDAO); - Whitebox.setInternalState(applicationService, "networkAddressUIDAO", networkAddressUIDAO); - Whitebox.setInternalState(applicationService, "applicationCacheService", applicationCacheService); - Whitebox.setInternalState(applicationService, "serviceNameCacheService", serviceNameCacheService); - Whitebox.setInternalState(applicationService, "dateBetweenService", dateBetweenService); - duration = new Duration(); - duration.setEnd("2018-02"); - duration.setStart("2018-01"); - duration.setStep(Step.MONTH); - } - - @Test - public void getApplications() throws ParseException { - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - when(instanceDAO.getApplications(anyLong(), anyLong())).then(invocation -> { - List applications = new ArrayList<>(2); - for (int i = 0; i < 2; i++) { - Application application = new Application(); - application.setNumOfServer(i); - application.setName("test"); - application.setId(i); - applications.add(application); - } - return applications; - }); - mockCache(); - List applications = applicationService.getApplications(startSecondTimeBucket, endSecondTimeBucket); - Assert.assertTrue(applications.size() == 1); - } - - private void mockCache() { - Mockito.when(applicationCacheService.getApplicationById(anyInt())).then(invocation -> { - org.apache.skywalking.apm.collector.storage.table.register.Application application = new org.apache.skywalking.apm.collector.storage.table.register.Application(); - application.setApplicationId(1); - application.setApplicationCode("test"); - return application; - }); - } - - @Test - public void getSlowService() throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - when(serviceMetricUIDAO.getSlowService(anyInt(), anyObject(), anyLong(), anyLong(), anyInt(), anyObject())).then(invocation -> { - ServiceMetric serviceMetric = new ServiceMetric(); - serviceMetric.setCalls(200900); - serviceMetric.getService().setName("test"); - serviceMetric.setAvgResponseTime(100); - serviceMetric.getService().setId(1); - return Collections.singletonList(serviceMetric); - }); - when(serviceNameCacheService.get(anyInt())).then(invocation -> { - ServiceName serviceName = new ServiceName(); - serviceName.setServiceName("serviceName"); - return serviceName; - }); - mockCache(); - when(dateBetweenService.minutesBetween(anyInt(), anyLong(), anyLong())).then(invocation -> 20L); - List slowService = applicationService.getSlowService(1, duration.getStep(), startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket, 10); - Assert.assertTrue(slowService.get(0).getCpm() > 0); - } - - @Test - public void getTopNApplicationThroughput() throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - when(applicationMetricUIDAO.getTopNApplicationThroughput(anyObject(), anyLong(), anyLong(), anyInt(), anyInt(), anyObject())).then(invocation -> { - ApplicationThroughput applicationThroughput = new ApplicationThroughput(); - applicationThroughput.setApplicationId(-1); - return Collections.singletonList(applicationThroughput); - }); - mockCache(); - List topNApplicationThroughput = applicationService.getTopNApplicationThroughput(duration.getStep(), startTimeBucket, endTimeBucket, 10); - Assert.assertTrue(topNApplicationThroughput.size() > 0); - } - - @Test - public void getConjecturalApps() throws ParseException { - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - when(networkAddressUIDAO.getConjecturalApps()).then(invocation -> { - ConjecturalApp conjecturalApp = new ConjecturalApp(); - conjecturalApp.setId(1); - return Collections.singletonList(conjecturalApp); - }); - ConjecturalAppBrief conjecturalApps = applicationService.getConjecturalApps(duration.getStep(), startSecondTimeBucket, endSecondTimeBucket); - Assert.assertTrue(conjecturalApps.getApps().size() > 0); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/ApplicationTopologyServiceTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/ApplicationTopologyServiceTest.java deleted file mode 100644 index 862f30c81bfac77cd3b6ac42b568c6000e05e0fc..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/ApplicationTopologyServiceTest.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationComponentUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMappingUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationReferenceMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.ui.common.Duration; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.ui.common.Topology; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import static org.mockito.Matchers.*; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -public class ApplicationTopologyServiceTest { - - private ApplicationTopologyService applicationTopologyService; - private IApplicationComponentUIDAO applicationComponentUIDAO; - private IApplicationMappingUIDAO applicationMappingUIDAO; - private IApplicationMetricUIDAO applicationMetricUIDAO; - private IApplicationReferenceMetricUIDAO applicationReferenceMetricUIDAO; - private Duration duration; - - @Before - public void setUp() { - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - applicationTopologyService = new ApplicationTopologyService(moduleManager); - applicationComponentUIDAO = mock(IApplicationComponentUIDAO.class); - applicationMappingUIDAO = mock(IApplicationMappingUIDAO.class); - applicationMetricUIDAO = mock(IApplicationMetricUIDAO.class); - applicationReferenceMetricUIDAO = mock(IApplicationReferenceMetricUIDAO.class); - Whitebox.setInternalState(applicationTopologyService, "applicationComponentUIDAO", applicationComponentUIDAO); - Whitebox.setInternalState(applicationTopologyService, "applicationMappingUIDAO", applicationMappingUIDAO); - Whitebox.setInternalState(applicationTopologyService, "applicationMetricUIDAO", applicationMetricUIDAO); - Whitebox.setInternalState(applicationTopologyService, "applicationReferenceMetricUIDAO", applicationReferenceMetricUIDAO); - duration = new Duration(); - duration.setEnd("2018-02"); - duration.setStart("2018-01"); - duration.setStep(Step.MONTH); - } - - @Test - public void getApplicationTopology() throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - when(applicationComponentUIDAO.load(anyObject(), anyLong(), anyLong())).then(invocation -> { - List componentList = new ArrayList<>(); - for (int i = 0; i < 5; i++) { - IApplicationComponentUIDAO.ApplicationComponent applicationComponent = new IApplicationComponentUIDAO.ApplicationComponent(); - applicationComponent.setApplicationId(i); - applicationComponent.setComponentId(i); - componentList.add(applicationComponent); - } - return componentList; - }); - mockMapping(); - Topology topology = applicationTopologyService.getApplicationTopology(duration.getStep(), 1, startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket); - Assert.assertNotNull(topology); - } - - private void mockMapping() { - Mockito.when(applicationMappingUIDAO.load(anyObject(), anyLong(), anyLong())).then(invocation -> { - IApplicationMappingUIDAO.ApplicationMapping applicationMapping = new IApplicationMappingUIDAO.ApplicationMapping(); - applicationMapping.setMappingApplicationId(1); - applicationMapping.setApplicationId(1); - return Collections.singletonList(applicationMapping); - }); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/ClusterTopologyServiceTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/ClusterTopologyServiceTest.java deleted file mode 100644 index 5c029738b8bb0208db8c60c18bd6b59cd7f3e209..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/ClusterTopologyServiceTest.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationComponentUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMappingUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationReferenceMetricUIDAO; -import org.apache.skywalking.apm.collector.storage.ui.common.Duration; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.ui.common.Topology; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import static org.mockito.Matchers.*; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -public class ClusterTopologyServiceTest { - - private ClusterTopologyService clusterTopologyService; - private IApplicationComponentUIDAO applicationComponentUIDAO; - private IApplicationMappingUIDAO applicationMappingUIDAO; - private IApplicationMetricUIDAO applicationMetricUIDAO; - private IApplicationReferenceMetricUIDAO applicationReferenceMetricUIDAO; - private Duration duration; - - @Before - public void setUp() throws Exception { - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - clusterTopologyService = new ClusterTopologyService(moduleManager); - applicationComponentUIDAO = mock(IApplicationComponentUIDAO.class); - applicationMappingUIDAO = mock(IApplicationMappingUIDAO.class); - applicationMetricUIDAO = mock(IApplicationMetricUIDAO.class); - applicationReferenceMetricUIDAO = mock(IApplicationReferenceMetricUIDAO.class); - Whitebox.setInternalState(clusterTopologyService, "applicationComponentUIDAO", applicationComponentUIDAO); - Whitebox.setInternalState(clusterTopologyService, "applicationMappingUIDAO", applicationMappingUIDAO); - Whitebox.setInternalState(clusterTopologyService, "applicationMetricUIDAO", applicationMetricUIDAO); - Whitebox.setInternalState(clusterTopologyService, "applicationReferenceMetricUIDAO", applicationReferenceMetricUIDAO); - duration = new Duration(); - duration.setEnd("2018-02"); - duration.setStart("2018-01"); - duration.setStep(Step.MONTH); - } - - @Test - public void getClusterTopology() throws ParseException { - long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - when(applicationComponentUIDAO.load(anyObject(), anyLong(), anyLong())).then(invocation -> { - List componentList = new ArrayList<>(); - for (int i = 0; i < 5; i++) { - IApplicationComponentUIDAO.ApplicationComponent applicationComponent = new IApplicationComponentUIDAO.ApplicationComponent(); - applicationComponent.setApplicationId(i + 1); - applicationComponent.setComponentId(i + 1); - componentList.add(applicationComponent); - } - return componentList; - }); - mockMapping(); - Topology clusterTopology = clusterTopologyService.getClusterTopology(duration.getStep(), startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket); - Assert.assertNotNull(clusterTopology); - } - - private void mockMapping() { - Mockito.when(applicationMappingUIDAO.load(anyObject(), anyLong(), anyLong())).then(invocation -> { - IApplicationMappingUIDAO.ApplicationMapping applicationMapping = new IApplicationMappingUIDAO.ApplicationMapping(); - applicationMapping.setMappingApplicationId(2); - applicationMapping.setApplicationId(2); - return Collections.singletonList(applicationMapping); - }); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/DateBetweenServiceTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/DateBetweenServiceTest.java deleted file mode 100644 index 753b3dd75c887331ad67681a94bf459f60233fff..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/DateBetweenServiceTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceUIDAO; -import org.apache.skywalking.apm.collector.storage.ui.common.Duration; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mockito.internal.util.reflection.Whitebox; - -import java.text.ParseException; - -import static org.mockito.Matchers.anyInt; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -public class DateBetweenServiceTest { - - private DateBetweenService dateBetweenService; - - private IInstanceUIDAO instanceUIDAO; - - private Duration duration; - - @Before - public void setUp() throws Exception { - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - dateBetweenService = new DateBetweenService(moduleManager); - instanceUIDAO = mock(IInstanceUIDAO.class); - Whitebox.setInternalState(dateBetweenService, "instanceUIDAO", instanceUIDAO); - duration = new Duration(); - duration.setEnd("2018-02"); - duration.setStart("2018-01"); - duration.setStep(Step.MONTH); - } - - @Test - public void secondsBetween() throws ParseException { - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - when(instanceUIDAO.getLatestHeartBeatTime(anyInt())).then(invocation -> endSecondTimeBucket); - int seconds = dateBetweenService.secondsBetween(1, startSecondTimeBucket, endSecondTimeBucket); - Assert.assertTrue(seconds > 0); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/NetworkAddressServiceTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/NetworkAddressServiceTest.java deleted file mode 100644 index c365e9e65562a1c08dd10462d05f72391ccf2b9c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/NetworkAddressServiceTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.dao.ui.INetworkAddressUIDAO; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mockito.internal.util.reflection.Whitebox; - -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -public class NetworkAddressServiceTest { - - private INetworkAddressUIDAO networkAddressUIDAO; - private NetworkAddressService networkAddressService; - - @Before - public void setUp() throws Exception { - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - networkAddressService = new NetworkAddressService(moduleManager); - networkAddressUIDAO = mock(INetworkAddressUIDAO.class); - Whitebox.setInternalState(networkAddressService, "networkAddressUIDAO", networkAddressUIDAO); - } - - @Test - public void getNumOfDatabase() { - int numOfDatabase = networkAddressService.getNumOfDatabase(); - Assert.assertEquals(numOfDatabase, 0); - } - - @Test - public void getNumOfCache() { - int numOfCache = networkAddressService.getNumOfCache(); - Assert.assertEquals(numOfCache, 0); - } - - @Test - public void getNumOfMQ() { - int numOfMQ = networkAddressService.getNumOfMQ(); - Assert.assertEquals(numOfMQ, 0); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/SegmentTopServiceTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/SegmentTopServiceTest.java deleted file mode 100644 index c9d3f62232d749cdecee5bc8bc9cd17bd5783298..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/SegmentTopServiceTest.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.dao.ui.IGlobalTraceUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentDurationUIDAO; -import org.apache.skywalking.apm.collector.storage.ui.common.Duration; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.ui.trace.BasicTrace; -import org.apache.skywalking.apm.collector.storage.ui.trace.QueryOrder; -import org.apache.skywalking.apm.collector.storage.ui.trace.TraceBrief; -import org.apache.skywalking.apm.collector.storage.ui.trace.TraceState; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mockito.internal.util.reflection.Whitebox; - -import java.text.ParseException; -import java.util.Collections; - -import static org.mockito.Matchers.*; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -public class SegmentTopServiceTest { - - private ISegmentDurationUIDAO segmentDurationUIDAO; - private IGlobalTraceUIDAO globalTraceUIDAO; - private SegmentTopService segmentTopService; - private Duration duration; - - @Before - public void setUp() { - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - segmentTopService = new SegmentTopService(moduleManager); - segmentDurationUIDAO = mock(ISegmentDurationUIDAO.class); - globalTraceUIDAO = mock(IGlobalTraceUIDAO.class); - Whitebox.setInternalState(segmentTopService, "segmentDurationUIDAO", segmentDurationUIDAO); - Whitebox.setInternalState(segmentTopService, "globalTraceUIDAO", globalTraceUIDAO); - duration = new Duration(); - duration.setEnd("2018-02"); - duration.setStart("2018-01"); - duration.setStep(Step.MONTH); - } - - @Test - public void loadTop() throws ParseException { - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - when(globalTraceUIDAO.getSegmentIds(anyString())).then(invocation -> Collections.singletonList("segmentIds")); - when(segmentDurationUIDAO.loadTop(anyLong(), anyLong(), anyLong(), anyLong(), anyString(), anyInt(), anyInt(), anyInt(),anyObject(),anyObject())).then(invocation -> getTrace()); - when(segmentDurationUIDAO.loadTop(anyLong(), anyLong(), anyLong(), anyLong(), anyString(), anyInt(), anyInt(), anyInt(), anyObject(),anyObject(),anyObject())).then(invocation -> getTrace()); - TraceBrief traceBrief = segmentTopService.loadTop(startSecondTimeBucket, endSecondTimeBucket, 0, 1, "test", null, 1, 10, 0,TraceState.ALL,QueryOrder.BY_START_TIME); - Assert.assertTrue(traceBrief.getTraces().size() == 1); - traceBrief = segmentTopService.loadTop(startSecondTimeBucket, endSecondTimeBucket, 0, 1, "test", "traceId", 1, 10, 0,TraceState.ALL,QueryOrder.BY_START_TIME); - Assert.assertTrue(traceBrief.getTraces().size() == 1); - } - - private TraceBrief getTrace() { - TraceBrief traceBrief = new TraceBrief(); - BasicTrace basicTrace = new BasicTrace(); - basicTrace.setDuration(12); - basicTrace.setError(false); - basicTrace.getOperationName().add("test"); - basicTrace.setSegmentId("segmentId"); - basicTrace.setStart(System.currentTimeMillis()); - basicTrace.setTraceIds(Collections.singletonList("traceId")); - traceBrief.setTotal(1); - traceBrief.setTraces(Collections.singletonList(basicTrace)); - return traceBrief; - } - -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/ServerServiceTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/ServerServiceTest.java deleted file mode 100644 index 5ded746ea5ea37b39d440ef62782a308d8ae45b2..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/ServerServiceTest.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import com.google.gson.*; -import java.text.ParseException; -import java.util.*; -import org.apache.skywalking.apm.collector.cache.service.*; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.storage.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.table.register.*; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.apache.skywalking.apm.collector.storage.ui.server.*; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; -import org.junit.*; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -import static org.mockito.Matchers.*; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -public class ServerServiceTest { - - private IInstanceUIDAO instanceUIDAO; - private IInstanceMetricUIDAO instanceMetricUIDAO; - private ICpuMetricUIDAO cpuMetricUIDAO; - private IGCMetricUIDAO gcMetricUIDAO; - private IMemoryMetricUIDAO memoryMetricUIDAO; - private ApplicationCacheService applicationCacheService; - private InstanceCacheService instanceCacheService; - private DateBetweenService dateBetweenService; - private ServerService serverService; - private Duration duration; - private long startSecondTimeBucket; - private long endSecondTimeBucket; - private long startTimeBucket; - private long endTimeBucket; - - @Before - public void setUp() throws Exception { - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - serverService = new ServerService(moduleManager); - instanceUIDAO = mock(IInstanceUIDAO.class); - instanceMetricUIDAO = mock(IInstanceMetricUIDAO.class); - cpuMetricUIDAO = mock(ICpuMetricUIDAO.class); - gcMetricUIDAO = mock(IGCMetricUIDAO.class); - memoryMetricUIDAO = mock(IMemoryMetricUIDAO.class); - applicationCacheService = mock(ApplicationCacheService.class); - instanceCacheService = mock(InstanceCacheService.class); - dateBetweenService = mock(DateBetweenService.class); - Whitebox.setInternalState(serverService, "instanceUIDAO", instanceUIDAO); - Whitebox.setInternalState(serverService, "instanceMetricUIDAO", instanceMetricUIDAO); - Whitebox.setInternalState(serverService, "cpuMetricUIDAO", cpuMetricUIDAO); - Whitebox.setInternalState(serverService, "gcMetricUIDAO", gcMetricUIDAO); - Whitebox.setInternalState(serverService, "memoryMetricUIDAO", memoryMetricUIDAO); - Whitebox.setInternalState(serverService, "applicationCacheService", applicationCacheService); - Whitebox.setInternalState(serverService, "instanceCacheService", instanceCacheService); - Whitebox.setInternalState(serverService, "dateBetweenService", dateBetweenService); - duration = new Duration(); - duration.setEnd("2018-02"); - duration.setStart("2018-01"); - duration.setStep(Step.MONTH); - startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - } - - @Test - public void searchServer() throws ParseException { - long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - when(instanceUIDAO.searchServer(anyString(), anyLong(), anyLong())).then(invocation -> buildServerInfo()); - mockCache(); - List serverInfos = serverService.searchServer("keyword", startSecondTimeBucket, endSecondTimeBucket); - Assert.assertNotNull(serverInfos.get(0).getPid()); - } - - private List buildServerInfo() { - AppServerInfo appServerInfo = new AppServerInfo(); - appServerInfo.setId(-1); - JsonObject jsonObject = new JsonObject(); - jsonObject.addProperty("osName", "Mac"); - jsonObject.addProperty("hostName", "computer"); - jsonObject.addProperty("processId", "1"); - JsonArray jsonElements = new JsonArray(); - jsonElements.add("127.0.0.1"); - jsonObject.add("ipv4s", jsonElements); - appServerInfo.setOsInfo(new Gson().toJson(jsonObject)); - ArrayList appServerInfos = new ArrayList<>(); - appServerInfos.add(appServerInfo); - return appServerInfos; - } - - private void mockCache() { - Mockito.when(applicationCacheService.getApplicationById(anyInt())).then(invocation -> { - Application application = new Application(); - application.setApplicationId(1); - application.setApplicationCode("test"); - return application; - }); - } - - @Test - public void getAllServer() throws ParseException { - when(instanceUIDAO.getAllServer(anyInt(), anyLong(), anyLong())).then(invocation -> buildServerInfo()); - mockCache(); - List allServer = serverService.getAllServer(-1, startSecondTimeBucket, endSecondTimeBucket); - Assert.assertNotNull(allServer.get(0).getPid()); - } - - @Test - public void getServerResponseTimeTrend() throws ParseException { - when(instanceMetricUIDAO.getResponseTimeTrend(anyInt(), anyObject(), anyObject())).then(invocation -> Collections.singletonList(1)); - ResponseTimeTrend serverResponseTimeTrend = serverService.getServerResponseTimeTrend(1, duration.getStep(), startTimeBucket, endTimeBucket); - Assert.assertTrue(serverResponseTimeTrend.getTrendList().size() == 1); - } - - @Test - public void getServerThroughput() throws ParseException { - when(instanceMetricUIDAO.getServerThroughput(anyInt(), anyObject(), anyLong(), anyLong(), anyInt(), anyInt(), anyObject())).then(invocation -> buildServerInfo()); - when(instanceUIDAO.getInstance(anyInt())).then(invocation -> { - Instance instance = new Instance(); - JsonObject jsonObject = new JsonObject(); - JsonArray jsonElements = new JsonArray(); - jsonElements.add("127.0.0.1"); - jsonObject.add("ipv4s", jsonElements); - instance.setOsInfo(new Gson().toJson(jsonObject)); - return instance; - }); - mockCache(); - List serverThroughput = serverService.getServerThroughput(1, Step.MONTH, startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket, 10); - Assert.assertTrue(serverThroughput.size() == 1); - } - - @Test - public void getServerThroughputTrend() throws ParseException { - ThroughputTrend serverTPSTrend = serverService.getServerThroughputTrend(1, duration.getStep(), startTimeBucket, endTimeBucket); - Assert.assertNotNull(serverTPSTrend); - } - - @Test - public void getCPUTrend() throws ParseException { - CPUTrend cpuTrend = serverService.getCPUTrend(1, duration.getStep(), startTimeBucket, endTimeBucket); - Assert.assertNotNull(cpuTrend); - } - - @Test - public void getGCTrend() throws ParseException { - GCTrend gcTrend = serverService.getGCTrend(1, duration.getStep(), startTimeBucket, endTimeBucket); - Assert.assertNotNull(gcTrend); - } - - @Test - public void getMemoryTrend() throws ParseException { - when(memoryMetricUIDAO.getHeapMemoryTrend(anyInt(), anyObject(), anyObject())).then(invocation -> { - IMemoryMetricUIDAO.Trend trend = new IMemoryMetricUIDAO.Trend(); - trend.getMaxMetrics().addAll(Collections.singletonList(1)); - trend.getMetrics().addAll(Collections.singletonList(2)); - return trend; - }); - when(memoryMetricUIDAO.getNoHeapMemoryTrend(anyInt(), anyObject(), anyObject())).then(invocation -> { - IMemoryMetricUIDAO.Trend trend = new IMemoryMetricUIDAO.Trend(); - trend.getMaxMetrics().addAll(Collections.singletonList(1)); - trend.getMetrics().addAll(Collections.singletonList(2)); - return trend; - }); - MemoryTrend memoryTrend = serverService.getMemoryTrend(1, duration.getStep(), startTimeBucket, endTimeBucket); - Assert.assertNotNull(memoryTrend); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/ServiceNameServiceTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/ServiceNameServiceTest.java deleted file mode 100644 index 358c92aa60ede853ce20386fb7349a2396b3ef0a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/ServiceNameServiceTest.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import java.text.ParseException; -import java.util.*; -import org.apache.skywalking.apm.collector.cache.service.*; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.storage.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.apache.skywalking.apm.collector.storage.ui.service.*; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; -import org.junit.*; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -import static org.mockito.Matchers.*; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -public class ServiceNameServiceTest { - - private IServiceNameServiceUIDAO serviceNameServiceUIDAO; - private IServiceMetricUIDAO serviceMetricUIDAO; - private ServiceNameCacheService serviceNameCacheService; - private ApplicationCacheService applicationCacheService; - private DateBetweenService dateBetweenService; - private ServiceNameService serverNameService; - private Duration duration; - private long startSecondTimeBucket; - private long endSecondTimeBucket; - private long startTimeBucket; - private long endTimeBucket; - - @Before - public void setUp() throws Exception { - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - serverNameService = new ServiceNameService(moduleManager); - serviceNameCacheService = mock(ServiceNameCacheService.class); - applicationCacheService = mock(ApplicationCacheService.class); - serviceMetricUIDAO = mock(IServiceMetricUIDAO.class); - dateBetweenService = mock(DateBetweenService.class); - Whitebox.setInternalState(serverNameService, "serviceNameCacheService", serviceNameCacheService); - Whitebox.setInternalState(serverNameService, "applicationCacheService", applicationCacheService); - Whitebox.setInternalState(serverNameService, "serviceMetricUIDAO", serviceMetricUIDAO); - Whitebox.setInternalState(serverNameService, "dateBetweenService", dateBetweenService); - duration = new Duration(); - duration.setEnd("2018-02"); - duration.setStart("2018-01"); - duration.setStep(Step.MONTH); - startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - } - - @Test - public void getCount() { - int count = serverNameService.getCount(); - Assert.assertTrue(count == 0); - } - - @Test - public void searchService() { - List serviceInfos = serverNameService.searchService("keyword", 0, 10); - Assert.assertTrue(serviceInfos.size() == 0); - } - - @Test - public void getServiceThroughputTrend() throws ParseException { - ThroughputTrend serviceTPSTrend = serverNameService.getServiceThroughputTrend(1, duration.getStep(), startTimeBucket, endTimeBucket); - Assert.assertNotNull(serviceTPSTrend); - } - - @Test - public void getServiceResponseTimeTrend() throws ParseException { - ResponseTimeTrend serviceResponseTimeTrend = serverNameService.getServiceResponseTimeTrend(1, duration.getStep(), startTimeBucket, endTimeBucket); - Assert.assertNotNull(serviceResponseTimeTrend); - } - - @Test - public void getServiceSLATrend() throws ParseException { - SLATrend serviceSLATrend = serverNameService.getServiceSLATrend(1, duration.getStep(), startTimeBucket, endTimeBucket); - Assert.assertNotNull(serviceSLATrend); - } - - @Test - public void getSlowService() throws ParseException { - when(serviceMetricUIDAO.getSlowService(anyInt(), anyObject(), anyLong(), anyLong(), anyInt(), anyObject())).then(invocation -> { - ServiceMetric serviceMetric = new ServiceMetric(); - serviceMetric.setCalls(200901); - serviceMetric.getService().setName("test"); - serviceMetric.setAvgResponseTime(100); - serviceMetric.getService().setApplicationId(1); - serviceMetric.getService().setId(1); - return Collections.singletonList(serviceMetric); - }); - when(dateBetweenService.minutesBetween(anyInt(), anyLong(), anyLong())).then(invocation -> 20L); - mockCache(); - List slowService = serverNameService.getSlowService(duration.getStep(), startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket, 10); - Assert.assertTrue(slowService.size() > 0); - } - - private void mockCache() { - Mockito.when(serviceNameCacheService.get(anyInt())).then(invocation -> { - ServiceName serviceName = new ServiceName(); - serviceName.setServiceName("test_name"); - serviceName.setApplicationId(1); - return serviceName; - }); - - Mockito.when(applicationCacheService.getApplicationById(anyInt())).then(invocation -> { - org.apache.skywalking.apm.collector.storage.table.register.Application application = new org.apache.skywalking.apm.collector.storage.table.register.Application(); - application.setApplicationId(1); - application.setApplicationCode("test"); - return application; - }); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/ServiceTopologyServiceTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/ServiceTopologyServiceTest.java deleted file mode 100644 index e156d6610ec6878f90308d6013e969e74e9faf89..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/ServiceTopologyServiceTest.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import java.text.ParseException; -import java.util.*; -import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.storage.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.table.register.ServiceName; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.apache.skywalking.apm.collector.storage.ui.service.ServiceNode; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; -import org.junit.*; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -import static org.mockito.Matchers.*; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -public class ServiceTopologyServiceTest { - - private IApplicationComponentUIDAO applicationComponentUIDAO; - private IServiceMetricUIDAO serviceMetricUIDAO; - private IServiceReferenceMetricUIDAO serviceReferenceMetricUIDAO; - private ServiceNameCacheService serviceNameCacheService; - private DateBetweenService dateBetweenService; - private ServiceTopologyService serviceTopologyService; - private Duration duration; - private long startSecondTimeBucket; - private long endSecondTimeBucket; - private long startTimeBucket; - private long endTimeBucket; - - @Before - public void setUp() throws Exception { - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - serviceTopologyService = new ServiceTopologyService(moduleManager); - applicationComponentUIDAO = mock(IApplicationComponentUIDAO.class); - serviceMetricUIDAO = mock(IServiceMetricUIDAO.class); - serviceReferenceMetricUIDAO = mock(IServiceReferenceMetricUIDAO.class); - serviceNameCacheService = mock(ServiceNameCacheService.class); - dateBetweenService = mock(DateBetweenService.class); - Whitebox.setInternalState(serviceTopologyService, "applicationComponentUIDAO", applicationComponentUIDAO); - Whitebox.setInternalState(serviceTopologyService, "serviceMetricUIDAO", serviceMetricUIDAO); - Whitebox.setInternalState(serviceTopologyService, "serviceReferenceMetricUIDAO", serviceReferenceMetricUIDAO); - Whitebox.setInternalState(serviceTopologyService, "serviceNameCacheService", serviceNameCacheService); - Whitebox.setInternalState(serviceTopologyService, "dateBetweenService", dateBetweenService); - duration = new Duration(); - duration.setEnd("2018-02"); - duration.setStart("2018-01"); - duration.setStep(Step.MONTH); - startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - } - - @Test - public void getServiceTopology() throws ParseException { - when(applicationComponentUIDAO.load(anyObject(), anyLong(), anyLong())).then(invocation -> { - List componentList = new ArrayList<>(); - for (int i = 0; i < 5; i++) { - IApplicationComponentUIDAO.ApplicationComponent applicationComponent = new IApplicationComponentUIDAO.ApplicationComponent(); - applicationComponent.setApplicationId(i + 2); - applicationComponent.setComponentId(i + 2); - componentList.add(applicationComponent); - } - return componentList; - }); - when(serviceReferenceMetricUIDAO.getFrontServices(anyObject(), anyLong(), anyLong(), anyObject(), anyInt())).then(invocation -> { - List list = new ArrayList<>(); - for (int i = 0; i < 5; i++) { - IServiceReferenceMetricUIDAO.ServiceReferenceMetric serviceReferenceMetric = new IServiceReferenceMetricUIDAO.ServiceReferenceMetric(); - serviceReferenceMetric.setSource(i); - serviceReferenceMetric.setTarget(i + 1); - serviceReferenceMetric.setCalls(200); - serviceReferenceMetric.setErrorCalls(2); - list.add(serviceReferenceMetric); - } - return list; - }); - mockCache(); - - when(dateBetweenService.minutesBetween(anyInt(), anyLong(), anyLong())).then(invocation -> 20L); - when(serviceMetricUIDAO.getServicesMetric(anyObject(), anyLong(), anyLong(), anyObject(), anyObject())).then(invocation -> { - List nodes = new LinkedList<>(); - ServiceNode serviceNode = new ServiceNode(); - serviceNode.setId(1); - serviceNode.setCalls(200); - serviceNode.setSla(99); - nodes.add(serviceNode); - return nodes; - }); - Topology serviceTopology = serviceTopologyService.getServiceTopology(duration.getStep(), 1, startTimeBucket, endTimeBucket, startSecondTimeBucket, endSecondTimeBucket); - Assert.assertTrue(serviceTopology.getCalls().size() > 0); - Assert.assertTrue(serviceTopology.getNodes().size() > 0); - } - - private void mockCache() { - Mockito.when(serviceNameCacheService.get(anyInt())).then(invocation -> { - ServiceName serviceName = new ServiceName(); - serviceName.setServiceName("test_name"); - return serviceName; - }); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/SpanServiceTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/SpanServiceTest.java deleted file mode 100644 index 625271871ac1b68b3ee0147c4ad3b0a3b4d6637c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/SpanServiceTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import com.google.gson.JsonObject; -import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService; -import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService; -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentUIDAO; -import org.apache.skywalking.apm.network.language.agent.KeyWithStringValue; -import org.apache.skywalking.apm.network.language.agent.LogMessage; -import org.apache.skywalking.apm.network.language.agent.SpanObject; -import org.apache.skywalking.apm.network.language.agent.TraceSegmentObject; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mockito.internal.util.reflection.Whitebox; - -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -public class SpanServiceTest { - - private SpanService spanService; - private ISegmentUIDAO segmentDAO; - private ServiceNameCacheService serviceNameCacheService; - private ApplicationCacheService applicationCacheService; - - @Before - public void setUp() throws Exception { - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - spanService = new SpanService(moduleManager); - serviceNameCacheService = mock(ServiceNameCacheService.class); - applicationCacheService = mock(ApplicationCacheService.class); - segmentDAO = mock(ISegmentUIDAO.class); - Whitebox.setInternalState(spanService, "serviceNameCacheService", serviceNameCacheService); - Whitebox.setInternalState(spanService, "applicationCacheService", applicationCacheService); - Whitebox.setInternalState(spanService, "segmentDAO", segmentDAO); - } - - @Test - public void load() { - when(segmentDAO.load(anyString())).then(invocation -> { - LogMessage message = LogMessage.newBuilder() - .setTime(System.currentTimeMillis()) - .addData(KeyWithStringValue.newBuilder().setKey("a").setValue("b").build()) - .build(); - SpanObject testSpanObject = SpanObject.newBuilder() - .setSpanId(1) - .setOperationName("testSpanName") - .addLogs(message) - .addTags(KeyWithStringValue.newBuilder().setKey("tagKey").setValue("tagValue").build()) - .setOperationNameId(1) - .build(); - return TraceSegmentObject.newBuilder() - .addSpans(testSpanObject) - .build(); - }); - - JsonObject load = spanService.load("123", 1); - Assert.assertNotNull(load); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilderTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilderTest.java deleted file mode 100644 index d04376e8545dae52e369eaa0c2c25eecf9206719..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilderTest.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import java.text.ParseException; -import java.util.*; -import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService; -import org.apache.skywalking.apm.collector.core.module.*; -import org.apache.skywalking.apm.collector.storage.dao.ui.*; -import org.apache.skywalking.apm.collector.storage.table.register.Application; -import org.apache.skywalking.apm.collector.storage.ui.alarm.*; -import org.apache.skywalking.apm.collector.storage.ui.common.*; -import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; -import org.junit.*; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -import static org.mockito.Matchers.*; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -public class TopologyBuilderTest { - - private ApplicationCacheService applicationCacheService; - private ServerService serverService; - private DateBetweenService dateBetweenService; - private AlarmService alarmService; - private TopologyBuilder topologyBuilder; - private Duration duration; - private long startSecondTimeBucket; - private long endSecondTimeBucket; - private long startTimeBucket; - private long endTimeBucket; - - @Before - public void setUp() throws Exception { - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - topologyBuilder = new TopologyBuilder(moduleManager); - applicationCacheService = mock(ApplicationCacheService.class); - alarmService = mock(AlarmService.class); - dateBetweenService = mock(DateBetweenService.class); - Whitebox.setInternalState(topologyBuilder, "applicationCacheService", applicationCacheService); - Whitebox.setInternalState(topologyBuilder, "dateBetweenService", dateBetweenService); - duration = new Duration(); - duration.setEnd("2018-02"); - duration.setStart("2018-01"); - duration.setStep(Step.MONTH); - startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); - endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); - startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart()); - endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd()); - } - - @Test - public void build() throws ParseException { - List applicationComponents = new ArrayList<>(); - IApplicationComponentUIDAO.ApplicationComponent component = new IApplicationComponentUIDAO.ApplicationComponent(); - component.setComponentId(1); - component.setApplicationId(2); - applicationComponents.add(component); - - List applicationMappings = new ArrayList<>(); - IApplicationMappingUIDAO.ApplicationMapping mapping = new IApplicationMappingUIDAO.ApplicationMapping(); - mapping.setApplicationId(2); - mapping.setMappingApplicationId(3); - applicationMappings.add(mapping); - - List applicationMetrics = new ArrayList<>(); - IApplicationMetricUIDAO.ApplicationMetric applicationMetric = new IApplicationMetricUIDAO.ApplicationMetric(); - applicationMetric.setCalls(200); - applicationMetric.setErrorCalls(2); - applicationMetric.setDurations(100); - applicationMetric.setSatisfiedCount(100); - applicationMetric.setToleratingCount(50); - applicationMetric.setFrustratedCount(50); - applicationMetric.setErrorDurations(1000); - applicationMetrics.add(applicationMetric); - - List callerReferenceMetric = new ArrayList<>(); - IApplicationReferenceMetricUIDAO.ApplicationReferenceMetric applicationReferenceMetric = new IApplicationReferenceMetricUIDAO.ApplicationReferenceMetric(); - applicationReferenceMetric.setCalls(200); - applicationReferenceMetric.setErrorCalls(2); - applicationReferenceMetric.setSource(1); - applicationReferenceMetric.setTarget(2); - callerReferenceMetric.add(applicationReferenceMetric); - - List calleeReferenceMetric = new ArrayList<>(); - IApplicationReferenceMetricUIDAO.ApplicationReferenceMetric metric = new IApplicationReferenceMetricUIDAO.ApplicationReferenceMetric(); - metric.setCalls(200); - metric.setErrorCalls(2); - metric.setSource(1); - metric.setTarget(2); - calleeReferenceMetric.add(metric); - mockCache(); - - when(alarmService.loadApplicationAlarmList(anyString(), anyInt(), anyObject(), anyLong(), anyLong(), anyInt(), anyInt())).then(invocation -> { - Alarm alarm = new Alarm(); - alarm.setItems(Collections.singletonList(new AlarmItem())); - return alarm; - }); - when(alarmService.loadInstanceAlarmList(anyString(), anyObject(), anyLong(), anyLong(), anyInt(), anyInt())).then(invocation -> { - Alarm alarm = new Alarm(); - alarm.setItems(Collections.singletonList(new AlarmItem())); - return alarm; - }); - when(alarmService.loadServiceAlarmList(anyString(), anyObject(), anyLong(), anyLong(), anyInt(), anyInt())).then(invocation -> { - Alarm alarm = new Alarm(); - alarm.setItems(Collections.singletonList(new AlarmItem())); - return alarm; - }); - when(dateBetweenService.minutesBetween(anyInt(), anyLong(), anyLong())).then(invocation -> 20L); - Topology topology = topologyBuilder.build(applicationComponents, applicationMappings, applicationMetrics, callerReferenceMetric, calleeReferenceMetric, startSecondTimeBucket, endSecondTimeBucket); - Assert.assertNotNull(topology); - } - - private void mockCache() { - Mockito.when(applicationCacheService.getApplicationById(anyInt())).then(invocation -> { - Application application = new Application(); - application.setApplicationId(1); - application.setApplicationCode("test"); - return application; - }); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/TraceStackServiceTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/TraceStackServiceTest.java deleted file mode 100644 index 892c202d144a87bb08d5fd870e29103ee5072e2a..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/TraceStackServiceTest.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.service; - -import com.google.common.collect.Lists; -import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService; -import org.apache.skywalking.apm.collector.cache.service.NetworkAddressCacheService; -import org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService; -import org.apache.skywalking.apm.collector.core.module.MockModule; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.storage.dao.ui.IGlobalTraceUIDAO; -import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentUIDAO; -import org.apache.skywalking.apm.collector.storage.table.register.Application; -import org.apache.skywalking.apm.collector.storage.ui.trace.Trace; -import org.apache.skywalking.apm.network.language.agent.*; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; -import org.mockito.internal.util.reflection.Whitebox; - -import static org.mockito.Matchers.anyInt; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -/** - * @author lican - */ -public class TraceStackServiceTest { - - private TraceStackService traceStackService; - private IGlobalTraceUIDAO globalTraceDAO; - private ISegmentUIDAO segmentDAO; - private ApplicationCacheService applicationCacheService; - private ServiceNameCacheService serviceNameCacheService; - private NetworkAddressCacheService networkAddressCacheService; - - @Before - public void setUp() throws Exception { - ModuleManager moduleManager = mock(ModuleManager.class); - when(moduleManager.find(anyString())).then(invocation -> new MockModule()); - traceStackService = new TraceStackService(moduleManager); - globalTraceDAO = mock(IGlobalTraceUIDAO.class); - segmentDAO = mock(ISegmentUIDAO.class); - applicationCacheService = mock(ApplicationCacheService.class); - Whitebox.setInternalState(traceStackService, "globalTraceDAO", globalTraceDAO); - Whitebox.setInternalState(traceStackService, "segmentDAO", segmentDAO); - Whitebox.setInternalState(traceStackService, "applicationCacheService", applicationCacheService); - } - - @Test - public void load() { - when(globalTraceDAO.getSegmentIds(anyString())).then(invocation -> Lists.newArrayList("1", "2", "3")); - when(segmentDAO.load(anyString())).then(invocation -> { - TraceSegmentReference traceSegmentReference = TraceSegmentReference.newBuilder() - .setRefType(RefType.CrossProcess) - .setRefTypeValue(1) - .build(); - LogMessage message = LogMessage.newBuilder() - .setTime(System.currentTimeMillis()) - .addData(KeyWithStringValue.newBuilder().setKey("a").setValue("b").build()) - .build(); - SpanObject testSpanObject = SpanObject.newBuilder() - .setSpanId(1) - .setOperationName("testSpanName") - .addLogs(message) - .addTags(KeyWithStringValue.newBuilder().setKey("tagKey").setValue("tagValue").build()) - .setOperationNameId(1) - .addRefs(traceSegmentReference) - .build(); - return TraceSegmentObject.newBuilder() - .addSpans(testSpanObject) - .build(); - }); - mockCache(); - Trace load = traceStackService.load("123"); - Assert.assertNotNull(load); - } - - private void mockCache() { - Mockito.when(applicationCacheService.getApplicationById(anyInt())).then(invocation -> { - Application application = new Application(); - application.setApplicationId(1); - application.setApplicationCode("test"); - return application; - }); - } -} \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/utils/ApdexCalculatorTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/utils/ApdexCalculatorTest.java deleted file mode 100644 index 2e2da7a7b8791a5fb41f60de9659f0ed60239556..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/utils/ApdexCalculatorTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.utils; - -import org.junit.Assert; -import org.junit.Test; - -/** - * @author lican - */ -public class ApdexCalculatorTest { - - /** - * about apdex: https://en.wikipedia.org/wiki/Apdex - */ - @Test - public void testApdexCalculator() { - int apdex = ApdexCalculator.INSTANCE.calculate(80, 10, 10); - Assert.assertEquals(apdex, 85, 1); - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/utils/DurationTestCase.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/utils/DurationTestCase.java deleted file mode 100644 index 28009c7a7279be48c82981b85a20545d38704404..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/utils/DurationTestCase.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.utils; - -import org.junit.Assert; - -/** - * @author peng-yongsheng - */ -public class DurationTestCase { - - @org.junit.Test - public void test() { - Assert.assertEquals(true, expression(80, 150)); - Assert.assertEquals(true, expression(80, 250)); - Assert.assertEquals(true, expression(150, 250)); - Assert.assertEquals(true, expression(120, 180)); - Assert.assertEquals(false, expression(70, 90)); - Assert.assertEquals(false, expression(250, 300)); - } - - private boolean expression(int start, int end) { - int register = 100; - int heart = 200; - - return (heart > end && register <= end) || (register <= end && heart >= start); - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/utils/DurationUtilsTestCase.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/utils/DurationUtilsTestCase.java deleted file mode 100644 index 34127f9a58971a50dba1f947398444a96f0f8c9e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/utils/DurationUtilsTestCase.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.utils; - -import org.apache.skywalking.apm.collector.core.UnexpectedException; -import org.apache.skywalking.apm.collector.storage.ui.common.Step; -import org.apache.skywalking.apm.collector.storage.utils.DurationPoint; -import org.junit.Assert; -import org.junit.Test; - -import java.text.ParseException; -import java.util.List; - -/** - * @author peng-yongsheng - */ -public class DurationUtilsTestCase { - - @Test - public void test() throws ParseException { - } - - @Test - public void testGetDurationPoints() throws ParseException { - List durationPoints = DurationUtils.INSTANCE.getDurationPoints(Step.MONTH, 201710, 201803); - Assert.assertEquals(6, durationPoints.size()); - Assert.assertEquals(201710L, durationPoints.get(0).getPoint()); - Assert.assertEquals(2678400, durationPoints.get(0).getSecondsBetween()); - Assert.assertEquals(201711L, durationPoints.get(1).getPoint()); - Assert.assertEquals(2592000, durationPoints.get(1).getSecondsBetween()); - Assert.assertEquals(201712L, durationPoints.get(2).getPoint()); - Assert.assertEquals(2678400, durationPoints.get(2).getSecondsBetween()); - Assert.assertEquals(201801L, durationPoints.get(3).getPoint()); - Assert.assertEquals(2678400, durationPoints.get(3).getSecondsBetween()); - Assert.assertEquals(201802L, durationPoints.get(4).getPoint()); - Assert.assertEquals(2419200, durationPoints.get(4).getSecondsBetween()); - Assert.assertEquals(201803L, durationPoints.get(5).getPoint()); - Assert.assertEquals(2678400, durationPoints.get(5).getSecondsBetween()); - - durationPoints = DurationUtils.INSTANCE.getDurationPoints(Step.DAY, 20180129, 20180202); - Assert.assertEquals(5, durationPoints.size()); - Assert.assertEquals(20180129L, durationPoints.get(0).getPoint()); - Assert.assertEquals(86400, durationPoints.get(0).getSecondsBetween()); - Assert.assertEquals(20180130L, durationPoints.get(1).getPoint()); - Assert.assertEquals(86400, durationPoints.get(1).getSecondsBetween()); - Assert.assertEquals(20180131L, durationPoints.get(2).getPoint()); - Assert.assertEquals(86400, durationPoints.get(2).getSecondsBetween()); - Assert.assertEquals(20180201L, durationPoints.get(3).getPoint()); - Assert.assertEquals(86400, durationPoints.get(3).getSecondsBetween()); - Assert.assertEquals(20180202L, durationPoints.get(4).getPoint()); - Assert.assertEquals(86400, durationPoints.get(4).getSecondsBetween()); - - durationPoints = DurationUtils.INSTANCE.getDurationPoints(Step.HOUR, 2018012922, 2018013002); - Assert.assertEquals(5, durationPoints.size()); - Assert.assertEquals(2018012922L, durationPoints.get(0).getPoint()); - Assert.assertEquals(3600, durationPoints.get(0).getSecondsBetween()); - Assert.assertEquals(2018012923L, durationPoints.get(1).getPoint()); - Assert.assertEquals(3600, durationPoints.get(1).getSecondsBetween()); - Assert.assertEquals(2018013000L, durationPoints.get(2).getPoint()); - Assert.assertEquals(3600, durationPoints.get(2).getSecondsBetween()); - Assert.assertEquals(2018013001L, durationPoints.get(3).getPoint()); - Assert.assertEquals(3600, durationPoints.get(3).getSecondsBetween()); - Assert.assertEquals(2018013002L, durationPoints.get(4).getPoint()); - Assert.assertEquals(3600, durationPoints.get(4).getSecondsBetween()); - - durationPoints = DurationUtils.INSTANCE.getDurationPoints(Step.MINUTE, 201801292258L, 201801292302L); - Assert.assertEquals(5, durationPoints.size()); - Assert.assertEquals(201801292258L, durationPoints.get(0).getPoint()); - Assert.assertEquals(60, durationPoints.get(0).getSecondsBetween()); - Assert.assertEquals(201801292259L, durationPoints.get(1).getPoint()); - Assert.assertEquals(60, durationPoints.get(1).getSecondsBetween()); - Assert.assertEquals(201801292300L, durationPoints.get(2).getPoint()); - Assert.assertEquals(60, durationPoints.get(2).getSecondsBetween()); - Assert.assertEquals(201801292301L, durationPoints.get(3).getPoint()); - Assert.assertEquals(60, durationPoints.get(3).getSecondsBetween()); - Assert.assertEquals(201801292302L, durationPoints.get(4).getPoint()); - Assert.assertEquals(60, durationPoints.get(4).getSecondsBetween()); - - durationPoints = DurationUtils.INSTANCE.getDurationPoints(Step.SECOND, 20180129225858L, 20180129225902L); - Assert.assertEquals(5, durationPoints.size()); - Assert.assertEquals(20180129225858L, durationPoints.get(0).getPoint()); - Assert.assertEquals(1, durationPoints.get(0).getSecondsBetween()); - Assert.assertEquals(20180129225859L, durationPoints.get(1).getPoint()); - Assert.assertEquals(1, durationPoints.get(1).getSecondsBetween()); - Assert.assertEquals(20180129225900L, durationPoints.get(2).getPoint()); - Assert.assertEquals(1, durationPoints.get(2).getSecondsBetween()); - Assert.assertEquals(20180129225901L, durationPoints.get(3).getPoint()); - Assert.assertEquals(1, durationPoints.get(3).getSecondsBetween()); - Assert.assertEquals(20180129225902L, durationPoints.get(4).getPoint()); - Assert.assertEquals(1, durationPoints.get(4).getSecondsBetween()); - } - - @Test(expected = UnexpectedException.class) - public void testGetDurationPointsErrorDuration() throws ParseException { - DurationUtils.INSTANCE.getDurationPoints(Step.MONTH, 20171001, 20180301); - } - - @Test - public void testStartTimeDurationToSecondTimeBucket() throws ParseException { - long secondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(Step.MONTH, "201710"); - Assert.assertEquals(20171000000000L, secondTimeBucket); - - secondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(Step.DAY, "20171001"); - Assert.assertEquals(20171001000000L, secondTimeBucket); - - secondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(Step.HOUR, "2017100108"); - Assert.assertEquals(20171001080000L, secondTimeBucket); - - secondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(Step.MINUTE, "201710010805"); - Assert.assertEquals(20171001080500L, secondTimeBucket); - - secondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(Step.SECOND, "20171001080501"); - Assert.assertEquals(20171001080501L, secondTimeBucket); - } - - @Test - public void testEndTimeDurationToSecondTimeBucket() throws ParseException { - long secondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(Step.MONTH, "201710"); - Assert.assertEquals(20171099999999L, secondTimeBucket); - - secondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(Step.DAY, "20171001"); - Assert.assertEquals(20171001999999L, secondTimeBucket); - - secondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(Step.HOUR, "2017100108"); - Assert.assertEquals(20171001089999L, secondTimeBucket); - - secondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(Step.MINUTE, "201710010805"); - Assert.assertEquals(20171001080599L, secondTimeBucket); - - secondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(Step.SECOND, "20171001080501"); - Assert.assertEquals(20171001080501L, secondTimeBucket); - } - - @Test - public void testSecondsBetween() throws ParseException { - int secondsBetweenMonth = DurationUtils.INSTANCE.secondsBetween(Step.MONTH, 201804L, 201805L); - Assert.assertEquals(secondsBetweenMonth, 30 * 24 * 3600); - - int secondsBetweenDay = DurationUtils.INSTANCE.secondsBetween(Step.DAY, 20180401L, 20180402L); - Assert.assertEquals(secondsBetweenDay, 24 * 3600); - - int secondsBetweenHour = DurationUtils.INSTANCE.secondsBetween(Step.HOUR, 2018040101L, 2018040102L); - Assert.assertEquals(secondsBetweenHour, 3600); - - int secondsBetweenMinute = DurationUtils.INSTANCE.secondsBetween(Step.MINUTE, 201804010100L, 201804010101L); - Assert.assertEquals(secondsBetweenMinute, 60); - - int secondsBetweenSecond = DurationUtils.INSTANCE.secondsBetween(Step.SECOND, 20180401010000L, 20180401010001L); - Assert.assertEquals(secondsBetweenSecond, 1); - - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/utils/PaginationUtilsTestCase.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/utils/PaginationUtilsTestCase.java deleted file mode 100644 index 324e30f7faf42649fe73d1000aedae75a9798b9c..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/utils/PaginationUtilsTestCase.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.utils; - -import org.apache.skywalking.apm.collector.storage.ui.common.Pagination; -import org.junit.Assert; -import org.junit.Test; - -/** - * @author peng-yongsheng - */ -public class PaginationUtilsTestCase { - - @Test - public void test() { - Pagination pagination = new Pagination(); - pagination.setPageSize(10); - pagination.setPageNum(1); - - PaginationUtils.Page page = PaginationUtils.INSTANCE.exchange(pagination); - Assert.assertEquals(0, page.getFrom()); - Assert.assertEquals(10, page.getLimit()); - - pagination = new Pagination(); - pagination.setPageSize(10); - - page = PaginationUtils.INSTANCE.exchange(pagination); - Assert.assertEquals(0, page.getFrom()); - Assert.assertEquals(10, page.getLimit()); - - pagination = new Pagination(); - pagination.setPageSize(10); - pagination.setPageNum(2); - - page = PaginationUtils.INSTANCE.exchange(pagination); - Assert.assertEquals(10, page.getFrom()); - Assert.assertEquals(10, page.getLimit()); - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/utils/SLACalculatorTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/utils/SLACalculatorTest.java deleted file mode 100644 index 19a45232d34b31cca185cd17e1f603fa8346dc9e..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/utils/SLACalculatorTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 org.apache.skywalking.apm.collector.ui.utils; - -import org.junit.Assert; -import org.junit.Test; - -/** - * @author lican - */ -public class SLACalculatorTest { - - @Test - public void testCalculate() { - int calculate = SLACalculator.INSTANCE.calculate(20, 100); - Assert.assertEquals(80, calculate); - } -} diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/resources/log4j2.xml b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/resources/log4j2.xml deleted file mode 100644 index c9eec4f6e22bc0b68dff05dca8c6151eb68a5f72..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/resources/log4j2.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/apm-collector/apm-collector-ui/pom.xml b/apm-collector/apm-collector-ui/pom.xml deleted file mode 100644 index 9a19483b10b2357629a03ab85d831e8815137b40..0000000000000000000000000000000000000000 --- a/apm-collector/apm-collector-ui/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - apm-collector - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - apm-collector-ui - pom - - collector-ui-define - collector-ui-graphql - collector-ui-jetty-provider - - - - - org.apache.skywalking - apm-collector-core - ${project.version} - - - diff --git a/apm-collector/pom.xml b/apm-collector/pom.xml deleted file mode 100644 index 158da49fe28d71de5840a0700f2235d5342a3b1e..0000000000000000000000000000000000000000 --- a/apm-collector/pom.xml +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - apm - org.apache.skywalking - 6.0.0-alpha-SNAPSHOT - - 4.0.0 - - apm-collector - - pom - - apm-collector-instrument - apm-collector-boot - apm-collector-ui - apm-collector-core - apm-collector-component - apm-collector-cluster - apm-collector-cache - apm-collector-storage - apm-collector-naming - apm-collector-grpc-manager - apm-collector-jetty-manager - apm-collector-remote - apm-collector-configuration - apm-collector-agent - apm-collector-analysis - apm-collector-thirdparty-receiver - - - - UTF-8 - 1.7.25 - 2.9.0 - 20.0 - 2.6.2 - 1.18 - 1.7.8 - 4.3.0 - 2.8.1 - 2.9.9 - 9.4.2.v20170220 - 1.4.196 - 2.9.0 - 3.4.10 - 5.5.0 - 2.9.1 - 2.0.3 - 1.4 - - - - - org.apache.skywalking - apm-util - - - org.slf4j - slf4j-api - - - org.slf4j - log4j-over-slf4j - - - org.apache.logging.log4j - log4j-core - - - org.apache.logging.log4j - log4j-slf4j-impl - - - org.apache.logging.log4j - log4j-core - - - - - - - - - org.apache.skywalking - apm-util - ${project.version} - - - org.slf4j - slf4j-api - ${slf4j.version} - - - org.slf4j - log4j-over-slf4j - ${slf4j.version} - - - org.apache.logging.log4j - log4j-core - ${log4j.version} - - - com.graphql-java - graphql-java-tools - ${graphql-java-tools.version} - - - net.bytebuddy - byte-buddy - ${byte-buddy.version} - - - com.google.code.gson - gson - ${gson.version} - - - joda-time - joda-time - ${joda-time.version} - - - org.eclipse.jetty - jetty-server - ${jetty.version} - - - org.eclipse.jetty - jetty-servlet - ${jetty.version} - - - com.h2database - h2 - ${h2.version} - - - redis.clients - jedis - ${jedis.version} - - - org.elasticsearch.client - transport - ${elasticsearch.client.version} - - - snakeyaml - org.yaml - - - netty-common - io.netty - - - netty-transport - io.netty - - - netty-codec - io.netty - - - netty-codec-http - io.netty - - - netty-buffer - io.netty - - - netty-handler - io.netty - - - netty-resolver - io.netty - - - - - org.apache.zookeeper - zookeeper - ${zookeeper.version} - - - slf4j-api - org.slf4j - - - slf4j-log4j12 - org.slf4j - - - - - io.shardingjdbc - sharding-jdbc-core - ${shardingjdbc.version} - - - commons-dbcp - commons-dbcp - ${commons-dbcp.version} - - - com.google.guava - guava - ${guava.version} - - - com.github.ben-manes.caffeine - caffeine - ${caffeine.version} - - - org.yaml - snakeyaml - ${snakeyaml.version} - - - org.apache.logging.log4j - log4j-slf4j-impl - ${log4j.version} - - - org.apache.logging.log4j - log4j-core - - - - - io.zipkin.zipkin2 - zipkin - ${zipkin.version} - - - - diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/Const.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/Const.java index 55779f99a2f95af687871b8c63054b58f1d70cea..2ce7c97acce40f60ebc05bc3e7642b59c26a77c0 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/Const.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/Const.java @@ -24,10 +24,10 @@ package org.apache.skywalking.oap.server.core; public class Const { public static final int NONE = 0; public static final String ID_SPLIT = "_"; - public static final int NONE_APPLICATION_ID = 1; - public static final int NONE_INSTANCE_ID = 1; public static final int NONE_SERVICE_ID = 1; - public static final String NONE_SERVICE_NAME = "None"; + public static final int NONE_INSTANCE_ID = 1; + public static final int NONE_ENDPOINT_ID = 1; + public static final String NONE_ENDPOINT_NAME = "None"; public static final String USER_CODE = "User"; public static final String SEGMENT_SPAN_SPLIT = "S"; public static final String UNKNOWN = "Unknown"; diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cache/ServiceInstanceInventoryCache.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cache/ServiceInstanceInventoryCache.java index 74ec4c0e70aa242daf84df4b8f13d5934a56cf62..0f07b37c7b5aae5721d64654ef514efd03bde0f6 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cache/ServiceInstanceInventoryCache.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/cache/ServiceInstanceInventoryCache.java @@ -19,6 +19,7 @@ package org.apache.skywalking.oap.server.core.cache; import com.google.common.cache.*; +import java.util.Objects; import org.apache.skywalking.oap.server.core.*; import org.apache.skywalking.oap.server.core.register.ServiceInstanceInventory; import org.apache.skywalking.oap.server.core.storage.cache.IServiceInstanceInventoryCacheDAO; @@ -34,7 +35,7 @@ public class ServiceInstanceInventoryCache implements Service { private static final Logger logger = LoggerFactory.getLogger(ServiceInstanceInventoryCache.class); - private final Cache serviceInstanceIdCache = CacheBuilder.newBuilder().initialCapacity(100).maximumSize(5000).build(); + private final Cache serviceInstanceIdCache = CacheBuilder.newBuilder().initialCapacity(100).maximumSize(5000).build(); private final Cache serviceInstanceNameCache = CacheBuilder.newBuilder().initialCapacity(100).maximumSize(5000).build(); @@ -54,21 +55,21 @@ public class ServiceInstanceInventoryCache implements Service { return this.cacheDAO; } - public int getServiceId(int serviceInstanceId) { - int serviceId = Const.NONE; + public ServiceInstanceInventory get(int serviceInstanceId) { + ServiceInstanceInventory serviceInstanceInventory = null; try { - serviceId = serviceInstanceIdCache.get(serviceInstanceId, () -> getCacheDAO().getServiceId(serviceInstanceId)); + serviceInstanceInventory = serviceInstanceIdCache.get(serviceInstanceId, () -> getCacheDAO().get(serviceInstanceId)); } catch (Throwable e) { logger.error(e.getMessage(), e); } - if (serviceId == Const.NONE) { - serviceId = getCacheDAO().getServiceId(serviceInstanceId); - if (serviceId != Const.NONE) { - serviceInstanceIdCache.put(serviceInstanceId, serviceId); + if (Objects.isNull(serviceInstanceInventory)) { + serviceInstanceInventory = getCacheDAO().get(serviceInstanceId); + if (Objects.nonNull(serviceInstanceInventory)) { + serviceInstanceIdCache.put(serviceInstanceId, serviceInstanceInventory); } } - return serviceId; + return serviceInstanceInventory; } public int getServiceInstanceId(int serviceId, String serviceInstanceName) { diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ComponentLibraryCatalogService.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/ComponentLibraryCatalogService.java similarity index 93% rename from apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ComponentLibraryCatalogService.java rename to oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/ComponentLibraryCatalogService.java index 00438513b9fbd6be890acbe18d27ecc35b638dc7..535cf93492d0004928548c3bd4da4a857e46bbb2 100644 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ComponentLibraryCatalogService.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/ComponentLibraryCatalogService.java @@ -16,15 +16,12 @@ * */ -package org.apache.skywalking.apm.collector.configuration.service; - -import java.io.FileNotFoundException; -import java.io.Reader; -import java.util.HashMap; -import java.util.Map; -import org.apache.skywalking.apm.collector.core.util.ResourceUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +package org.apache.skywalking.oap.server.core.config; + +import java.io.*; +import java.util.*; +import org.apache.skywalking.oap.server.library.util.ResourceUtils; +import org.slf4j.*; import org.yaml.snakeyaml.Yaml; /** diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IComponentLibraryCatalogService.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/IComponentLibraryCatalogService.java similarity index 89% rename from apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IComponentLibraryCatalogService.java rename to oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/IComponentLibraryCatalogService.java index e074c9e5a024522cd3a1f2d6e1fa58677e6d268f..486be1e677b1a7e32c52ecdd842cae726f9ca7ca 100644 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IComponentLibraryCatalogService.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/IComponentLibraryCatalogService.java @@ -16,9 +16,9 @@ * */ -package org.apache.skywalking.apm.collector.configuration.service; +package org.apache.skywalking.oap.server.core.config; -import org.apache.skywalking.apm.collector.core.module.Service; +import org.apache.skywalking.oap.server.library.module.Service; /** * @author wusheng diff --git a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/NodeNotFoundException.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/InitialComponentCatalogException.java similarity index 83% rename from apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/NodeNotFoundException.java rename to oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/InitialComponentCatalogException.java index 72f1ced983ae980de6d10975d65925a5f4c4db49..3592808788a156410d876487acd2b0944f1b56f1 100644 --- a/apm-collector/apm-collector-core/src/main/java/org/apache/skywalking/apm/collector/core/graph/NodeNotFoundException.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/InitialComponentCatalogException.java @@ -16,14 +16,13 @@ * */ - -package org.apache.skywalking.apm.collector.core.graph; +package org.apache.skywalking.oap.server.core.config; /** * @author wusheng */ -public class NodeNotFoundException extends RuntimeException { - public NodeNotFoundException(String message) { +class InitialComponentCatalogException extends RuntimeException { + InitialComponentCatalogException(String message) { super(message); } } diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/mpool/MemoryPoolMinuteMetricH2TableDefine.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceInstance.java similarity index 60% rename from apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/mpool/MemoryPoolMinuteMetricH2TableDefine.java rename to oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceInstance.java index 5807c97f347ed1491c523ff6fec891ebbbb93634..c1705a5d5acef302904b61a0888ff82d169e7811 100644 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/mpool/MemoryPoolMinuteMetricH2TableDefine.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceInstance.java @@ -16,18 +16,26 @@ * */ -package org.apache.skywalking.apm.collector.storage.h2.define.mpool; +package org.apache.skywalking.oap.server.core.source; -import org.apache.skywalking.apm.collector.core.storage.TimePyramid; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.storage.table.jvm.MemoryPoolMetricTable; +import lombok.*; +import org.apache.skywalking.oap.server.core.source.annotation.SourceType; /** * @author peng-yongsheng */ -public class MemoryPoolMinuteMetricH2TableDefine extends AbstractMemoryPoolMetricH2TableDefine { - - public MemoryPoolMinuteMetricH2TableDefine() { - super(MemoryPoolMetricTable.TABLE + Const.ID_SPLIT + TimePyramid.Minute.getName()); +@SourceType +public class ServiceInstance extends Source { + @Override public Scope scope() { + return Scope.ServiceInstance; } + + @Getter @Setter private int id; + @Getter @Setter private String name; + @Getter @Setter private String serviceName; + @Getter @Setter private String endpointName; + @Getter @Setter private int latency; + @Getter @Setter private boolean status; + @Getter @Setter private int responseCode; + @Getter @Setter private RequestType type; } diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCRegistration.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceInstanceRelation.java similarity index 50% rename from apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCRegistration.java rename to oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceInstanceRelation.java index cf49deaa2a4673aca1cb5e576a737eea63af657f..7c51b8e83263015452e3a0bb00f97273f759a3f2 100644 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/AgentModuleGRPCRegistration.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceInstanceRelation.java @@ -16,26 +16,29 @@ * */ +package org.apache.skywalking.oap.server.core.source; -package org.apache.skywalking.apm.collector.agent.grpc.provider; - -import org.apache.skywalking.apm.collector.cluster.ModuleRegistration; -import org.apache.skywalking.apm.collector.core.util.Const; +import lombok.*; /** * @author peng-yongsheng */ -public class AgentModuleGRPCRegistration extends ModuleRegistration { - - private final String host; - private final int port; +public class ServiceInstanceRelation extends Source { - public AgentModuleGRPCRegistration(String host, int port) { - this.host = host; - this.port = port; + @Override public Scope scope() { + return Scope.ServiceInstanceRelation; } - @Override public Value buildValue() { - return new Value(host, port, Const.EMPTY_STRING); - } + @Getter @Setter private int sourceServiceInstanceId; + @Getter @Setter private String sourceServiceName; + @Getter @Setter private String sourceServiceInstanceName; + @Getter @Setter private int destServiceInstanceId; + @Getter @Setter private String destServiceName; + @Getter @Setter private String destServiceInstanceName; + @Getter @Setter private String endpoint; + @Getter @Setter private int latency; + @Getter @Setter private boolean status; + @Getter @Setter private int responseCode; + @Getter @Setter private RequestType type; + @Getter @Setter private DetectPoint detectPoint; } diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/define/AgentGRPCModule.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceRelation.java similarity index 51% rename from apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/define/AgentGRPCModule.java rename to oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceRelation.java index 3c519c0dabfb6a2ef1fd9a15bdae41c6656334b6..e461a7dcd4d4c053cbce78010a6acab828cb2138 100644 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/define/AgentGRPCModule.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceRelation.java @@ -16,23 +16,29 @@ * */ +package org.apache.skywalking.oap.server.core.source; -package org.apache.skywalking.apm.collector.agent.grpc.define; - -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; +import lombok.*; /** * @author peng-yongsheng */ -public class AgentGRPCModule extends ModuleDefine { - - public static final String NAME = "agent_gRPC"; +public class ServiceRelation extends Source { - @Override public String name() { - return NAME; + @Override public Scope scope() { + return Scope.ServiceRelation; } - @Override public Class[] services() { - return new Class[0]; - } + @Getter @Setter private int sourceServiceId; + @Getter @Setter private String sourceServiceName; + @Getter @Setter private String sourceServiceInstanceName; + @Getter @Setter private int destServiceId; + @Getter @Setter private String destServiceName; + @Getter @Setter private String destServiceInstanceName; + @Getter @Setter private String endpoint; + @Getter @Setter private int latency; + @Getter @Setter private boolean status; + @Getter @Setter private int responseCode; + @Getter @Setter private RequestType type; + @Getter @Setter private DetectPoint detectPoint; } diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/cache/IServiceInstanceInventoryCacheDAO.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/cache/IServiceInstanceInventoryCacheDAO.java index 60501a92b2ab19bc35462a3d623583a9ef501546..9b75afa1f5f2da94931f7d814e3637f6c624f46d 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/cache/IServiceInstanceInventoryCacheDAO.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/cache/IServiceInstanceInventoryCacheDAO.java @@ -18,6 +18,7 @@ package org.apache.skywalking.oap.server.core.storage.cache; +import org.apache.skywalking.oap.server.core.register.ServiceInstanceInventory; import org.apache.skywalking.oap.server.core.storage.DAO; /** @@ -25,7 +26,7 @@ import org.apache.skywalking.oap.server.core.storage.DAO; */ public interface IServiceInstanceInventoryCacheDAO extends DAO { - int getServiceId(int serviceInstanceId); + ServiceInstanceInventory get(int serviceInstanceId); int getServiceInstanceId(int serviceId, String serviceInstanceName); diff --git a/oap-server/server-library/library-buffer/src/main/java/org/apache/skywalking/oap/server/library/buffer/DataStreamReader.java b/oap-server/server-library/library-buffer/src/main/java/org/apache/skywalking/oap/server/library/buffer/DataStreamReader.java index f838020ff693b0b9ff9f1de4168073757178f8b7..049f8636bc631755735ea7e1cd4165ba773f3bcd 100644 --- a/oap-server/server-library/library-buffer/src/main/java/org/apache/skywalking/oap/server/library/buffer/DataStreamReader.java +++ b/oap-server/server-library/library-buffer/src/main/java/org/apache/skywalking/oap/server/library/buffer/DataStreamReader.java @@ -29,7 +29,7 @@ import org.slf4j.*; /** * @author peng-yongsheng */ -class DataStreamReader { +public class DataStreamReader { private static final Logger logger = LoggerFactory.getLogger(DataStreamReader.class); @@ -119,7 +119,7 @@ class DataStreamReader { } } - interface CallBack { + public interface CallBack { void call(MESSAGE_TYPE message); } } diff --git a/oap-server/server-receiver-plugin/pom.xml b/oap-server/server-receiver-plugin/pom.xml index 96faaa9a5ae5046db9f1b0a4e20a48bd5c1c738f..0ad99c3d73580cd0be5d6eaf7b52ea3b22143a92 100644 --- a/oap-server/server-receiver-plugin/pom.xml +++ b/oap-server/server-receiver-plugin/pom.xml @@ -59,5 +59,10 @@ library-util ${project.version} + + org.apache.skywalking + library-buffer + ${project.version} + \ No newline at end of file diff --git a/apm-collector/apm-collector-ui/collector-ui-define/src/main/java/org/apache/skywalking/apm/collector/ui/UIModule.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/module/TraceModule.java similarity index 81% rename from apm-collector/apm-collector-ui/collector-ui-define/src/main/java/org/apache/skywalking/apm/collector/ui/UIModule.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/module/TraceModule.java index fc89696c486f0f982887f3082f7285a6ba6ee201..6b0558f733defd0da5db69c18079268d8d489f29 100644 --- a/apm-collector/apm-collector-ui/collector-ui-define/src/main/java/org/apache/skywalking/apm/collector/ui/UIModule.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/module/TraceModule.java @@ -16,20 +16,17 @@ * */ +package org.apache.skywalking.oap.server.receiver.trace.module; -package org.apache.skywalking.apm.collector.ui; - -import org.apache.skywalking.apm.collector.core.module.ModuleDefine; +import org.apache.skywalking.oap.server.library.module.ModuleDefine; /** * @author peng-yongsheng */ -public class UIModule extends ModuleDefine { - - public static final String NAME = "ui"; +public class TraceModule extends ModuleDefine { @Override public String name() { - return NAME; + return "receiver-trace"; } @Override public Class[] services() { diff --git a/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/TraceModuleProvider.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/TraceModuleProvider.java new file mode 100644 index 0000000000000000000000000000000000000000..c40bdcf370604f9c6951e1d3c52868c2895be2f2 --- /dev/null +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/TraceModuleProvider.java @@ -0,0 +1,69 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 org.apache.skywalking.oap.server.receiver.trace.provider; + +import java.io.IOException; +import org.apache.skywalking.oap.server.core.CoreModule; +import org.apache.skywalking.oap.server.core.server.GRPCHandlerRegister; +import org.apache.skywalking.oap.server.library.module.*; +import org.apache.skywalking.oap.server.receiver.trace.module.TraceModule; +import org.apache.skywalking.oap.server.receiver.trace.provider.handler.TraceSegmentServiceHandler; +import org.apache.skywalking.oap.server.receiver.trace.provider.parser.SegmentParserListenerManager; +import org.apache.skywalking.oap.server.receiver.trace.provider.parser.listener.endpoint.MultiScopesSpanListener; + +/** + * @author peng-yongsheng + */ +public class TraceModuleProvider extends ModuleProvider { + + @Override public String name() { + return "default"; + } + + @Override public Class module() { + return TraceModule.class; + } + + @Override public ModuleConfig createConfigBeanIfAbsent() { + return null; + } + + @Override public void prepare() { + } + + @Override public void start() throws ModuleStartException { + SegmentParserListenerManager listenerManager = new SegmentParserListenerManager(); + listenerManager.add(new MultiScopesSpanListener.Factory()); + + GRPCHandlerRegister grpcHandlerRegister = getManager().find(CoreModule.NAME).getService(GRPCHandlerRegister.class); + try { + grpcHandlerRegister.addHandler(new TraceSegmentServiceHandler(getManager(), listenerManager)); + } catch (IOException e) { + throw new ModuleStartException(e.getMessage(), e); + } + } + + @Override public void notifyAfterCompleted() { + + } + + @Override public String[] requiredModules() { + return new String[] {CoreModule.NAME}; + } +} diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/SegmentCounter.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/handler/SegmentCounter.java similarity index 93% rename from apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/SegmentCounter.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/handler/SegmentCounter.java index db933afc60f42945ea5c27e985e92b7a3869b792..1c75d9d63a6c74a0844bfc6200b93db275fda036 100644 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/SegmentCounter.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/handler/SegmentCounter.java @@ -16,7 +16,7 @@ * */ -package org.apache.skywalking.apm.collector.agent.grpc.provider.handler; +package org.apache.skywalking.oap.server.receiver.trace.provider.handler; import java.util.concurrent.atomic.AtomicLong; diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/TraceSegmentServiceHandler.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/handler/TraceSegmentServiceHandler.java similarity index 77% rename from apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/TraceSegmentServiceHandler.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/handler/TraceSegmentServiceHandler.java index 5c5c0a99a00d3e2f333009eef090b0ed20cc64c4..6b153e403df691003b7f229f3fcd5f6f18d361b8 100644 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/TraceSegmentServiceHandler.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/handler/TraceSegmentServiceHandler.java @@ -16,14 +16,14 @@ * */ -package org.apache.skywalking.apm.collector.agent.grpc.provider.handler; +package org.apache.skywalking.oap.server.receiver.trace.provider.handler; import io.grpc.stub.StreamObserver; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.AnalysisSegmentParserModule; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.service.ISegmentParseService; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.server.grpc.GRPCHandler; +import java.io.IOException; import org.apache.skywalking.apm.network.language.agent.*; +import org.apache.skywalking.oap.server.library.module.ModuleManager; +import org.apache.skywalking.oap.server.library.server.grpc.GRPCHandler; +import org.apache.skywalking.oap.server.receiver.trace.provider.parser.*; import org.slf4j.*; /** @@ -33,11 +33,11 @@ public class TraceSegmentServiceHandler extends TraceSegmentServiceGrpc.TraceSeg private static final Logger logger = LoggerFactory.getLogger(TraceSegmentServiceHandler.class); - private final ISegmentParseService segmentParseService; + private final SegmentParse segmentParse; private final Boolean debug; - public TraceSegmentServiceHandler(ModuleManager moduleManager) { - this.segmentParseService = moduleManager.find(AnalysisSegmentParserModule.NAME).getService(ISegmentParseService.class); + public TraceSegmentServiceHandler(ModuleManager moduleManager, SegmentParserListenerManager listenerManager) throws IOException { + this.segmentParse = new SegmentParse(moduleManager, listenerManager); this.debug = System.getProperty("debug") != null; } @@ -48,7 +48,7 @@ public class TraceSegmentServiceHandler extends TraceSegmentServiceGrpc.TraceSeg logger.debug("receive segment"); } - segmentParseService.parse(segment, ISegmentParseService.Source.Agent); + segmentParse.parse(segment, SegmentParse.Source.Agent); if (debug) { long count = SegmentCounter.INSTANCE.incrementAndGet(); diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/SegmentParse.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/SegmentParse.java similarity index 77% rename from apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/SegmentParse.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/SegmentParse.java index 2b7fe7cd89c810804458eaf3fddda0879f454485..fc0d5a7b26290c70be19a0138b803e09fe92dea4 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/SegmentParse.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/SegmentParse.java @@ -16,27 +16,24 @@ * */ -package org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser; +package org.apache.skywalking.oap.server.receiver.trace.provider.parser; import com.google.protobuf.InvalidProtocolBufferException; +import java.io.IOException; import java.util.*; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.*; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.graph.GraphIdDefine; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.*; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.service.ISegmentParseService; -import org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser.standardization.*; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.graph.*; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.TimeBucketUtils; -import org.apache.skywalking.apm.collector.storage.table.segment.Segment; import org.apache.skywalking.apm.network.language.agent.*; +import org.apache.skywalking.oap.server.library.buffer.DataStreamReader; +import org.apache.skywalking.oap.server.library.module.ModuleManager; +import org.apache.skywalking.oap.server.library.util.TimeBucketUtils; +import org.apache.skywalking.oap.server.receiver.trace.provider.parser.decorator.*; +import org.apache.skywalking.oap.server.receiver.trace.provider.parser.listener.*; +import org.apache.skywalking.oap.server.receiver.trace.provider.parser.standardization.*; import org.slf4j.*; /** * @author peng-yongsheng */ -public class SegmentParse { +public class SegmentParse implements DataStreamReader.CallBack { private static final Logger logger = LoggerFactory.getLogger(SegmentParse.class); @@ -44,18 +41,23 @@ public class SegmentParse { private final List spanListeners; private final SegmentParserListenerManager listenerManager; private final SegmentCoreInfo segmentCoreInfo; + private final SegmentStandardizationWorker standardizationWorker; - public SegmentParse(ModuleManager moduleManager, SegmentParserListenerManager listenerManager) { + public SegmentParse(ModuleManager moduleManager, SegmentParserListenerManager listenerManager) throws IOException { this.moduleManager = moduleManager; this.listenerManager = listenerManager; this.spanListeners = new LinkedList<>(); this.segmentCoreInfo = new SegmentCoreInfo(); this.segmentCoreInfo.setStartTime(Long.MAX_VALUE); this.segmentCoreInfo.setEndTime(Long.MIN_VALUE); + this.standardizationWorker = new SegmentStandardizationWorker(moduleManager, listenerManager); } - @GraphComputingMetric(name = "/segment/parse") - public boolean parse(UpstreamSegment segment, ISegmentParseService.Source source) { + @Override public void call(UpstreamSegment segment) { + parse(segment, Source.Buffer); + } + + public boolean parse(UpstreamSegment segment, Source source) { createSpanListeners(); try { @@ -69,7 +71,7 @@ public class SegmentParse { logger.debug("This segment id exchange not success, write to buffer file, id: {}", segmentCoreInfo.getSegmentId()); } - if (source.equals(ISegmentParseService.Source.Agent)) { + if (source.equals(Source.Agent)) { writeToBufferFile(segmentCoreInfo.getSegmentId(), segment); } return false; @@ -88,12 +90,10 @@ public class SegmentParse { } } - @GraphComputingMetric(name = "/segment/parse/parseBinarySegment") private TraceSegmentObject parseBinarySegment(UpstreamSegment segment) throws InvalidProtocolBufferException { return TraceSegmentObject.parseFrom(segment.getSegment()); } - @GraphComputingMetric(name = "/segment/parse/preBuild") private boolean preBuild(List traceIds, SegmentDecorator segmentDecorator) { StringBuilder segmentIdBuilder = new StringBuilder(); @@ -160,17 +160,13 @@ public class SegmentParse { return true; } - @GraphComputingMetric(name = "/segment/parse/buildSegment") private void buildSegment(String id, byte[] dataBinary) { - Segment segment = new Segment(); - segment.setId(id); - segment.setDataBinary(dataBinary); - segment.setTimeBucket(segmentCoreInfo.getMinuteTimeBucket()); - Graph graph = GraphManager.INSTANCE.findGraph(GraphIdDefine.SEGMENT_PERSISTENCE_GRAPH_ID, Segment.class); - graph.start(segment); +// Segment segment = new Segment(); +// segment.setId(id); +// segment.setDataBinary(dataBinary); +// segment.setTimeBucket(segmentCoreInfo.getMinuteTimeBucket()); } - @GraphComputingMetric(name = "/segment/parse/bufferFile/write") private void writeToBufferFile(String id, UpstreamSegment upstreamSegment) { if (logger.isDebugEnabled()) { logger.debug("push to segment buffer write worker, id: {}", id); @@ -178,16 +174,14 @@ public class SegmentParse { SegmentStandardization standardization = new SegmentStandardization(id); standardization.setUpstreamSegment(upstreamSegment); - Graph graph = GraphManager.INSTANCE.findGraph(GraphIdDefine.SEGMENT_STANDARDIZATION_GRAPH_ID, SegmentStandardization.class); - graph.start(standardization); + + standardizationWorker.in(standardization); } - @GraphComputingMetric(name = "/segment/parse/notifyListenerToBuild") private void notifyListenerToBuild() { spanListeners.forEach(SpanListener::build); } - @GraphComputingMetric(name = "/segment/parse/notifyExitListener") private void notifyExitListener(SpanDecorator spanDecorator) { spanListeners.forEach(listener -> { if (listener.containsPoint(SpanListener.Point.Exit)) { @@ -196,7 +190,6 @@ public class SegmentParse { }); } - @GraphComputingMetric(name = "/segment/parse/notifyEntryListener") private void notifyEntryListener(SpanDecorator spanDecorator) { spanListeners.forEach(listener -> { if (listener.containsPoint(SpanListener.Point.Entry)) { @@ -205,7 +198,6 @@ public class SegmentParse { }); } - @GraphComputingMetric(name = "/segment/parse/notifyLocalListener") private void notifyLocalListener(SpanDecorator spanDecorator) { spanListeners.forEach(listener -> { if (listener.containsPoint(SpanListener.Point.Local)) { @@ -214,7 +206,6 @@ public class SegmentParse { }); } - @GraphComputingMetric(name = "/segment/parse/notifyFirstListener") private void notifyFirstListener(SpanDecorator spanDecorator) { spanListeners.forEach(listener -> { if (listener.containsPoint(SpanListener.Point.First)) { @@ -223,7 +214,6 @@ public class SegmentParse { }); } - @GraphComputingMetric(name = "/segment/parse/notifyGlobalsListener") private void notifyGlobalsListener(UniqueId uniqueId) { spanListeners.forEach(listener -> { if (listener.containsPoint(SpanListener.Point.GlobalTraceIds)) { @@ -232,8 +222,11 @@ public class SegmentParse { }); } - @GraphComputingMetric(name = "/segment/parse/createSpanListeners") private void createSpanListeners() { listenerManager.getSpanListenerFactories().forEach(spanListenerFactory -> spanListeners.add(spanListenerFactory.create(moduleManager))); } + + public enum Source { + Agent, Buffer + } } diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/SegmentParserListenerManager.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/SegmentParserListenerManager.java similarity index 84% rename from apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/SegmentParserListenerManager.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/SegmentParserListenerManager.java index 20f738be846f8c20793d0ac5f5421de9258c229f..a2dd3036faa2dc5a316600fc9a89e04fb496e8d3 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/SegmentParserListenerManager.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/SegmentParserListenerManager.java @@ -16,11 +16,10 @@ * */ -package org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser; +package org.apache.skywalking.oap.server.receiver.trace.provider.parser; -import java.util.LinkedList; -import java.util.List; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener.SpanListenerFactory; +import java.util.*; +import org.apache.skywalking.oap.server.receiver.trace.provider.parser.listener.SpanListenerFactory; /** * @author peng-yongsheng diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/decorator/ReferenceDecorator.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/decorator/ReferenceDecorator.java similarity index 94% rename from apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/decorator/ReferenceDecorator.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/decorator/ReferenceDecorator.java index 9417099e59d234c0c92684b5f50e8d794150ecca..964d6e8ecead9bcd53f8f0e88c94c33dce0147e4 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/decorator/ReferenceDecorator.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/decorator/ReferenceDecorator.java @@ -16,12 +16,9 @@ * */ +package org.apache.skywalking.oap.server.receiver.trace.provider.parser.decorator; -package org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator; - -import org.apache.skywalking.apm.network.language.agent.RefType; -import org.apache.skywalking.apm.network.language.agent.TraceSegmentReference; -import org.apache.skywalking.apm.network.language.agent.UniqueId; +import org.apache.skywalking.apm.network.language.agent.*; /** * @author peng-yongsheng diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/decorator/SegmentCoreInfo.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/decorator/SegmentCoreInfo.java similarity index 96% rename from apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/decorator/SegmentCoreInfo.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/decorator/SegmentCoreInfo.java index 48607c37a757c53802e9a7e7c609b5e1dd64e9a8..78817ea3a76a6fb4e4b519b2de079d517fe4f678 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/decorator/SegmentCoreInfo.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/decorator/SegmentCoreInfo.java @@ -16,7 +16,7 @@ * */ -package org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator; +package org.apache.skywalking.oap.server.receiver.trace.provider.parser.decorator; /** * @author peng-yongsheng diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/decorator/SegmentDecorator.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/decorator/SegmentDecorator.java similarity index 91% rename from apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/decorator/SegmentDecorator.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/decorator/SegmentDecorator.java index cddf0cd926e56007b9445a1bcff7a1cd6ae7160b..29232bdfd1b65cbcbc0a28920c069637586abb0d 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/decorator/SegmentDecorator.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/decorator/SegmentDecorator.java @@ -16,10 +16,9 @@ * */ -package org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator; +package org.apache.skywalking.oap.server.receiver.trace.provider.parser.decorator; -import org.apache.skywalking.apm.network.language.agent.TraceSegmentObject; -import org.apache.skywalking.apm.network.language.agent.UniqueId; +import org.apache.skywalking.apm.network.language.agent.*; import static java.util.Objects.isNull; diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/decorator/SpanDecorator.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/decorator/SpanDecorator.java similarity index 98% rename from apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/decorator/SpanDecorator.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/decorator/SpanDecorator.java index 5ad35330f08b73d1947b35afbde4b71dc00c4ecd..bb00495e28797ce269a0c513883d091464426cbe 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/decorator/SpanDecorator.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/decorator/SpanDecorator.java @@ -16,7 +16,7 @@ * */ -package org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator; +package org.apache.skywalking.oap.server.receiver.trace.provider.parser.decorator; import org.apache.skywalking.apm.network.language.agent.*; diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/decorator/StandardBuilder.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/decorator/StandardBuilder.java similarity index 91% rename from apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/decorator/StandardBuilder.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/decorator/StandardBuilder.java index 11ccda5d159ba660af8bc5f723511e062978c81e..fbe9006f5e5d24933d1f246c3a3a25560f1e1e80 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/decorator/StandardBuilder.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/decorator/StandardBuilder.java @@ -16,8 +16,7 @@ * */ - -package org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator; +package org.apache.skywalking.oap.server.receiver.trace.provider.parser.decorator; /** * @author peng-yongsheng diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/EntrySpanListener.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/EntrySpanListener.java similarity index 85% rename from apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/EntrySpanListener.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/EntrySpanListener.java index 12b29f13055b02edf8074583958bfb90e04c3c0d..1c9e2f22a612bbcfe8e677474cf85ea3f0cdca43 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/EntrySpanListener.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/EntrySpanListener.java @@ -16,9 +16,9 @@ * */ -package org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener; +package org.apache.skywalking.oap.server.receiver.trace.provider.parser.listener; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.*; +import org.apache.skywalking.oap.server.receiver.trace.provider.parser.decorator.*; /** * @author peng-yongsheng diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/ExitSpanListener.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/ExitSpanListener.java similarity index 85% rename from apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/ExitSpanListener.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/ExitSpanListener.java index 271af729417ce143cca0c47cf99d5ad3a870a5e1..3c960487748abba13fd3726861e9ed8ed576a9db 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/ExitSpanListener.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/ExitSpanListener.java @@ -16,9 +16,9 @@ * */ -package org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener; +package org.apache.skywalking.oap.server.receiver.trace.provider.parser.listener; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.*; +import org.apache.skywalking.oap.server.receiver.trace.provider.parser.decorator.*; /** * @author peng-yongsheng diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/FirstSpanListener.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/FirstSpanListener.java similarity index 85% rename from apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/FirstSpanListener.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/FirstSpanListener.java index 8e333331ce0bcaf6e7986ff6fbaf900ec55590b2..1e6026dead3a17514a969237e06d17011fcac9e9 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/FirstSpanListener.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/FirstSpanListener.java @@ -16,9 +16,9 @@ * */ -package org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener; +package org.apache.skywalking.oap.server.receiver.trace.provider.parser.listener; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.*; +import org.apache.skywalking.oap.server.receiver.trace.provider.parser.decorator.*; /** * @author peng-yongsheng diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/GlobalTraceIdsListener.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/GlobalTraceIdsListener.java similarity index 85% rename from apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/GlobalTraceIdsListener.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/GlobalTraceIdsListener.java index 85e6e244939b3b98babf7e652a2e3b86f66e7a65..948ba2a7320cb872fb36342bce74598a7b74c4a9 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/GlobalTraceIdsListener.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/GlobalTraceIdsListener.java @@ -16,10 +16,10 @@ * */ -package org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener; +package org.apache.skywalking.oap.server.receiver.trace.provider.parser.listener; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.SegmentCoreInfo; import org.apache.skywalking.apm.network.language.agent.UniqueId; +import org.apache.skywalking.oap.server.receiver.trace.provider.parser.decorator.SegmentCoreInfo; /** * @author peng-yongsheng diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/LocalSpanListener.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/LocalSpanListener.java similarity index 85% rename from apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/LocalSpanListener.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/LocalSpanListener.java index 6a4e8bc909b9f2265f572adfc580bd4f0db5d0df..f4bf171fa8697192f4aabd0b88698b974c6f53bb 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/LocalSpanListener.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/LocalSpanListener.java @@ -16,9 +16,9 @@ * */ -package org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener; +package org.apache.skywalking.oap.server.receiver.trace.provider.parser.listener; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.*; +import org.apache.skywalking.oap.server.receiver.trace.provider.parser.decorator.*; /** * @author peng-yongsheng diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/SpanListener.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/SpanListener.java similarity index 92% rename from apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/SpanListener.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/SpanListener.java index 45bc9fad7e682c0c70cfee85711cdae4340cb8da..ce7008125976896722c6bba98915b72a6a3eb5b1 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/SpanListener.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/SpanListener.java @@ -16,7 +16,7 @@ * */ -package org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener; +package org.apache.skywalking.oap.server.receiver.trace.provider.parser.listener; /** * @author peng-yongsheng diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/SpanListenerFactory.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/SpanListenerFactory.java similarity index 86% rename from apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/SpanListenerFactory.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/SpanListenerFactory.java index 76386d96455ee1cfe62784e14caa68ae9ad0e9b5..fd8d09f213bff23e46fb431618e0cd43bd73b9d7 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/define/listener/SpanListenerFactory.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/SpanListenerFactory.java @@ -16,9 +16,9 @@ * */ -package org.apache.skywalking.apm.collector.analysis.segment.parser.define.listener; +package org.apache.skywalking.oap.server.receiver.trace.provider.parser.listener; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; +import org.apache.skywalking.oap.server.library.module.ModuleManager; /** * @author peng-yongsheng diff --git a/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/endpoint/MultiScopesSpanListener.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/endpoint/MultiScopesSpanListener.java new file mode 100644 index 0000000000000000000000000000000000000000..290390f84eb1a2efbd76b8d02d5b4a72357d9937 --- /dev/null +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/endpoint/MultiScopesSpanListener.java @@ -0,0 +1,188 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 org.apache.skywalking.oap.server.receiver.trace.provider.parser.listener.endpoint; + +import java.util.*; +import org.apache.skywalking.apm.network.language.agent.SpanLayer; +import org.apache.skywalking.oap.server.core.*; +import org.apache.skywalking.oap.server.core.cache.*; +import org.apache.skywalking.oap.server.core.source.*; +import org.apache.skywalking.oap.server.library.module.ModuleManager; +import org.apache.skywalking.oap.server.receiver.trace.provider.parser.decorator.*; +import org.apache.skywalking.oap.server.receiver.trace.provider.parser.listener.*; +import org.slf4j.*; + +import static java.util.Objects.nonNull; + +/** + * @author peng-yongsheng + */ +public class MultiScopesSpanListener implements EntrySpanListener, ExitSpanListener { + + private static final Logger logger = LoggerFactory.getLogger(MultiScopesSpanListener.class); + + private final SourceReceiver sourceReceiver; + private final ServiceInstanceInventoryCache instanceInventoryCache; + private final ServiceInventoryCache serviceInventoryCache; + private final EndpointInventoryCache endpointInventoryCache; + + private final List entrySourceBuilders; + private final List exitSourceBuilders; + private SpanDecorator entrySpanDecorator; + private long minuteTimeBucket; + + private MultiScopesSpanListener(ModuleManager moduleManager) { + this.sourceReceiver = moduleManager.find(CoreModule.NAME).getService(SourceReceiver.class); + this.entrySourceBuilders = new LinkedList<>(); + this.exitSourceBuilders = new LinkedList<>(); + this.instanceInventoryCache = moduleManager.find(CoreModule.NAME).getService(ServiceInstanceInventoryCache.class); + this.serviceInventoryCache = moduleManager.find(CoreModule.NAME).getService(ServiceInventoryCache.class); + this.endpointInventoryCache = moduleManager.find(CoreModule.NAME).getService(EndpointInventoryCache.class); + } + + @Override public boolean containsPoint(Point point) { + return Point.Entry.equals(point) || Point.Exit.equals(point); + } + + @Override + public void parseEntry(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreInfo) { + this.minuteTimeBucket = segmentCoreInfo.getMinuteTimeBucket(); + + if (spanDecorator.getRefsCount() > 0) { + for (int i = 0; i < spanDecorator.getRefsCount(); i++) { + ReferenceDecorator reference = spanDecorator.getRefs(i); + SourceBuilder sourceBuilder = new SourceBuilder(); + sourceBuilder.setSourceEndpointId(reference.getParentServiceId()); + + if (spanDecorator.getSpanLayer().equals(SpanLayer.MQ)) { + int serviceIdByPeerId = serviceInventoryCache.getServiceId(reference.getNetworkAddressId()); + int instanceIdByPeerId = instanceInventoryCache.getServiceInstanceId(serviceIdByPeerId, reference.getNetworkAddressId()); + sourceBuilder.setSourceServiceInstanceId(instanceIdByPeerId); + sourceBuilder.setSourceServiceId(serviceIdByPeerId); + } else { + sourceBuilder.setSourceServiceInstanceId(reference.getParentApplicationInstanceId()); + sourceBuilder.setSourceServiceId(instanceInventoryCache.get(reference.getParentApplicationInstanceId()).getServiceId()); + } + sourceBuilder.setDestEndpointId(spanDecorator.getOperationNameId()); + sourceBuilder.setDestServiceInstanceId(segmentCoreInfo.getApplicationInstanceId()); + sourceBuilder.setDestServiceId(segmentCoreInfo.getApplicationId()); + sourceBuilder.setDetectPoint(DetectPoint.SERVER); + setPublicAttrs(sourceBuilder, spanDecorator); + entrySourceBuilders.add(sourceBuilder); + } + } else { + SourceBuilder sourceBuilder = new SourceBuilder(); + sourceBuilder.setSourceEndpointId(Const.NONE_ENDPOINT_ID); + sourceBuilder.setSourceServiceInstanceId(Const.NONE_INSTANCE_ID); + sourceBuilder.setSourceServiceId(Const.NONE_SERVICE_ID); + sourceBuilder.setDestEndpointId(spanDecorator.getOperationNameId()); + sourceBuilder.setDestServiceInstanceId(segmentCoreInfo.getApplicationInstanceId()); + sourceBuilder.setDestServiceId(segmentCoreInfo.getApplicationId()); + sourceBuilder.setDetectPoint(DetectPoint.SERVER); + + setPublicAttrs(sourceBuilder, spanDecorator); + entrySourceBuilders.add(sourceBuilder); + } + this.entrySpanDecorator = spanDecorator; + } + + @Override public void parseExit(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreInfo) { + if (this.minuteTimeBucket == 0) { + this.minuteTimeBucket = segmentCoreInfo.getMinuteTimeBucket(); + } + + SourceBuilder sourceBuilder = new SourceBuilder(); + + int peerId = spanDecorator.getPeerId(); + int destServiceId = serviceInventoryCache.getServiceId(peerId); + int destInstanceId = instanceInventoryCache.getServiceInstanceId(destServiceId, peerId); + + sourceBuilder.setSourceEndpointId(Const.NONE_ENDPOINT_ID); + sourceBuilder.setSourceServiceInstanceId(segmentCoreInfo.getApplicationInstanceId()); + sourceBuilder.setSourceServiceId(segmentCoreInfo.getApplicationId()); + sourceBuilder.setDestEndpointId(spanDecorator.getOperationNameId()); + sourceBuilder.setDestServiceInstanceId(destInstanceId); + sourceBuilder.setDestServiceId(destServiceId); + sourceBuilder.setDetectPoint(DetectPoint.CLIENT); + setPublicAttrs(sourceBuilder, spanDecorator); + exitSourceBuilders.add(sourceBuilder); + } + + private void setPublicAttrs(SourceBuilder sourceBuilder, SpanDecorator spanDecorator) { + long latency = spanDecorator.getEndTime() - spanDecorator.getStartTime(); + sourceBuilder.setLatency((int)latency); + sourceBuilder.setResponseCode(Const.NONE); + sourceBuilder.setStatus(spanDecorator.getIsError()); + + switch (spanDecorator.getSpanLayer()) { + case Http: + sourceBuilder.setType(RequestType.HTTP); + break; + case Database: + sourceBuilder.setType(RequestType.DATABASE); + break; + default: + sourceBuilder.setType(RequestType.RPC); + break; + } + + sourceBuilder.setSourceServiceName(serviceInventoryCache.get(sourceBuilder.getSourceServiceId()).getName()); + sourceBuilder.setSourceServiceInstanceName(instanceInventoryCache.get(sourceBuilder.getSourceServiceInstanceId()).getName()); + sourceBuilder.setSourceEndpointName(endpointInventoryCache.get(sourceBuilder.getSourceEndpointId()).getName()); + sourceBuilder.setDestServiceName(serviceInventoryCache.get(sourceBuilder.getDestServiceId()).getName()); + sourceBuilder.setDestServiceInstanceName(instanceInventoryCache.get(sourceBuilder.getDestServiceInstanceId()).getName()); + sourceBuilder.setDestEndpointName(endpointInventoryCache.get(sourceBuilder.getDestEndpointId()).getName()); + } + + @Override public void build() { + entrySourceBuilders.forEach(entrySourceBuilder -> { + entrySourceBuilder.setTimeBucket(minuteTimeBucket); + sourceReceiver.receive(entrySourceBuilder.toService()); + sourceReceiver.receive(entrySourceBuilder.toServiceInstance()); + sourceReceiver.receive(entrySourceBuilder.toEndpoint()); + sourceReceiver.receive(entrySourceBuilder.toServiceRelation()); + sourceReceiver.receive(entrySourceBuilder.toServiceInstanceRelation()); + sourceReceiver.receive(entrySourceBuilder.toEndpointRelation()); + }); + + exitSourceBuilders.forEach(exitSourceBuilder -> { + if (nonNull(entrySpanDecorator)) { + exitSourceBuilder.setSourceEndpointId(entrySpanDecorator.getOperationNameId()); + } else { + exitSourceBuilder.setSourceEndpointId(Const.NONE_ENDPOINT_ID); + } + exitSourceBuilder.setSourceEndpointName(endpointInventoryCache.get(exitSourceBuilder.getSourceEndpointId()).getName()); + + exitSourceBuilder.setTimeBucket(minuteTimeBucket); + sourceReceiver.receive(exitSourceBuilder.toService()); + sourceReceiver.receive(exitSourceBuilder.toServiceInstance()); + sourceReceiver.receive(exitSourceBuilder.toEndpoint()); + sourceReceiver.receive(exitSourceBuilder.toServiceRelation()); + sourceReceiver.receive(exitSourceBuilder.toServiceInstanceRelation()); + sourceReceiver.receive(exitSourceBuilder.toEndpointRelation()); + }); + } + + public static class Factory implements SpanListenerFactory { + + @Override public SpanListener create(ModuleManager moduleManager) { + return new MultiScopesSpanListener(moduleManager); + } + } +} diff --git a/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/endpoint/SourceBuilder.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/endpoint/SourceBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..c138c5e16b2f34aca7903a0427b5491b0f2773df --- /dev/null +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/endpoint/SourceBuilder.java @@ -0,0 +1,142 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 org.apache.skywalking.oap.server.receiver.trace.provider.parser.listener.endpoint; + +import lombok.*; +import org.apache.skywalking.oap.server.core.source.*; + +/** + * @author peng-yongsheng + */ +class SourceBuilder { + + @Getter @Setter private int sourceServiceId; + @Getter @Setter private String sourceServiceName; + @Getter @Setter private int sourceServiceInstanceId; + @Getter @Setter private String sourceServiceInstanceName; + @Getter @Setter private int sourceEndpointId; + @Getter @Setter private String sourceEndpointName; + @Getter @Setter private int destServiceId; + @Getter @Setter private String destServiceName; + @Getter @Setter private int destServiceInstanceId; + @Getter @Setter private String destServiceInstanceName; + @Getter @Setter private int destEndpointId; + @Getter @Setter private String destEndpointName; + @Getter @Setter private int latency; + @Getter @Setter private boolean status; + @Getter @Setter private int responseCode; + @Getter @Setter private RequestType type; + @Getter @Setter private DetectPoint detectPoint; + @Getter @Setter private long timeBucket; + + Service toService() { + Service service = new Service(); + service.setId(destServiceId); + service.setName(destServiceName); + service.setServiceInstanceName(destServiceInstanceName); + service.setEndpointName(destEndpointName); + service.setLatency(latency); + service.setStatus(status); + service.setResponseCode(responseCode); + service.setType(type); + service.setTimeBucket(timeBucket); + return service; + } + + ServiceRelation toServiceRelation() { + ServiceRelation serviceRelation = new ServiceRelation(); + serviceRelation.setSourceServiceId(sourceServiceId); + serviceRelation.setSourceServiceName(sourceServiceName); + serviceRelation.setSourceServiceInstanceName(sourceServiceInstanceName); + serviceRelation.setDestServiceId(destServiceId); + serviceRelation.setDestServiceName(destServiceName); + serviceRelation.setDestServiceInstanceName(destServiceInstanceName); + serviceRelation.setEndpoint(destEndpointName); + serviceRelation.setLatency(latency); + serviceRelation.setStatus(status); + serviceRelation.setResponseCode(responseCode); + serviceRelation.setType(type); + serviceRelation.setDetectPoint(detectPoint); + serviceRelation.setTimeBucket(timeBucket); + return serviceRelation; + } + + ServiceInstance toServiceInstance() { + ServiceInstance serviceInstance = new ServiceInstance(); + serviceInstance.setId(destServiceInstanceId); + serviceInstance.setName(destServiceInstanceName); + serviceInstance.setServiceName(destServiceName); + serviceInstance.setEndpointName(destEndpointName); + serviceInstance.setLatency(latency); + serviceInstance.setStatus(status); + serviceInstance.setResponseCode(responseCode); + serviceInstance.setType(type); + serviceInstance.setTimeBucket(timeBucket); + return serviceInstance; + } + + ServiceInstanceRelation toServiceInstanceRelation() { + ServiceInstanceRelation serviceInstanceRelation = new ServiceInstanceRelation(); + serviceInstanceRelation.setSourceServiceInstanceId(sourceServiceInstanceId); + serviceInstanceRelation.setSourceServiceName(sourceServiceName); + serviceInstanceRelation.setSourceServiceInstanceName(sourceServiceInstanceName); + serviceInstanceRelation.setDestServiceInstanceId(destServiceInstanceId); + serviceInstanceRelation.setDestServiceName(destServiceName); + serviceInstanceRelation.setDestServiceInstanceName(destServiceInstanceName); + serviceInstanceRelation.setEndpoint(destEndpointName); + serviceInstanceRelation.setLatency(latency); + serviceInstanceRelation.setStatus(status); + serviceInstanceRelation.setResponseCode(responseCode); + serviceInstanceRelation.setType(type); + serviceInstanceRelation.setDetectPoint(detectPoint); + serviceInstanceRelation.setTimeBucket(timeBucket); + return serviceInstanceRelation; + } + + Endpoint toEndpoint() { + Endpoint endpoint = new Endpoint(); + endpoint.setId(destEndpointId); + endpoint.setName(destEndpointName); + endpoint.setServiceId(destServiceId); + endpoint.setServiceName(destServiceName); + endpoint.setServiceInstanceId(destServiceInstanceId); + endpoint.setServiceInstanceName(destServiceInstanceName); + endpoint.setLatency(latency); + endpoint.setStatus(status); + endpoint.setResponseCode(responseCode); + endpoint.setType(type); + endpoint.setTimeBucket(timeBucket); + return endpoint; + } + + EndpointRelation toEndpointRelation() { + EndpointRelation endpointRelation = new EndpointRelation(); + endpointRelation.setEndpointId(sourceEndpointId); + endpointRelation.setEndpoint(sourceEndpointName); + endpointRelation.setChildEndpointId(destEndpointId); + endpointRelation.setChildEndpoint(destEndpointName); + endpointRelation.setRpcLatency(latency); + endpointRelation.setStatus(status); + endpointRelation.setResponseCode(responseCode); + endpointRelation.setType(type); + endpointRelation.setDetectPoint(detectPoint); + endpointRelation.setTimeBucket(timeBucket); + return endpointRelation; + } +} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/IdExchanger.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/standardization/IdExchanger.java similarity index 77% rename from apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/IdExchanger.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/standardization/IdExchanger.java index 07e50d4230577a021e4c9d20236b6b4135ad8853..0505983bfaa050c9052e30ebfec8005f8d2ccc7e 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/IdExchanger.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/standardization/IdExchanger.java @@ -16,13 +16,13 @@ * */ -package org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser.standardization; +package org.apache.skywalking.oap.server.receiver.trace.provider.parser.standardization; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.StandardBuilder; +import org.apache.skywalking.oap.server.receiver.trace.provider.parser.decorator.StandardBuilder; /** * @author peng-yongsheng */ public interface IdExchanger { - boolean exchange(T standardBuilder, int applicationId); + boolean exchange(T standardBuilder, int serviceId); } diff --git a/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/standardization/ReferenceIdExchanger.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/standardization/ReferenceIdExchanger.java new file mode 100644 index 0000000000000000000000000000000000000000..5cfd58f9840586ce858730cb668b821d772b9bb2 --- /dev/null +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/standardization/ReferenceIdExchanger.java @@ -0,0 +1,105 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 org.apache.skywalking.oap.server.receiver.trace.provider.parser.standardization; + +import org.apache.skywalking.oap.server.core.*; +import org.apache.skywalking.oap.server.core.cache.ServiceInstanceInventoryCache; +import org.apache.skywalking.oap.server.core.register.service.*; +import org.apache.skywalking.oap.server.library.module.ModuleManager; +import org.apache.skywalking.oap.server.library.util.StringUtils; +import org.apache.skywalking.oap.server.receiver.trace.provider.parser.decorator.ReferenceDecorator; +import org.slf4j.*; + +/** + * @author peng-yongsheng + */ +public class ReferenceIdExchanger implements IdExchanger { + + private static final Logger logger = LoggerFactory.getLogger(ReferenceIdExchanger.class); + + private static ReferenceIdExchanger EXCHANGER; + private final IEndpointInventoryRegister endpointInventoryRegister; + private final ServiceInstanceInventoryCache serviceInstanceInventoryCache; + private final INetworkAddressInventoryRegister networkAddressInventoryRegister; + + public static ReferenceIdExchanger getInstance(ModuleManager moduleManager) { + if (EXCHANGER == null) { + EXCHANGER = new ReferenceIdExchanger(moduleManager); + } + return EXCHANGER; + } + + private ReferenceIdExchanger(ModuleManager moduleManager) { + this.endpointInventoryRegister = moduleManager.find(CoreModule.NAME).getService(IEndpointInventoryRegister.class); + this.networkAddressInventoryRegister = moduleManager.find(CoreModule.NAME).getService(INetworkAddressInventoryRegister.class); + this.serviceInstanceInventoryCache = moduleManager.find(CoreModule.NAME).getService(ServiceInstanceInventoryCache.class); + } + + @Override public boolean exchange(ReferenceDecorator standardBuilder, int serviceId) { + if (standardBuilder.getEntryServiceId() == 0) { + String entryEndpointName = StringUtils.isNotEmpty(standardBuilder.getEntryServiceName()) ? standardBuilder.getEntryServiceName() : Const.DOMAIN_OPERATION_NAME; + int entryEndpointId = endpointInventoryRegister.get(serviceInstanceInventoryCache.get(standardBuilder.getEntryApplicationInstanceId()).getServiceId(), entryEndpointName); + + if (entryEndpointId == 0) { + if (logger.isDebugEnabled()) { + int entryServiceId = serviceInstanceInventoryCache.get(standardBuilder.getEntryApplicationInstanceId()).getServiceId(); + logger.debug("entry endpoint name: {} from service id: {} exchange failed", entryEndpointName, entryServiceId); + } + return false; + } else { + standardBuilder.toBuilder(); + standardBuilder.setEntryServiceId(entryEndpointId); + standardBuilder.setEntryServiceName(Const.EMPTY_STRING); + } + } + + if (standardBuilder.getParentServiceId() == 0) { + String parentEndpointName = StringUtils.isNotEmpty(standardBuilder.getParentServiceName()) ? standardBuilder.getParentServiceName() : Const.DOMAIN_OPERATION_NAME; + int parentEndpointId = endpointInventoryRegister.get(serviceInstanceInventoryCache.get(standardBuilder.getParentApplicationInstanceId()).getServiceId(), parentEndpointName); + + if (parentEndpointId == 0) { + if (logger.isDebugEnabled()) { + int parentServiceId = serviceInstanceInventoryCache.get(standardBuilder.getParentApplicationInstanceId()).getServiceId(); + logger.debug("parent endpoint name: {} from service id: {} exchange failed", parentEndpointName, parentServiceId); + } + return false; + } else { + standardBuilder.toBuilder(); + standardBuilder.setParentServiceId(parentEndpointId); + standardBuilder.setParentServiceName(Const.EMPTY_STRING); + } + } + + if (standardBuilder.getNetworkAddressId() == 0 && StringUtils.isNotEmpty(standardBuilder.getNetworkAddress())) { + int networkAddressId = networkAddressInventoryRegister.getOrCreate(standardBuilder.getNetworkAddress()); + + if (networkAddressId == 0) { + if (logger.isDebugEnabled()) { + logger.debug("network address: {} from service id: {} exchange failed", standardBuilder.getNetworkAddress(), serviceId); + } + return false; + } else { + standardBuilder.toBuilder(); + standardBuilder.setNetworkAddressId(networkAddressId); + standardBuilder.setNetworkAddress(Const.EMPTY_STRING); + } + } + return true; + } +} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/SegmentStandardization.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/standardization/SegmentStandardization.java similarity index 87% rename from apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/SegmentStandardization.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/standardization/SegmentStandardization.java index 7c02b6bd8596d32e9350c71976da0c9c01912cda..6e23e47efa75e7497383191da2e99305c167c008 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/SegmentStandardization.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/standardization/SegmentStandardization.java @@ -16,11 +16,10 @@ * */ -package org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser.standardization; +package org.apache.skywalking.oap.server.receiver.trace.provider.parser.standardization; -import org.apache.skywalking.apm.collector.core.data.QueueData; -import org.apache.skywalking.apm.collector.core.queue.EndOfBatchContext; import org.apache.skywalking.apm.network.language.agent.UpstreamSegment; +import org.apache.skywalking.oap.server.core.analysis.data.*; /** * @author peng-yongsheng diff --git a/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/standardization/SegmentStandardizationWorker.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/standardization/SegmentStandardizationWorker.java new file mode 100644 index 0000000000000000000000000000000000000000..a567e1a3177a32623509f1dd21bfc13caa9025cf --- /dev/null +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/standardization/SegmentStandardizationWorker.java @@ -0,0 +1,96 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 org.apache.skywalking.oap.server.receiver.trace.provider.parser.standardization; + +import java.io.IOException; +import java.util.*; +import org.apache.skywalking.apm.commons.datacarrier.DataCarrier; +import org.apache.skywalking.apm.commons.datacarrier.consumer.IConsumer; +import org.apache.skywalking.apm.network.language.agent.UpstreamSegment; +import org.apache.skywalking.oap.server.core.worker.AbstractWorker; +import org.apache.skywalking.oap.server.library.buffer.BufferStream; +import org.apache.skywalking.oap.server.library.module.ModuleManager; +import org.apache.skywalking.oap.server.receiver.trace.provider.parser.*; +import org.slf4j.*; + +/** + * @author peng-yongsheng + */ +public class SegmentStandardizationWorker extends AbstractWorker { + + private static final Logger logger = LoggerFactory.getLogger(SegmentStandardizationWorker.class); + + private final DataCarrier dataCarrier; + private final BufferStream stream; + + public SegmentStandardizationWorker(ModuleManager moduleManager, + SegmentParserListenerManager listenerManager) throws IOException { + super(9999); + this.dataCarrier = new DataCarrier<>(1, 1024); + this.dataCarrier.consume(new Consumer(this), 1); + + String directory = "/Users/pengys5/code/sky-walking/buffer-test"; + BufferStream.Builder builder = new BufferStream.Builder<>(directory); +// builder.cleanWhenRestart(true); + builder.dataFileMaxSize(50); + builder.offsetFileMaxSize(10); + builder.parser(UpstreamSegment.parser()); + builder.callBack(new SegmentParse(moduleManager, listenerManager)); + + stream = builder.build(); + stream.initialize(); + } + + @Override public void in(SegmentStandardization standardization) { + stream.write(standardization.getUpstreamSegment()); + } + + private class Consumer implements IConsumer { + + private final SegmentStandardizationWorker aggregator; + + private Consumer(SegmentStandardizationWorker aggregator) { + this.aggregator = aggregator; + } + + @Override public void init() { + } + + @Override public void consume(List data) { + Iterator inputIterator = data.iterator(); + + int i = 0; + while (inputIterator.hasNext()) { + SegmentStandardization indicator = inputIterator.next(); + i++; + if (i == data.size()) { + indicator.getEndOfBatchContext().setEndOfBatch(true); + } + aggregator.in(indicator); + } + } + + @Override public void onError(List data, Throwable t) { + logger.error(t.getMessage(), t); + } + + @Override public void onExit() { + } + } +} diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/SpanIdExchanger.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/standardization/SpanIdExchanger.java similarity index 51% rename from apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/SpanIdExchanger.java rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/standardization/SpanIdExchanger.java index 0465a9e853370ac8b0489e79f02354baffae3984..f2dcb1d2f6520bc8ae304906e7ffaca960cdcb6e 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/SpanIdExchanger.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/standardization/SpanIdExchanger.java @@ -16,20 +16,15 @@ * */ -package org.apache.skywalking.apm.collector.analysis.segment.parser.provider.parser.standardization; +package org.apache.skywalking.oap.server.receiver.trace.provider.parser.standardization; -import org.apache.skywalking.apm.collector.analysis.register.define.AnalysisRegisterModule; -import org.apache.skywalking.apm.collector.analysis.register.define.service.INetworkAddressIDService; -import org.apache.skywalking.apm.collector.analysis.register.define.service.IServiceNameService; -import org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.SpanDecorator; -import org.apache.skywalking.apm.collector.configuration.ConfigurationModule; -import org.apache.skywalking.apm.collector.configuration.service.IComponentLibraryCatalogService; -import org.apache.skywalking.apm.collector.core.annotations.trace.GraphComputingMetric; -import org.apache.skywalking.apm.collector.core.module.ModuleManager; -import org.apache.skywalking.apm.collector.core.util.Const; -import org.apache.skywalking.apm.collector.core.util.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.apache.skywalking.oap.server.core.*; +import org.apache.skywalking.oap.server.core.config.IComponentLibraryCatalogService; +import org.apache.skywalking.oap.server.core.register.service.*; +import org.apache.skywalking.oap.server.library.module.ModuleManager; +import org.apache.skywalking.oap.server.library.util.StringUtils; +import org.apache.skywalking.oap.server.receiver.trace.provider.parser.decorator.SpanDecorator; +import org.slf4j.*; /** * @author peng-yongsheng @@ -39,8 +34,8 @@ public class SpanIdExchanger implements IdExchanger { private static final Logger logger = LoggerFactory.getLogger(SpanIdExchanger.class); private static SpanIdExchanger EXCHANGER; - private final IServiceNameService serviceNameService; - private final INetworkAddressIDService networkAddressIDService; + private final IEndpointInventoryRegister endpointInventoryRegister; + private final INetworkAddressInventoryRegister networkAddressInventoryRegister; private final IComponentLibraryCatalogService componentLibraryCatalogService; public static SpanIdExchanger getInstance(ModuleManager moduleManager) { @@ -51,19 +46,18 @@ public class SpanIdExchanger implements IdExchanger { } private SpanIdExchanger(ModuleManager moduleManager) { - this.serviceNameService = moduleManager.find(AnalysisRegisterModule.NAME).getService(IServiceNameService.class); - this.networkAddressIDService = moduleManager.find(AnalysisRegisterModule.NAME).getService(INetworkAddressIDService.class); - this.componentLibraryCatalogService = moduleManager.find(ConfigurationModule.NAME).getService(IComponentLibraryCatalogService.class); + this.endpointInventoryRegister = moduleManager.find(CoreModule.NAME).getService(IEndpointInventoryRegister.class); + this.networkAddressInventoryRegister = moduleManager.find(CoreModule.NAME).getService(INetworkAddressInventoryRegister.class); + this.componentLibraryCatalogService = moduleManager.find(CoreModule.NAME).getService(IComponentLibraryCatalogService.class); } - @GraphComputingMetric(name = "/segment/parse/exchange/spanIdExchanger") - @Override public boolean exchange(SpanDecorator standardBuilder, int applicationId) { + @Override public boolean exchange(SpanDecorator standardBuilder, int serviceId) { if (standardBuilder.getComponentId() == 0 && StringUtils.isNotEmpty(standardBuilder.getComponent())) { int componentId = componentLibraryCatalogService.getComponentId(standardBuilder.getComponent()); if (componentId == 0) { if (logger.isDebugEnabled()) { - logger.debug("component: {} in application: {} exchange failed", standardBuilder.getComponent(), applicationId); + logger.debug("component: {} in service: {} exchange failed", standardBuilder.getComponent(), serviceId); } return false; } else { @@ -74,11 +68,11 @@ public class SpanIdExchanger implements IdExchanger { } if (standardBuilder.getPeerId() == 0 && StringUtils.isNotEmpty(standardBuilder.getPeer())) { - int peerId = networkAddressIDService.getOrCreate(standardBuilder.getPeer()); + int peerId = networkAddressInventoryRegister.getOrCreate(standardBuilder.getPeer()); if (peerId == 0) { if (logger.isDebugEnabled()) { - logger.debug("peer: {} in application: {} exchange failed", standardBuilder.getPeer(), applicationId); + logger.debug("peer: {} in service: {} exchange failed", standardBuilder.getPeer(), serviceId); } return false; } else { @@ -86,24 +80,24 @@ public class SpanIdExchanger implements IdExchanger { standardBuilder.setPeerId(peerId); standardBuilder.setPeer(Const.EMPTY_STRING); - int spanLayer = standardBuilder.getSpanLayerValue(); - int serverType = componentLibraryCatalogService.getServerIdBasedOnComponent(standardBuilder.getComponentId()); - networkAddressIDService.update(peerId, spanLayer, serverType); +// int spanLayer = standardBuilder.getSpanLayerValue(); +// int serverType = componentLibraryCatalogService.getServerIdBasedOnComponent(standardBuilder.getComponentId()); +// networkAddressInventoryRegister.update(peerId, spanLayer, serverType); } } if (standardBuilder.getOperationNameId() == 0) { - String operationName = StringUtils.isNotEmpty(standardBuilder.getOperationName()) ? standardBuilder.getOperationName() : Const.DOMAIN_OPERATION_NAME; - int operationNameId = serviceNameService.getOrCreate(applicationId, standardBuilder.getSpanTypeValue(), operationName); + String endpointName = StringUtils.isNotEmpty(standardBuilder.getOperationName()) ? standardBuilder.getOperationName() : Const.DOMAIN_OPERATION_NAME; + int endpointId = endpointInventoryRegister.getOrCreate(serviceId, endpointName, standardBuilder.getSpanTypeValue()); - if (operationNameId == 0) { + if (endpointId == 0) { if (logger.isDebugEnabled()) { - logger.debug("service name: {} from application id: {} exchange failed", operationName, applicationId); + logger.debug("endpoint name: {} from service id: {} exchange failed", endpointName, serviceId); } return false; } else { standardBuilder.toBuilder(); - standardBuilder.setOperationNameId(operationNameId); + standardBuilder.setOperationNameId(endpointId); standardBuilder.setOperationName(Const.EMPTY_STRING); } } diff --git a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleDefine similarity index 92% rename from apm-collector/apm-collector-cluster/collector-cluster-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleDefine index 874d83046ccc256d225c8df562ab653055400934..2cc90a086180db935613d8d9a8b08541c370d18f 100644 --- a/apm-collector/apm-collector-cluster/collector-cluster-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleDefine @@ -16,5 +16,4 @@ # # - -org.apache.skywalking.apm.collector.cluster.ClusterModule +org.apache.skywalking.oap.server.receiver.trace.module.TraceModule \ No newline at end of file diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleProvider similarity index 91% rename from apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine rename to oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleProvider index 24ac5122eb40e0831f77dc1ab484c72196c0e351..da2ee7f3339441016207606915b4f60e9917f57f 100644 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/main/resources/META-INF/services/org.apache.skywalking.oap.server.library.module.ModuleProvider @@ -16,4 +16,4 @@ # # -org.apache.skywalking.apm.collector.agent.jetty.define.AgentJettyModule +org.apache.skywalking.oap.server.receiver.trace.provider.TraceModuleProvider \ No newline at end of file diff --git a/oap-server/server-starter/src/main/resources/application.yml b/oap-server/server-starter/src/main/resources/application.yml index 371529f792c0e29741df58feefe692d9e21fa0f0..f7e244a2bd026122d38b4a5a3e73cd4daea62f29 100644 --- a/oap-server/server-starter/src/main/resources/application.yml +++ b/oap-server/server-starter/src/main/resources/application.yml @@ -51,6 +51,8 @@ storage: monthMetricDataTTL: 18 # Unit is month receiver-register: default: +receiver-trace: + default: receiver-jvm: default: service-mesh: diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/ServiceInstanceInventoryCacheDAO.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/ServiceInstanceInventoryCacheDAO.java index ecfb568c7a611013380538fa9e4473ae034bf454..d0c97a77fe02c14198daeea45ceb2f9f1e6ddc4a 100644 --- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/ServiceInstanceInventoryCacheDAO.java +++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/cache/ServiceInstanceInventoryCacheDAO.java @@ -43,7 +43,7 @@ public class ServiceInstanceInventoryCacheDAO extends EsDAO implements IServiceI super(client); } - @Override public int getServiceId(int serviceInstanceId) { + @Override public ServiceInstanceInventory get(int serviceInstanceId) { try { SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); searchSourceBuilder.query(QueryBuilders.termQuery(ServiceInstanceInventory.SEQUENCE, serviceInstanceId)); @@ -52,13 +52,13 @@ public class ServiceInstanceInventoryCacheDAO extends EsDAO implements IServiceI SearchResponse response = getClient().search(ServiceInstanceInventory.MODEL_NAME, searchSourceBuilder); if (response.getHits().totalHits == 1) { SearchHit searchHit = response.getHits().getAt(0); - return builder.map2Data(searchHit.getSourceAsMap()).getServiceId(); + return builder.map2Data(searchHit.getSourceAsMap()); } else { - return Const.NONE; + return null; } } catch (Throwable e) { logger.error(e.getMessage()); - return Const.NONE; + return null; } } diff --git a/pom.xml b/pom.xml index cf05b5cb36d8880c893d90db69fb2d7f90ee92d6..ad698c3353b9d0796ee0ff7d4b60e9d84941ce01 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,6 @@ apm-commons apm-sniffer apm-application-toolkit - apm-collector apm-protocol apm-webapp apm-dist