/*
 * 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.hadoop;

import alluxio.Constants;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.DelegateToFileSystem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;

/**
 * The AlluxioFS implementation of Hadoop AbstractFileSystem. The implementation delegates to the
 * existing Alluxio FileSystem and Only necessary for use with Hadoop 2.x.
 * Configuration example in Hadoop core-site.xml file:
 * <pre>
 * &lt;property&gt;
 *    &lt;name>fs.AbstractFileSystem.alluxio.impl&lt;/name&gt;
 *    &lt;value>alluxio.hadoop.AlluxioFs&lt;/value&gt;
 * &lt;/property&gt;
 * </pre>
 */
// TODO(pfxuan): DelegateToFileSystem is a private/unstable interface.
// For long term solution, we need to rewrite AlluxioFs by extending Hadoop
// AbstractFileSystem directly.
// https://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/AbstractFileSystem.html
public class AlluxioFs extends DelegateToFileSystem {
  private static final Logger LOG = LoggerFactory.getLogger(Constants.LOGGER_TYPE);

  /**
   * This constructor has the signature needed by
   * {@link org.apache.hadoop.fs.AbstractFileSystem#createFileSystem(java.net.URI, Configuration)}.
   *
   * @param uri which must be that of AlluxioFS
   * @param conf
   * @throws java.io.IOException
   * @throws java.net.URISyntaxException
   */
  AlluxioFs(final URI uri, final Configuration conf) throws IOException, URISyntaxException {
    super(uri, new FileSystem(), conf, Constants.SCHEME, false);
  }

  @Override
  public int getUriDefaultPort() {
    return Constants.DEFAULT_MASTER_PORT;
  }
}

@@ -817,17 +817,17 @@
 AlluxioF
-S
+s
  impleme
@@ -920,16 +920,38 @@
 Alluxio 
+%7B@link alluxio.hadoop.
 FileSyst
@@ -956,14 +956,18 @@
 stem
+%7D
  and 
-O
+is o
 nly 
@@ -988,16 +988,19 @@
 use with
+%0A *
  Hadoop 
@@ -1003,19 +1003,16 @@
 oop 2.x.
-%0A *
  Configu
@@ -1240,256 +1240,116 @@
 %3E%0A *
-/%0A// TODO(pfxuan): DelegateToFileSystem is a private/unstable interface.%0A// For long term solution, we need to rewrite AlluxioFs by extending Hadoop%0A// AbstractFileSystem directly.%0A// https://hadoop.apache.org/docs/current/api/org/apache/
+%0A * For long term solution, we need to rewrite AlluxioFs by extending Hadoop%0A * %7B@link org.apache.
 hadoop
-/fs/
+.fs.
 Abst
@@ -1366,13 +1366,23 @@
 stem
-.html
+%7D directly.%0A */
 %0Apub
@@ -1642,25 +1642,16 @@
 eSystem(
-java.net.
 URI, Con
@@ -1662,16 +1662,35 @@
 ration)%7D
+%0A   * in Hadoop 2.x
 .%0A   *%0A 
@@ -1708,56 +1708,83 @@
 uri 
-which must be that of AlluxioFS%0A   * @param conf
+the uri for this AlluxioFs filesystem%0A   * @param conf Hadoop configuration
 %0A   
@@ -1808,24 +1808,47 @@
 .IOException
+ if an I/O error occurs
 %0A   * @throw
@@ -1872,24 +1872,61 @@
 taxException
+ if %3Ccode%3Euri%3C/code%3E has syntax error
 %0A   */%0A  All

Improve java doc for extending DelegateToFileSystem.