Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/ru/rt/restream/reindexer/binding/Consts.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public final class Consts {
public static final int QUERY_RESULT_EXPLAIN = 2;
public static final int QUERY_RESULT_SHARDING_VERSION = 3;
public static final int QUERY_RESULT_SHARD_ID = 4;
// incarnation tags are not supported int java connector
// incarnation tags are not supported in java connector
public static final int QUERY_RESULT_INCARNATION_TAGS = 5;
public static final int QUERY_RESULT_RANK_FORMAT = 6;

Expand Down Expand Up @@ -117,7 +117,7 @@ public final class Consts {

public static final long BINDING_CAPABILITY_QR_IDLE_TIMEOUTS = 1;
public static final long BINDING_CAPABILITY_RESULTS_WITH_SHARD_IDS = 1 << 1;
// incarnation tags are not supported int java connector
// incarnation tags are not supported in java connector
public static final long BINDING_CAPABILITY_NAMESPACE_INCARNATIONS = 1 << 2;
public static final long BINDING_CAPABILITY_COMPLEX_RANK = 1 << 3;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import static ru.rt.restream.reindexer.binding.Consts.QUERY_RESULT_AGGREGATION;
import static ru.rt.restream.reindexer.binding.Consts.QUERY_RESULT_END;
import static ru.rt.restream.reindexer.binding.Consts.QUERY_RESULT_EXPLAIN;
import static ru.rt.restream.reindexer.binding.Consts.QUERY_RESULT_INCARNATION_TAGS;
import static ru.rt.restream.reindexer.binding.Consts.QUERY_RESULT_RANK_FORMAT;
import static ru.rt.restream.reindexer.binding.Consts.QUERY_RESULT_SHARDING_VERSION;
import static ru.rt.restream.reindexer.binding.Consts.QUERY_RESULT_SHARD_ID;
Expand Down Expand Up @@ -125,6 +126,18 @@ public QueryResult read(byte[] rawQueryResult) {
case QUERY_RESULT_SHARD_ID:
queryResult.setShardId((int) buffer.getVarUInt());
break;
case QUERY_RESULT_INCARNATION_TAGS:
// Read the result from the buffer, but do not use it -
// incarnation tags are not supported in java connector.
int shardsCnt = (int) buffer.getVarUInt();
for (int i = 0; i < shardsCnt; i++) {
int shardId = (int) buffer.getVarInt();
int nsCnt = (int) buffer.getVarUInt();
for (int j = 0; j < nsCnt; j++) {
buffer.getVarInt();
}
}
break;
case QUERY_RESULT_RANK_FORMAT:
int format = (int) buffer.getVarUInt();
if (format != RANK_FORMAT_SINGLE_FLOAT) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

import static ru.rt.restream.reindexer.binding.Consts.APP_PROPERTY_NAME;
import static ru.rt.restream.reindexer.binding.Consts.BINDING_CAPABILITY_COMPLEX_RANK;
import static ru.rt.restream.reindexer.binding.Consts.BINDING_CAPABILITY_NAMESPACE_INCARNATIONS;
import static ru.rt.restream.reindexer.binding.Consts.BINDING_CAPABILITY_RESULTS_WITH_SHARD_IDS;
import static ru.rt.restream.reindexer.binding.Consts.DEF_APP_NAME;
import static ru.rt.restream.reindexer.binding.Consts.REINDEXER_VERSION;
Expand Down Expand Up @@ -124,7 +125,9 @@ public PhysicalConnection(String host, int port, String user, String password, S
-1, // expectedClusterID
REINDEXER_VERSION,
getAppName(),
BINDING_CAPABILITY_RESULTS_WITH_SHARD_IDS | BINDING_CAPABILITY_COMPLEX_RANK);
BINDING_CAPABILITY_RESULTS_WITH_SHARD_IDS
| BINDING_CAPABILITY_COMPLEX_RANK
| BINDING_CAPABILITY_NAMESPACE_INCARNATIONS);
} catch (Exception e) {
onError(e);
throw new NetworkException(e);
Expand Down