@@ -0,0 +1,2163 @@
+/*%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 */%0A%0Apackage tachyon.client.keyvalue;%0A%0Aimport com.google.common.base.Preconditions;%0Aimport tachyon.TachyonURI;%0Aimport tachyon.client.file.TachyonFile;%0Aimport tachyon.client.file.TachyonFileSystem;%0Aimport tachyon.client.file.TachyonFileSystem.TachyonFileSystemFactory;%0Aimport tachyon.exception.TachyonException;%0A%0Aimport java.io.IOException;%0Aimport java.util.List;%0A%0A/**%0A * Interface of the reader class to access a Tachyon key-value file.%0A */%0Apublic interface KeyValueFileReader %7B%0A%0A  class Factory %7B%0A    /**%0A     * Factory method to create a KeyValueFileReader.%0A     *%0A     * @param uri Tachyon URI of the key-value file as input%0A     * @return an instance of a %7B@link KeyValueFileReader%7D%0A     * @throws TachyonException%0A     * @throws IOException%0A     */%0A    public static KeyValueFileReader create(TachyonURI uri) throws TachyonException, IOException %7B%0A      Preconditions.checkArgument(uri != null);%0A      TachyonFileSystem tfs = TachyonFileSystemFactory.get();%0A      TachyonFile tFile = tfs.open(uri);%0A      List%3CLong%3E blockIds = tfs.getInfo(tFile).getBlockIds();%0A      return new KeyValueFileReaderImpl(blockIds);%0A    %7D%0A  %7D%0A%0A  /**%0A   * Gets the value associated with the given key in the key-value file, return null if not found.%0A   *%0A   * @param key key to get, cannot be null%0A   * @return bytes of the value if found, null otherwise%0A   */%0A  byte%5B%5D get(byte%5B%5D key);%0A%7D%0A

Add interface of KeyValueFileReader