Skip to content

Commit eb76c8c

Browse files
Split examples into multiple subprojects.
1 parent 30b4cc0 commit eb76c8c

File tree

15 files changed

+79
-30
lines changed

15 files changed

+79
-30
lines changed

examples/map/build.gradle.kts

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
plugins {
2+
kotlin("jvm")
3+
}
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
dependencies {
10+
implementation(project(":examples:map:utils"))
11+
}

examples/map/src/main/kotlin/com/target/nativememoryallocator/examples/map/OffHeapDemo.kt renamed to examples/map/offheapdemo/src/main/kotlin/com/target/nativememoryallocator/examples/map/offheapdemo/OffHeapDemo.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.target.nativememoryallocator.examples.map
1+
package com.target.nativememoryallocator.examples.map.offheapdemo
22

33
import com.target.nativememoryallocator.allocator.NativeMemoryAllocatorBuilder
44
import com.target.nativememoryallocator.examples.map.utils.CacheObject
@@ -22,9 +22,9 @@ private val logger = KotlinLogging.logger {}
2222
*
2323
* This is a total of 10 GB of data in off-heap memory.
2424
*
25-
* [OnHeapDemo] is the same application using normal on-heap storage for comparison.
25+
* OnHeapDemo is the same application using normal on-heap storage for comparison.
2626
*/
27-
class OffHeapDemo {
27+
private class OffHeapDemo {
2828

2929
private val numEntries = 20_000
3030

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
plugins {
2+
kotlin("jvm")
3+
}
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
dependencies {
10+
implementation(project(":examples:map:utils"))
11+
}

examples/map/src/main/kotlin/com/target/nativememoryallocator/examples/map/OffHeapDemoWithEviction.kt renamed to examples/map/offheapdemowitheviction/src/main/kotlin/com/target/nativememoryallocator/examples/map/offheapdemowitheviction/OffHeapDemoWithEviction.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.target.nativememoryallocator.examples.map
1+
package com.target.nativememoryallocator.examples.map.offheapdemowitheviction
22

33
import com.target.nativememoryallocator.allocator.NativeMemoryAllocatorBuilder
44
import com.target.nativememoryallocator.examples.map.utils.CacheObject
@@ -14,9 +14,9 @@ private val logger = KotlinLogging.logger {}
1414

1515

1616
/**
17-
* Same as [OffHeapDemo] but uses the Caffeine backend with maximumSize of 10,000 entries.
17+
* Same as OffHeapDemo but uses the Caffeine backend with maximumSize of 10,000 entries.
1818
*/
19-
class OffHeapDemoWithEviction {
19+
private class OffHeapDemoWithEviction {
2020

2121
private val numEntries = 20_000
2222

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
plugins {
2+
kotlin("jvm")
3+
}
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
dependencies {
10+
implementation(project(":examples:map:utils"))
11+
}

examples/map/src/main/kotlin/com/target/nativememoryallocator/examples/map/OffHeapDemoWithEvictionAndOperationCounters.kt renamed to examples/map/offheapdemowithevictionandoperationcounters/src/main/kotlin/com/target/nativememoryallocator/examples/map/offheapdemowithevictionandoperationcounters/OffHeapDemoWithEvictionAndOperationCounters.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.target.nativememoryallocator.examples.map
1+
package com.target.nativememoryallocator.examples.map.offheapdemowithevictionandoperationcounters
22

33
import com.target.nativememoryallocator.allocator.NativeMemoryAllocatorBuilder
44
import com.target.nativememoryallocator.examples.map.utils.CacheObject
@@ -14,9 +14,9 @@ private val logger = KotlinLogging.logger {}
1414

1515

1616
/**
17-
* Same as [OffHeapDemoWithEviction] but enables operation counters
17+
* Same as OffHeapDemoWithEviction but enables operation counters
1818
*/
19-
class OffHeapDemoWithEvictionAndOperationCounters {
19+
private class OffHeapDemoWithEvictionAndOperationCounters {
2020

2121
private val numEntries = 20_000
2222

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
plugins {
2+
kotlin("jvm")
3+
}
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
dependencies {
10+
implementation(project(":examples:map:utils"))
11+
}

examples/map/src/main/kotlin/com/target/nativememoryallocator/examples/map/OnHeapDemo.kt renamed to examples/map/onheapdemo/src/main/kotlin/com/target/nativememoryallocator/examples/map/onheapdemo/OnHeapDemo.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.target.nativememoryallocator.examples.map
1+
package com.target.nativememoryallocator.examples.map.onheapdemo
22

33
import com.target.nativememoryallocator.examples.map.utils.CacheObject
44
import com.target.nativememoryallocator.examples.map.utils.buildRandomString
@@ -17,9 +17,9 @@ private val logger = KotlinLogging.logger {}
1717
* This is a total of 10 GB of data stored on the normal Java heap.
1818
*
1919
* This application does not make use of any features of the native_memory_allocator library.
20-
* It is provided for comparison with [OffHeapDemo].
20+
* It is provided for comparison with off-heap demos.
2121
*/
22-
class OnHeapDemo {
22+
private class OnHeapDemo {
2323

2424
private val numEntries = 20_000
2525

examples/map/settings.gradle.kts

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)