This repository has been archived by the owner on Feb 27, 2023. It is now read-only.
forked from hector-client/hector
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix for issue hector-client#223, cassandra-all should be a test depen…
…dency
- Loading branch information
Showing
19 changed files
with
767 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
core/src/main/java/me/prettyprint/cassandra/constants/CFMetaDataDefaults.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package me.prettyprint.cassandra.constants; | ||
|
||
/** | ||
* Defaults | ||
*/ | ||
public class CFMetaDataDefaults { | ||
public final static double DEFAULT_ROW_CACHE_SIZE = 0.0; | ||
public final static double DEFAULT_KEY_CACHE_SIZE = 200000; | ||
public final static double DEFAULT_READ_REPAIR_CHANCE = 1.0; | ||
public final static boolean DEFAULT_REPLICATE_ON_WRITE = true; | ||
public final static int DEFAULT_SYSTEM_MEMTABLE_THROUGHPUT_IN_MB = 8; | ||
public final static int DEFAULT_ROW_CACHE_SAVE_PERIOD_IN_SECONDS = 0; | ||
public final static int DEFAULT_KEY_CACHE_SAVE_PERIOD_IN_SECONDS = 4 * 3600; | ||
public final static int DEFAULT_GC_GRACE_SECONDS = 864000; | ||
public final static int DEFAULT_MIN_COMPACTION_THRESHOLD = 4; | ||
public final static int DEFAULT_MAX_COMPACTION_THRESHOLD = 32; | ||
public final static int DEFAULT_MEMTABLE_LIFETIME_IN_MINS = 60 * 24; | ||
public final static double DEFAULT_MERGE_SHARDS_CHANCE = 0.1; | ||
//this defaults to ram / 16 / 1MB on the server | ||
//but we are on the client, so we don't know how much | ||
//ram is on the server, assume a conservative 8G | ||
public final static int DEFAULT_MEMTABLE_THROUGHPUT_IN_MB = 500; | ||
public final static double DEFAULT_MEMTABLE_OPERATIONS_IN_MILLIONS = | ||
sizeMemtableOperations(DEFAULT_MEMTABLE_THROUGHPUT_IN_MB); | ||
|
||
|
||
private static double sizeMemtableOperations(int mem_throughput) | ||
{ | ||
return 0.3 * mem_throughput / 64.0; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
core/src/main/java/me/prettyprint/cassandra/utils/DaemonThreadPoolFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package me.prettyprint.cassandra.utils; | ||
|
||
import java.util.concurrent.ConcurrentHashMap; | ||
import java.util.concurrent.ThreadFactory; | ||
import java.util.concurrent.atomic.AtomicInteger; | ||
|
||
public class DaemonThreadPoolFactory implements ThreadFactory { | ||
|
||
private ConcurrentHashMap<String, AtomicInteger> counters = | ||
new ConcurrentHashMap<String, AtomicInteger>(); | ||
|
||
private final String name; | ||
|
||
public DaemonThreadPoolFactory(Class<?> parentClass) { | ||
this.name = "Hector." + parentClass.getName(); | ||
} | ||
|
||
private int getNextThreadNumber() { | ||
if(!counters.containsKey(name)) { | ||
counters.putIfAbsent(name, new AtomicInteger()); | ||
} | ||
return counters.get(name).incrementAndGet(); | ||
} | ||
|
||
@Override | ||
public Thread newThread(Runnable r) { | ||
Thread t = new Thread(r); | ||
t.setDaemon(true); | ||
t.setName(name + "-" + getNextThreadNumber()); | ||
return t; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.