| 89 | } |
| 90 | |
| 91 | std::string tupleToString(Tuple const& tuple) { |
| 92 | std::string str = "("; |
| 93 | for (int i = 0; i < tuple.size(); ++i) { |
| 94 | Tuple::ElementType type = tuple.getType(i); |
| 95 | if (type == Tuple::NULL_TYPE) { |
| 96 | str += "NULL"; |
| 97 | } else if (type == Tuple::BYTES || type == Tuple::UTF8) { |
| 98 | if (type == Tuple::UTF8) { |
| 99 | str += "u"; |
| 100 | } |
| 101 | str += "\'" + tuple.getString(i).printable() + "\'"; |
| 102 | } else if (type == Tuple::INT) { |
| 103 | str += format("%ld", tuple.getInt(i)); |
| 104 | } else if (type == Tuple::FLOAT) { |
| 105 | str += format("%f", tuple.getFloat(i)); |
| 106 | } else if (type == Tuple::DOUBLE) { |
| 107 | str += format("%f", tuple.getDouble(i)); |
| 108 | } else if (type == Tuple::BOOL) { |
| 109 | str += tuple.getBool(i) ? "true" : "false"; |
| 110 | } else if (type == Tuple::UUID) { |
| 111 | Uuid u = tuple.getUuid(i); |
| 112 | str += format("%016llx%016llx", *(uint64_t*)u.getData().begin(), *(uint64_t*)(u.getData().begin() + 8)); |
| 113 | } else if (type == Tuple::NESTED) { |
| 114 | str += tupleToString(tuple.getNested(i)); |
| 115 | } else if (type == Tuple::VERSIONSTAMP) { |
| 116 | Versionstamp versionstamp = tuple.getVersionstamp(i); |
| 117 | str += format("Transaction Version: '%ld', BatchNumber: '%hd', UserVersion : '%hd'", |
| 118 | versionstamp.getVersion(), |
| 119 | versionstamp.getBatchNumber(), |
| 120 | versionstamp.getUserVersion()); |
| 121 | } else { |
| 122 | ASSERT(false); |
| 123 | } |
| 124 | |
| 125 | if (i < tuple.size() - 1) { |
| 126 | str += ", "; |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | str += ")"; |
| 131 | return str; |
| 132 | } |
| 133 | |
| 134 | ACTOR Future<Standalone<RangeResultRef>> getRange(Reference<Transaction> tr, |
| 135 | KeySelectorRef begin, |
no test coverage detected