Changelog History
Page 1
-
v0.16.2 Changes
October 09, 2020- โ added
MultiPrepareBuilder
for creatingMultiPrepare
instance forMultiMap
from Java. - ๐ renamed
Bag.Less
toGlass
andBag.less
instance toBag.glass
.Glass
being a transparent type. - โ removed redundant
BAG[_]
type param fromgetKeyValueDeadline
functions - โฌ๏ธ bumped ZIO version to 1.0.2
- โ added
-
v0.16.1 Changes
October 05, 2020๐ Release overview
- ๐ Improved SkipList implementation for faster writes and atomic reads
- โ Removed snapshotting LevelZero state for reads.
๐ Improved write performance for sequential writes
Implemented a faster
NavigableMap
(forSequentialOrder
writes) backed byArray
and binary-search which can be enabled for applications that only require sequential writes and do not need random writes.The following shows benchmarks of
SequentialOrder
(Array) vsRandomOrder
(java.ConcurrentSkipListMap) for sequential writes.How to optimise SwayDB for SequentialOrder writes?
0๏ธโฃ Default setting optimises writes for
RandomOrder
. The following code samples optimise writes forSequentialOrder
.initialSkipListLength
sets the length of theArray
sinceSequentialOrder
is backed byArray
.Java
Map\<Integer, String, Void\> map =MemoryMap .functionsOff(Default.intSerializer(), Default.stringSerializer()) .setOptimiseWrites(OptimiseWrites.sequentialOrder(10000)) .get();
Scala
val map = memory.Map[Int, String, Nothing, Bag.Less]( optimiseWrites = OptimiseWrites.SequentialOrder(initialSkipListLength = 10000) )
Atomic SkipList reads
Previously
SkipList
required copying in-memory key-values for atomicity (#124). NowLevelZero
performs atomic reads without copying.0๏ธโฃ Default setting disables
Atomic
which can be enabled with the following.Java
Map\<Integer, String, Void\> map =MemoryMap .functionsOff(Default.intSerializer(), Default.stringSerializer()) .setAtomic(Atomic.on()) .get();
Scala
val map = memory.Map[Int, String, Nothing, Bag.Less](atomic = Atomic.On)
โ Removed snapshotting
๐ฒ Previously reads were creating a snapshot which provided the state of write-ahead-log files in
LevelZero
for each read. Now snapshotting happen lazily (Stream like) as the read progresses. This change was aimed to further minimise GC workload. -
v0.16 Changes
September 20, 2020๐ This release was focused on
- ๐ MultiMap & Compaction performance improvements.
- Completing Java API.
- โ QA and Usability testing.
- ๐ Support for Boopickle serialisation.
- ๐ Resolving issues labeled Production release.
MultiMap and SetMap Java types
MultiMap
andSetMap
are now implemented for Java. Java API is now complete.MultiMap
allows creating deeply nestedMap
.//create a root mapMultiMap\<String, Integer, String, Void\> root =MemoryMultiMap.functionsOff( stringSerializer(), //nested Map key type intSerializer(), //key type stringSerializer() //value type ).get();//first child mapMultiMap\<String, Integer, String, Void\> child1 = root.child("first child"); child1.put(1, "child1's value 1");
๐
SetMap
providesMap
like API forSet
. Useful for application that always fetch the value with the key. It stores both key & value in the same location for faster seeks and reduced IOps.SetMap\<Integer, String\> setMap =MemorySetMap .config(intSerializer(), stringSerializer()) .get(); setMap.put(1, "one");
๐ Improved MultiMap performance and reduced storage cost
๐
MultiMap
previously stored parent key bytes within child key bytes. Now deeply nestedMap
do not have any extra storage cost over a root MultiMap. This also improved read and write performance.๐ Deeply nested
MultiMap
has constant performance regardless of the depth.Access to all nested child MultiMap nodes
//get all children of root mapStream\<MultiMap\<String, Integer, String, Void\>\> children = root.children();//get all children of root map and all it's grand children. Stream\<MultiMap\<String, Integer, String, Void\>\> child = root.childrenFlatten();
Functions
Shorter syntax for enabling functions
Java
Create functions without need to specify the return type. All java functions types are under
PureFunctionJava
.//function that appends "updated" to old valueOnValue\<Integer, String\> myFunction = (String value) -\>Apply.update(value + " updated");
Register the function as a
List
.Map\<Integer, String, PureFunction\<Integer, String, Apply.Map\<String\>\>\> map =PersistentMap .functionsOn( Paths.get("my\_map"), //directoryDefault.intSerializer(), //key serialiserDefault.stringSerializer(), //value serializwrArrays.asList(myFunction) //functions list ).get();
Scala
Syntax shortened for enabling functions -
PureFunction.Map[Int, String]
. All Scala function types are underPureFunctionScala
.val map = persistent.Map[Int, String, PureFunction.Map[Int, String], Bag.Less]("my\_map")
To register function supply
implicit
functions List.//sample function that appends "updated" to old valueval myFunction: OnValue[String] = (value: String) =\> Apply.Update(value + " updated")implicit val myFunctions = Functions[PureFunction.Map[Int, String]](myFunction)
โ Added new function types
OnKey
- reads the keyOnKeyDeadline
(Scala) &OnKeyExpiration
(Java) - reads the key and deadlineOnKeyValue
- reads the key and valueOnValue
- reads the valueOnValueDeadline
(Scala) &OnValueExpiration
(Java) - reads the value and deadlineOnKeyValueValueDeadline
(Scala) &OnKeyValueValueExpiration
(Java) - read the key, value and deadline.
๐ Improve Serialisers
Java
๐ Use
Slice<T>
to easily build custom serialisers.ByteOps.Java
removes the need to castjava.lang.Byte
toscala.Byte
.new Serializer\<String\>() { @Overridepublic Slice\<Byte\> write(String data) { return Slice.writeStringUTF8(data, ByteOps.Java()); } @Overridepublic String read(Slice\<Byte\> slice) { return slice.readStringUTF8(ByteOps.Java()); } };
Scala
Easily serialise
case class
es using Bookpickleimport swaydb.\_import boopickle.Default.\_case class MyClass(id: Int, value: String)implicit val serialiser = swaydb.serializers.BooPickle[MyClass]val set = memory.Set[MyClass, Nothing, Bag.Less]()
๐ Better Scala and Java interop
Scala functions can be shared with Java and vice versa. Scala instance can also be accessed from Java.
Set\<Integer, Void\> mySet =MemorySet .functionsOff(intSerializer()) .get(); mySet.asScala(); //get scala set
Validating missing functions
Missing applied functions reported on re-boot to ensure safe startups.
๐ป > swaydb.Exception$MissingFunctions: Missing 1 function. List("myFunction").
Flags for clearing applied functions
Functions that are applied can be cleared by setting the
clearAppliedFunctionsOnBoot
flag.Scala
val map = persistent.Set[Int, PureFunction.Set[Int], Bag.Less]("my\_set", clearAppliedFunctionsOnBoot = true)
Java
Set\<Integer, PureFunction\<Integer, Void, Apply.Set\<Void\>\>\> mySet =PersistentSet .functionsOn(Paths.get("my\_set"), intSerializer(), Arrays.asList()) .setClearAppliedFunctionsOnBoot(true) .get();
๐ Build Validator - Error reporting
Incompatible SwayDB version files get reported on boot-up.
Eg: Current v0.16 is incompatible with older versions so start v0.16 on older versions will result in the following error
Incompatible versions! SwayDB v0.16 is not compatible with files created by v0.15
Directories are type-checked. Eg: starting
Set
on aMap
directory will yieldInvalid data type Set for the directory of type Map.
-
v0.15 Changes
September 08, 2020- Streams created from data-types (
Map
,Set
,Queue
... ) use the bag from within the data-type. - โ added
eventually.persistent.SetMap
- โ added
added eventually.persistent.Queue
- โ added
build.info
file which stores the version and used to perform compatibility checks. MultiMap
is not experimental anymore.
๐ฅ Breaking change - with the addition of
build.info
file, previous versions are incompatible with this version. - Streams created from data-types (
-
v0.14.7 Changes
September 03, 2020Resolved issues
#260 - Rename MapConfig, SetConfig & QueueConfig in Java to reflect their storage types
๐ #259 - Remove Function type param from SetMap
#258 - Java's Set.stream is returning Stream instead of Source
#257 - Add asJava to interop with java.util.Map
#256 - Terminate Bag on close
#255 - Implement Source for Stream
#253 - Add Stream.materializeBuilder for custom collection type
โ #252 - SwayDBExpireSpec test failing -
v0.14.6 Changes
August 28, 2020๐ This release fixes issues relating to memory-mapped files not working on Windows and other important issues.
๐ #156 - program won't end (resolved) &
java.nio.file.AccessDeniedException
on Windows
๐ #251 - [WINDOWS] -MappedByteBuffer.force
is extremely slow on Windows Performance
#250 - Compaction does not progress on reboot -ArrayIndexOutOfBoundsException
#249 - ByteBufferSweeper Actor can be a basic Actor๐ See issue #156 for more details on new
ForceSave
andMMAP
configurations to handle memory-mapped files on Windows. -
v0.14.5 Changes
August 24, 2020Resolves important issues.
- #248 - Disallow api calls after close or delete
- #247 - Releasing FileLock does not close channel
- โฑ #246 - Scheduler should be internal to the Actor
- #245 - Memory mapped files result in "Too many opened files"
- #243 - BufferCleaner should be passed explicitly
- #242 - Terminate all Actors and Cache on Shutdown
- #241 - terminateAndRecover function for Actor
-
v0.14.4 Changes
August 09, 2020๐ #240 -
java
anddata-java
modules should not disable cross builds.๐ Reverts change made to java artifact id in previous release - v0.14.3.
\<dependency\> \<groupId\>io.swaydb\</groupId\> \<artifactId\>java\_2.13\</artifactId\> \<version\>0.14.4\</version\> \</dependency\>
-
v0.14.3 Changes
August 09, 2020Resolves following bugs.
โก๏ธ #238 - LevelZero's compaction is not updating Maps.currentMapsSlice safely
#236 - Stream returns missing results when transitioning level0 entries to level1 for databases with mapSize = 1.byte
#237 - Actor pauses processing messages
0๏ธโฃ #239 - Convenience functions for Java to overwrite default Configs parameters from Scala.Java's artifactId changed to
java
instead ofjava_2.13
Maven dependency looks like
\<dependency\> \<groupId\>io.swaydb\</groupId\> \<artifactId\>java\</artifactId\> \<version\>0.14.3\</version\> \</dependency\>
-
v0.14.2 Changes
August 01, 2020๐ Fixes
#237 - Actor pauses processing messages