Avoid multiple drops
This commit is contained in:
parent
9c86a51a69
commit
20c19f662b
@ -30,6 +30,7 @@ public class LLDelta extends LiveResourceSupport<LLDelta, LLDelta> {
|
||||
}
|
||||
|
||||
public static LLDelta of(Send<Buffer> min, Send<Buffer> max) {
|
||||
assert (min == null && max == null) || (min != max);
|
||||
return new LLDelta(min, max, d -> {});
|
||||
}
|
||||
|
||||
@ -80,17 +81,16 @@ public class LLDelta extends LiveResourceSupport<LLDelta, LLDelta> {
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringJoiner(", ", LLDelta.class.getSimpleName() + "[", "]")
|
||||
.add("min=" + LLUtils.toString(previous))
|
||||
.add("max=" + LLUtils.toString(current))
|
||||
.add("min=" + LLUtils.toStringSafe(previous))
|
||||
.add("max=" + LLUtils.toStringSafe(current))
|
||||
.toString();
|
||||
}
|
||||
|
||||
public LLDelta copy() {
|
||||
ensureOwned();
|
||||
return new LLDelta(previous != null ? previous.copy().send() : null,
|
||||
current != null ? current.copy().send() : null,
|
||||
d -> {}
|
||||
);
|
||||
var prevCopy = previous != null ? previous.copy().send() : null;
|
||||
Send<Buffer> curCopy = current != null ? current.copy().send() : null;
|
||||
return new LLDelta(prevCopy, curCopy, d -> {});
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -100,10 +100,8 @@ public class LLDelta extends LiveResourceSupport<LLDelta, LLDelta> {
|
||||
|
||||
@Override
|
||||
protected Owned<LLDelta> prepareSend() {
|
||||
Send<Buffer> minSend;
|
||||
Send<Buffer> maxSend;
|
||||
minSend = this.previous != null ? this.previous.send() : null;
|
||||
maxSend = this.current != null ? this.current.send() : null;
|
||||
Send<Buffer> minSend = this.previous != null ? this.previous.send() : null;
|
||||
Send<Buffer> maxSend = this.current != null ? this.current.send() : null;
|
||||
return drop -> new LLDelta(minSend, maxSend, drop);
|
||||
}
|
||||
|
||||
@ -112,17 +110,17 @@ public class LLDelta extends LiveResourceSupport<LLDelta, LLDelta> {
|
||||
private final Drop<LLDelta> delegate;
|
||||
|
||||
public CloseOnDrop(Drop<LLDelta> drop) {
|
||||
if (drop instanceof CloseOnDrop closeOnDrop) {
|
||||
this.delegate = closeOnDrop.delegate;
|
||||
} else {
|
||||
this.delegate = drop;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drop(LLDelta obj) {
|
||||
if (obj.previous != null && obj.previous.isAccessible()) {
|
||||
obj.previous.close();
|
||||
}
|
||||
if (obj.current != null && obj.current.isAccessible()) {
|
||||
obj.current.close();
|
||||
}
|
||||
if (obj.previous != null) obj.previous.close();
|
||||
if (obj.current != null) obj.current.close();
|
||||
delegate.drop(obj);
|
||||
}
|
||||
}
|
||||
|
@ -115,17 +115,17 @@ public class LLEntry extends LiveResourceSupport<LLEntry, LLEntry> {
|
||||
private final Drop<LLEntry> delegate;
|
||||
|
||||
public CloseOnDrop(Drop<LLEntry> drop) {
|
||||
if (drop instanceof CloseOnDrop closeOnDrop) {
|
||||
this.delegate = closeOnDrop.delegate;
|
||||
} else {
|
||||
this.delegate = drop;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drop(LLEntry obj) {
|
||||
if (obj.key.isAccessible()) {
|
||||
obj.key.close();
|
||||
}
|
||||
if (obj.value.isAccessible()) {
|
||||
obj.value.close();
|
||||
}
|
||||
delegate.drop(obj);
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import io.net5.buffer.api.Owned;
|
||||
import io.net5.buffer.api.Send;
|
||||
import io.net5.buffer.api.internal.ResourceSupport;
|
||||
import java.util.StringJoiner;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Range of data, from min (inclusive),to max (exclusive)
|
||||
@ -15,8 +16,11 @@ import java.util.StringJoiner;
|
||||
public class LLRange extends LiveResourceSupport<LLRange, LLRange> {
|
||||
|
||||
private static final LLRange RANGE_ALL = new LLRange(null, null, null, d -> {});
|
||||
@Nullable
|
||||
private Buffer min;
|
||||
@Nullable
|
||||
private Buffer max;
|
||||
@Nullable
|
||||
private Buffer single;
|
||||
|
||||
private LLRange(Send<Buffer> min, Send<Buffer> max, Send<Buffer> single, Drop<LLRange> drop) {
|
||||
@ -207,14 +211,18 @@ public class LLRange extends LiveResourceSupport<LLRange, LLRange> {
|
||||
private final Drop<LLRange> delegate;
|
||||
|
||||
public CloseOnDrop(Drop<LLRange> drop) {
|
||||
if (drop instanceof CloseOnDrop closeOnDrop) {
|
||||
this.delegate = closeOnDrop.delegate;
|
||||
} else {
|
||||
this.delegate = drop;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drop(LLRange obj) {
|
||||
if (obj.min != null && obj.min.isAccessible()) obj.min.close();
|
||||
if (obj.max != null && obj.max.isAccessible()) obj.max.close();
|
||||
if (obj.single != null && obj.single.isAccessible()) obj.single.close();
|
||||
if (obj.min != null) obj.min.close();
|
||||
if (obj.max != null) obj.max.close();
|
||||
if (obj.single != null) obj.single.close();
|
||||
delegate.drop(obj);
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import it.cavallium.dbengine.client.BadBlock;
|
||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||
import it.cavallium.dbengine.database.LLDictionary;
|
||||
import it.cavallium.dbengine.database.LLDictionaryResultType;
|
||||
import it.cavallium.dbengine.database.LLEntry;
|
||||
import it.cavallium.dbengine.database.LLRange;
|
||||
import it.cavallium.dbengine.database.LLSnapshot;
|
||||
import it.cavallium.dbengine.database.LLUtils;
|
||||
@ -427,23 +428,23 @@ public class DatabaseMapDictionaryDeep<T, U, US extends DatabaseStage<U>> extend
|
||||
this.range = null;
|
||||
}
|
||||
|
||||
private static class CloseOnDrop<T, U, US extends DatabaseStage<U>> implements
|
||||
Drop<DatabaseMapDictionaryDeep<T, U, US>> {
|
||||
private static class CloseOnDrop<T, U, US extends DatabaseStage<U>>
|
||||
implements Drop<DatabaseMapDictionaryDeep<T, U, US>> {
|
||||
|
||||
private final Drop<DatabaseMapDictionaryDeep<T,U,US>> delegate;
|
||||
|
||||
public CloseOnDrop(Drop<DatabaseMapDictionaryDeep<T, U, US>> drop) {
|
||||
if (drop instanceof CloseOnDrop<T, U, US> closeOnDrop) {
|
||||
this.delegate = closeOnDrop.delegate;
|
||||
} else {
|
||||
this.delegate = drop;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drop(DatabaseMapDictionaryDeep<T, U, US> obj) {
|
||||
if (obj.range != null) {
|
||||
obj.range.close();
|
||||
}
|
||||
if (obj.keyPrefix != null) {
|
||||
obj.keyPrefix.close();
|
||||
}
|
||||
delegate.drop(obj);
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import io.net5.buffer.api.Send;
|
||||
import it.cavallium.dbengine.client.BadBlock;
|
||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||
import it.cavallium.dbengine.database.LLDictionary;
|
||||
import it.cavallium.dbengine.database.LLEntry;
|
||||
import it.cavallium.dbengine.database.LLUtils;
|
||||
import it.cavallium.dbengine.database.LiveResourceSupport;
|
||||
import it.cavallium.dbengine.database.UpdateMode;
|
||||
@ -327,14 +328,16 @@ public class DatabaseMapDictionaryHashed<T, U, TH> extends
|
||||
private final Drop<DatabaseMapDictionaryHashed<T,U,TH>> delegate;
|
||||
|
||||
public CloseOnDrop(Drop<DatabaseMapDictionaryHashed<T,U,TH>> drop) {
|
||||
if (drop instanceof CloseOnDrop<T, U, TH> closeOnDrop) {
|
||||
this.delegate = closeOnDrop.delegate;
|
||||
} else {
|
||||
this.delegate = drop;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drop(DatabaseMapDictionaryHashed<T, U, TH> obj) {
|
||||
if (obj.subDictionary != null) {
|
||||
obj.subDictionary.close();
|
||||
}
|
||||
delegate.drop(obj);
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||
import it.cavallium.dbengine.database.Delta;
|
||||
import it.cavallium.dbengine.database.LLDictionary;
|
||||
import it.cavallium.dbengine.database.LLDictionaryResultType;
|
||||
import it.cavallium.dbengine.database.LLEntry;
|
||||
import it.cavallium.dbengine.database.LLRange;
|
||||
import it.cavallium.dbengine.database.LLSnapshot;
|
||||
import it.cavallium.dbengine.database.LLUtils;
|
||||
@ -156,14 +157,16 @@ public class DatabaseSingle<U> extends ResourceSupport<DatabaseStage<U>, Databas
|
||||
private final Drop<DatabaseSingle<U>> delegate;
|
||||
|
||||
public CloseOnDrop(Drop<DatabaseSingle<U>> drop) {
|
||||
if (drop instanceof CloseOnDrop<U> closeOnDrop) {
|
||||
this.delegate = closeOnDrop.delegate;
|
||||
} else {
|
||||
this.delegate = drop;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drop(DatabaseSingle<U> obj) {
|
||||
if (obj.key != null) {
|
||||
obj.key.close();
|
||||
}
|
||||
delegate.drop(obj);
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import it.cavallium.dbengine.client.BadBlock;
|
||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||
import it.cavallium.dbengine.database.Column;
|
||||
import it.cavallium.dbengine.database.Delta;
|
||||
import it.cavallium.dbengine.database.LLEntry;
|
||||
import it.cavallium.dbengine.database.LLUtils;
|
||||
import it.cavallium.dbengine.database.LiveResourceSupport;
|
||||
import it.cavallium.dbengine.database.UpdateReturnMode;
|
||||
@ -223,14 +224,16 @@ public class DatabaseSingleBucket<K, V, TH>
|
||||
private final Drop<DatabaseSingleBucket<K, V, TH>> delegate;
|
||||
|
||||
public CloseOnDrop(Drop<DatabaseSingleBucket<K, V, TH>> drop) {
|
||||
if (drop instanceof CloseOnDrop<K, V, TH> closeOnDrop) {
|
||||
this.delegate = closeOnDrop.delegate;
|
||||
} else {
|
||||
this.delegate = drop;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drop(DatabaseSingleBucket<K, V, TH> obj) {
|
||||
if (obj.bucketStage != null) {
|
||||
obj.bucketStage.close();
|
||||
}
|
||||
delegate.drop(obj);
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import it.cavallium.dbengine.client.BadBlock;
|
||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||
import it.cavallium.dbengine.client.Mapper;
|
||||
import it.cavallium.dbengine.database.Delta;
|
||||
import it.cavallium.dbengine.database.LLEntry;
|
||||
import it.cavallium.dbengine.database.LLUtils;
|
||||
import it.cavallium.dbengine.database.UpdateReturnMode;
|
||||
import it.cavallium.dbengine.database.serialization.SerializationException;
|
||||
@ -174,14 +175,16 @@ public class DatabaseSingleMapped<A, B> extends ResourceSupport<DatabaseStage<A>
|
||||
private final Drop<DatabaseSingleMapped<A, B>> delegate;
|
||||
|
||||
public CloseOnDrop(Drop<DatabaseSingleMapped<A, B>> drop) {
|
||||
if (drop instanceof CloseOnDrop<A, B> closeOnDrop) {
|
||||
this.delegate = closeOnDrop.delegate;
|
||||
} else {
|
||||
this.delegate = drop;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drop(DatabaseSingleMapped<A, B> obj) {
|
||||
if (obj.serializedSingle != null) {
|
||||
obj.serializedSingle.close();
|
||||
}
|
||||
delegate.drop(obj);
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import io.net5.buffer.api.Owned;
|
||||
import io.net5.buffer.api.Resource;
|
||||
import io.net5.buffer.api.Send;
|
||||
import io.net5.buffer.api.internal.ResourceSupport;
|
||||
import it.cavallium.dbengine.database.LLEntry;
|
||||
import it.cavallium.dbengine.database.LiveResourceSupport;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
|
||||
import java.io.IOException;
|
||||
@ -93,12 +94,16 @@ public interface LLIndexSearchers extends Resource<LLIndexSearchers> {
|
||||
private final Drop<UnshardedIndexSearchers> delegate;
|
||||
|
||||
public CloseOnDrop(Drop<UnshardedIndexSearchers> drop) {
|
||||
if (drop instanceof CloseOnDrop closeOnDrop) {
|
||||
this.delegate = closeOnDrop.delegate;
|
||||
} else {
|
||||
this.delegate = drop;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drop(UnshardedIndexSearchers obj) {
|
||||
if (obj.indexSearcher != null) obj.indexSearcher.close();
|
||||
obj.indexSearcher.close();
|
||||
delegate.drop(obj);
|
||||
}
|
||||
}
|
||||
@ -182,24 +187,21 @@ public interface LLIndexSearchers extends Resource<LLIndexSearchers> {
|
||||
|
||||
private static class CloseOnDrop implements Drop<ShardedIndexSearchers> {
|
||||
|
||||
private volatile boolean dropped = false;
|
||||
private final Drop<ShardedIndexSearchers> delegate;
|
||||
|
||||
public CloseOnDrop(Drop<ShardedIndexSearchers> drop) {
|
||||
if (drop instanceof CloseOnDrop closeOnDrop) {
|
||||
this.delegate = closeOnDrop.delegate;
|
||||
} else {
|
||||
this.delegate = drop;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drop(ShardedIndexSearchers obj) {
|
||||
assert !dropped;
|
||||
if (obj.indexSearchers != null) {
|
||||
for (LLIndexSearcher indexSearcher : obj.indexSearchers) {
|
||||
if (indexSearcher.isAccessible()) {
|
||||
indexSearcher.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
dropped = true;
|
||||
delegate.drop(obj);
|
||||
}
|
||||
}
|
||||
|
@ -930,6 +930,10 @@ public class LLLocalDictionary implements LLDictionary {
|
||||
assert newData.isAccessible();
|
||||
dbPut(cfh, null, key.send(), newData.copy().send());
|
||||
}
|
||||
if (newData == prevData && newData != null) {
|
||||
newData = newData.copy();
|
||||
}
|
||||
assert (prevData == null && newData == null) || newData != prevData;
|
||||
return LLDelta.of(
|
||||
prevData != null ? prevData.send() : null,
|
||||
newData != null ? newData.send() : null
|
||||
|
@ -7,6 +7,7 @@ import io.net5.buffer.api.Send;
|
||||
import io.net5.buffer.api.internal.ResourceSupport;
|
||||
import it.cavallium.dbengine.client.SearchResult;
|
||||
import it.cavallium.dbengine.database.LiveResourceSupport;
|
||||
import it.cavallium.dbengine.database.collections.DatabaseSingle;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class NullableBuffer extends LiveResourceSupport<NullableBuffer, NullableBuffer> {
|
||||
@ -54,16 +55,16 @@ public class NullableBuffer extends LiveResourceSupport<NullableBuffer, Nullable
|
||||
private final Drop<NullableBuffer> delegate;
|
||||
|
||||
public CloseOnDrop(Drop<NullableBuffer> drop) {
|
||||
if (drop instanceof CloseOnDrop closeOnDrop) {
|
||||
this.delegate = closeOnDrop.delegate;
|
||||
} else {
|
||||
this.delegate = drop;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drop(NullableBuffer obj) {
|
||||
if (obj.buffer != null) {
|
||||
if (obj.buffer.isAccessible()) {
|
||||
obj.buffer.close();
|
||||
}
|
||||
}
|
||||
if (obj.buffer != null) obj.buffer.close();
|
||||
delegate.drop(obj);
|
||||
}
|
||||
}
|
||||
|
@ -229,9 +229,7 @@ public abstract class TestDictionaryMapDeep {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideArgumentsSet")
|
||||
public void testSetValueGetAllValues(UpdateMode updateMode,
|
||||
String key,
|
||||
Map<String, String> value,
|
||||
public void testSetValueGetAllValues(UpdateMode updateMode, String key, Map<String, String> value,
|
||||
boolean shouldFail) {
|
||||
var stpVer = StepVerifier
|
||||
.create(tempDb(getTempDbGenerator(), allocator, db -> tempDictionary(db, updateMode)
|
||||
@ -252,7 +250,8 @@ public abstract class TestDictionaryMapDeep {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideArgumentsSet")
|
||||
public void testAtSetGetAllStagesGetAllValues(UpdateMode updateMode, String key, Map<String, String> value, boolean shouldFail) {
|
||||
public void testAtSetGetAllStagesGetAllValues(UpdateMode updateMode, String key, Map<String, String> value,
|
||||
boolean shouldFail) {
|
||||
var remainingEntries = new ConcurrentHashMap<Tuple3<String, String, String>, Boolean>().keySet(true);
|
||||
Step<Tuple3<String, String, String>> stpVer = StepVerifier
|
||||
.create(tempDb(getTempDbGenerator(), allocator, db -> tempDictionary(db, updateMode)
|
||||
@ -302,13 +301,24 @@ public abstract class TestDictionaryMapDeep {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource({"provideArgumentsPut"})
|
||||
public void testAtPutValueAtGetValue(UpdateMode updateMode, String key1, String key2, String value, boolean shouldFail) {
|
||||
public void testAtPutValueAtGetValue(UpdateMode updateMode, String key1, String key2, String value,
|
||||
boolean shouldFail) {
|
||||
var stpVer = StepVerifier
|
||||
.create(tempDb(getTempDbGenerator(), allocator, db -> tempDictionary(db, updateMode)
|
||||
.map(dict -> tempDatabaseMapDictionaryDeepMap(dict, 5, 6))
|
||||
.flatMap(map -> map
|
||||
.at(null, key1).flatMap(v -> v.putValue(key2, value).doFinally(s -> v.close()))
|
||||
.then(map.at(null, key1).flatMap(v -> v.getValue(null, key2).doFinally(s -> v.close())))
|
||||
.at(null, key1)
|
||||
.flatMap(v -> v
|
||||
.putValue(key2, value)
|
||||
.doFinally(s -> v.close())
|
||||
)
|
||||
.then(map
|
||||
.at(null, key1)
|
||||
.flatMap(v -> v
|
||||
.getValue(null, key2)
|
||||
.doFinally(s -> v.close())
|
||||
)
|
||||
)
|
||||
.doFinally(s -> map.close())
|
||||
)
|
||||
));
|
||||
@ -327,8 +337,8 @@ public abstract class TestDictionaryMapDeep {
|
||||
.create(tempDb(getTempDbGenerator(), allocator, db -> tempDictionary(db, updateMode)
|
||||
.map(dict -> tempDatabaseMapDictionaryDeepMap(dict, 5, 6))
|
||||
.flatMapMany(map -> Flux
|
||||
.concat(
|
||||
map
|
||||
.concat
|
||||
(map
|
||||
.putValueAndGetPrevious(key, Map.of("error?", "error."))
|
||||
.defaultIfEmpty(Map.of("nothing", "nothing")),
|
||||
map.putValueAndGetPrevious(key, value),
|
||||
@ -347,7 +357,8 @@ public abstract class TestDictionaryMapDeep {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideArgumentsPut")
|
||||
public void testAtPutValueAndGetPrevious(UpdateMode updateMode, String key1, String key2, String value, boolean shouldFail) {
|
||||
public void testAtPutValueAndGetPrevious(UpdateMode updateMode, String key1, String key2, String value,
|
||||
boolean shouldFail) {
|
||||
var stpVer = StepVerifier
|
||||
.create(tempDb(getTempDbGenerator(), allocator, db -> tempDictionary(db, updateMode)
|
||||
.map(dict -> tempDatabaseMapDictionaryDeepMap(dict, 5, 6))
|
||||
@ -385,7 +396,8 @@ public abstract class TestDictionaryMapDeep {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideArgumentsSet")
|
||||
public void testSetValueRemoveAndGetPrevious(UpdateMode updateMode, String key, Map<String, String> value, boolean shouldFail) {
|
||||
public void testSetValueRemoveAndGetPrevious(UpdateMode updateMode, String key, Map<String, String> value,
|
||||
boolean shouldFail) {
|
||||
var stpVer = StepVerifier
|
||||
.create(tempDb(getTempDbGenerator(), allocator, db -> tempDictionary(db, updateMode)
|
||||
.map(dict -> tempDatabaseMapDictionaryDeepMap(dict, 5, 6))
|
||||
@ -408,7 +420,8 @@ public abstract class TestDictionaryMapDeep {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideArgumentsPut")
|
||||
public void testAtPutValueRemoveAndGetPrevious(UpdateMode updateMode, String key1, String key2, String value, boolean shouldFail) {
|
||||
public void testAtPutValueRemoveAndGetPrevious(UpdateMode updateMode, String key1, String key2, String value,
|
||||
boolean shouldFail) {
|
||||
var stpVer = StepVerifier
|
||||
.create(tempDb(getTempDbGenerator(), allocator, db -> tempDictionary(db, updateMode)
|
||||
.map(dict -> tempDatabaseMapDictionaryDeepMap(dict, 5, 6))
|
||||
@ -447,7 +460,8 @@ public abstract class TestDictionaryMapDeep {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideArgumentsSet")
|
||||
public void testSetValueRemoveAndGetStatus(UpdateMode updateMode, String key, Map<String, String> value, boolean shouldFail) {
|
||||
public void testSetValueRemoveAndGetStatus(UpdateMode updateMode, String key, Map<String, String> value,
|
||||
boolean shouldFail) {
|
||||
var stpVer = StepVerifier
|
||||
.create(tempDb(getTempDbGenerator(), allocator, db -> tempDictionary(db, updateMode)
|
||||
.map(dict -> tempDatabaseMapDictionaryDeepMap(dict, 5, 6))
|
||||
@ -470,7 +484,8 @@ public abstract class TestDictionaryMapDeep {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideArgumentsPut")
|
||||
public void testAtPutValueRemoveAndGetStatus(UpdateMode updateMode, String key1, String key2, String value, boolean shouldFail) {
|
||||
public void testAtPutValueRemoveAndGetStatus(UpdateMode updateMode, String key1, String key2, String value,
|
||||
boolean shouldFail) {
|
||||
var stpVer = StepVerifier
|
||||
.create(tempDb(getTempDbGenerator(), allocator, db -> tempDictionary(db, updateMode)
|
||||
.map(dict -> tempDatabaseMapDictionaryDeepMap(dict, 5, 6))
|
||||
@ -630,7 +645,9 @@ public abstract class TestDictionaryMapDeep {
|
||||
if (updateMode != UpdateMode.ALLOW_UNSAFE || shouldFail) {
|
||||
stpVer.verifyError();
|
||||
} else {
|
||||
stpVer.expectNext(Map.of("error?", "error."), Map.of("error?", "error."), Map.of("error?", "error."), value, value).verifyComplete();
|
||||
stpVer
|
||||
.expectNext(Map.of("error?", "error."), Map.of("error?", "error."), Map.of("error?", "error."), value, value)
|
||||
.verifyComplete();
|
||||
}
|
||||
}
|
||||
|
||||
@ -747,7 +764,8 @@ public abstract class TestDictionaryMapDeep {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideArgumentsSetMulti")
|
||||
public void testSetMultiGetMulti(UpdateMode updateMode, Map<String, Map<String, String>> entries, boolean shouldFail) {
|
||||
public void testSetMultiGetMulti(UpdateMode updateMode, Map<String, Map<String, String>> entries,
|
||||
boolean shouldFail) {
|
||||
var remainingEntries = new ConcurrentHashMap<Entry<String, Map<String, String>>, Boolean>().keySet(true);
|
||||
Step<Entry<String, Map<String, String>>> stpVer = StepVerifier
|
||||
.create(tempDb(getTempDbGenerator(), allocator, db -> tempDictionary(db, updateMode)
|
||||
@ -777,7 +795,8 @@ public abstract class TestDictionaryMapDeep {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideArgumentsSetMulti")
|
||||
public void testSetAllValuesGetMulti(UpdateMode updateMode, Map<String, Map<String, String>> entries, boolean shouldFail) {
|
||||
public void testSetAllValuesGetMulti(UpdateMode updateMode, Map<String, Map<String, String>> entries,
|
||||
boolean shouldFail) {
|
||||
var remainingEntries = new ConcurrentHashMap<Entry<String, Map<String, String>>, Boolean>().keySet(true);
|
||||
Step<Entry<String, Map<String, String>>> stpVer = StepVerifier
|
||||
.create(tempDb(getTempDbGenerator(), allocator, db -> tempDictionary(db, updateMode)
|
||||
@ -804,7 +823,8 @@ public abstract class TestDictionaryMapDeep {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideArgumentsSetMulti")
|
||||
public void testSetAllValuesAndGetPrevious(UpdateMode updateMode, Map<String, Map<String, String>> entries, boolean shouldFail) {
|
||||
public void testSetAllValuesAndGetPrevious(UpdateMode updateMode, Map<String, Map<String, String>> entries,
|
||||
boolean shouldFail) {
|
||||
var remainingEntries = new ConcurrentHashMap<Entry<String, Map<String, String>>, Boolean>().keySet(true);
|
||||
Step<Entry<String, Map<String, String>>> stpVer = StepVerifier
|
||||
.create(tempDb(getTempDbGenerator(), allocator, db -> tempDictionary(db, updateMode)
|
||||
@ -862,7 +882,8 @@ public abstract class TestDictionaryMapDeep {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideArgumentsSetMulti")
|
||||
public void testSetAndGetStatus(UpdateMode updateMode, Map<String, Map<String, String>> entries, boolean shouldFail) {
|
||||
public void testSetAndGetStatus(UpdateMode updateMode, Map<String, Map<String, String>> entries,
|
||||
boolean shouldFail) {
|
||||
Step<Boolean> stpVer = StepVerifier
|
||||
.create(tempDb(getTempDbGenerator(), allocator, db -> tempDictionary(db, updateMode)
|
||||
.map(dict -> tempDatabaseMapDictionaryDeepMap(dict, 5, 6))
|
||||
@ -894,7 +915,8 @@ public abstract class TestDictionaryMapDeep {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideArgumentsSetMulti")
|
||||
public void testSetAndGetPrevious(UpdateMode updateMode, Map<String, Map<String, String>> entries, boolean shouldFail) {
|
||||
public void testSetAndGetPrevious(UpdateMode updateMode, Map<String, Map<String, String>> entries,
|
||||
boolean shouldFail) {
|
||||
var remainingEntries = new ConcurrentHashMap<Entry<String, Map<String, String>>, Boolean>().keySet(true);
|
||||
Step<Entry<String, Map<String, String>>> stpVer = StepVerifier
|
||||
.create(tempDb(getTempDbGenerator(), allocator, db -> tempDictionary(db, updateMode)
|
||||
@ -923,7 +945,8 @@ public abstract class TestDictionaryMapDeep {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideArgumentsSetMulti")
|
||||
public void testSetClearAndGetPreviousGet(UpdateMode updateMode, Map<String, Map<String, String>> entries, boolean shouldFail) {
|
||||
public void testSetClearAndGetPreviousGet(UpdateMode updateMode, Map<String, Map<String, String>> entries,
|
||||
boolean shouldFail) {
|
||||
var remainingEntries = new ConcurrentHashMap<Entry<String, Map<String, String>>, Boolean>().keySet(true);
|
||||
Step<Entry<String, Map<String, String>>> stpVer = StepVerifier
|
||||
.create(tempDb(getTempDbGenerator(), allocator, db -> tempDictionary(db, updateMode)
|
||||
@ -950,7 +973,8 @@ public abstract class TestDictionaryMapDeep {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideArgumentsSetMulti")
|
||||
public void testSetMultiGetAllValues(UpdateMode updateMode, Map<String, Map<String, String>> entries, boolean shouldFail) {
|
||||
public void testSetMultiGetAllValues(UpdateMode updateMode, Map<String, Map<String, String>> entries,
|
||||
boolean shouldFail) {
|
||||
var remainingEntries = new ConcurrentHashMap<Entry<String, Map<String, String>>, Boolean>().keySet(true);
|
||||
Step<Entry<String, Map<String, String>>> stpVer = StepVerifier
|
||||
.create(tempDb(getTempDbGenerator(), allocator, db -> tempDictionary(db, updateMode)
|
||||
@ -1006,7 +1030,8 @@ public abstract class TestDictionaryMapDeep {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideArgumentsSetMulti")
|
||||
public void testSetMultiGetAllStagesGet(UpdateMode updateMode, Map<String, Map<String, String>> entries, boolean shouldFail) {
|
||||
public void testSetMultiGetAllStagesGet(UpdateMode updateMode, Map<String, Map<String, String>> entries,
|
||||
boolean shouldFail) {
|
||||
var remainingEntries = new ConcurrentHashMap<Entry<String, Map<String, String>>, Boolean>().keySet(true);
|
||||
Step<Entry<String, Map<String, String>>> stpVer = StepVerifier
|
||||
.create(tempDb(getTempDbGenerator(), allocator, db -> tempDictionary(db, updateMode)
|
||||
@ -1040,7 +1065,8 @@ public abstract class TestDictionaryMapDeep {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideArgumentsSetMulti")
|
||||
public void testSetMultiIsEmpty(UpdateMode updateMode, Map<String, Map<String, String>> entries, boolean shouldFail) {
|
||||
public void testSetMultiIsEmpty(UpdateMode updateMode, Map<String, Map<String, String>> entries,
|
||||
boolean shouldFail) {
|
||||
Step<Boolean> stpVer = StepVerifier
|
||||
.create(tempDb(getTempDbGenerator(), allocator, db -> tempDictionary(db, updateMode)
|
||||
.map(dict -> tempDatabaseMapDictionaryDeepMap(dict, 5, 6))
|
||||
|
Loading…
Reference in New Issue
Block a user