Permalink
Browse files

Fixed default for adminThrottling.

  • Loading branch information...
bbansal
bbansal committed Dec 13, 2009
1 parent eefa763 commit 39c00ccaa5bbdb9de65a2590ade2245f70435729
@@ -198,8 +198,8 @@ public VoldemortConfig(Props props) {
this.adminConnectionTimeout = props.getInt("admin.client.socket.timeout.ms", 5 * 60 * 1000);
this.adminSocketTimeout = props.getInt("admin.client.socket.timeout.ms", 10000);
- this.streamMaxReadBytesPerSec = props.getInt("stream.read.byte.per.sec", 1 * 1000 * 1000);
- this.streamMaxWriteBytesPerSec = props.getInt("stream.write.byte.per.sec", 1 * 1000 * 1000);
+ this.streamMaxReadBytesPerSec = props.getInt("stream.read.byte.per.sec", 10 * 1000 * 1000);
+ this.streamMaxWriteBytesPerSec = props.getInt("stream.write.byte.per.sec", 10 * 1000 * 1000);
this.socketTimeoutMs = props.getInt("socket.timeout.ms", 4000);
this.socketBufferSize = (int) props.getBytes("socket.buffer.size", 32 * 1024);
@@ -476,20 +476,21 @@ private VoldemortFilter getFilterFromRequest(VAdminProto.VoldemortFilter request
byte[] classBytes = ProtoUtils.decodeBytes(request.getData()).get();
String className = request.getName();
+ logger.debug("Attempt to load VoldemortFilter class:" + className);
try {
if(voldemortConfig.isNetworkClassLoaderEnabled()) {
// TODO: network class loader was throwing NoClassDefFound for
// voldemort.server package classes, Need testing and fixes
- // before can be reenabled.
-
- // Class<?> cl = networkClassLoader.loadClass(className,
- // classBytes,
- // 0,
- // classBytes.length);
- // filter = (VoldemortFilter) cl.newInstance();
- //
- throw new VoldemortException("NetworkLoader is experimental and is disabled for now.");
+
+ logger.warn("NetworkLoader is experimental and should not be used for now.");
+
+ Class<?> cl = networkClassLoader.loadClass(className,
+ classBytes,
+ 0,
+ classBytes.length);
+ filter = (VoldemortFilter) cl.newInstance();
+
} else {
Class<?> cl = Thread.currentThread().getContextClassLoader().loadClass(className);
filter = (VoldemortFilter) cl.newInstance();
@@ -58,8 +58,9 @@ public void maybeThrottle(int eventsSeen) {
long ellapsedMs = ellapsedNs / Time.NS_PER_MS;
long sleepTime = Math.round(eventsSeenInLastInterval / maxEventsPerMs - ellapsedMs);
if(logger.isDebugEnabled())
- logger.debug("Natural I/O rate is " + eventsPerSec
- + " bytes/sec, sleeping for " + sleepTime + " ms to compensate.");
+ logger.debug("Natural rate is " + eventsPerSec
+ + " events/sec max allowed rate is " + ratesPerSecond
+ + " events/sec, sleeping for " + sleepTime + " ms to compensate.");
if(sleepTime > 0) {
try {
time.sleep(sleepTime);
@@ -338,8 +338,8 @@ public static VoldemortConfig createServerConfig(int nodeId,
config.setMysqlDatabaseName("voldemort");
config.setMysqlUsername("voldemort");
config.setMysqlPassword("voldemort");
- config.setStreamMaxReadBytesPerSec(10 * 1000);
- config.setStreamMaxWriteBytesPerSec(10 * 1000);
+ config.setStreamMaxReadBytesPerSec(10 * 1000 * 1000);
+ config.setStreamMaxWriteBytesPerSec(10 * 1000 * 1000);
// clean and reinit metadata dir.
File tempDir = new File(config.getMetadataDirectory());

0 comments on commit 39c00cc

Please sign in to comment.