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

Merge pull request #323 from bigbes/master

Issue #319: [tarantool] Error on scan operation and replace problems
parents 45631e8b 25e0ec89
No related branches found
No related tags found
No related merge requests found
...@@ -92,7 +92,7 @@ public class TarantoolClient extends DB { ...@@ -92,7 +92,7 @@ public class TarantoolClient extends DB {
j += 2; j += 2;
} }
try { try {
this.connection.insert(this.spaceNo, tuple); this.connection.replace(this.spaceNo, tuple);
} catch (TarantoolException exc) { } catch (TarantoolException exc) {
logger.log(Level.SEVERE,"Can't insert element", exc); logger.log(Level.SEVERE,"Can't insert element", exc);
return 1; return 1;
...@@ -131,7 +131,7 @@ public class TarantoolClient extends DB { ...@@ -131,7 +131,7 @@ public class TarantoolClient extends DB {
public int scan(String table, String startkey, public int scan(String table, String startkey,
int recordcount, Set<String> fields, int recordcount, Set<String> fields,
Vector<HashMap<String, ByteIterator>> result) { Vector<HashMap<String, ByteIterator>> result) {
List<String> response; List<List<String>> response;
try { try {
response = this.connection.select(this.spaceNo, 0, Arrays.asList(startkey), 0, recordcount, 6); response = this.connection.select(this.spaceNo, 0, Arrays.asList(startkey), 0, recordcount, 6);
} catch (TarantoolException exc) { } catch (TarantoolException exc) {
...@@ -140,9 +140,11 @@ public class TarantoolClient extends DB { ...@@ -140,9 +140,11 @@ public class TarantoolClient extends DB {
} catch (NullPointerException exc) { } catch (NullPointerException exc) {
return 1; return 1;
} }
HashMap<String, ByteIterator> temp = tuple_convert_filter(response, fields); for(List<String> i: response) {
if (!temp.isEmpty()) HashMap<String, ByteIterator> temp = tuple_convert_filter(i, fields);
result.add((HashMap<String, ByteIterator>) temp.clone()); if (!temp.isEmpty())
result.add((HashMap<String, ByteIterator>) temp.clone());
}
return 0; return 0;
} }
......
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