public class ScriptExecutor extends Object
| Constructor and Description |
|---|
ScriptExecutor(com.datastax.driver.core.Session session) |
| Modifier and Type | Method and Description |
|---|---|
protected List<com.datastax.driver.core.SimpleStatement> |
buildStatements(List<String> lines) |
com.datastax.driver.core.ResultSet |
execute(com.datastax.driver.core.Statement statement)
Execute a CQL statement
|
com.datastax.driver.core.ResultSet |
execute(String statement)
Execute a plain CQL string statement
|
CompletableFuture<com.datastax.driver.core.ResultSet> |
executeAsync(com.datastax.driver.core.Statement statement)
Execute a CQL statement asynchronously
|
CompletableFuture<com.datastax.driver.core.ResultSet> |
executeAsync(String statement)
Execute a plain CQL string statement asynchronously
|
void |
executeScript(String scriptLocation)
Execute a CQL script file located in the class path
|
void |
executeScriptTemplate(String scriptTemplateLocation,
Map<String,Object> values)
Execute a CQL script template located in the class path and
inject provided values into the template to produce the actual script
|
com.datastax.driver.core.Session |
getSession() |
protected List<String> |
loadScriptAsLines(String scriptLocation) |
protected List<String> |
loadScriptAsLines(String scriptLocation,
Map<String,Object> variables) |
public void executeScript(String scriptLocation)
scriptLocation - the location of the script file in the class pathpublic void executeScriptTemplate(String scriptTemplateLocation, Map<String,Object> values)
scriptTemplateLocation - the location of the script template in the class pathvalues - template valuespublic com.datastax.driver.core.ResultSet execute(String statement)
statement - plain CQL string statementpublic com.datastax.driver.core.ResultSet execute(com.datastax.driver.core.Statement statement)
statement - CQL statementpublic CompletableFuture<com.datastax.driver.core.ResultSet> executeAsync(String statement)
statement - the CQL string statementpublic CompletableFuture<com.datastax.driver.core.ResultSet> executeAsync(com.datastax.driver.core.Statement statement)
statement - CQL statementprotected List<String> loadScriptAsLines(String scriptLocation, Map<String,Object> variables)
protected List<com.datastax.driver.core.SimpleStatement> buildStatements(List<String> lines)
public com.datastax.driver.core.Session getSession()
Copyright © 2012-2021. All Rights Reserved.