-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
336 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM openjdk:17-jdk-slim | ||
ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8 | ||
RUN sed -i -E 's/(security|deb)\.debian\.org/mirrors.aliyun.com/g' /etc/apt/sources.list \ | ||
&& apt-get clean && apt-get update \ | ||
&& apt-get -y install tini | ||
|
||
COPY bin/* /etc/tinylsm/ | ||
COPY target/scala-3.3.1/TinyLsmAssembly.jar /etc/tinylsm/TinyLsmAssembly.jar | ||
|
||
RUN ln -s /etc/tinylsm/tinylsm-cli /usr/bin/tinylsm-cli | ||
|
||
WORKDIR /etc/tinylsm | ||
ENTRYPOINT ["tini", "--"] | ||
CMD ["bash", "/etc/tinylsm/tinylsm"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,31 @@ | ||
# TinyLSM | ||
|
||
Tiny LSM in scala | ||
|
||
Requirement: | ||
## Requirement | ||
|
||
- JDK 11 or later | ||
|
||
## Configuration | ||
|
||
Configuration lookup order: | ||
|
||
1. JVM system properties, e.g., `-Dkey.subkey=value` | ||
2. Operation system environment e.g., `export TINY_LSM_KEY_SUBKEY=value` | ||
3. `.env` file in classpath, using operation system environment key | ||
4. config file specified by JVM system properties `config.file` or operation system environment `TINY_LSM_CONFIG_FILE`, | ||
using JVM system properties key | ||
|
||
| environment key | system properties name | meaning | default value | | ||
|--------------------------|------------------------|------------------------------------------------------------------------------|---------------------------| | ||
| TINY_LSM_PORT | port | | 9527 | | ||
| TINY_LSM_LISTEN | listen | | 0.0.0.0 | | ||
| TINY_LSM_BLOCK_SIZE | block.size | Block size in bytes | 4096 | | ||
| TINY_LSM_TARGET_SST_SIZE | block.size | SST size in bytes, also the approximate memtable capacity limit | 2 << 20 (2MB) | | ||
| TINY_LSM_MEMTABLE_NUM | memtable.num | Maximum number of memtables in memory, flush to L0 when exceeding this limit | 50 | | ||
| TINY_LSM_ENABLE_WAL | enable.wal | | true | | ||
| TINY_LSM_SERIALIZABLE | serializable | | false | | ||
| TINY_LSM_DATA_DIR | data.dir | | /etc/tinylsm/data | | ||
| TINY_LSM_CONFIG_FILE | config.file | | /etc/tinylsm/tinylsm.conf | | ||
|
||
[Reference](https://skyzh.github.io/mini-lsm/00-preface.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
SCRIPT_DIR=$(cd $(dirname $0);pwd) | ||
cd $SCRIPT_DIR/.. | ||
|
||
sbt assembly | ||
docker build . -f Dockerfile -t ${DOCKER_IMAGE_TAG:-tiny-lsm:0.0.1} --network=host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
SCRIPT_DIR=$(cd $(dirname $0);pwd) | ||
|
||
java -cp .:TinyLsmAssembly.jar io.github.leibnizhu.tinylsm.TinyLsmWebServer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
SCRIPT_DIR=$(cd $(dirname $0);pwd) | ||
|
||
java -cp .:TinyLsmAssembly.jar io.github.leibnizhu.tinylsm.TinyLsmCli $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.