Skip to content

Commit

Permalink
Merge pull request brianfrankcooper#323 from bigbes/master
Browse files Browse the repository at this point in the history
Issue brianfrankcooper#319: [tarantool] Error on scan operation and replace problems
  • Loading branch information
busbey committed Jun 25, 2015
2 parents b36e2ee + 88128ea commit d2827a2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tarantool/src/main/java/com/yahoo/ycsb/db/TarantoolClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public int insert(String table, String key, HashMap<String, ByteIterator> values
j += 2;
}
try {
this.connection.insert(this.spaceNo, tuple);
this.connection.replace(this.spaceNo, tuple);
} catch (TarantoolException exc) {
logger.log(Level.SEVERE,"Can't insert element", exc);
return 1;
Expand Down Expand Up @@ -131,7 +131,7 @@ public int read(String table, String key, Set<String> fields,
public int scan(String table, String startkey,
int recordcount, Set<String> fields,
Vector<HashMap<String, ByteIterator>> result) {
List<String> response;
List<List<String>> response;
try {
response = this.connection.select(this.spaceNo, 0, Arrays.asList(startkey), 0, recordcount, 6);
} catch (TarantoolException exc) {
Expand All @@ -140,9 +140,11 @@ public int scan(String table, String startkey,
} catch (NullPointerException exc) {
return 1;
}
HashMap<String, ByteIterator> temp = tuple_convert_filter(response, fields);
if (!temp.isEmpty())
result.add((HashMap<String, ByteIterator>) temp.clone());
for(List<String> i: response) {
HashMap<String, ByteIterator> temp = tuple_convert_filter(i, fields);
if (!temp.isEmpty())
result.add((HashMap<String, ByteIterator>) temp.clone());
}
return 0;
}

Expand Down

0 comments on commit d2827a2

Please sign in to comment.