You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by el...@apache.org on 2019/04/09 15:42:18 UTC
[hadoop] branch trunk updated: HDDS-1383. Create project skeleton
with CLI interface for In-place upgrade.
This is an automated email from the ASF dual-hosted git repository.
elek pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 8ef3bc8 HDDS-1383. Create project skeleton with CLI interface for In-place upgrade.
8ef3bc8 is described below
commit 8ef3bc8113d2cdce67fd0110ee0a7d13182f2ac1
Author: Márton Elek <el...@apache.org>
AuthorDate: Tue Apr 9 17:35:04 2019 +0200
HDDS-1383. Create project skeleton with CLI interface for In-place upgrade.
Closes #694
---
hadoop-ozone/common/src/main/bin/ozone | 5 ++
hadoop-ozone/dist/pom.xml | 11 +++++
hadoop-ozone/pom.xml | 6 +++
hadoop-ozone/upgrade/pom.xml | 54 ++++++++++++++++++++++
.../org/apache/hadoop/ozone/upgrade/Balance.java | 38 +++++++++++++++
.../org/apache/hadoop/ozone/upgrade/Execute.java | 37 +++++++++++++++
.../hadoop/ozone/upgrade/InPlaceUpgrade.java | 45 ++++++++++++++++++
.../java/org/apache/hadoop/ozone/upgrade/Plan.java | 38 +++++++++++++++
.../apache/hadoop/ozone/upgrade/package-info.java | 23 +++++++++
9 files changed, 257 insertions(+)
diff --git a/hadoop-ozone/common/src/main/bin/ozone b/hadoop-ozone/common/src/main/bin/ozone
index a6ad1eb..26906c4 100755
--- a/hadoop-ozone/common/src/main/bin/ozone
+++ b/hadoop-ozone/common/src/main/bin/ozone
@@ -52,6 +52,7 @@ function hadoop_usage
hadoop_add_subcommand "s3" client "command line interface for s3 related operations"
hadoop_add_subcommand "version" client "print the version"
hadoop_add_subcommand "dtutil" client "operations related to delegation tokens"
+ hadoop_add_subcommand "upgrade" client "HDFS to Ozone in-place upgrade tool"
hadoop_generate_usage "${HADOOP_SHELL_EXECNAME}" false
}
@@ -174,6 +175,10 @@ function ozonecmd_case
HADOOP_CLASSNAME=org.apache.hadoop.security.token.DtUtilShell
OZONE_RUN_ARTIFACT_NAME="hadoop-ozone-tools"
;;
+ upgrade)
+ HADOOP_CLASSNAME=org.apache.hadoop.ozone.upgrade.InPlaceUpgrade
+ OZONE_RUN_ARTIFACT_NAME="hadoop-ozone-upgrade"
+ ;;
*)
HADOOP_CLASSNAME="${subcmd}"
if ! hadoop_validate_classname "${HADOOP_CLASSNAME}"; then
diff --git a/hadoop-ozone/dist/pom.xml b/hadoop-ozone/dist/pom.xml
index ace1eb0..b31c5b9 100644
--- a/hadoop-ozone/dist/pom.xml
+++ b/hadoop-ozone/dist/pom.xml
@@ -110,6 +110,13 @@
<classifier>classpath</classifier>
<destFileName>hadoop-ozone-recon.classpath</destFileName>
</artifactItem>
+ <artifactItem>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-ozone-upgrade</artifactId>
+ <version>${ozone.version}</version>
+ <classifier>classpath</classifier>
+ <destFileName>hadoop-ozone-upgrade.classpath</destFileName>
+ </artifactItem>
</artifactItems>
</configuration>
</execution>
@@ -255,5 +262,9 @@
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdds-docs</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-ozone-upgrade</artifactId>
+ </dependency>
</dependencies>
</project>
diff --git a/hadoop-ozone/pom.xml b/hadoop-ozone/pom.xml
index 7010878..c24e511 100644
--- a/hadoop-ozone/pom.xml
+++ b/hadoop-ozone/pom.xml
@@ -50,6 +50,7 @@
<module>dist</module>
<module>ozone-recon</module>
<module>ozone-recon-codegen</module>
+ <module>upgrade</module>
</modules>
<repositories>
@@ -167,6 +168,11 @@
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-ozone-upgrade</artifactId>
+ <version>${ozone.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdds-container-service</artifactId>
<version>${hdds.version}</version>
<type>test-jar</type>
diff --git a/hadoop-ozone/upgrade/pom.xml b/hadoop-ozone/upgrade/pom.xml
new file mode 100644
index 0000000..072f2b1
--- /dev/null
+++ b/hadoop-ozone/upgrade/pom.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. See accompanying LICENSE file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-ozone</artifactId>
+ <version>0.5.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>hadoop-ozone-upgrade</artifactId>
+ <version>0.5.0-SNAPSHOT</version>
+ <description>Apache Hadoop Ozone In-Place Upgrade</description>
+ <name>Apache Hadoop Ozone In-Place Upgrade</name>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-hdds-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>findbugs</artifactId>
+ <version>3.0.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>2.15.0</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/hadoop-ozone/upgrade/src/main/java/org/apache/hadoop/ozone/upgrade/Balance.java b/hadoop-ozone/upgrade/src/main/java/org/apache/hadoop/ozone/upgrade/Balance.java
new file mode 100644
index 0000000..1492738
--- /dev/null
+++ b/hadoop-ozone/upgrade/src/main/java/org/apache/hadoop/ozone/upgrade/Balance.java
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS 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.ozone.upgrade;
+
+import java.util.concurrent.Callable;
+
+import picocli.CommandLine.Command;
+
+/**
+ * Command to move blocks between HDFS datanodes.
+ */
+@Command(name = "balance",
+ description = "Move the HDFS blocks for a better distribution "
+ + "usage.")
+public class Balance implements Callable<Void> {
+
+ @Override
+ public Void call() throws Exception {
+ System.err.println("[In-Place upgrade : balance] is not yet supported.");
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/hadoop-ozone/upgrade/src/main/java/org/apache/hadoop/ozone/upgrade/Execute.java b/hadoop-ozone/upgrade/src/main/java/org/apache/hadoop/ozone/upgrade/Execute.java
new file mode 100644
index 0000000..0837200
--- /dev/null
+++ b/hadoop-ozone/upgrade/src/main/java/org/apache/hadoop/ozone/upgrade/Execute.java
@@ -0,0 +1,37 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS 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.ozone.upgrade;
+
+import java.util.concurrent.Callable;
+
+import picocli.CommandLine.Command;
+
+/**
+ * Execute Ozone specific HDFS ballanced..
+ */
+@Command(name = "execute",
+ description = "Start/restart upgrade from HDFS to Ozone cluster.")
+public class Execute implements Callable<Void> {
+
+ @Override
+ public Void call() throws Exception {
+ System.err.println("In-Place upgrade : execute] is not yet supported.");
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/hadoop-ozone/upgrade/src/main/java/org/apache/hadoop/ozone/upgrade/InPlaceUpgrade.java b/hadoop-ozone/upgrade/src/main/java/org/apache/hadoop/ozone/upgrade/InPlaceUpgrade.java
new file mode 100644
index 0000000..b307f44
--- /dev/null
+++ b/hadoop-ozone/upgrade/src/main/java/org/apache/hadoop/ozone/upgrade/InPlaceUpgrade.java
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS 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.ozone.upgrade;
+
+import org.apache.hadoop.hdds.cli.GenericCli;
+import org.apache.hadoop.hdds.cli.HddsVersionProvider;
+
+import picocli.CommandLine.Command;
+
+/**
+ * Command line interface for the In-Place upgrade utility.
+ * <p>
+ * In-Place upgrade can convert HDFS cluster data to Ozone data without
+ * (or minimal) data moving.
+ */
+@Command(name = "ozone upgrade",
+ description = "Convert raw HDFS data to Ozone data without data movement.",
+ subcommands = {
+ Plan.class,
+ Balance.class,
+ Execute.class,
+ },
+ versionProvider = HddsVersionProvider.class,
+ mixinStandardHelpOptions = true)
+public class InPlaceUpgrade extends GenericCli {
+
+ public static void main(String[] args) {
+ new InPlaceUpgrade().run(args);
+ }
+}
diff --git a/hadoop-ozone/upgrade/src/main/java/org/apache/hadoop/ozone/upgrade/Plan.java b/hadoop-ozone/upgrade/src/main/java/org/apache/hadoop/ozone/upgrade/Plan.java
new file mode 100644
index 0000000..efd6092
--- /dev/null
+++ b/hadoop-ozone/upgrade/src/main/java/org/apache/hadoop/ozone/upgrade/Plan.java
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS 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.ozone.upgrade;
+
+import java.util.concurrent.Callable;
+
+import picocli.CommandLine.Command;
+
+/**
+ * Command to calculate statistics and estimate the upgrade.
+ */
+@Command(name = "plan",
+ description = "Plan existing HDFS block distribution and give."
+ + "estimation.")
+public class Plan implements Callable<Void> {
+
+ @Override
+ public Void call() throws Exception {
+ System.err.println("[In-Place upgrade : plan] is not yet supported.");
+ return null;
+ }
+
+}
diff --git a/hadoop-ozone/upgrade/src/main/java/org/apache/hadoop/ozone/upgrade/package-info.java b/hadoop-ozone/upgrade/src/main/java/org/apache/hadoop/ozone/upgrade/package-info.java
new file mode 100644
index 0000000..b147683
--- /dev/null
+++ b/hadoop-ozone/upgrade/src/main/java/org/apache/hadoop/ozone/upgrade/package-info.java
@@ -0,0 +1,23 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS 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.ozone.upgrade;
+
+/**
+ * In-Place upgrade utility to upgrade HDDS to Ozone cluster..
+ */
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org