Loading Jenkinsfile-E2E 100644 → 100755 +13 −3 Original line number Diff line number Diff line Loading @@ -45,7 +45,11 @@ pipeline { // thus save unnecessary E2E builds(which is expensive) sh './mvnw checkstyle:check apache-rat:check' sh './mvnw -Dcheckstyle.skip -Drat.skip -T2 -Dmaven.compile.fork -Dmaven.compiler.maxmem=3072 -DskipTests clean package' sh 'tar -zxf dist/apache-skywalking-apm-bin.tar.gz -C dist' // Some of the tests will modify files in the distribution folder, e.g. cluster test will modify the application.yml // so we give each test a separate distribution folder here sh 'mkdir -p dist-for-single-node-service && tar -zxf dist/apache-skywalking-apm-bin.tar.gz -C dist-for-single-node-service' sh 'mkdir -p dist-for-cluster && tar -zxf dist/apache-skywalking-apm-bin.tar.gz -C dist-for-cluster' sh 'mkdir -p dist-for-agent-reboot && tar -zxf dist/apache-skywalking-apm-bin.tar.gz -C dist-for-agent-reboot' } } Loading @@ -62,6 +66,12 @@ pipeline { sh './mvnw -Dbuild.id=${BUILD_ID} -f test/e2e/pom.xml -pl e2e-cluster/test-runner -am verify' } } stage('Run Agent Reboot Tests') { steps { sh './mvnw -Dbuild.id=${BUILD_ID} -f test/e2e/pom.xml -pl e2e-agent-reboot -am verify' } } } } } Loading @@ -78,8 +88,8 @@ pipeline { // the container can not be deleted by `deleteDir()`, we need to mount it again and delete them // inside the container // // Delete `/dist` folder sh 'docker run -v $(pwd)/dist:/sw alpine sleep 10 && rm -rf /sw/*' // Delete all distribution folder sh 'docker run -v $(pwd):/sw alpine sleep 10 && rm -rf /sw/dist-for-cluster/* /sw/dist-for-single-node-service/* /sw/dist-for-agent-reboot/*' deleteDir() } } Loading apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/command/CommandDeserializer.java 0 → 100644 +35 −0 Original line number Diff line number Diff line /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.skywalking.apm.network.trace.component.command; import org.apache.skywalking.apm.network.common.Command; /** * @author kezhenxu94 */ public class CommandDeserializer { public static BaseCommand deserialize(final Command command) { final String commandName = command.getCommand(); if (ServiceResetCommand.NAME.equals(commandName)) { return ServiceResetCommand.DESERIALIZER.deserialize(command); } throw new UnsupportedCommandException(command); } } apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/command/Deserializable.java +2 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,6 @@ import org.apache.skywalking.apm.network.common.Command; /** * @author peng-yongsheng */ public interface Deserializable { void deserialize(Command command); public interface Deserializable<T extends BaseCommand> { T deserialize(Command command); } apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/command/ServiceResetCommand.java +22 −3 Original line number Diff line number Diff line Loading @@ -19,19 +19,38 @@ package org.apache.skywalking.apm.network.trace.component.command; import org.apache.skywalking.apm.network.common.Command; import org.apache.skywalking.apm.network.common.KeyStringValuePair; import java.util.List; /** * Clear the service metadata cache and other metadata caches belong to it, and re-register them. * * @author peng-yongsheng */ public class ServiceResetCommand extends BaseCommand implements Serializable { public class ServiceResetCommand extends BaseCommand implements Serializable, Deserializable<ServiceResetCommand> { public static final Deserializable<ServiceResetCommand> DESERIALIZER = new ServiceResetCommand(""); public static final String NAME = "ServiceMetadataReset"; public ServiceResetCommand(String serialNumber) { super("ServiceMetadataReset", serialNumber); super(NAME, serialNumber); } @Override public Command.Builder serialize() { @Override public Command.Builder serialize() { return commandBuilder(); } @Override public ServiceResetCommand deserialize(Command command) { final List<KeyStringValuePair> argsList = command.getArgsList(); String serialNumber = null; for (final KeyStringValuePair pair : argsList) { if ("SerialNumber".equals(pair.getKey())) { serialNumber = pair.getValue(); break; } } return new ServiceResetCommand(serialNumber); } } apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/command/UnsupportedCommandException.java 0 → 100644 +35 −0 Original line number Diff line number Diff line /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.skywalking.apm.network.trace.component.command; import org.apache.skywalking.apm.network.common.Command; /** * @author kezhenxu94 */ public class UnsupportedCommandException extends RuntimeException { private final Command command; public UnsupportedCommandException(final Command command) { this.command = command; } public Command getCommand() { return command; } } Loading
Jenkinsfile-E2E 100644 → 100755 +13 −3 Original line number Diff line number Diff line Loading @@ -45,7 +45,11 @@ pipeline { // thus save unnecessary E2E builds(which is expensive) sh './mvnw checkstyle:check apache-rat:check' sh './mvnw -Dcheckstyle.skip -Drat.skip -T2 -Dmaven.compile.fork -Dmaven.compiler.maxmem=3072 -DskipTests clean package' sh 'tar -zxf dist/apache-skywalking-apm-bin.tar.gz -C dist' // Some of the tests will modify files in the distribution folder, e.g. cluster test will modify the application.yml // so we give each test a separate distribution folder here sh 'mkdir -p dist-for-single-node-service && tar -zxf dist/apache-skywalking-apm-bin.tar.gz -C dist-for-single-node-service' sh 'mkdir -p dist-for-cluster && tar -zxf dist/apache-skywalking-apm-bin.tar.gz -C dist-for-cluster' sh 'mkdir -p dist-for-agent-reboot && tar -zxf dist/apache-skywalking-apm-bin.tar.gz -C dist-for-agent-reboot' } } Loading @@ -62,6 +66,12 @@ pipeline { sh './mvnw -Dbuild.id=${BUILD_ID} -f test/e2e/pom.xml -pl e2e-cluster/test-runner -am verify' } } stage('Run Agent Reboot Tests') { steps { sh './mvnw -Dbuild.id=${BUILD_ID} -f test/e2e/pom.xml -pl e2e-agent-reboot -am verify' } } } } } Loading @@ -78,8 +88,8 @@ pipeline { // the container can not be deleted by `deleteDir()`, we need to mount it again and delete them // inside the container // // Delete `/dist` folder sh 'docker run -v $(pwd)/dist:/sw alpine sleep 10 && rm -rf /sw/*' // Delete all distribution folder sh 'docker run -v $(pwd):/sw alpine sleep 10 && rm -rf /sw/dist-for-cluster/* /sw/dist-for-single-node-service/* /sw/dist-for-agent-reboot/*' deleteDir() } } Loading
apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/command/CommandDeserializer.java 0 → 100644 +35 −0 Original line number Diff line number Diff line /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.skywalking.apm.network.trace.component.command; import org.apache.skywalking.apm.network.common.Command; /** * @author kezhenxu94 */ public class CommandDeserializer { public static BaseCommand deserialize(final Command command) { final String commandName = command.getCommand(); if (ServiceResetCommand.NAME.equals(commandName)) { return ServiceResetCommand.DESERIALIZER.deserialize(command); } throw new UnsupportedCommandException(command); } }
apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/command/Deserializable.java +2 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,6 @@ import org.apache.skywalking.apm.network.common.Command; /** * @author peng-yongsheng */ public interface Deserializable { void deserialize(Command command); public interface Deserializable<T extends BaseCommand> { T deserialize(Command command); }
apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/command/ServiceResetCommand.java +22 −3 Original line number Diff line number Diff line Loading @@ -19,19 +19,38 @@ package org.apache.skywalking.apm.network.trace.component.command; import org.apache.skywalking.apm.network.common.Command; import org.apache.skywalking.apm.network.common.KeyStringValuePair; import java.util.List; /** * Clear the service metadata cache and other metadata caches belong to it, and re-register them. * * @author peng-yongsheng */ public class ServiceResetCommand extends BaseCommand implements Serializable { public class ServiceResetCommand extends BaseCommand implements Serializable, Deserializable<ServiceResetCommand> { public static final Deserializable<ServiceResetCommand> DESERIALIZER = new ServiceResetCommand(""); public static final String NAME = "ServiceMetadataReset"; public ServiceResetCommand(String serialNumber) { super("ServiceMetadataReset", serialNumber); super(NAME, serialNumber); } @Override public Command.Builder serialize() { @Override public Command.Builder serialize() { return commandBuilder(); } @Override public ServiceResetCommand deserialize(Command command) { final List<KeyStringValuePair> argsList = command.getArgsList(); String serialNumber = null; for (final KeyStringValuePair pair : argsList) { if ("SerialNumber".equals(pair.getKey())) { serialNumber = pair.getValue(); break; } } return new ServiceResetCommand(serialNumber); } }
apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/command/UnsupportedCommandException.java 0 → 100644 +35 −0 Original line number Diff line number Diff line /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.skywalking.apm.network.trace.component.command; import org.apache.skywalking.apm.network.common.Command; /** * @author kezhenxu94 */ public class UnsupportedCommandException extends RuntimeException { private final Command command; public UnsupportedCommandException(final Command command) { this.command = command; } public Command getCommand() { return command; } }