@Test public void mapNoOfTransaction() { SparkBitcoinBlockCounter sparkTransformator = new SparkBitcoinBlockCounter(); BitcoinBlock testBlock = new BitcoinBlock(); BitcoinTransaction testTransaction = new BitcoinTransaction(); ArrayList<BitcoinTransaction> testTransactionList = new ArrayList<BitcoinTransaction>(); testTransactionList.add(testTransaction); testBlock.setTransactions(testTransactionList); Tuple2<String,Long> result = sparkTransformator.mapNoOfTransaction(testBlock); assertEquals((long)1,(long)result._2(),"One transaction should have been mapped"); }
public static Tuple2<String,Long> mapNoOfTransaction(BitcoinBlock block) { return new Tuple2<String, Long>("No of transactions: ",(long)(block.getTransactions().size())); }
SparkBitcoinBlockCounter { public static Tuple2<String,Long> mapNoOfTransaction(BitcoinBlock block) { return new Tuple2<String, Long>("No of transactions: ",(long)(block.getTransactions().size())); } }
SparkBitcoinBlockCounter { public static Tuple2<String,Long> mapNoOfTransaction(BitcoinBlock block) { return new Tuple2<String, Long>("No of transactions: ",(long)(block.getTransactions().size())); } SparkBitcoinBlockCounter(); }
SparkBitcoinBlockCounter { public static Tuple2<String,Long> mapNoOfTransaction(BitcoinBlock block) { return new Tuple2<String, Long>("No of transactions: ",(long)(block.getTransactions().size())); } SparkBitcoinBlockCounter(); static void main(String[] args); static void jobTotalNumOfTransactions(JavaSparkContext sc, Configuration hadoopConf, String inputFile, String outputFile); static Tuple2<String,Long> mapNoOfTransaction(BitcoinBlock block); static Long reduceSumUpTransactions(Long a, Long b); }
SparkBitcoinBlockCounter { public static Tuple2<String,Long> mapNoOfTransaction(BitcoinBlock block) { return new Tuple2<String, Long>("No of transactions: ",(long)(block.getTransactions().size())); } SparkBitcoinBlockCounter(); static void main(String[] args); static void jobTotalNumOfTransactions(JavaSparkContext sc, Configuration hadoopConf, String inputFile, String outputFile); static Tuple2<String,Long> mapNoOfTransaction(BitcoinBlock block); static Long reduceSumUpTransactions(Long a, Long b);  }