Package org.codehaus.mojo.cassandra
Class AbstractCqlExecMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.mojo.cassandra.AbstractCassandraMojo
-
- org.codehaus.mojo.cassandra.AbstractCqlExecMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractCqlLoadMojo
,CqlExecCassandraMojo
public abstract class AbstractCqlExecMojo extends AbstractCassandraMojo
Abstract parent class for mojos that need to run CQL statements.- Author:
- sparhomenko
-
-
Field Summary
Fields Modifier and Type Field Description protected String
cqlEncoding
Charset used when loading CQL files.protected boolean
useCqlLexer
Should we use the CqlLexer when loading the cql file.-
Fields inherited from class org.codehaus.mojo.cassandra.AbstractCassandraMojo
addMainClasspath, addTestClasspath, cassandraDir, jmxPort, keyspace, listenAddress, logLevel, maxMemory, nativeTransportPort, project, rpcAddress, session, skip, startNativeTransport, stopKey, stopPort, storagePort, systemPropertyVariables
-
-
Constructor Summary
Constructors Constructor Description AbstractCqlExecMojo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<com.datastax.oss.driver.api.core.cql.Row>
executeCql(String statements)
protected String
readFile(File file)
protected static List<String>
splitStatementsUsingCqlLexer(String statements)
Best effort to somewhat parse the cql input instead of just splitting on ; which breaks badly if you have ; in strings or comments.-
Methods inherited from class org.codehaus.mojo.cassandra.AbstractCassandraMojo
createCassandraHome, createCassandraHome, createCassandraJar, createCassandraJar, createEnvironmentVars, getToolchain, newJavaCommandLine, newNodetoolCommandLine, newServiceCommandLine, newServiceCommandLine, useJdk11Options
-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Field Detail
-
cqlEncoding
@Parameter(property="cql.encoding") protected String cqlEncoding
Charset used when loading CQL files. If not specified the system default encoding will be used.- Since:
- 3.6
-
useCqlLexer
@Parameter(defaultValue="false") protected boolean useCqlLexer
Should we use the CqlLexer when loading the cql file. This should be better than than the default behaviour which is to just split input on ; since it handles ; in comments and strings. It is not enabled by default since has not been extensively tested.- Since:
- 3.7
-
-
Method Detail
-
readFile
protected String readFile(File file) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
executeCql
protected List<com.datastax.oss.driver.api.core.cql.Row> executeCql(String statements) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-