forked from oltpbenchmark/oltpbench
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated summary output file to include the DB version
- Loading branch information
Showing
7 changed files
with
63 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/com/oltpbenchmark/util/dbms_collectors/DBCollector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.oltpbenchmark.util.dbms_collectors; | ||
|
||
import com.oltpbenchmark.catalog.Catalog; | ||
import org.apache.log4j.Logger; | ||
|
||
import java.util.Map; | ||
import java.util.TreeMap; | ||
|
||
class DBCollector implements DBParameterCollector { | ||
private static final Logger LOG = Logger.getLogger(DBCollector.class); | ||
protected final Map<String, String> dbConf = new TreeMap<String, String>(); | ||
|
||
@Override | ||
public String collectParameters() { | ||
StringBuilder confBuilder = new StringBuilder(); | ||
for (Map.Entry<String, String> kv : dbConf.entrySet()) { | ||
confBuilder.append(kv.getKey().toLowerCase()) | ||
.append("=") | ||
.append(kv.getValue().toLowerCase()) | ||
.append("\n"); | ||
} | ||
return confBuilder.toString(); | ||
} | ||
|
||
@Override | ||
public String collectVersion() { | ||
return ""; | ||
} | ||
} |
5 changes: 2 additions & 3 deletions
5
src/com/oltpbenchmark/util/dbms_collectors/DBParameterCollector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
package com.oltpbenchmark.util.dbms_collectors; | ||
|
||
import java.util.Map; | ||
|
||
public interface DBParameterCollector { | ||
Map<String, String> collect(String oriDBUrl, String username, String password); | ||
String collectParameters(); | ||
String collectVersion(); | ||
} |
8 changes: 4 additions & 4 deletions
8
src/com/oltpbenchmark/util/dbms_collectors/DBParameterCollectorGen.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
package com.oltpbenchmark.util.dbms_collectors; | ||
|
||
public class DBParameterCollectorGen { | ||
public static DBParameterCollector getCollector(String dbType) { | ||
public static DBParameterCollector getCollector(String dbType, String dbUrl, String username, String password) { | ||
String db = dbType.toLowerCase(); | ||
if (db.equals("mysql")) { | ||
return new MYSQLCollector(); | ||
return new MYSQLCollector(dbUrl, username, password); | ||
} else if (db.equals("postgres")) { | ||
return new POSTGRESCollector(); | ||
return new POSTGRESCollector(dbUrl, username, password); | ||
} else { | ||
return new DummyCollector(); | ||
return new DBCollector(); | ||
} | ||
} | ||
} |
11 changes: 0 additions & 11 deletions
11
src/com/oltpbenchmark/util/dbms_collectors/DummyCollector.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters