GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Yyuan168/SkipList-java: An engine of skiplist data structure

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
target
target
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

Repository files navigation

跳表SkipList KV存储引擎 JAVA 实现

本项目就是基于 跳表 实现的轻量级键值型存储引擎,使用 JAVA 实现。
实现的功能:

  1. 插入数据
  2. 删除数据
  3. 查询数据 (是否存在)
  4. 数据结构展示
  5. 数据落盘
  6. 文件加载数据
  7. 数据库大小显示。

JDK 版本

jdk 11

项目中的文件

  • pom.xml maven方式创建项目的依赖
  • Main.java 小规模测试接口功能的主程序
  • SkipList.java 跳表的数据结构实现
  • SkipListNode.java 跳表节点的数据结构实现
  • StressTest.java 压力测试代码
  • SkipListTest.java 测试接口代码
  • SkipList.jar 可执行jar文件(运行Main程序)

提供接口

  • insert (插入数据)
  • delete (删除数据)
  • contains (根据键值查询数据是否存在)
  • query (根据键值查询数据)
  • save (保存跳表)
  • load (加载已保存的跳表)
  • show (显示跳表)

压力测试表现

本项目采用多线程并发插入、查询数据(ThreadPoolExecutor、CountDownLatch) 来模拟多个用户同时访问和更改数据库。

插入数据

这里采取的方式是随机插入数据(key:Integer,value:String),所获取的是按照对应数据量运行五次取平均得出的数据。

插入数据规模(万条) 平均树高(层) 平均耗时(s)
10 16.4 0.3554
50 18.4 1.4380
100 19.4 2.9238
500 22.2 18.0350
1000 23.2 40.4302

查询数据

这里采取的方式是根据随机key值查询数据的方式,所获取的是按照对应数据量运行五次取平均得出的数据。

查询数据规模(万条) 平均树高(层) 平均耗时(s)
10 16.4 0.2042
50 18.4 0.9120
100 19.4 1.7836
500 22.2 12.0356
1000 23.2 28.8008

项目运行方式

无操作系统限制,只需要安装有jdk 11的运行环境即可运行main程序。 执行命令:

java -jar 路径/SkipList.jar

还能优化的点

  • 没有将数据结构打包成jar供别的项目使用
  • 可以加上一致性协议,再启动一个http server对外提供分布式存储服务

About

An engine of skiplist data structure

Resources

Readme
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.