Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Ozone as a under file system of Alluxio
This PR introduces a new top-level UFS module for compiling an Ozone-compatible UFS. The Ozone client is able to use the Hadoop FileSystem interface, so we don't need to write any new logic to support Ozone. The reason we include this as a top-level UFS as opposed to including the ozone libraries directly in the HDFS UFS is to gain more control over the supported ozone version as well as reduce the size of the release tarball. Otherwise, we would maintain many copies of the same Ozone jars. Resolves #11390 pr-link: #11396 change-id: cid-06387b11a6bd2ce0694cf33bad1f09f76a396c2c
- Loading branch information
1 parent
2ae0579
commit d73dc12
Showing
7 changed files
with
158 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<!-- | ||
The Alluxio Open Foundation licenses this work under the Apache License, version 2.0 | ||
(the "License"). You may not use this work except in compliance with the License, which is | ||
available at www.apache.org/licenses/LICENSE-2.0 | ||
This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
either express or implied, as more fully set forth in the License. | ||
See the NOTICE file distributed with this work for information regarding copyright ownership. | ||
--> | ||
<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> | ||
<artifactId>alluxio-underfs</artifactId> | ||
<groupId>org.alluxio</groupId> | ||
<version>2.3.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>alluxio-underfs-ozone</artifactId> | ||
<name>Alluxio Under File System - Apache Ozone</name> | ||
<description>Apache Ozone Under File System implementation</description> | ||
<properties> | ||
<!-- The following paths need to be defined here as well as in the parent pom so that mvn can --> | ||
<!-- run properly from sub-project directories --> | ||
<build.path>${project.parent.parent.basedir}/build</build.path> | ||
</properties> | ||
|
||
<dependencies> | ||
<!-- External dependencies --> | ||
<dependency> | ||
<groupId>org.apache.hadoop</groupId> | ||
<artifactId>hadoop-ozone-client</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.hadoop</groupId> | ||
<artifactId>hadoop-ozone-filesystem</artifactId> | ||
</dependency> | ||
<!-- Internal dependencies --> | ||
<dependency> | ||
<groupId>org.alluxio</groupId> | ||
<artifactId>alluxio-core-common</artifactId> | ||
<version>${project.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.alluxio</groupId> | ||
<artifactId>alluxio-underfs-hdfs</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>shade</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<configuration> | ||
<filters> | ||
<filter> | ||
<artifact>*:*</artifact> | ||
<excludes> | ||
<exclude>LICENSE</exclude> | ||
<exclude>META-INF/LICENSE</exclude> | ||
<exclude>META-INF/*.SF</exclude> | ||
<exclude>META-INF/*.DSA</exclude> | ||
<exclude>META-INF/*.RSA</exclude> | ||
</excludes> | ||
</filter> | ||
<filter> | ||
<artifact>org.alluxio:alluxio-underfs-hdfs</artifact> | ||
<excludes> | ||
<exclude>META-INF/services/alluxio.underfs.UnderFileSystemFactory</exclude> | ||
</excludes> | ||
</filter> | ||
</filters> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>com.coderplus.maven.plugins</groupId> | ||
<artifactId>copy-rename-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
38 changes: 38 additions & 0 deletions
38
underfs/ozone/src/main/java/alluxio/underfs/ozone/OzoneUnderFileSystemFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* The Alluxio Open Foundation licenses this work under the Apache License, version 2.0 | ||
* (the "License"). You may not use this work except in compliance with the License, which is | ||
* available at www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
* either express or implied, as more fully set forth in the License. | ||
* | ||
* See the NOTICE file distributed with this work for information regarding copyright ownership. | ||
*/ | ||
|
||
package alluxio.underfs.ozone; | ||
|
||
import alluxio.Constants; | ||
import alluxio.underfs.hdfs.HdfsUnderFileSystem; | ||
import alluxio.underfs.hdfs.HdfsUnderFileSystemFactory; | ||
import alluxio.underfs.UnderFileSystemConfiguration; | ||
|
||
import javax.annotation.concurrent.ThreadSafe; | ||
|
||
/** | ||
* Factory for creating {@link HdfsUnderFileSystem}. | ||
* | ||
* It caches created {@link HdfsUnderFileSystem}s, using the scheme and authority pair as the key. | ||
*/ | ||
@ThreadSafe | ||
public class OzoneUnderFileSystemFactory extends HdfsUnderFileSystemFactory { | ||
|
||
@Override | ||
public boolean supportsPath(String path) { | ||
return path != null && path.startsWith(Constants.HEADER_OZONE); | ||
} | ||
|
||
@Override | ||
public boolean supportsPath(String path, UnderFileSystemConfiguration conf) { | ||
return supportsPath(path); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
underfs/ozone/src/main/resources/META-INF/services/alluxio.underfs.UnderFileSystemFactory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# | ||
# The Alluxio Open Foundation licenses this work under the Apache License, version 2.0 | ||
# (the “License”). You may not use this work except in compliance with the License, which is | ||
# available at www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
# either express or implied, as more fully set forth in the License. | ||
# | ||
# See the NOTICE file distributed with this work for information regarding copyright ownership. | ||
# | ||
|
||
alluxio.underfs.ozone.OzoneUnderFileSystemFactory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters