Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 68383200B5A for ; Thu, 4 Aug 2016 14:42:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 66A6A160AB0; Thu, 4 Aug 2016 12:42:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id AE9E7160A7C for ; Thu, 4 Aug 2016 14:41:59 +0200 (CEST) Received: (qmail 78327 invoked by uid 500); 4 Aug 2016 12:41:51 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 77741 invoked by uid 99); 4 Aug 2016 12:41:51 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Aug 2016 12:41:51 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 15983E5725; Thu, 4 Aug 2016 12:41:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: drankye@apache.org To: common-commits@hadoop.apache.org Date: Thu, 04 Aug 2016 12:42:18 -0000 Message-Id: In-Reply-To: <7645f9c68f5847808c164fd3ad7f3ea2@git.apache.org> References: <7645f9c68f5847808c164fd3ad7f3ea2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [29/30] hadoop git commit: YARN-5459. Add support for docker rm. Contributed by Shane Kumpf. archived-at: Thu, 04 Aug 2016 12:42:00 -0000 YARN-5459. Add support for docker rm. Contributed by Shane Kumpf. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/08e33381 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/08e33381 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/08e33381 Branch: refs/heads/HADOOP-12756 Commit: 08e33381f5342590a68c65504c79c296b40fe5af Parents: 05db649 Author: Varun Vasudev Authored: Thu Aug 4 14:08:34 2016 +0530 Committer: Varun Vasudev Committed: Thu Aug 4 14:08:34 2016 +0530 ---------------------------------------------------------------------- .../linux/runtime/docker/DockerRmCommand.java | 30 ++++++++++++ .../runtime/docker/TestDockerRmCommand.java | 48 ++++++++++++++++++++ 2 files changed, 78 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/08e33381/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerRmCommand.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerRmCommand.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerRmCommand.java new file mode 100644 index 0000000..b1aea61 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/DockerRmCommand.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.runtime.docker; + +/** + * Encapsulates the docker rm command and its command + * line arguments. + */ +public class DockerRmCommand extends DockerCommand { + private static final String RM_COMMAND = "rm"; + + public DockerRmCommand(String containerName) { + super(RM_COMMAND); + super.addCommandArguments(containerName); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hadoop/blob/08e33381/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/TestDockerRmCommand.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/TestDockerRmCommand.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/TestDockerRmCommand.java new file mode 100644 index 0000000..d1b9904 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/docker/TestDockerRmCommand.java @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.runtime.docker; + +import static org.junit.Assert.assertEquals; +import org.junit.Before; +import org.junit.Test; + +/** + * Tests the docker rm command and any command + * line arguments. + */ +public class TestDockerRmCommand { + + private DockerRmCommand dockerRmCommand; + + private static final String CONTAINER_NAME = "foo"; + + @Before + public void setUp() { + dockerRmCommand = new DockerRmCommand(CONTAINER_NAME); + } + + @Test + public void testGetCommandOption() { + assertEquals("rm", dockerRmCommand.getCommandOption()); + } + + @Test + public void testGetCommandWithArguments() { + assertEquals("rm foo", dockerRmCommand.getCommandWithArguments()); + } + +} --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org