Skip to content

Commit

Permalink
fix push confirm success
Browse files Browse the repository at this point in the history
  • Loading branch information
shangyu.wh committed Nov 21, 2019
1 parent 79f9167 commit 5b1f784
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ public void run(ProcessingResult processingResult, Task task) {
if (result == null) {
if (processingResult == ProcessingResult.Success) {
tasks.remove(task.getTaskId());
if (tasks.isEmpty()) {
LOGGER.info("Push all tasks success,dataInfoId={}", dataInfoId);
if (taskClosure != null) {
taskClosure.run(ProcessingResult.Success, null);
}
}
}
}
}
Expand All @@ -81,12 +87,7 @@ public void start() {

pushTaskCheckAsyncHashedWheelTimer.newTimeout(timeout -> {

if (tasks.isEmpty()) {
LOGGER.info("Push all tasks success,dataInfoId={}",dataInfoId);
if (taskClosure != null) {
taskClosure.run(ProcessingResult.Success, null);
}
} else {
if (!tasks.isEmpty()) {
LOGGER.warn("Push tasks found error tasks {},dataInfoId={}!", tasks.size(),dataInfoId);
if (taskClosure != null) {
taskClosure.run(ProcessingResult.PermanentError, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,19 @@ private NodeOptions initNodeOptions(RaftServerConfig raftServerConfig) {

// See https://github.com/sofastack/sofa-jraft/pull/156
final BlockBasedTableConfig conf = new BlockBasedTableConfig() //
// Begin to use partitioned index filters
// https://github.com/facebook/rocksdb/wiki/Partitioned-Index-Filters#how-to-use-it
.setIndexType(IndexType.kTwoLevelIndexSearch) //
.setFilter(new BloomFilter(16, false)) //
.setPartitionFilters(true) //
.setMetadataBlockSize(8 * SizeUnit.KB) //
.setCacheIndexAndFilterBlocks(false) //
.setCacheIndexAndFilterBlocksWithHighPriority(true) //
.setPinL0FilterAndIndexBlocksInCache(true) //
// End of partitioned index filters settings.
.setBlockSize(4 * SizeUnit.KB)//
.setBlockCacheSize(raftServerConfig.getRockDBCacheSize() * SizeUnit.MB) //
.setCacheNumShardBits(8);
// Begin to use partitioned index filters
// https://github.com/facebook/rocksdb/wiki/Partitioned-Index-Filters#how-to-use-it
.setIndexType(IndexType.kTwoLevelIndexSearch) //
.setFilter(new BloomFilter(16, false)) //
.setPartitionFilters(true) //
.setMetadataBlockSize(8 * SizeUnit.KB) //
.setCacheIndexAndFilterBlocks(false) //
.setCacheIndexAndFilterBlocksWithHighPriority(true) //
.setPinL0FilterAndIndexBlocksInCache(true) //
// End of partitioned index filters settings.
.setBlockSize(4 * SizeUnit.KB)//
.setBlockCacheSize(raftServerConfig.getRockDBCacheSize() * SizeUnit.MB) //
.setCacheNumShardBits(8);

StorageOptionsFactory.registerRocksDBTableFormatConfig(RocksDBLogStorage.class, conf);

Expand Down

0 comments on commit 5b1f784

Please sign in to comment.