Buggy code:
public final class StreamingKMeansDriver extends AbstractJob { public static final String ESTIMATED_NUM_MAP_CLUSTERS = "estimatedNumMapClusters" ; public static final String ESTIMATED_DISTANCE_CUTOFF = "estimatedDistanceCutoff" ; public static final String MAX_NUM_ITERATIONS = "maxNumIterations" ; public static final String TRIM_FRACTION = "trimFraction" ; public static final String RANDOM_INIT = "randomInit" ; public static final String IGNORE_WEIGHTS = "ignoreWeights" ; public static final String TEST_PROBABILITY = "testProbability" ; public static final String NUM_BALLKMEANS_RUNS = "numBallKMeansRuns" ; public static final String SEARCHER_CLASS_OPTION = "searcherClass" ; public static final String NUM_PROJECTIONS_OPTION = "numProjections" ; public static final String SEARCH_SIZE_OPTION = "searchSize" ; public static final String REDUCE_STREAMING_KMEANS = "reduceStreamingKMeans" ; private static final Logger log = LoggerFactory . getLogger ( StreamingKMeansDriver . class ) ; public static final float INVALID_DISTANCE_CUTOFF = - 1 ; @ Override public int run ( String [ ] args ) throws Exception { } private void configureOptionsForWorkers ( ) throws ClassNotFoundException { } public static void configureOptionsForWorkers ( Configuration conf , int numClusters , int estimatedNumMapClusters , float estimatedDistanceCutoff , int maxNumIterations , float trimFraction , boolean randomInit , boolean ignoreWeights , float testProbability , int numBallKMeansRuns , String measureClass , String searcherClass , int searchSize , int numProjections , String method , boolean reduceStreamingKMeans ) throws ClassNotFoundException { } public static int run ( Configuration conf , Path input , Path output ) throws IOException , ClassNotFoundException , InterruptedException , ExecutionException { } private static int runSequentially ( Configuration conf , Path input , Path output ) throws IOException , InterruptedException , ExecutionException { long start = System . currentTimeMillis ( ) ; ExecutorService pool = Executors . newCachedThreadPool ( ) ; List < Future < Iterable < Centroid > > > intermediateCentroidFutures = Lists . newArrayList ( ) ; for ( FileStatus status : HadoopUtil . listStatus ( FileSystem . get ( conf ) , input , PathFilters . logsCRCFilter ( ) ) ) { intermediateCentroidFutures . add ( pool . submit ( new StreamingKMeansThread ( status . getPath ( ) , conf ) ) ) ; } StreamingKMeansDriver . log . info ( "Finished<seq2seq4repair_space>running<seq2seq4repair_space>Mappers" ) ; List < Centroid > intermediateCentroids = Lists . newArrayList ( ) ; for ( Future < Iterable < Centroid > > futureIterable : intermediateCentroidFutures ) { for ( Centroid centroid : futureIterable . get ( ) ) { intermediateCentroids . add ( centroid ) ; } } pool . shutdown ( ) ; pool . awaitTermination ( Long . MAX_VALUE , TimeUnit . SECONDS ) ; StreamingKMeansDriver . log . info ( "Finished<seq2seq4repair_space>StreamingKMeans" ) ; <START_BUG> SequenceFile . Writer writer = SequenceFile . createWriter ( FileSystem . get ( conf ) , conf , output , IntWritable . class , CentroidWritable . class ) ; <END_BUG> int numCentroids = 0 ; for ( Vector finalVector : StreamingKMeansReducer . getBestCentroids ( intermediateCentroids , conf ) ) { Centroid finalCentroid = ( ( Centroid ) ( finalVector ) ) ; writer . append ( new IntWritable ( ( numCentroids ++ ) ) , new CentroidWritable ( finalCentroid ) ) ; } writer . close ( ) ; long end = System . currentTimeMillis ( ) ; StreamingKMeansDriver . log . info ( "Finished<seq2seq4repair_space>BallKMeans.<seq2seq4repair_space>Took<seq2seq4repair_space>{}." , ( ( end - start ) // 1000.0 ) ) ; return 0 ; } public static int runMapReduce ( Configuration conf , Path input , Path output ) throws IOException , ClassNotFoundException , InterruptedException { } private StreamingKMeansDriver ( ) { } public static void main ( String [ ] args ) throws Exception { } }

Fix:
SequenceFile . Writer writer = SequenceFile . createWriter ( FileSystem . get ( conf ) , conf , new Path ( output , "part-r-00000" ) , IntWritable . class , CentroidWritable . class ) ;