data file generator
authorjihoonl <jihoonl>
Tue, 2 Feb 2010 00:13:58 +0000 (00:13 +0000)
committerjihoonl <jihoonl>
Tue, 2 Feb 2010 00:13:58 +0000 (00:13 +0000)
Robust/src/Benchmarks/Recovery/FileSystem/LookUpService.java
Robust/src/Benchmarks/Recovery/FileSystem/data/dirname [new file with mode: 0644]
Robust/src/Benchmarks/Recovery/FileSystem/data/gen.c [new file with mode: 0644]
Robust/src/Benchmarks/Recovery/FileSystem/makefile

index e9a62ff0b97f335f4071b3bdea1e03e2cc24bbb6..39333501ff1caf5cb419243e45ce3107b7ccbe2f 100644 (file)
@@ -1,3 +1,10 @@
+/*\r
+Usage :\r
+  ./LookupService.bin <num thread> <datafile prefix>\r
+*/\r
+\r
+\r
+\r
 public class LookUpService extends Thread {\r
        DistributedHashMap dir;\r
        DistributedHashMap fs;\r
@@ -13,7 +20,7 @@ public class LookUpService extends Thread {
                this.dir = dir;\r
                this.fs = fs;\r
                this.mid = mid;\r
-               this.inputfile = global new GlobalString(filename + "_" + mid);\r
+               this.inputfile = global new GlobalString("data/"+filename + mid);\r
        }\r
 \r
        public void init() {\r
@@ -87,40 +94,37 @@ public class LookUpService extends Thread {
                                gkey = global new GlobalString(key);\r
                        }\r
 \r
-                       if (command == 'r') {   \r
-//                             System.out.println("["+command+"] ["+key+"]");\r
-                               if (isDir == true) {\r
-                                       atomic {\r
-                                               readDirectory(gkey);\r
-                                       }\r
-                               }\r
-                               else {\r
-                                       atomic {\r
+                       if (command == 'r') {\r
+                               System.out.println("["+command+"] ["+key+"]");\r
+               atomic {\r
+                               if (isDir == true) {\r
+                                               readDirectory(gkey);\r
+                               }\r
+                               else {\r
                                                readFile(gkey);\r
-                                       }\r
-                               }\r
-                       }\r
-                       else if (command == 'c') {      \r
-                               if (isDir == true) {\r
-//                                     System.out.println("["+command+"] ["+key+"]");\r
-                                       atomic {\r
-                                               createDirectory(gkey);\r
-                                               if(!myDir.contains(key)) {\r
-                                                       myDir.add(key);\r
-                                               }\r
-                                       }\r
-                               }\r
-                               else {\r
-                                       val = t.getValue();\r
-//                                     System.out.println("["+command+"] ["+key+"] ["+val+"]");\r
-                                       atomic {\r
+                                 }\r
+                         }\r
+      }\r
+                       else if (command == 'c') {\r
+                                       System.out.println("["+command+"] ["+key+"]");\r
+                               atomic {\r
+                               if (isDir == true) {\r
+                                               createDirectory(gkey);\r
+                                               if(!myDir.contains(key)) {\r
+                                                       myDir.add(key);\r
+                                               }\r
+                       }\r
+                               else {\r
+                                       val = t.getValue();\r
                                                gval = global new GlobalString(val);\r
                                                createFile(gkey, gval);\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
+                                 }\r
+                       }\r
+               }\r
+    }\r
                output(myDir);\r
+\r
+    RecoveryStat.printRecoveryStat();\r
        }\r
 \r
        public static void output(LinkedList myDir) { \r
diff --git a/Robust/src/Benchmarks/Recovery/FileSystem/data/dirname b/Robust/src/Benchmarks/Recovery/FileSystem/data/dirname
new file mode 100644 (file)
index 0000000..67810fa
--- /dev/null
@@ -0,0 +1,702 @@
+yward
+Chandler
+SanBernardino
+OilCity
+LaPuente
+Lincoln
+WallaWalla
+MissionViejo
+Hattiesburg
+AsburyPark
+Cicero
+EggHarbor
+Pascagoula
+Detroit
+Carbondale
+Starkville
+SouthElMonte
+PortArthur
+Woodruff
+Blythe
+Monrovia
+Areceibo
+Plattsburgh
+Visalia
+Rolla
+Jeffersonville
+Naperville
+Ada
+Newport
+Rutland
+Urbana
+Agawam
+Valencia
+Pierre
+Oneida
+Hickory
+Corinth
+Murray
+WestHollywood
+MissionViejo
+NewportNews
+Butte
+Shreveport
+Fredericksburg
+Greenville
+Wheeling
+Claremore
+Corvallis
+Parma
+Cheyenne
+Flint
+EdenPrairie
+Commerce
+Agawam
+Commerce
+WestCovina
+Johnstown
+nus
+Uriel
+Connor
+Joel
+Tanek
+Luke
+Eric
+Keith
+Giacomo
+Joseph
+Walter
+Barry
+Vladimir
+Jerome
+Derek
+Igor
+Damian
+Baxter
+Carter
+Tate
+Brody
+Baxter
+Cameron
+Oscar
+Declan
+Carson
+Kevin
+Nero
+Abbot
+Wallace
+Calvin
+Logan
+Talon
+Graham
+Callum
+Phelan
+Amos
+James
+Erich
+Hedley
+Amal
+Dolan
+Jordan
+Zachery
+Richard
+Robert
+Hu
+Arthur
+Travis
+Lyle
+Warren
+Amir
+Oren
+Brennan
+Ralph
+Adrian
+Duncan
+Garrison
+Norman
+Dylan
+Erasmus
+Theodore
+Wade
+Cody
+Dorian
+Boris
+Yoshio
+Felix
+Len
+Elliott
+Raphael
+Mannix
+Len
+Eric
+Macon
+Harlan
+Cain
+Brandon
+Jamal
+Asher
+Porter
+Hiram
+Branden
+Jasper
+Kermit
+Tucker
+Joel
+Theodore
+Drew
+Daniel
+Christopher
+Lucas
+Cadman
+Cadman
+Simon
+Herrod
+David
+Samuel
+Raymond
+Tanek
+Calvin
+Lance
+Julian
+Quinlan
+Vladimir
+Chase
+Coby
+Bernard
+Elliott
+Nigel
+Carl
+Beau
+Carson
+Dominic
+Lane
+Phelan
+Clarke
+Bruce
+Malcolm
+Jasper
+Giacomo
+Steel
+Caesar
+Kamal
+Ahmed
+Addison
+Abraham
+Devin
+Simon
+Reuben
+Camden
+Alan
+Hall
+Nicholas
+Reed
+Francis
+Troy
+Alden
+Hu
+Cooper
+Oscar
+Lucius
+Emery
+Ulric
+Vernon
+Vincent
+Michael
+Byron
+Barclay
+Ezra
+Mark
+Ira
+Clayton
+Rogan
+Ali
+Conan
+Ryder
+Amal
+Jeremy
+Murphy
+Silas
+Micah
+Noah
+Dennis
+Grady
+Jonah
+Luke
+Edward
+Kasimir
+Brady
+Kareem
+Dustin
+Phelan
+Thaddeus
+Colton
+Nasim
+Russell
+Tyrone
+Seth
+Tucker
+Davis
+Jermaine
+Gil
+Isaac
+Erich
+Harrison
+Nicholas
+Carson
+Igor
+Conan
+Stone
+Eric
+Tyrone
+Knox
+Leo
+Elmo
+Brent
+Darius
+Lucian
+Mohammad
+SanJuanCapistrano
+WestHollywood
+Batavia
+Middletown
+Sturgis
+BaySt.Louis
+Laredo
+Minneapolis
+Prescott
+Stillwater
+Rome
+Gadsden
+Seattle
+GlenCove
+Waycross
+Wausau
+ChulaVista
+Edmond
+FortCollins
+Carolina
+Joplin
+Lodi
+Scottsdale
+Murfreesboro
+Sanford
+Bend
+SanAntonio
+SantaCruz
+Elkhart
+RapidCity
+Dover
+BattleCreek
+Peoria
+FondduLac
+Newburgh
+MichiganCity
+HalfMoonBay
+Bremerton
+CalumetCity
+Biddeford
+Williamsport
+Titusville
+HuntingtonPark
+SanMateo
+Denver
+GreenRiver
+Reedsport
+Hopkinsville
+NewBedford
+Augusta
+Marlborough
+Austin
+Mequon
+GreenRiver
+NorthPlatte
+Greenfield
+Jenks
+Jeffersontown
+Cheyenne
+Philadelphia
+Chicopee
+HotSprings
+Rockford
+St.Marys
+PicoRivera
+HermosaBeach
+Irwindale
+BatonRouge
+Lawton
+Melrose
+Centennial
+LaPuente
+Kalispell
+Meriden
+EggHarbor
+Oshkosh
+Tupelo
+AgouraHills
+Baytown
+Lufkin
+BaldwinPark
+MyrtleBeach
+Midland
+Nanticoke
+WestBend
+Covington
+WestHaven
+Helena
+Nome
+Brookings
+Bend
+SanRafael
+Louisville
+SignalHill
+OilCity
+CulverCity
+Darlington
+Bellflower
+Enid
+Pocatello
+NewMadrid
+Ithaca
+Clarksburg
+Batavia
+WichitaFalls
+Kahului
+Pullman
+Syracuse
+Kearns
+SanJuanCapistrano
+Homer
+Lewiston
+Homer
+WestMemphis
+BossierCity
+GrandForks
+Chicopee
+Bakersfield
+Provo
+SanRafael
+Chino
+SantaBarbara
+Murrieta
+PalosVerdesEstates
+NorthChicago
+EastLansing
+TheDalles
+St.Petersburg
+Gardena
+ChicagoHeights
+Minnetonka
+Waukegan
+Montpelier
+Reno
+AgouraHills
+Meridian
+Cody
+RanchoCordova
+JerseyCity
+Newburyport
+Mandan
+Selma
+
+ve
+
+Vacaville
+FortWorth
+CityofIndustry
+Waycross
+Coatesville
+Fremont
+Chickasha
+BrokenArrow
+WestValleyCity
+OroValley
+Poughkeepsie
+Downey
+PortHuron
+Greensburg
+Cheyenne
+SanFernando
+NicholsHills
+Lockport
+Flagstaff
+LongBeach
+Cortland
+SiouxFalls
+Brookfield
+Merced
+MiamiBeach
+PhenixCity
+Allentown
+Plattsburgh
+Muncie
+Belleville
+Wausau
+Longview
+Healdsburg
+BuenaPark
+Knoxville
+MiamiGardens
+Joliet
+NewKensington
+Oxnard
+Honolulu
+Fairmont
+Homer
+Norfolk
+Yuma
+Rialto
+SanLuisObispo
+SanDiego
+Helena
+Fontana
+Bethany
+TheDalles
+LittleRock
+Vancouver
+Abilene
+BaldwinPark
+Laramie
+Philadelphia
+Beaumont
+Columbus
+FarmerCity
+CarsonCity
+Carbondale
+Sandpoint
+Lynwood
+Easton
+Easthampton
+Berkeley
+Pawtucket
+SunValley
+Riverside
+Bethany
+Chelsea
+Cedarburg
+Portland
+Chattanooga
+Tok
+Lowell
+Watertown
+Escondido
+SaultSte.Marie
+Ansonia
+Chico
+Frederiksted
+WebsterGroves
+Chicopee
+Hammond
+Jenks
+Stanton
+Johnstown
+NewLondon
+Charleston
+Mobile
+Rochester
+WestAllis
+Blacksburg
+Albany
+Covina
+CityofIndustry
+
+Laurel
+Fernley
+Marquette
+Charleston
+Athens
+SiouxFalls
+Norwalk
+LasVegas
+Baltimore
+Lancaster
+Woodward
+Mentor
+Tucson
+Utica
+SpokaneValley
+AuburnHills
+Livonia
+Hampton
+Compton
+Spartanburg
+Brea
+Dixon
+Yakima
+Lynwood
+Georgetown
+Pittsburgh
+Caguas
+Visalia
+CulverCity
+Brookfield
+GreenRiver
+Phoenix
+Hutchinson
+Texarkana
+SouthPortland
+Kenner
+Provo
+Liberal
+Vineland
+Saipan
+Williston
+Vail
+Garland
+Tallahassee
+Shelton
+Cleveland
+Ventura
+Gettysburg
+Medford
+Brookings
+Cohoes
+Ogden
+GrandRapids
+Claremont
+CityofIndustry
+Parkersburg
+Superior
+Florence
+NewBedford
+BeverlyHills
+Independence
+WestlakeVillage
+SanAngelo
+Schenectady
+Spartanburg
+Nogales
+ElCerrito
+Monrovia
+Cambridge
+Concord
+Greensburg
+Bradford
+BrighamCity
+Pasadena
+WisconsinRapids
+Warwick
+Starkville
+Tupelo
+Enid
+Idabel
+Amesbury
+Knoxville
+BatonRouge
+Hannibal
+NewportNews
+Dickinson
+Austin
+Lockport
+Manitowoc
+Oneonta
+Moscow
+Washington
+Newburgh
+Hastings
+Rockford
+LakeForest
+AgouraHills
+Anaheim
+Baltimore
+CapeMay
+DalyCity
+Idabel
+Dover
+GardenGrove
+Birmingham
+Dayton
+ElPaso
+WestCovina
+Calabasas
+Marshfield
+Guthrie
+Cedarburg
+Yonkers
+Jackson
+LowerBurrell
+NewYork
+Ogdensburg
+Middletown
+Cairo
+CollegeStation
+Deadwood
+PortOrford
+Cairo
+SouthGate
+Biloxi
+Tempe
+Galveston
+Bloomington
+Turlock
+Hawthorne
+DeltaJunction
+Burbank
+SanAngelo
+Laconia
+Keene
+Superior
+Peabody
+Pocatello
+Shamokin
+Schaumburg
+Dunkirk
+Columbia
+WestWarwick
+Dover
+Natchitoches
+Lakeland
+Stanton
+EggHarbor
+Athens
+Worcester
+Kenner
+ElCerrito
+Pittston
+Mobile
+Bristol
+SanGabriel
+Kokomo
+Joliet
+TempleCity
+HalfMoonBay
+SantaRosa
+Brookfield
+LasCruces
+Muncie
+MontereyPark
+VillaPark
+Laconia
+Elmira
+NorthAdams
+Fernley
+Beverly
+Tempe
+Lansing
+Aurora
+Burlington
+Biloxi
+Malibu
+Woburn
+GreenBay
+Midland
+Wichita
+SanRafael
+Shamokin
+Paducah
+Hartford
+Waltham
+LaPuente
+Sharon
+Hartford
+GreatFalls
+Columbus
+Cleveland
+LaMirada
+Paducah
+SaintAlbans
+Atwater
+Nanticoke
+Duarte
+Fredericksburg
+Dover
+Phoenix
diff --git a/Robust/src/Benchmarks/Recovery/FileSystem/data/gen.c b/Robust/src/Benchmarks/Recovery/FileSystem/data/gen.c
new file mode 100644 (file)
index 0000000..bf9696f
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+   It generates random data files which contain a certain amount of command 
+   for File System benchmark
+  usage :
+    ./gen <num_file> <num_command> <File prefix>
+ */
+
+#include<stdio.h>
+#include<stdlib.h>
+#include<string.h>
+#include<time.h>
+
+#define DIR_FILE "dirname"
+#define FILE_NAME "file"
+#define HOME_DIR "home"
+#define STR_SIZE 256
+
+void generateData(char fileName[],int numCmd,char** wordList,int numWord);
+
+/* to read word tokens*/
+char** readList(char* fileName,int* num);
+void freeList(char** list,int num);
+
+int main(int argn,char** argv)
+{
+  char** wordList;
+  int numWord;
+  int numFile;
+  int numCmd;
+  char* prefix;
+  char fileName[256];
+  int i;
+  srand(0);
+
+  if(argn < 4) {
+    printf("Usage : ./gen <# of file to generate> <# of command> <File prefix>\n");
+    printf(" Ex)    ./gen 8 800 data\n");
+    printf("It generates 8 files(data0...data7) which contain 800 commands\n");
+    exit(0);
+  }
+  else {
+    sscanf(argv[1]," %d",&numFile);
+    sscanf(argv[2]," %d",&numCmd);
+    prefix = argv[3];
+  }
+
+  printf("# of file    : %d\n",numFile);
+  printf("# of Command : %d\n",numCmd);
+
+  wordList = readList(DIR_FILE,&numWord);
+
+  for(i = 0;i< numFile;i++) {
+    printf("Generating %s%d...\n",prefix,i);
+    sprintf(fileName,"%s%d",prefix,i);
+    generateData(fileName,numCmd,wordList,numWord);
+  }
+
+  freeList(wordList,numWord);
+
+
+}
+
+void generateData(char fileName[],int numCmd,char** wordList,int numWord)
+{
+  FILE* file = fopen(fileName,"w");
+  char cmdString[STR_SIZE];
+  char subCmdString[STR_SIZE];
+  char* wordToken;
+  int rand_index;
+  int token;
+  int i;
+  // create initial directory on home
+  sprintf(cmdString,"c /%s/%s/",HOME_DIR,fileName);
+  fprintf(file,"%s\n",cmdString);
+  numCmd--;
+
+  while(numCmd > 0) {
+    
+    // creating directory
+    wordToken = wordList[rand() % numWord];
+    sprintf(subCmdString,"%s%s/",cmdString,wordToken);
+    fprintf(file,"%s\n",subCmdString);
+    numCmd--;
+
+    if(numCmd == 0 )
+      break;
+
+    rand_index = (rand() % numCmd);
+    rand_index /= 2;
+
+    // creating files in the directory
+    for(i = 0;i <rand_index && numCmd > 0;i++) {
+      sprintf(subCmdString,"%s%s/%s%d",cmdString,wordToken,FILE_NAME,i);
+      fprintf(file,"%s\n",subCmdString);
+      numCmd--;
+    }  
+  }
+  fclose(file);
+}
+
+char** readList(char* fileName,int* num)
+{
+  char ** list;
+  int cnt = 0 ;
+  char buffer[100];
+  int size;
+  
+  FILE* fp = fopen(fileName,"r");
+
+  while((fscanf(fp," %s",buffer)) != EOF) cnt++;  // to count the number of elements
+
+  list = (char**)malloc(sizeof(char*) * cnt);
+
+  rewind(fp);
+
+  *num = 0;
+
+  while((fscanf(fp," %s",buffer)) != EOF) // read actual list
+  {
+    size = strlen(buffer); // to get length of the word,url, or account
+    list[*num] = (char*)malloc(sizeof(char) * size + 1);
+    strcpy(list[*num],buffer);
+    (*num)++;
+  }
+
+  fclose(fp);
+  return list;  
+}
+
+void freeList(char** list,int num)
+{
+  int i;
+
+  for(i=0;i<num;i++)
+  {
+    free(list[i]);
+  }
+
+  free(list);
+}
index 42e3ea926ab5c4c1dd89927c711b86e993c7c12e..260b37a42600c221d5791f9fd421c86a2b978d54 100644 (file)
@@ -1,6 +1,6 @@
 MAINCLASS=LookUpService
 SRC1=${MAINCLASS}.java 
-FLAGS= -dsm -dsmtask -32bit -recovery -nooptimize -mainclass ${MAINCLASS}
+FLAGS= -recoverystats -dsm -dsmtask -32bit -recovery -nooptimize -mainclass ${MAINCLASS}
 default:
        ../../../buildscript ${FLAGS} -o ${MAINCLASS} ${SRC1}