@@ -0,0 +1,2279 @@
+/**%0A * Licensed to the Apache Software Foundation (ASF) under one%0A * or more contributor license agreements.  See the NOTICE file%0A * distributed with this work for additional information%0A * regarding copyright ownership.  The ASF licenses this file%0A * to you under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance%0A * with the License.  You may obtain a 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%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.apache.hadoop.hdfs.server.datanode;%0A%0Aimport java.io.Closeable;%0Aimport java.io.IOException;%0Aimport java.util.Iterator;%0A%0A/**%0A * Rolling logs consist of a current log and a previous log.%0A * When the roll operation is invoked, current is rolled to previous%0A * and previous is deleted.%0A * The implementation should support a single appender and multiple readers.%0A */%0Apublic interface RollingLogs %7B%0A  /**%0A   * To iterate the lines of the logs.%0A   */%0A  public interface LineIterator extends Iterator%3CString%3E, Closeable %7B%0A    /** Is the iterator iterating the previous? */%0A    public boolean isPrevious();%0A  %7D%0A%0A  /**%0A   * To append text to the logs.%0A   */%0A  public interface Appender extends Appendable, Closeable %7B%0A  %7D%0A%0A  /**%0A   * Create an iterator to iterate the lines in the logs.%0A   * %0A   * @param skipPrevious Should it skip reading the previous log? %0A   * @return a new iterator.%0A   */%0A  public LineIterator iterator(boolean skipPrevious) throws IOException;%0A%0A  /**%0A   * @return the only appender to append text to the logs.%0A   *   The same object is returned if it is invoked multiple times.%0A   */%0A  public Appender appender();%0A%0A  /**%0A   * Roll current to previous and delete the previous.%0A   *%0A   * @return true if the rolling succeeded.%0A   *   When it returns false, it is not equivalent to an error. %0A   *   It means that the rolling cannot be performed at the moment,%0A   *   e.g. the logs are being read.%0A   */%0A  public boolean roll() throws IOException;%0A%7D

add the new file for the previous commit.