45 const char *dbname = gEnv->GetValue(
"o2root.dbname" ,
"dbname");
46 const char *user = gEnv->GetValue(
"o2root.username" ,
"username");
47 const char *password = gEnv->GetValue(
"o2root.password" ,
"password");
48 const char *rdb = gEnv->GetValue(
"o2root.rdb" ,
"");
49 const char *
outdir = gEnv->GetValue(
"o2root.outdir" ,
"./");
52 bool do_volume =
false;
53 bool do_processoperation =
false;
54 bool do_parentprocessoperation =
false;
55 bool do_scanback =
false;
56 bool do_brickinfo =
false;
57 ULong64_t id_volume = 0LL;
58 ULong64_t processoperation = 0LL;
59 ULong64_t parentprocessoperation = 0LL;
66 for(
int i=1; i<argc; i++ ) {
69 if (!strncmp(key,
"-v=",3))
71 if(strlen(key)>3) sscanf(key+3,
"%lld",&id_volume);
74 else if(!strncmp(key,
"-p=",3))
76 if(strlen(key)>3) sscanf(key+3,
"%lld",&processoperation);
77 do_processoperation=
true;
79 else if(!strncmp(key,
"-P=",3))
81 if(strlen(key)>3) sscanf(key+3,
"%lld",&parentprocessoperation);
82 do_parentprocessoperation=
true;
84 else if(!strncmp(key,
"-o=",3))
86 if(strlen(key)>3)
outdir=key+3;
88 else if(!strncmp(key,
"-ma=",4))
90 if(strlen(key)>4) major=atoi(key+4);
92 else if(!strncmp(key,
"-mi=",4))
94 if(strlen(key)>4) minor=atoi(key+4);
96 else if(!strncmp(key,
"-rdb=",5))
98 if(strlen(key)>5) rdb=key+5;
100 else if(!strncmp(key,
"-brick=",7))
102 if(strlen(key)>7) id_brick=atol(key+7);
104 else if(!strncmp(key,
"-sb=",4))
106 if(strlen(key)>4) path=atol(key+4);
109 else if(!strncmp(key,
"-info",5))
115 if(!(do_volume||do_scanback||do_processoperation||do_parentprocessoperation||do_brickinfo)) {
print_help_message();
return 0; }
118 if(!
db) {
Log(1,
"o2root",
"ERROR: the database connection is failed!");
return 0; }
121 printf(
"\n----------------------------------------------------------------------------\n");
122 printf(
"Read volume: \t\t\t%lld \nfrom the database: \t\t%s%s \nand save into directory: \t%s \nwith versions: \t\t\t%d.%d\n",
123 id_volume, dbname, rdb,
outdir, major,minor);
124 printf(
"----------------------------------------------------------------------------\n\n");
125 db->ConvertMicrotracksVolumeToEdb(id_volume,
outdir, major, minor);
127 if(do_processoperation) {
128 printf(
"\n----------------------------------------------------------------------------\n");
129 printf(
"Read processoperation: \t\t\t%lld \nfrom the database: \t\t%s%s \nand save into directory: \t%s \nwith versions: \t\t\t%d.%d\n",
130 processoperation, dbname, rdb,
outdir, major,minor);
131 printf(
"----------------------------------------------------------------------------\n\n");
132 db->ConvertMicrotracksProcessToEdb(processoperation,
outdir, major, minor);
134 if(do_parentprocessoperation) {
135 printf(
"\n----------------------------------------------------------------------------\n");
136 printf(
"Read parentprocessoperation: \t\t\t%lld \nfrom the database: \t\t%s%s \nand save into directory: \t%s \nwith versions: \t\t\t%d.%d\n",
137 parentprocessoperation, dbname, rdb,
outdir, major,minor);
138 printf(
"----------------------------------------------------------------------------\n\n");
139 db->ConvertMicrotracksParentProcessToEdb(parentprocessoperation,
outdir, major, minor);
142 printf(
"\n----------------------------------------------------------------------------\n");
143 printf(
"Read scanback path: \t\t%d of brick %ld \nfrom the database: \t\t%s%s \nand save into directory: \t%s \nwith versions: \t\t\t%d.%d\n",
144 path, id_brick, dbname, rdb,
outdir, major,minor);
145 printf(
"----------------------------------------------------------------------------\n\n");
146 db->ConvertScanbackPathToEdb(id_brick, path,
outdir, major, minor);
149 printf(
"\n---------------------------------------------------------------------------------------------\n");
150 printf(
"Print info for brick: \t%ld from the database: \t\t%s%s\n",
151 id_brick, dbname, rdb);
152 printf(
"---------------------------------------------------------------------------------------------\n");
153 db->PrintBrickInfoFull(id_brick,0);
bool Log(int level, const char *location, const char *fmt,...)
Definition: EdbLog.cxx:75
Definition: TOracleServerE2.h:13
const char * outdir
Definition: emrec.cpp:37
gEDBDEBUGLEVEL
Definition: energy.C:7
void print_help_message()
Definition: o2root.cpp:12
TOracleServerE * db
Definition: test_oracle.C:8