001/* DataFileInputFormat 002 003/* 004 * Copyright (c) 2010-2013 The Regents of the University of California. 005 * All rights reserved. 006 * 007 * Permission is hereby granted, without written agreement and without 008 * license or royalty fees, to use, copy, modify, and distribute this 009 * software and its documentation for any purpose, provided that the above 010 * copyright notice and the following two paragraphs appear in all copies 011 * of this software. 012 * 013 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY 014 * FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 015 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 016 * THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF 017 * SUCH DAMAGE. 018 * 019 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 020 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 021 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE 022 * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF 023 * CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 024 * ENHANCEMENTS, OR MODIFICATIONS. 025 * 026 */ 027package org.kepler.hadoop.io.input; 028 029import java.io.IOException; 030 031import org.apache.hadoop.io.Text; 032import org.apache.hadoop.mapreduce.InputSplit; 033import org.apache.hadoop.mapreduce.RecordReader; 034import org.apache.hadoop.mapreduce.TaskAttemptContext; 035import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; 036 037////////////////////////////////////////////////////////////////////////// 038////FilePathInputFormat 039 040/** 041* This class provides InputFormat to read file paths. 042* Key is file name (no path info), value is file path. 043* 044* @author Jianwu Wang (jianwu@sdsc.edu) 045* @version $Id: FilePathInputFormat.java 33070 2014-11-12 23:21:09Z crawl $ 046*/ 047 048public class FilePathInputFormat extends FileInputFormat<Text, Text> { 049 050 @Override 051 public RecordReader<Text, Text> createRecordReader( 052 InputSplit split, TaskAttemptContext context) 053 throws IOException, InterruptedException { 054 return new FilePathRecordReader(); 055 } 056}