*** empty log message ***
[IRC.git] / Robust / Transactions / dstm2 / src / dstm2 / benchmark / PureIO.java
1 /*
2  * To change this template, choose Tools | Templates
3  * and open the template in the editor.
4  */
5
6 package dstm2.benchmark;
7
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;
15
16 /**
17  *
18  * @author navid
19  */
20 public class PureIO extends CustomBenchmark {
21
22     @Override
23     protected void init() {
24         
25     }
26
27     
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);
32         try {
33             
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);         
36    //           
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));
41              
42         
43         } catch (IOException ex) {
44             Logger.getLogger(PureIO.class.getName()).log(Level.SEVERE, null, ex);
45         }
46         
47     }
48
49     
50     protected void printResults() {
51         
52     }
53
54 }