MCPcopy
hub / github.com/questdb/questdb / Key

Class Key

core/src/main/java/io/questdb/cairo/map/OrderedMap.java:1058–1140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1056 }
1057
1058 abstract class Key implements MapKey {
1059 protected long appendAddr;
1060 protected long startAddr;
1061
1062 @Override
1063 public MapValue createValue() {
1064 long keySize = commit();
1065 // calculate hash remembering "key" structure
1066 // [ key size | key block | value block ]
1067 long hashCode = hash();
1068 return createValue(keySize, hashCode);
1069 }
1070
1071 @Override
1072 public MapValue createValue(long hashCode) {
1073 long keySize = commit();
1074 return createValue(keySize, hashCode);
1075 }
1076
1077 @Override
1078 public MapValue findValue() {
1079 return findValue(value);
1080 }
1081
1082 @Override
1083 public MapValue findValue2() {
1084 return findValue(value2);
1085 }
1086
1087 @Override
1088 public MapValue findValue3() {
1089 return findValue(value3);
1090 }
1091
1092 public Key init() {
1093 reset();
1094 return this;
1095 }
1096
1097 @Override
1098 public void put(Record record, RecordSink sink) {
1099 sink.copy(record, this);
1100 }
1101
1102 public abstract void putLong256(long l0, long l1, long l2, long l3);
1103
1104 @Override
1105 public void putRecord(Record value) {
1106 // no-op
1107 }
1108
1109 public void reset() {
1110 startAddr = kPos;
1111 appendAddr = kPos + keyOffset;
1112 }
1113
1114 private MapValue createValue(long keySize, long hashCode) {
1115 int hashCodeLo = Numbers.decodeLowInt(hashCode);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected