@@ -0,0 +1,1790 @@
+/*%0A * Licensed to the University of California, Berkeley under one or more contributor license%0A * agreements. See the NOTICE file distributed with this work for additional information regarding%0A * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance with the License. You may obtain a%0A * copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software distributed under the License%0A * is distributed on an %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express%0A * or implied. See the License for the specific language governing permissions and limitations under%0A * the License.%0A */%0A%0Apackage tachyon.worker.block.io;%0A%0Aimport java.io.IOException;%0Aimport java.nio.ByteBuffer;%0Aimport java.nio.channels.WritableByteChannel;%0A%0A/**%0A * A writer interface to write or update a block stored in managed storage.%0A * %3Cp%3E%0A * This class does not provide thread-safety.%0A */%0Apublic interface BlockWriter %7B%0A  /**%0A   * Appends data to the end of a block from an input ByteBuffer.%0A   *%0A   * @param inputBuf ByteBuffer that input data is stored in%0A   * @return the size of data that was appended%0A   * @throws IOException%0A   */%0A  long append(ByteBuffer inputBuf) throws IOException;%0A%0A  /**%0A   * Returns writable byte channel to write to this block%0A   *%0A   * @return channel%0A   */%0A  WritableByteChannel getChannel();%0A%0A  /**%0A   * Deletes this block.%0A   *%0A   * @return true on success, false otherwise%0A   */%0A  boolean delete();%0A%0A  /**%0A   * Moves the block file to another path.%0A   *%0A   * @param dstPath destination path%0A   * @return true on success, false otherwise%0A   */%0A  boolean move(String dstPath);%0A%7D%0A

Add a BlockWriter interface