@Override
  public FSDataOutputStream append(Path path, int bufferSize, Progressable progress)
      throws IOException {
    LOG.debug("append({}, {}, {})", path, bufferSize, progress);
    if (mStatistics != null) {
      mStatistics.incrementWriteOps(1);
    }
    AlluxioURI uri = getAlluxioPath(path);
    try {
      if (mFileSystem.exists(uri)) {
        throw new IOException(
            "append() to existing Alluxio path is currently not supported: " + uri);
      }
      return new FSDataOutputStream(
          mFileSystem.createFile(uri, CreateFilePOptions.newBuilder().setRecursive(true).build()),
          mStatistics);
    } catch (InvalidArgumentRuntimeException e) {
      throw new IllegalArgumentException(e);
    } catch (AlluxioRuntimeException e) {
      throw toHdfsIOException(e);
    } catch (AlluxioException e) {
      throw new IOException(e);
    }
  }
@Test
  public void appendExistingNotSupported() throws Exception {
    Path path = new Path("/file");
    alluxio.client.file.FileSystem alluxioFs =
        mock(alluxio.client.file.FileSystem.class);
    when(alluxioFs.exists(new AlluxioURI(HadoopUtils.getPathWithoutScheme(path))))
        .thenReturn(true);

    try (FileSystem alluxioHadoopFs = new FileSystem(alluxioFs)) {
      alluxioHadoopFs.append(path, 100);
      fail("append() of existing file is expected to fail");
    } catch (IOException e) {
      assertEquals("append() to existing Alluxio path is currently not supported: " + path,
          e.getMessage());
    }
  }