Browse Source

HADOOP-10444. Add pom.xml infrastructure for hadoop-native-core (decstery via cmccabe)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HADOOP-10388@1598780 13f79535-47bb-0310-9956-ffa450edef68
Colin McCabe 11 years ago
parent
commit
e2dd4ecdc1
38 changed files with 160 additions and 1 deletions
  1. 6 0
      hadoop-dist/pom.xml
  2. 147 0
      hadoop-native-core/pom.xml
  3. 0 0
      hadoop-native-core/src/main/native/CMakeLists.txt
  4. 1 1
      hadoop-native-core/src/main/native/GenerateProtobufs.cmake
  5. 0 0
      hadoop-native-core/src/main/native/common/hadoop_err-unit.c
  6. 0 0
      hadoop-native-core/src/main/native/common/hadoop_err.c
  7. 0 0
      hadoop-native-core/src/main/native/common/hadoop_err.h
  8. 0 0
      hadoop-native-core/src/main/native/common/net-unit.c
  9. 0 0
      hadoop-native-core/src/main/native/common/net.c
  10. 0 0
      hadoop-native-core/src/main/native/common/net.h
  11. 0 0
      hadoop-native-core/src/main/native/common/queue.h
  12. 0 0
      hadoop-native-core/src/main/native/common/string.c
  13. 0 0
      hadoop-native-core/src/main/native/common/string.h
  14. 0 0
      hadoop-native-core/src/main/native/common/test.c
  15. 0 0
      hadoop-native-core/src/main/native/common/test.h
  16. 0 0
      hadoop-native-core/src/main/native/common/tree.h
  17. 0 0
      hadoop-native-core/src/main/native/common/user.c
  18. 0 0
      hadoop-native-core/src/main/native/common/user.h
  19. 0 0
      hadoop-native-core/src/main/native/hdfs/namenode-rpc-unit.c
  20. 0 0
      hadoop-native-core/src/main/native/rpc/call.c
  21. 0 0
      hadoop-native-core/src/main/native/rpc/call.h
  22. 0 0
      hadoop-native-core/src/main/native/rpc/client_id.c
  23. 0 0
      hadoop-native-core/src/main/native/rpc/client_id.h
  24. 0 0
      hadoop-native-core/src/main/native/rpc/conn.c
  25. 0 0
      hadoop-native-core/src/main/native/rpc/conn.h
  26. 0 0
      hadoop-native-core/src/main/native/rpc/messenger.c
  27. 0 0
      hadoop-native-core/src/main/native/rpc/messenger.h
  28. 0 0
      hadoop-native-core/src/main/native/rpc/protoc-gen-hrpc.cc
  29. 0 0
      hadoop-native-core/src/main/native/rpc/proxy.c
  30. 0 0
      hadoop-native-core/src/main/native/rpc/proxy.h
  31. 0 0
      hadoop-native-core/src/main/native/rpc/reactor.c
  32. 0 0
      hadoop-native-core/src/main/native/rpc/reactor.h
  33. 0 0
      hadoop-native-core/src/main/native/rpc/shorten.c
  34. 0 0
      hadoop-native-core/src/main/native/rpc/varint-unit.c
  35. 0 0
      hadoop-native-core/src/main/native/rpc/varint.c
  36. 0 0
      hadoop-native-core/src/main/native/rpc/varint.h
  37. 5 0
      hadoop-project/pom.xml
  38. 1 0
      pom.xml

+ 6 - 0
hadoop-dist/pom.xml

@@ -52,6 +52,11 @@
       <artifactId>hadoop-yarn-api</artifactId>
       <scope>provided</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.hadoop</groupId>
+      <artifactId>hadoop-native-core</artifactId>
+      <scope>provided</scope>
+    </dependency>
   </dependencies>
 
   <build>
@@ -122,6 +127,7 @@
                       run cp -r $ROOT/hadoop-yarn-project/target/hadoop-yarn-project-${project.version}/* .
                       run cp -r $ROOT/hadoop-mapreduce-project/target/hadoop-mapreduce-${project.version}/* .
                       run cp -r $ROOT/hadoop-tools/hadoop-tools-dist/target/hadoop-tools-dist-${project.version}/* .
+                      run cp -r $ROOT/hadoop-native-core/target/hadoop-native-core-${project.version}/* .
                       echo
                       echo "Hadoop dist layout available at: ${project.build.directory}/hadoop-${project.version}"
                       echo

+ 147 - 0
hadoop-native-core/pom.xml

@@ -0,0 +1,147 @@
+<?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-project</artifactId>
+    <version>3.0.0-SNAPSHOT</version>
+    <relativePath>../hadoop-project</relativePath>
+  </parent>
+  <groupId>org.apache.hadoop</groupId>
+  <artifactId>hadoop-native-core</artifactId>
+  <version>3.0.0-SNAPSHOT</version>
+  <description>Apache Hadoop Native Client</description>
+  <name>Apache Hadoop Native Client</name>
+  <packaging>jar</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.hadoop</groupId>
+      <artifactId>hadoop-hdfs</artifactId>
+      <scope>test</scope>
+      <type>test-jar</type>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hadoop</groupId>
+      <artifactId>hadoop-yarn-server-tests</artifactId>
+      <scope>test</scope>
+      <type>test-jar</type>
+    </dependency>
+  </dependencies>
+
+  <profiles>
+    <profile>
+      <id>native</id>
+      <activation>
+        <activeByDefault>false</activeByDefault>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>make</id>
+                <phase>compile</phase>
+                <goals><goal>run</goal></goals>
+                <configuration>
+                  <target>
+                    <mkdir dir="${project.build.directory}/native"/>
+                    <exec executable="cmake" dir="${project.build.directory}/native" 
+                        failonerror="true">
+                      <arg line="${basedir}/src/main/native"/>
+                    </exec>
+                    <exec executable="make" dir="${project.build.directory}/native" failonerror="true">
+                      <arg line="VERBOSE=1"/>
+                    </exec>
+                  </target>
+                </configuration>
+              </execution>
+              <execution>
+                <id>native_tests</id>
+                <phase>test</phase>
+                <goals><goal>run</goal></goals>
+                <configuration>
+                  <target>
+                    <property name="test_classpath" refid="maven.test.classpath"/>
+                    <exec executable="sh" failonerror="true" dir="${project.build.directory}/native/">
+                      <arg value="-c"/>
+                      <arg value="echo CLASSPATH=$CLASSPATH"/>
+                      <env key="CLASSPATH" value="${test_classpath}"/>
+                    </exec>
+                    <exec executable="sh" failonerror="true" dir="${project.build.directory}/native/">
+                      <arg value="-c"/>
+                      <arg value="[ x$SKIPTESTS = xtrue ] || make test"/>
+                      <env key="CLASSPATH" value="${test_classpath}"/>
+                      <env key="SKIPTESTS" value="${skipTests}"/>
+                    </exec>
+                  </target>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <profile>
+      <id>dist</id>
+      <activation>
+        <activeByDefault>false</activeByDefault>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>pre-dist</id>
+                <phase>prepare-package</phase>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+                <configuration>
+                  <target>
+                    <!-- Using Unix script to preserve symlinks -->
+                    <echo file="${project.build.directory}/dist-copynativelibs.sh">
+                      BUILD_DIR="${project.build.directory}"
+                      TAR='tar cf -'
+                      UNTAR='tar xfBp -'
+                      LIB_DIR="${BUILD_DIR}/native"
+                      if [ -d $${LIB_DIR} ] ; then
+                        TARGET_DIR="${BUILD_DIR}/${project.artifactId}-${project.version}/lib/native"
+                        mkdir -p $${TARGET_DIR}
+                        cd $${LIB_DIR}
+                        $$TAR lib* | (cd $${TARGET_DIR}/; $$UNTAR)
+                      fi
+                    </echo>
+                    <exec executable="sh" dir="${project.build.directory}" failonerror="true">
+                      <arg line="./dist-copynativelibs.sh"/>
+                    </exec>
+                  </target>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+</project>

+ 0 - 0
hadoop-native-core/CMakeLists.txt → hadoop-native-core/src/main/native/CMakeLists.txt


+ 1 - 1
hadoop-native-core/GenerateProtobufs.cmake → hadoop-native-core/src/main/native/GenerateProtobufs.cmake

@@ -53,7 +53,7 @@ function(DECLARE_PROTOS OUTPUT_SRC_LIST GENERATOR_DIR INCLUDE_DIRS)
     set(${OUTPUT_SRC_LIST} ${CFILES} ${HFILES} PARENT_SCOPE)
 endfunction()
 
-get_filename_component(R "${PROJECT_SOURCE_DIR}/.." REALPATH)
+get_filename_component(R "${PROJECT_SOURCE_DIR}/../../../../" REALPATH)
 
 # Common protobuf files.  In general, the other subprojects such as HDFS and
 # YARN may rely on definitions in these protobuf files.

+ 0 - 0
hadoop-native-core/common/hadoop_err-unit.c → hadoop-native-core/src/main/native/common/hadoop_err-unit.c


+ 0 - 0
hadoop-native-core/common/hadoop_err.c → hadoop-native-core/src/main/native/common/hadoop_err.c


+ 0 - 0
hadoop-native-core/common/hadoop_err.h → hadoop-native-core/src/main/native/common/hadoop_err.h


+ 0 - 0
hadoop-native-core/common/net-unit.c → hadoop-native-core/src/main/native/common/net-unit.c


+ 0 - 0
hadoop-native-core/common/net.c → hadoop-native-core/src/main/native/common/net.c


+ 0 - 0
hadoop-native-core/common/net.h → hadoop-native-core/src/main/native/common/net.h


+ 0 - 0
hadoop-native-core/common/queue.h → hadoop-native-core/src/main/native/common/queue.h


+ 0 - 0
hadoop-native-core/common/string.c → hadoop-native-core/src/main/native/common/string.c


+ 0 - 0
hadoop-native-core/common/string.h → hadoop-native-core/src/main/native/common/string.h


+ 0 - 0
hadoop-native-core/common/test.c → hadoop-native-core/src/main/native/common/test.c


+ 0 - 0
hadoop-native-core/common/test.h → hadoop-native-core/src/main/native/common/test.h


+ 0 - 0
hadoop-native-core/common/tree.h → hadoop-native-core/src/main/native/common/tree.h


+ 0 - 0
hadoop-native-core/common/user.c → hadoop-native-core/src/main/native/common/user.c


+ 0 - 0
hadoop-native-core/common/user.h → hadoop-native-core/src/main/native/common/user.h


+ 0 - 0
hadoop-native-core/hdfs/namenode-rpc-unit.c → hadoop-native-core/src/main/native/hdfs/namenode-rpc-unit.c


+ 0 - 0
hadoop-native-core/rpc/call.c → hadoop-native-core/src/main/native/rpc/call.c


+ 0 - 0
hadoop-native-core/rpc/call.h → hadoop-native-core/src/main/native/rpc/call.h


+ 0 - 0
hadoop-native-core/rpc/client_id.c → hadoop-native-core/src/main/native/rpc/client_id.c


+ 0 - 0
hadoop-native-core/rpc/client_id.h → hadoop-native-core/src/main/native/rpc/client_id.h


+ 0 - 0
hadoop-native-core/rpc/conn.c → hadoop-native-core/src/main/native/rpc/conn.c


+ 0 - 0
hadoop-native-core/rpc/conn.h → hadoop-native-core/src/main/native/rpc/conn.h


+ 0 - 0
hadoop-native-core/rpc/messenger.c → hadoop-native-core/src/main/native/rpc/messenger.c


+ 0 - 0
hadoop-native-core/rpc/messenger.h → hadoop-native-core/src/main/native/rpc/messenger.h


+ 0 - 0
hadoop-native-core/rpc/protoc-gen-hrpc.cc → hadoop-native-core/src/main/native/rpc/protoc-gen-hrpc.cc


+ 0 - 0
hadoop-native-core/rpc/proxy.c → hadoop-native-core/src/main/native/rpc/proxy.c


+ 0 - 0
hadoop-native-core/rpc/proxy.h → hadoop-native-core/src/main/native/rpc/proxy.h


+ 0 - 0
hadoop-native-core/rpc/reactor.c → hadoop-native-core/src/main/native/rpc/reactor.c


+ 0 - 0
hadoop-native-core/rpc/reactor.h → hadoop-native-core/src/main/native/rpc/reactor.h


+ 0 - 0
hadoop-native-core/rpc/shorten.c → hadoop-native-core/src/main/native/rpc/shorten.c


+ 0 - 0
hadoop-native-core/rpc/varint-unit.c → hadoop-native-core/src/main/native/rpc/varint-unit.c


+ 0 - 0
hadoop-native-core/rpc/varint.c → hadoop-native-core/src/main/native/rpc/varint.c


+ 0 - 0
hadoop-native-core/rpc/varint.h → hadoop-native-core/src/main/native/rpc/varint.h


+ 5 - 0
hadoop-project/pom.xml

@@ -307,6 +307,11 @@
         <artifactId>hadoop-openstack</artifactId>
         <version>${project.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.apache.hadoop</groupId>
+        <artifactId>hadoop-native-core</artifactId>
+        <version>${project.version}</version>
+      </dependency>
 
       <dependency>
         <groupId>com.google.guava</groupId>

+ 1 - 0
pom.xml

@@ -101,6 +101,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
     <module>hadoop-yarn-project</module>
     <module>hadoop-mapreduce-project</module>
     <module>hadoop-tools</module>
+    <module>hadoop-native-core</module>
     <module>hadoop-dist</module>
     <module>hadoop-client</module>
     <module>hadoop-minicluster</module>