Skip to content

Commit

Permalink
release 0.14.7
Browse files Browse the repository at this point in the history
  • Loading branch information
simerplaha committed Sep 3, 2020
1 parent 587bfdb commit cbc673a
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
<dependency>
<groupId>io.swaydb</groupId>
<artifactId>java_2.13</artifactId>
<version>0.14.6</version>
<version>0.14.7</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
Expand Down
5 changes: 3 additions & 2 deletions src/main/kotlin/functions/LikesTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import swaydb.java.PureFunction
import swaydb.java.Return
import swaydb.java.memory.MapConfig
import swaydb.java.memory.MemoryMap
import swaydb.java.serializers.Default
import java.util.stream.IntStream

Expand All @@ -20,7 +20,8 @@ internal class LikesTest {
}

val likesMap =
MapConfig.functionsOn(Default.stringSerializer(), Default.intSerializer())
MemoryMap
.functionsOn(Default.stringSerializer(), Default.intSerializer())
.registerFunction(incrementLikesFunction)
.get()

Expand Down
7 changes: 4 additions & 3 deletions src/main/kotlin/ordering/ReverseOrderingTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ package ordering

import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import swaydb.java.memory.MapConfig
import swaydb.java.memory.MemoryMap
import swaydb.java.serializers.Default

internal class ReverseOrderingTest {

@Test
fun reverse() {
val map =
MapConfig.functionsOff(Default.intSerializer(), Default.intSerializer()) //provide a typed comparator that reverses ordering
MemoryMap
.functionsOff(Default.intSerializer(), Default.intSerializer()) //provide a typed comparator that reverses ordering
.setTypedComparator { key1: Int, key2: Int? -> key1.compareTo(key2!!) * -1 }
.get()

Expand All @@ -30,4 +31,4 @@ internal class ReverseOrderingTest {

assertEquals(expected, actual)
}
}
}
5 changes: 3 additions & 2 deletions src/main/kotlin/queue/QueueTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package queue

import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import swaydb.java.memory.QueueConfig
import swaydb.java.memory.MemoryQueue
import swaydb.java.serializers.Default
import java.time.Duration

Expand All @@ -11,7 +11,8 @@ internal class QueueTest {
@Test
fun quickStart() {
val queue =
QueueConfig.config(Default.intSerializer())
MemoryQueue
.config(Default.intSerializer())
.get()

queue.push(1)
Expand Down
13 changes: 7 additions & 6 deletions src/main/kotlin/quickstart/QuickStartMapFunctions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import swaydb.java.Deadline
import swaydb.java.PureFunction
import swaydb.java.Return
import swaydb.java.Stream
import swaydb.java.memory.MapConfig
import swaydb.java.memory.MemoryMap
import swaydb.java.serializers.Default.intSerializer
import java.time.Duration
import java.util.*
Expand All @@ -26,10 +26,11 @@ internal object QuickStartMapFunctions {
}
}

val map = MapConfig
.functionsOn(intSerializer(), intSerializer())
.registerFunction(function)
.get()
val map =
MemoryMap
.functionsOn(intSerializer(), intSerializer())
.registerFunction(function)
.get()

map.put(1, 1) //basic put
map[1].get() //basic get
Expand All @@ -42,8 +43,8 @@ internal object QuickStartMapFunctions {
//Create a stream that updates all values within range 10 to 90.
val updatedKeyValues =
map
.from(10)
.stream()
.from(10)
.takeWhile { it.key() <= 90 }
.map { KeyVal.create(it.key(), it.value() + 5000000) }

Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/quickstart/QuickStartMapSimple.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package quickstart

import swaydb.KeyVal
import swaydb.java.Stream
import swaydb.java.memory.MapConfig
import swaydb.java.memory.MemoryMap
import swaydb.java.serializers.Default.intSerializer
import java.time.Duration

Expand All @@ -11,7 +11,7 @@ internal object QuickStartMapSimple {
@JvmStatic
fun main(args: Array<String>) {
val map =
MapConfig
MemoryMap
.functionsOff(intSerializer(), intSerializer())
.get()

Expand All @@ -26,8 +26,8 @@ internal object QuickStartMapSimple {
//Create a stream that updates all values within range 10 to 90.
val updatedKeyValues =
map
.from(10)
.stream()
.from(10)
.takeWhile { it.key() <= 90 }
.map { KeyVal.create(it.key(), it.value() + 5000000) }

Expand Down
8 changes: 5 additions & 3 deletions src/main/kotlin/quickstart/QuickStartQueue.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package quickstart

import swaydb.java.memory.QueueConfig
import swaydb.java.memory.MemoryQueue
import swaydb.java.serializers.Default
import java.time.Duration

object QuickStartQueue {

@JvmStatic
fun main(args: Array<String>) {
val queue = QueueConfig.config(Default.intSerializer())
.get()
val queue =
MemoryQueue
.config(Default.intSerializer())
.get()

queue.push(1)
queue.push(2, Duration.ofSeconds(0))
Expand Down

0 comments on commit cbc673a

Please sign in to comment.