diff options
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/commands/fle2_get_count_info_command.cpp | 15 | ||||
-rw-r--r-- | src/mongo/db/commands/fle2_get_count_info_command.idl | 38 | ||||
-rw-r--r-- | src/mongo/db/fle_crud.cpp | 13 |
3 files changed, 46 insertions, 20 deletions
diff --git a/src/mongo/db/commands/fle2_get_count_info_command.cpp b/src/mongo/db/commands/fle2_get_count_info_command.cpp index b1dd29fd4dd..55642335564 100644 --- a/src/mongo/db/commands/fle2_get_count_info_command.cpp +++ b/src/mongo/db/commands/fle2_get_count_info_command.cpp @@ -78,12 +78,15 @@ QECountInfoReplyTokens tokenFromCountInfo(const FLEEdgeCountInfo& countInfo) { token.setEDCDerivedFromDataTokenAndContentionFactorToken(countInfo.edc.value().toCDR()); } - if (countInfo.cpos) { - token.setCpos(countInfo.cpos.get()); - } - - if (countInfo.apos) { - token.setApos(countInfo.apos.get()); + if (countInfo.cpos || countInfo.apos) { + ESCOptionalPositionsPair spos; + if (countInfo.cpos) { + spos.setCpos(countInfo.cpos.get()); + } + if (countInfo.apos) { + spos.setApos(countInfo.apos.get()); + } + token.setSearchedPositions(spos); } if (countInfo.stats) { diff --git a/src/mongo/db/commands/fle2_get_count_info_command.idl b/src/mongo/db/commands/fle2_get_count_info_command.idl index 8717fa9e32f..0914ee9f5cc 100644 --- a/src/mongo/db/commands/fle2_get_count_info_command.idl +++ b/src/mongo/db/commands/fle2_get_count_info_command.idl @@ -34,6 +34,30 @@ imports: - "mongo/crypto/fle_stats.idl" structs: + ESCPositionsPair: + description: "A pair of non-anchor and anchor positions" + strict: true + fields: + cpos: + description: "non-anchor position" + type: long + apos: + description: "anchor position" + type: long + + ESCOptionalPositionsPair: + description: "A pair of optional non-anchor and anchor positions" + strict: true + fields: + cpos: + description: "non-anchor position" + type: long + optional: true + apos: + description: "anchor position" + type: long + optional: true + QECountInfoReplyTokens: description: "A tokens of ESC information" strict: true @@ -51,13 +75,15 @@ structs: type: bindata_generic cpp_name: EDCDerivedFromDataTokenAndContentionFactorToken optional: true - cpos: - description: "cpos argument returned from emuBinary" - type: long + spos: + description: "positions returned from emuBinary" + type: ESCOptionalPositionsPair + cpp_name: SearchedPositions optional: true - apos: - description: "cpos argument returned from emuBinary" - type: long + npos: + description: "position pair retrieved from the null anchor" + type: ESCPositionsPair + cpp_name: NullAnchorPositions optional: true stats: description: "stats returned for compaction algorithm" diff --git a/src/mongo/db/fle_crud.cpp b/src/mongo/db/fle_crud.cpp index 0868141218c..2cf9e1a5b6f 100644 --- a/src/mongo/db/fle_crud.cpp +++ b/src/mongo/db/fle_crud.cpp @@ -194,14 +194,11 @@ FLEEdgeCountInfo convertTokensToEdgeCount(const QECountInfoReplyTokens& token) { token.getEDCDerivedFromDataTokenAndContentionFactorToken().value()); } - boost::optional<uint64_t> cpos; - if (token.getCpos()) { - cpos = token.getCpos(); - } - - boost::optional<uint64_t> apos; - if (token.getApos()) { - apos = token.getApos(); + boost::optional<uint64_t> cpos, apos; + auto& spos = token.getSearchedPositions(); + if (spos) { + cpos = spos->getCpos(); + apos = spos->getApos(); } auto esc = |