MCPcopy Create free account
hub / github.com/cmu-db/benchbase / setupSession

Method setupSession

src/main/java/com/oltpbenchmark/api/Worker.java:741–760  ·  view source on GitHub ↗

Set up the session by running a set of statements before benchmark execution begins. The path of the file where a set of statements defined should be added in <sessionsetupfile> </sessionsetupfile>

()

Source from the content-addressed store, hash-verified

739 * </sessionsetupfile>
740 */
741 protected void setupSession() {
742 try {
743 String setupSessionFile = configuration.getSessionSetupFile();
744 if (setupSessionFile == null || setupSessionFile.isEmpty()) {
745 return;
746 }
747
748 String statements = new String(Files.readAllBytes(Paths.get(setupSessionFile)));
749 if (statements.isEmpty()) {
750 return;
751 }
752
753 try (Statement stmt = conn.createStatement()) {
754 stmt.execute(statements);
755 }
756 // conn.commit();
757 } catch (SQLException | IOException ex) {
758 throw new RuntimeException("Failed setting up session", ex);
759 }
760 }
761
762 /**
763 * Invoke a single transaction for the given TransactionType

Callers 2

runMethod · 0.95
testExecuteWorkMethod · 0.80

Calls 4

getSessionSetupFileMethod · 0.80
isEmptyMethod · 0.45
getMethod · 0.45
executeMethod · 0.45

Tested by 1

testExecuteWorkMethod · 0.64