I'm seeing the following exception when using version 3.17.6 of Chronicle map.
Exception in thread "main" java.lang.ClassCastException: net.openhft.chronicle.map.impl.CompiledMapIterationContext cannot be cast to net.openhft.chronicle.set.SetEntry
at net.openhft.chronicle.set.SetFromMap.lambda$forEachEntry$1(SetFromMap.java:188)
at net.openhft.chronicle.map.AbstractChronicleMap.lambda$forEachEntry$5(AbstractChronicleMap.java:234)
at net.openhft.chronicle.map.impl.CompiledMapIterationContext.forEachTierEntryWhile(CompiledMapIterationContext.java:3885)
at net.openhft.chronicle.map.impl.CompiledMapIterationContext.innerForEachSegmentEntryWhile(CompiledMapIterationContext.java:3920)
at net.openhft.chronicle.map.impl.CompiledMapIterationContext.forEachSegmentEntryWhile(CompiledMapIterationContext.java:3940)
at net.openhft.chronicle.map.AbstractChronicleMap.forEachEntryWhile(AbstractChronicleMap.java:244)
at net.openhft.chronicle.map.AbstractChronicleMap.forEachEntry(AbstractChronicleMap.java:233)
at net.openhft.chronicle.set.SetFromMap.forEachEntry(SetFromMap.java:188)
In SetFromMap.lambda$forEachEntry$1 the type of e is CompiledMapIterationContext. which is, as far as I can tell, is not a SetEntry.
Of course, it is possible that I'm doing something wrong - I've just started using this software. Sample program below:
static class MySetEntryConsumer implements Consumer<SetEntry<LongValue>> {
final LongValue reusableValue = Values.newHeapInstance(LongValue.class);
long max = 0;
@Override
public void accept(SetEntry<LongValue> entry) {
if (max < entry.key().getUsing(reusableValue).getValue()) {
max = entry.key().getUsing(reusableValue).getValue();
}
}
}
public static void main(String[] args) {
final long size = 1024 * 1024 * 16;
try (final ChronicleSet<LongValue> mySet = ChronicleSet
.of(LongValue.class)
.name("my-set")
.entries(size)
.create()) {
final LongValue reusableValue = Values.newHeapInstance(LongValue.class);
for (long i = 0; i < size; i++) {
reusableValue.setValue(i);
mySet.add(reusableValue);
}
assert mySet.size() == size;
MySetEntryConsumer mySetEntryConsumer = new MySetEntryConsumer();
mySet.forEachEntry(mySetEntryConsumer);
assert mySetEntryConsumer.max == size - 1;
}
}
I'm seeing the following exception when using version 3.17.6 of Chronicle map.
In
SetFromMap.lambda$forEachEntry$1
the type ofe
isCompiledMapIterationContext
. which is, as far as I can tell, is not aSetEntry
.Of course, it is possible that I'm doing something wrong - I've just started using this software. Sample program below: