diff --git a/ChangeLog.md b/ChangeLog.md index 32344fb..2e23fae 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,6 @@ +## 0.0.15 +- Better error handling for case when C* inserts are failing + ## 0.0.14 - Updated cassandra-unloader to add support for collections, consistency level, ssl, etc diff --git a/README.md b/README.md index 54d30a5..fe20342 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,11 @@ loading of various types of delimited files, including ### Downloading This utility has already been built, and is available at -https://github.com/brianmhess/cassandra-loader/releases/download/v0.0.14/cassandra-loader +https://github.com/brianmhess/cassandra-loader/releases/download/v0.0.15/cassandra-loader Get it with wget: ``` -wget https://github.com/brianmhess/cassandra-loader/releases/download/v0.0.14/cassandra-loader +wget https://github.com/brianmhess/cassandra-loader/releases/download/v0.0.15/cassandra-loader ``` ### Building @@ -255,7 +255,7 @@ cassandra-unloader Usage statement: ``` -version: 0.0.14 +version: 0.0.15 Usage: -f -host -schema [OPTIONS] OPTIONS: -configFile File with configuration options diff --git a/build.gradle b/build.gradle index fae7358..eac2729 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'java' apply plugin: 'application' -def versionNum = '0.0.14' +def versionNum = '0.0.15' allprojects { tasks.withType(JavaCompile) { diff --git a/src/main/java/com/datastax/loader/CqlDelimLoad.java b/src/main/java/com/datastax/loader/CqlDelimLoad.java index 090f666..55f2570 100644 --- a/src/main/java/com/datastax/loader/CqlDelimLoad.java +++ b/src/main/java/com/datastax/loader/CqlDelimLoad.java @@ -86,7 +86,7 @@ import com.codahale.metrics.Timer; public class CqlDelimLoad { - private String version = "0.0.14"; + private String version = "0.0.15"; private String host = null; private int port = 9042; private String username = null; diff --git a/src/main/java/com/datastax/loader/CqlDelimLoadTask.java b/src/main/java/com/datastax/loader/CqlDelimLoadTask.java index 2fe91da..31bbbf5 100644 --- a/src/main/java/com/datastax/loader/CqlDelimLoadTask.java +++ b/src/main/java/com/datastax/loader/CqlDelimLoadTask.java @@ -86,6 +86,7 @@ class CqlDelimLoadTask implements Callable { private PrintStream badParsePrinter = null; private PrintStream badInsertPrinter = null; private PrintStream logPrinter = null; + private String logFname = ""; private BufferedReader reader; private File infile; private int numFutures; @@ -160,7 +161,8 @@ private void setup() throws IOException, ParseException { if (null != badDir) { badParsePrinter = new PrintStream(new BufferedOutputStream(new FileOutputStream(badDir + "/" + readerName + BADPARSE))); badInsertPrinter = new PrintStream(new BufferedOutputStream(new FileOutputStream(badDir + "/" + readerName + BADINSERT))); - logPrinter = new PrintStream(new BufferedOutputStream(new FileOutputStream(badDir + "/" + readerName + LOG))); + logFname = badDir + "/" + readerName + LOG; + logPrinter = new PrintStream(new BufferedOutputStream(new FileOutputStream(logFname))); } cdp = new CqlDelimParser(cqlSchema, delimiter, nullString, @@ -230,7 +232,7 @@ private long execute() throws IOException { if (1 == batchSize) { resultSetFuture = session.executeAsync(bind); if (!fm.add(resultSetFuture, line)) { - System.err.println("Oh no - cleaning up"); + System.err.println("There was an error. Please check the log file for more information (" + logFname + ")"); cleanup(false); return -2; } @@ -241,7 +243,7 @@ private long execute() throws IOException { if (batchSize == batch.size()) { resultSetFuture = session.executeAsync(batch); if (!fm.add(resultSetFuture, line)) { - System.err.println("Uh oh - cleaning up"); + System.err.println("There was an error. Please check the log file for more information (" + logFname + ")"); cleanup(false); return -2; } diff --git a/src/main/java/com/datastax/loader/CqlDelimUnload.java b/src/main/java/com/datastax/loader/CqlDelimUnload.java index 93627eb..32abc09 100644 --- a/src/main/java/com/datastax/loader/CqlDelimUnload.java +++ b/src/main/java/com/datastax/loader/CqlDelimUnload.java @@ -75,7 +75,7 @@ public class CqlDelimUnload { - private String version = "0.0.14"; + private String version = "0.0.15"; private String host = null; private int port = 9042; private String username = null;