Skip to content

Commit

Permalink
实现基于BDB的日志存储 (sofastack#752)
Browse files Browse the repository at this point in the history
* 实现基于BDB的日志存储

* bdb代码优化

1、去掉注释代码
2、日志
3、SPI 优先级 = 1
  • Loading branch information
bybyset authored Apr 18, 2022
1 parent a5752a6 commit 4a9cd42
Show file tree
Hide file tree
Showing 9 changed files with 1,077 additions and 0 deletions.
31 changes: 31 additions & 0 deletions jraft-extension/bdb-log-storage-impl/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>jraft-extension</artifactId>
<groupId>com.alipay.sofa</groupId>
<version>1.3.9</version>
</parent>
<artifactId>bdb-log-storage-impl</artifactId>
<name>bdb-log-storage-impl</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jraft-core</artifactId>
</dependency>
<dependency>
<groupId>com.sleepycat</groupId>
<artifactId>je</artifactId>
<version>18.3.12</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alipay.sofa.jraft.core;

import com.alipay.sofa.jraft.core.DefaultJRaftServiceFactory;
import com.alipay.sofa.jraft.option.RaftOptions;
import com.alipay.sofa.jraft.storage.LogStorage;
import com.alipay.sofa.jraft.storage.impl.BDBLogStorage;
import com.alipay.sofa.jraft.util.SPI;

/**
* override createLogStorage
* @author cff
*
*/
@SPI(priority = 1)
public class BDBLogStorageJRaftServiceFactory extends DefaultJRaftServiceFactory {

@Override
public LogStorage createLogStorage(String uri, RaftOptions raftOptions) {
return new BDBLogStorage(uri, raftOptions);
}
}
Loading

0 comments on commit 4a9cd42

Please sign in to comment.