@@ -269,7 +269,6 @@ GetMappedRangeResult get_mapped_range(fdb::Transaction& tr,
269269 int target_bytes,
270270 FDBStreamingMode mode,
271271 int iteration,
272- int matchIndex,
273272 fdb_bool_t snapshot,
274273 fdb_bool_t reverse) {
275274 fdb::MappedKeyValueArrayFuture f1 = tr.get_mapped_range (begin_key_name,
@@ -286,7 +285,6 @@ GetMappedRangeResult get_mapped_range(fdb::Transaction& tr,
286285 target_bytes,
287286 mode,
288287 iteration,
289- matchIndex,
290288 snapshot,
291289 reverse);
292290
@@ -961,11 +959,7 @@ std::map<std::string, std::string> fillInRecords(int n) {
961959 return data;
962960}
963961
964- GetMappedRangeResult getMappedIndexEntries (int beginId,
965- int endId,
966- fdb::Transaction& tr,
967- std::string mapper,
968- int matchIndex) {
962+ GetMappedRangeResult getMappedIndexEntries (int beginId, int endId, fdb::Transaction& tr, std::string mapper) {
969963 std::string indexEntryKeyBegin = indexEntryKey (beginId);
970964 std::string indexEntryKeyEnd = indexEntryKey (endId);
971965
@@ -979,19 +973,14 @@ GetMappedRangeResult getMappedIndexEntries(int beginId,
979973 /* target_bytes */ 0 ,
980974 /* FDBStreamingMode */ FDB_STREAMING_MODE_WANT_ALL,
981975 /* iteration */ 0 ,
982- /* matchIndex */ matchIndex,
983976 /* snapshot */ false ,
984977 /* reverse */ 0 );
985978}
986979
987- GetMappedRangeResult getMappedIndexEntries (int beginId,
988- int endId,
989- fdb::Transaction& tr,
990- int matchIndex,
991- bool allMissing) {
980+ GetMappedRangeResult getMappedIndexEntries (int beginId, int endId, fdb::Transaction& tr, bool allMissing) {
992981 std::string mapper =
993982 Tuple::makeTuple (prefix, RECORD, (allMissing ? " {K[2]}" _sr : " {K[3]}" _sr), " {...}" _sr).pack ().toString ();
994- return getMappedIndexEntries (beginId, endId, tr, mapper, matchIndex );
983+ return getMappedIndexEntries (beginId, endId, tr, mapper);
995984}
996985
997986TEST_CASE (" versionstamp_unit_test" ) {
@@ -1070,16 +1059,7 @@ TEST_CASE("fdb_transaction_get_mapped_range") {
10701059 while (1 ) {
10711060 int beginId = 1 ;
10721061 int endId = 19 ;
1073- const double r = deterministicRandom ()->random01 ();
1074- int matchIndex = MATCH_INDEX_ALL;
1075- if (r < 0.25 ) {
1076- matchIndex = MATCH_INDEX_NONE;
1077- } else if (r < 0.5 ) {
1078- matchIndex = MATCH_INDEX_MATCHED_ONLY;
1079- } else if (r < 0.75 ) {
1080- matchIndex = MATCH_INDEX_UNMATCHED_ONLY;
1081- }
1082- auto result = getMappedIndexEntries (beginId, endId, tr, matchIndex, false );
1062+ auto result = getMappedIndexEntries (beginId, endId, tr, false );
10831063
10841064 if (result.err ) {
10851065 fdb::EmptyFuture f1 = tr.on_error (result.err );
@@ -1094,15 +1074,7 @@ TEST_CASE("fdb_transaction_get_mapped_range") {
10941074 int id = beginId;
10951075 for (int i = 0 ; i < expectSize; i++, id++) {
10961076 const auto & mkv = result.mkvs [i];
1097- if (matchIndex == MATCH_INDEX_ALL || i == 0 || i == expectSize - 1 ) {
1098- CHECK (indexEntryKey (id).compare (mkv.key ) == 0 );
1099- } else if (matchIndex == MATCH_INDEX_MATCHED_ONLY) {
1100- CHECK (indexEntryKey (id).compare (mkv.key ) == 0 );
1101- } else if (matchIndex == MATCH_INDEX_UNMATCHED_ONLY) {
1102- CHECK (EMPTY.compare (mkv.key ) == 0 );
1103- } else {
1104- CHECK (EMPTY.compare (mkv.key ) == 0 );
1105- }
1077+ CHECK (indexEntryKey (id).compare (mkv.key ) == 0 );
11061078 CHECK (EMPTY.compare (mkv.value ) == 0 );
11071079 CHECK (mkv.range_results .size () == SPLIT_SIZE);
11081080 for (int split = 0 ; split < SPLIT_SIZE; split++) {
@@ -1124,16 +1096,7 @@ TEST_CASE("fdb_transaction_get_mapped_range_missing_all_secondary") {
11241096 while (1 ) {
11251097 int beginId = 1 ;
11261098 int endId = 19 ;
1127- const double r = deterministicRandom ()->random01 ();
1128- int matchIndex = MATCH_INDEX_ALL;
1129- if (r < 0.25 ) {
1130- matchIndex = MATCH_INDEX_NONE;
1131- } else if (r < 0.5 ) {
1132- matchIndex = MATCH_INDEX_MATCHED_ONLY;
1133- } else if (r < 0.75 ) {
1134- matchIndex = MATCH_INDEX_UNMATCHED_ONLY;
1135- }
1136- auto result = getMappedIndexEntries (beginId, endId, tr, matchIndex, true );
1099+ auto result = getMappedIndexEntries (beginId, endId, tr, true );
11371100
11381101 if (result.err ) {
11391102 fdb::EmptyFuture f1 = tr.on_error (result.err );
@@ -1148,15 +1111,7 @@ TEST_CASE("fdb_transaction_get_mapped_range_missing_all_secondary") {
11481111 int id = beginId;
11491112 for (int i = 0 ; i < expectSize; i++, id++) {
11501113 const auto & mkv = result.mkvs [i];
1151- if (matchIndex == MATCH_INDEX_ALL || i == 0 || i == expectSize - 1 ) {
1152- CHECK (indexEntryKey (id).compare (mkv.key ) == 0 );
1153- } else if (matchIndex == MATCH_INDEX_MATCHED_ONLY) {
1154- CHECK (EMPTY.compare (mkv.key ) == 0 );
1155- } else if (matchIndex == MATCH_INDEX_UNMATCHED_ONLY) {
1156- CHECK (indexEntryKey (id).compare (mkv.key ) == 0 );
1157- } else {
1158- CHECK (EMPTY.compare (mkv.key ) == 0 );
1159- }
1114+ CHECK (indexEntryKey (id).compare (mkv.key ) == 0 );
11601115 CHECK (EMPTY.compare (mkv.value ) == 0 );
11611116 }
11621117 break ;
@@ -1176,7 +1131,6 @@ TEST_CASE("fdb_transaction_get_mapped_range_restricted_to_serializable") {
11761131 /* target_bytes */ 0 ,
11771132 /* FDBStreamingMode */ FDB_STREAMING_MODE_WANT_ALL,
11781133 /* iteration */ 0 ,
1179- /* matchIndex */ MATCH_INDEX_ALL,
11801134 /* snapshot */ true , // Set snapshot to true
11811135 /* reverse */ 0 );
11821136 ASSERT (result.err == error_code_unsupported_operation);
@@ -1196,7 +1150,6 @@ TEST_CASE("fdb_transaction_get_mapped_range_restricted_to_ryw_enable") {
11961150 /* target_bytes */ 0 ,
11971151 /* FDBStreamingMode */ FDB_STREAMING_MODE_WANT_ALL,
11981152 /* iteration */ 0 ,
1199- /* matchIndex */ MATCH_INDEX_ALL,
12001153 /* snapshot */ false ,
12011154 /* reverse */ 0 );
12021155 ASSERT (result.err == error_code_unsupported_operation);
@@ -1225,7 +1178,7 @@ TEST_CASE("fdb_transaction_get_mapped_range_fail_on_mapper_not_tuple") {
12251178 };
12261179 assertNotTuple (mapper);
12271180 fdb::Transaction tr (db);
1228- auto result = getMappedIndexEntries (1 , 3 , tr, mapper, MATCH_INDEX_ALL );
1181+ auto result = getMappedIndexEntries (1 , 3 , tr, mapper);
12291182 ASSERT (result.err == error_code_mapper_not_tuple);
12301183}
12311184
0 commit comments