Skip to content

Commit

Permalink
(feat) revert default log storage to be RocksDBLogStorage (sofastack#280
Browse files Browse the repository at this point in the history
)
  • Loading branch information
killme2008 authored Sep 21, 2019
1 parent 6d572a6 commit 8971210
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import com.alipay.sofa.jraft.storage.RaftMetaStorage;
import com.alipay.sofa.jraft.storage.SnapshotStorage;
import com.alipay.sofa.jraft.storage.impl.LocalRaftMetaStorage;
import com.alipay.sofa.jraft.storage.log.RocksDBSegmentLogStorage;
import com.alipay.sofa.jraft.storage.impl.RocksDBLogStorage;
import com.alipay.sofa.jraft.storage.snapshot.local.LocalSnapshotStorage;
import com.alipay.sofa.jraft.util.Requires;
import com.alipay.sofa.jraft.util.SPI;
Expand All @@ -47,7 +47,7 @@ public static DefaultJRaftServiceFactory newInstance() {
@Override
public LogStorage createLogStorage(final String uri, final RaftOptions raftOptions) {
Requires.requireTrue(StringUtils.isNotBlank(uri), "Blank log storage uri.");
return new RocksDBSegmentLogStorage(uri, raftOptions);
return new RocksDBLogStorage(uri, raftOptions);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@

import com.alipay.sofa.jraft.option.RaftOptions;
import com.alipay.sofa.jraft.storage.LogStorage;
import com.alipay.sofa.jraft.storage.log.RocksDBSegmentLogStorage;
import com.alipay.sofa.jraft.storage.impl.RocksDBLogStorage;

public class TestJRaftServiceFactory extends DefaultJRaftServiceFactory {

@Override
public LogStorage createLogStorage(String uri, RaftOptions raftOptions) {
//Force the data to be stored in segments.
return new RocksDBSegmentLogStorage(uri, raftOptions, 0);
public LogStorage createLogStorage(final String uri, final RaftOptions raftOptions) {
return new RocksDBLogStorage(uri, raftOptions);
}

}

0 comments on commit 8971210

Please sign in to comment.