Skip to content
Snippets Groups Projects
Commit 275806bd authored by Michael Nitschinger's avatar Michael Nitschinger
Browse files

[couchbase] Fix regression on key selection for scan all.

This fixes a regression introduced by switching over to the raw
workload where the key looks different now. The code trims and
removes the " " so that only the proper key is passed for retrieval.
parent 2c71287e
No related branches found
No related tags found
No related merge requests found
...@@ -608,7 +608,6 @@ public class Couchbase2Client extends DB { ...@@ -608,7 +608,6 @@ public class Couchbase2Client extends DB {
private Status scanAllFields(final String table, final String startkey, final int recordcount, private Status scanAllFields(final String table, final String startkey, final int recordcount,
final Vector<HashMap<String, ByteIterator>> result) { final Vector<HashMap<String, ByteIterator>> result) {
final List<HashMap<String, ByteIterator>> data = new ArrayList<HashMap<String, ByteIterator>>(recordcount); final List<HashMap<String, ByteIterator>> data = new ArrayList<HashMap<String, ByteIterator>>(recordcount);
bucket.async() bucket.async()
.query(N1qlQuery.parameterized( .query(N1qlQuery.parameterized(
scanAllQuery, scanAllQuery,
...@@ -633,7 +632,8 @@ public class Couchbase2Client extends DB { ...@@ -633,7 +632,8 @@ public class Couchbase2Client extends DB {
.flatMap(new Func1<AsyncN1qlQueryRow, Observable<RawJsonDocument>>() { .flatMap(new Func1<AsyncN1qlQueryRow, Observable<RawJsonDocument>>() {
@Override @Override
public Observable<RawJsonDocument> call(AsyncN1qlQueryRow row) { public Observable<RawJsonDocument> call(AsyncN1qlQueryRow row) {
return bucket.async().get(new String(row.byteValue()), RawJsonDocument.class); String id = new String(row.byteValue()).trim();
return bucket.async().get(id.substring(1, id.length()-1), RawJsonDocument.class);
} }
}) })
.map(new Func1<RawJsonDocument, HashMap<String, ByteIterator>>() { .map(new Func1<RawJsonDocument, HashMap<String, ByteIterator>>() {
......
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