Skip to content

Commit

Permalink
merged latest master into mavenized source tree
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewadams committed Nov 26, 2013
2 parents 7385f77 + ec1487d commit a472b5f
Show file tree
Hide file tree
Showing 18 changed files with 547 additions and 805 deletions.
17 changes: 14 additions & 3 deletions attic/gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,15 @@ sourceCompatibility = 1.6
targetCompatibility = 1.6

javadoc {
ext.srcDir = file("${projectDir}/docs/src/api")
destinationDir = file("${buildDir}/api")
ext.srcDir = file("${projectDir}/src/main/doc")
ext.destinationDir = file("${buildDir}/docs/javadoc")
ext.tmpDir = file("${buildDir}/api-work")

configure(options) {
//stylesheetFile = file("${srcDir}/spring-javadoc.css")
stylesheetFile = file("${srcDir}/spring-javadoc.css")
//overview = "${srcDir}/overview.html"
docFilesSubDirs = true

outputLevel = org.gradle.external.javadoc.JavadocOutputLevel.QUIET
breakIterator = true
showFromProtected()
Expand All @@ -94,6 +95,16 @@ javadoc {
exclude "org/springframework/data/cassandra/config/**"
}

logger.error("BuildDir => ${buildDir}");
logger.error("DestDir => ${destinationDir}");
logger.error("ExtDestDir => ${ext.destinationDir}");

copy {
from "src/main/doc/resources"
into "${ext.destinationDir}/resources"
include '**/*'
}

title = "${rootProject.description} ${version} API"
}

Expand Down
2 changes: 1 addition & 1 deletion attic/gradle/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ nettyVersion = 3.6.2.Final
# --------------------
# Project wide version
# --------------------
version=2.0.0.BUILD-SNAPSHOT
version=1.2.0.BUILD-SNAPSHOT

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -398,4 +398,44 @@ <T> List<T> query(PreparedStatementCreator psc, final PreparedStatementBinder ps
*/
Session getSession();

/**
* This is an operation designed for high performance writes. The cql is used to create a PreparedStatement once, then
* all row values are bound to the single PreparedStatement and executed against the Session.
*
* <p>
* This is used internally by the other ingest() methods, but can be used if you want to write your own RowIterator.
* The Object[] length returned by the next() implementation must match the number of bind variables in the CQL.
* </p>
*
* @param cql The CQL
* @param rowIterator Implementation to provide the Object[] to be bound to the CQL.
*/
void ingest(String cql, RowIterator rowIterator);

/**
* This is an operation designed for high performance writes. The cql is used to create a PreparedStatement once, then
* all row values are bound to the single PreparedStatement and executed against the Session.
*
* <p>
* The List<?> length must match the number of bind variables in the CQL.
* </p>
*
* @param cql The CQL
* @param rows List of List<?> with data to bind to the CQL.
*/
void ingest(String cql, List<List<?>> rows);

/**
* This is an operation designed for high performance writes. The cql is used to create a PreparedStatement once, then
* all row values are bound to the single PreparedStatement and executed against the Session.
*
* <p>
* The Object[] length of the nested array must match the number of bind variables in the CQL.
* </p>
*
* @param cql The CQL
* @param rows Object array of Object array of values to bind to the CQL.
*/
void ingest(String cql, Object[][] rows);

}
Original file line number Diff line number Diff line change
Expand Up @@ -560,4 +560,60 @@ public List<T> doInPreparedStatement(PreparedStatement ps) throws DriverExceptio
}
});
}

/* (non-Javadoc)
* @see org.springframework.cassandra.core.CassandraOperations#execute(java.lang.String, org.springframework.cassandra.core.RowProvider, int)
*/
@Override
public void ingest(String cql, RowIterator rowIterator) {

PreparedStatement preparedStatement = getSession().prepare(cql);

while (rowIterator.hasNext()) {
getSession().execute(preparedStatement.bind(rowIterator.next()));
}

}

/* (non-Javadoc)
* @see org.springframework.cassandra.core.CassandraOperations#execute(java.lang.String, java.util.List)
*/
@Override
public void ingest(String cql, List<List<?>> rows) {

Assert.notNull(rows);
Assert.notEmpty(rows);

Object[][] values = new Object[rows.size()][];
int i = 0;
for (List<?> row : rows) {
values[i++] = row.toArray();
}

ingest(cql, values);

}

/* (non-Javadoc)
* @see org.springframework.cassandra.core.CassandraOperations#execute(java.lang.String, java.lang.Object[][])
*/
@Override
public void ingest(String cql, final Object[][] rows) {

ingest(cql, new RowIterator() {

int index = 0;

@Override
public Object[] next() {
return rows[index++];
}

@Override
public boolean hasNext() {
return index < rows.length;
}

});
}
}

This file was deleted.

Loading

0 comments on commit a472b5f

Please sign in to comment.