Buggy code:
public class SpectralKMeansDriver extends AbstractJob { public static final double OVERSHOOT_MULTIPLIER = 2.0 ; public static void main ( String [ ] args ) throws Exception { } @ Override public int run ( String [ ] arg0 ) throws IOException , ClassNotFoundException , InterruptedException { } public static void run ( Configuration conf , Path input , Path output , int numDims , int clusters , DistanceMeasure measure , double convergenceDelta , int maxIterations ) throws IOException , ClassNotFoundException , InterruptedException { Path outputCalc = new Path ( output , "calculations" ) ; Path outputTmp = new Path ( output , "temporary" ) ; Path affSeqFiles = new Path ( outputCalc , ( "seqfile-" + ( ( System . nanoTime ( ) ) & 255 ) ) ) ; AffinityMatrixInputJob . runJob ( input , affSeqFiles , numDims , numDims ) ; DistributedRowMatrix A = new DistributedRowMatrix ( affSeqFiles , new Path ( outputTmp , ( "afftmp-" + ( ( System . nanoTime ( ) ) & 255 ) ) ) , numDims , numDims ) ; Configuration depConf = new Configuration ( conf ) ; A . setConf ( depConf ) ; Vector D = MatrixDiagonalizeJob . runJob ( affSeqFiles , numDims ) ; DistributedRowMatrix L = VectorMatrixMultiplicationJob . runJob ( affSeqFiles , D , new Path ( outputCalc , ( "laplacian-" + ( ( System . nanoTime ( ) ) & 255 ) ) ) , new Path ( outputCalc , ( "laplacian-tmp-" + ( ( System . nanoTime ( ) ) & 255 ) ) ) ) ; L . setConf ( depConf ) ; int overshoot = ( ( int ) ( ( ( double ) ( clusters ) ) * ( SpectralKMeansDriver . OVERSHOOT_MULTIPLIER ) ) ) ; DistributedLanczosSolver solver = new DistributedLanczosSolver ( ) ; <START_BUG> LanczosState state = new LanczosState ( L , clusters , DistributedLanczosSolver . getInitialVector ( L ) ) ; <END_BUG> Path lanczosSeqFiles = new Path ( outputCalc , ( "eigenvectors-" + ( ( System . nanoTime ( ) ) & 255 ) ) ) ; solver . runJob ( conf , state , overshoot , true , lanczosSeqFiles . toString ( ) ) ; EigenVerificationJob verifier = new EigenVerificationJob ( ) ; Path verifiedEigensPath = new Path ( outputCalc , "eigenverifier" ) ; verifier . runJob ( conf , lanczosSeqFiles , L . getRowPath ( ) , verifiedEigensPath , true , 1.0 , clusters ) ; Path cleanedEigens = verifier . getCleanedEigensPath ( ) ; DistributedRowMatrix W = new DistributedRowMatrix ( cleanedEigens , new Path ( cleanedEigens , "tmp" ) , clusters , numDims ) ; W . setConf ( depConf ) ; DistributedRowMatrix Wtrans = W . transpose ( ) ; Path unitVectors = new Path ( outputCalc , ( "unitvectors-" + ( ( System . nanoTime ( ) ) & 255 ) ) ) ; UnitVectorizerJob . runJob ( Wtrans . getRowPath ( ) , unitVectors ) ; DistributedRowMatrix Wt = new DistributedRowMatrix ( unitVectors , new Path ( unitVectors , "tmp" ) , clusters , numDims ) ; Wt . setConf ( depConf ) ; Path initialclusters = RandomSeedGenerator . buildRandom ( conf , Wt . getRowPath ( ) , new Path ( output , Cluster . INITIAL_CLUSTERS_DIR ) , clusters , measure ) ; KMeansDriver . run ( conf , Wt . getRowPath ( ) , initialclusters , output , measure , convergenceDelta , maxIterations , true , 0.0 , false ) ; } }

Fix:
LanczosState state = new LanczosState ( L , overshoot , DistributedLanczosSolver . getInitialVector ( L ) ) ;