2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
6 package dstm2.benchmark;
8 import TransactionalIO.benchmarks.benchmark;
9 import TransactionalIO.core.TransactionalFile;
10 import java.io.IOException;
11 import java.io.RandomAccessFile;
12 import java.util.Vector;
13 import java.util.logging.Level;
14 import java.util.logging.Logger;
20 public class PureIO extends CustomBenchmark {
23 protected void init() {
28 protected void execute(Vector arguments) {
29 char[] holder = (char[]) arguments.get(0);
30 int i = ((Integer) (arguments.get(1))).intValue();
31 byte[] towrite = (byte[]) arguments.get(2);
34 ((TransactionalFile) (benchmark.m.get(String.valueOf(holder,0,i).toLowerCase().substring(0, 1)))).write(towrite);
35 // ((RandomAccessFile) (benchmark.m.get(String.valueOf(holder,0,i).toLowerCase().substring(0, 1)))).write(towrite);
37 } catch (NullPointerException e){
38 System.out.println(i);
39 System.out.println(holder[0]);
40 System.out.println("kir " + String.valueOf(holder,0,i).toLowerCase().substring(0, 1));
43 } catch (IOException ex) {
44 Logger.getLogger(PureIO.class.getName()).log(Level.SEVERE, null, ex);
50 protected void printResults() {