/** * Creates a new Recoverable writer. * @param fs The Hadoop file system on which the writer operates. */ public HadoopRecoverableWriter(org.apache.hadoop.fs.FileSystem fs) { this.fs = checkNotNull(fs); // This writer is only supported on a subset of file systems, and on // specific versions. We check these schemes and versions eagerly for // better error messages. if (!"hdfs".equalsIgnoreCase(fs.getScheme()) || !HadoopUtils.isMinHadoopVersion(2, 7)) { throw new UnsupportedOperationException( "Recoverable writers on Hadoop are only supported for HDFS and for Hadoop version 2.7 or newer"); } }
@BeforeClass public static void testHadoopVersion() { Assume.assumeTrue(HadoopUtils.isMinHadoopVersion(2, 7)); }
/** * Creates a new Recoverable writer. * @param fs The Hadoop file system on which the writer operates. */ public HadoopRecoverableWriter(org.apache.hadoop.fs.FileSystem fs) { this.fs = checkNotNull(fs); // This writer is only supported on a subset of file systems, and on // specific versions. We check these schemes and versions eagerly for // better error messages. if (!"hdfs".equalsIgnoreCase(fs.getScheme()) || !HadoopUtils.isMinHadoopVersion(2, 7)) { throw new UnsupportedOperationException( "Recoverable writers on Hadoop are only supported for HDFS and for Hadoop version 2.7 or newer"); } }