Skip to content
Snippets Groups Projects
Commit 63956fbb authored by Sean Busbey's avatar Sean Busbey
Browse files

[cassandra] properly clear cached containers.

clear containers before we use them rather than after, so that in the case of
exceptions we can recover.

closes #127
parent f25f26f5
No related branches found
No related tags found
No related merge requests found
......@@ -453,6 +453,10 @@ public class CassandraClient10 extends DB {
}
for (int i = 0; i < operationRetries; i++) {
mutations.clear();
mutationMap.clear();
record.clear();
if (debug) {
System.out.println("Inserting key: " + key);
}
......@@ -479,10 +483,6 @@ public class CassandraClient10 extends DB {
client.batch_mutate(record, writeConsistencyLevel);
mutations.clear();
mutationMap.clear();
record.clear();
if (debug) {
System.out
.println("ConsistencyLevel=" + writeConsistencyLevel.toString());
......
......@@ -418,6 +418,10 @@ public class CassandraClient7 extends DB {
}
for (int i = 0; i < operationRetries; i++) {
mutations.clear();
mutationMap.clear();
record.clear();
if (debug) {
System.out.println("Inserting key: " + key);
}
......@@ -444,10 +448,6 @@ public class CassandraClient7 extends DB {
client.batch_mutate(record, ConsistencyLevel.ONE);
mutations.clear();
mutationMap.clear();
record.clear();
return Status.OK;
} catch (Exception e) {
errorexception = e;
......
......@@ -397,6 +397,10 @@ public class CassandraClient8 extends DB {
}
for (int i = 0; i < operationRetries; i++) {
mutations.clear();
mutationMap.clear();
record.clear();
if (debug) {
System.out.println("Inserting key: " + key);
}
......@@ -423,10 +427,6 @@ public class CassandraClient8 extends DB {
client.batch_mutate(record, ConsistencyLevel.ONE);
mutations.clear();
mutationMap.clear();
record.clear();
return Status.OK;
} catch (Exception e) {
errorexception = e;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment