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

import alluxio.AlluxioURI;
import alluxio.annotation.PublicApi;
import alluxio.client.WriteType;
import alluxio.client.file.FileOutStream;
import alluxio.client.file.FileSystemContext;
import alluxio.client.file.options.OutStreamOptions;

import java.io.IOException;

import javax.annotation.concurrent.NotThreadSafe;

/**
 * A stream API to write a file when lineage is enabled. It supports asynchronous persistence of the
 * data to the under storage system.
 */
@PublicApi
@NotThreadSafe
public class LineageFileOutStream extends FileOutStream {
  /**
   * Creates a new file output stream when lineage is enabled.
   *
   * @param context file system context
   * @param path the path of the file
   * @param options the set of options specific to this operation
   */
  public LineageFileOutStream(FileSystemContext context, AlluxioURI path, OutStreamOptions options)
      throws IOException {
    super(path, updateOutStreamOptions(options), context);
  }

  private static OutStreamOptions updateOutStreamOptions(OutStreamOptions options) {
    return options.setWriteType(WriteType.ASYNC_THROUGH);
  }

  @Override
  protected void scheduleAsyncPersist() throws IOException {
    // do nothing, the scheduling is handled by the lineage master
  }
}

@@ -1504,16 +1504,189 @@
 );%0A  %7D%0A%0A
+  /**%0A   * Sets the %7B@link WriteType%7D to %7B@link WriteType#ASYNC_THROUGH%7D for the options.%0A   *%0A   * @param options the set of options%0A   * @return the updated options%0A   */%0A
   privat

add javadoc for LineageFileOutStream