Skip to content

Commit

Permalink
better error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Aug 20, 2015
1 parent d79db43 commit 78680d8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -255,7 +255,7 @@ cassandra-unloader

Usage statement:
```
version: 0.0.14
version: 0.0.15
Usage: -f <outputStem> -host <ipaddress> -schema <schema> [OPTIONS]
OPTIONS:
-configFile <filename> File with configuration options
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'java'
apply plugin: 'application'

def versionNum = '0.0.14'
def versionNum = '0.0.15'

allprojects {
tasks.withType(JavaCompile) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/datastax/loader/CqlDelimLoad.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/com/datastax/loader/CqlDelimLoadTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class CqlDelimLoadTask implements Callable<Long> {
private PrintStream badParsePrinter = null;
private PrintStream badInsertPrinter = null;
private PrintStream logPrinter = null;
private String logFname = "";
private BufferedReader reader;
private File infile;
private int numFutures;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/datastax/loader/CqlDelimUnload.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 78680d8

Please sign in to comment.