From 7a655d563398d539e5aca8a42061926e5d35c3ae Mon Sep 17 00:00:00 2001 From: Jonathan Turner Eagles Date: Thu, 3 Apr 2014 22:20:47 +0000 Subject: [PATCH] HADOOP-10454. Provide FileContext version of har file system. (Kihwal Lee via jeagles) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1584431 13f79535-47bb-0310-9956-ffa450edef68 --- .../hadoop-common/CHANGES.txt | 3 ++ .../main/java/org/apache/hadoop/fs/HarFs.java | 38 +++++++++++++++++++ .../src/main/resources/core-default.xml | 5 +++ 3 files changed, 46 insertions(+) create mode 100644 hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HarFs.java diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 8cf753a7940..7fab7565313 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -349,6 +349,9 @@ Release 2.4.1 - UNRELEASED IMPROVEMENTS + HADOOP-10454. Provide FileContext version of har file system. (Kihwal Lee + via jeagles) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HarFs.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HarFs.java new file mode 100644 index 00000000000..a2369e32802 --- /dev/null +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HarFs.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 +* +* 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.fs; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +import org.apache.hadoop.conf.Configuration; + +public class HarFs extends DelegateToFileSystem { + HarFs(final URI theUri, final Configuration conf) + throws IOException, URISyntaxException { + super(theUri, new HarFileSystem(), conf, "har", true); + } + + @Override + public int getUriDefaultPort() { + return -1; + } +} + diff --git a/hadoop-common-project/hadoop-common/src/main/resources/core-default.xml b/hadoop-common-project/hadoop-common/src/main/resources/core-default.xml index 1252fd2e9d0..475dc4d4502 100644 --- a/hadoop-common-project/hadoop-common/src/main/resources/core-default.xml +++ b/hadoop-common-project/hadoop-common/src/main/resources/core-default.xml @@ -452,6 +452,11 @@ The AbstractFileSystem for file: uris. + + fs.AbstractFileSystem.har.impl + org.apache.hadoop.fs.HarFs + The AbstractFileSystem for har: uris. + fs.AbstractFileSystem.hdfs.impl