Skip to content
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.

Commit

Permalink
[Rocksandra] set merge operands limit
Browse files Browse the repository at this point in the history
Summary: to experiment performance difference

Test Plan: will manual test

Reviewers: wpc, #ig-cassandra, chenshen, svemuri

Reviewed By: chenshen, svemuri

Subscribers: trunkagent, fdeliege

Differential Revision: https://phabricator.intern.facebook.com/D6011752

Tasks: T21631952

Signature: 6011752:1507580817:364cec6b102924da72bab29d8bd1f12f9bf1ab93
  • Loading branch information
DikangGu committed Oct 9, 2017
1 parent 4173f26 commit a7dd54f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/java/org/apache/cassandra/rocksdb/RocksDBCF.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.UUID;

Expand Down Expand Up @@ -74,6 +73,7 @@
import org.rocksdb.StatsLevel;
import org.rocksdb.WriteOptions;

import static org.apache.cassandra.rocksdb.RocksDBConfigs.MERGE_OPERANDS_LIMIT;
import static org.apache.cassandra.rocksdb.RocksDBConfigs.ROCKSDB_DIR;

/**
Expand Down Expand Up @@ -114,7 +114,7 @@ public RocksDBCF(ColumnFamilyStore cfs) throws RocksDBException
int gcGraceSeconds = cfs.metadata.params.gcGraceSeconds;
boolean purgeTtlOnExpiration = cfs.metadata.params.purgeTtlOnExpiration;
compactionFilter = new CassandraCompactionFilter(purgeTtlOnExpiration, gcGraceSeconds);
mergeOperator = new CassandraValueMergeOperator(gcGraceSeconds);
mergeOperator = new CassandraValueMergeOperator(gcGraceSeconds, MERGE_OPERANDS_LIMIT);

DBOptions dbOptions = new DBOptions();
List<ColumnFamilyDescriptor> cfDescs = new ArrayList<>();
Expand Down
3 changes: 3 additions & 0 deletions src/java/org/apache/cassandra/rocksdb/RocksDBConfigs.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public class RocksDBConfigs
// disable write to rocksdb commit log or not, default is false
public static final boolean DISABLE_WRITE_TO_COMMITLOG = Boolean.getBoolean("cassandra.rocksdb.disable_write_to_commitlog");

// Limit the number of operands in merge operator, 0 means no limit
public static final int MERGE_OPERANDS_LIMIT = Integer.getInteger("cassandra.rocksdb.merge_operands_limit", 0);

/**
* Streaming configs
*/
Expand Down

0 comments on commit a7dd54f

Please sign in to comment.