Apache Omid Idea Debug 环境搭建

IDEA 搭建 Apache Omid 源码 DEBUG 环境

Apache Omid 在 Apache HBase 之上提供了多行分布式事务的能力,支持全局 MVCC 功能。简单介绍编译过程。

1.下载 HBase2 并启动

https://dlcdn.apache.org/hbase/

配置环境变量

shell 复制代码
export HBASE_HOME=/xxx/hbase-2.4.18
export PATH=$PATH:$HBASE_HOME/bin:

2.编译

代码编译

shell 复制代码
git clone https://github.com/apache/phoenix-omid

基于最新的 master af8e377affcd76b1cbde5cab3513731b23bd51fc 编译。

maven 依赖处理

有几处编译报错,处理如下:

根 pom 里添加:

xml 复制代码
<dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>javax.el</artifactId>
    <version>3.0.1-b06</version>
</dependency>

hbase-common 里添加:

xml 复制代码
<dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>javax.el</artifactId>
    <version>3.0.1-b06</version>
    <scope>test</scope>
</dependency>

timestamp-storage 模块里添加依赖:

xml 复制代码
<dependency>
    <groupId>com.google.inject</groupId>
    <artifactId>guice</artifactId>
    <version>5.1.0</version>
    <scope>compile</scope>
</dependency>
shell 复制代码
# 编译
mvn clean install -Phbase-2 -DskipTests
# 查看 tso-server/target/tso-server-<VERSION>-bin.tar.gz 编译产物并解压
# 进入编译产物的 tso-server-<VERSION> 目录
cd tso-server-<VERSION>

创建 Omid tables

shell 复制代码
bin/omid.sh create-hbase-commit-table -numRegions 16
bin/omid.sh create-hbase-timestamp-table

3. 启动 TSO server

方式 1:bin/omid.sh tso

方式 2:运行 org.apache.omid.tso.TSOServer#main

4.Demo 验证

运行工程 examples 下的 org.apache.omid.examples.BasicExample 和 org.apache.omid.examples.SnapshotIsolationExample,结果运行成功。

sql 复制代码
-- 运行 demo 前,先通过 habase shell 创建对应的表
create 'MY_TX_TABLE', {NAME => 'MY_CF', VERSIONS => '2147483647', TTL => '2147483647'}

BasicExample: 在 HBase 中执行包含多行修改的事务,保证原子性

SnapshotIsolationExample: 展示 Omid 在并发事务访问共享数据时如何保证快照隔离

ConfigurationExample: 展示 Omid 客户端配置选项的基本示例

参考

omid-quickstart

相关推荐
半旧夜夏1 小时前
【分布式缓存】Redis持久化和集群部署攻略
java·运维·redis·分布式·缓存
短视频矩阵源码定制1 小时前
矩阵系统源码推荐:技术架构与功能完备性深度解析
java·人工智能·矩阵·架构
Eiceblue1 小时前
使用 Java 将 Excel 工作表转换为 CSV 格式
java·intellij-idea·excel·myeclipse
漂流幻境1 小时前
IntelliJ IDEA的Terminal中执行ping命令时遇到的“No route to host“问题
java·ide·intellij-idea
苹果醋32 小时前
element-ui源码阅读-样式
java·运维·spring boot·mysql·nginx
BUG?不,是彩蛋!2 小时前
IntelliJ IDEA从安装到使用:零基础完整指南
java·ide·intellij-idea
程序员阿鹏2 小时前
56.合并区间
java·数据结构·算法·leetcode
SmoothSailingT2 小时前
IDEA实用快捷键
java·ide·intellij-idea
rengang662 小时前
Spring AI Alibaba 框架使用示例总体介绍
java·人工智能·spring·spring ai·ai应用编程
没有bug.的程序员2 小时前
@Controller、@RestController、@RequestMapping 解析机制
java·spring boot·spring·controller·requestmapping·restcontroller