activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1232067 - in /activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb: dto/LevelDBStoreDTO.java leveldb/LevelDBClient.scala
Date Mon, 16 Jan 2012 17:25:54 GMT
Author: chirino
Date: Mon Jan 16 17:25:54 2012
New Revision: 1232067

URL: http://svn.apache.org/viewvc?rev=1232067&view=rev
Log:
Support using nice symbolic 100M values to configure settings on the leveldb_store element.

Modified:
    activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/dto/LevelDBStoreDTO.java
    activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/leveldb/LevelDBClient.scala

Modified: activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/dto/LevelDBStoreDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/dto/LevelDBStoreDTO.java?rev=1232067&r1=1232066&r2=1232067&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/dto/LevelDBStoreDTO.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/dto/LevelDBStoreDTO.java
Mon Jan 16 17:25:54 2012
@@ -47,10 +47,10 @@ public class LevelDBStoreDTO extends Sto
     public Boolean verify_checksums;
 
     @XmlAttribute(name="log_size")
-    public Integer log_size;
+    public String log_size;
 
     @XmlAttribute(name="log__write_buffer_size")
-    public Integer log_write_buffer_size;
+    public String log_write_buffer_size;
 
     @XmlAttribute(name="index_max_open_files")
     public Integer index_max_open_files;
@@ -59,13 +59,13 @@ public class LevelDBStoreDTO extends Sto
     public Integer index_block_restart_interval;
 
     @XmlAttribute(name="index_write_buffer_size")
-    public Integer index_write_buffer_size;
+    public String index_write_buffer_size;
 
     @XmlAttribute(name="index_block_size")
-    public Integer index_block_size;
+    public String index_block_size;
 
     @XmlAttribute(name="index_cache_size")
-    public Long index_cache_size;
+    public String index_cache_size;
 
     @XmlAttribute(name="index_compression")
     public String index_compression;

Modified: activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/leveldb/LevelDBClient.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/leveldb/LevelDBClient.scala?rev=1232067&r1=1232066&r2=1232067&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/leveldb/LevelDBClient.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/leveldb/LevelDBClient.scala
Mon Jan 16 17:25:54 2012
@@ -201,7 +201,7 @@ class LevelDBClient(store: LevelDBStore)
 
   def log_size = {
     import OptionSupport._
-    config.log_size.getOrElse(1024 * 1024 * 100)
+    Option(config.log_size).map(MemoryPropertyEditor.parse(_).toInt).getOrElse(1024 * 1024
* 100)
   }
 
   def start() = {
@@ -230,21 +230,21 @@ class LevelDBClient(store: LevelDBStore)
     config.index_max_open_files.foreach( index_options.maxOpenFiles(_) )
     config.index_block_restart_interval.foreach( index_options.blockRestartInterval(_) )
     config.paranoid_checks.foreach( index_options.paranoidChecks(_) )
-    config.index_write_buffer_size.foreach( index_options.writeBufferSize(_) )
-    config.index_block_size.foreach( index_options.blockSize(_) )
+    Option(config.index_write_buffer_size).map(MemoryPropertyEditor.parse(_).toInt).foreach(
index_options.writeBufferSize(_) )
+    Option(config.index_block_size).map(MemoryPropertyEditor.parse(_).toInt).foreach( index_options.blockSize(_)
)
     Option(config.index_compression).foreach(x => index_options.compressionType( x match
{
       case "snappy" => CompressionType.SNAPPY
       case "none" => CompressionType.NONE
       case _ => CompressionType.SNAPPY
     }) )
 
-    index_options.cacheSize(config.index_cache_size.getOrElse(1024*1024*256L))
+    index_options.cacheSize(Option(config.index_cache_size).map(MemoryPropertyEditor.parse(_).toLong).getOrElse(1024*1024*256L))
     index_options.logger(new Logger() {
       def log(msg: String) = debug(store.store_kind+": "+msg)
     })
 
     log = create_log
-    log.write_buffer_size = config.log_write_buffer_size.getOrElse(1024*1024*4)
+    log.write_buffer_size = Option(config.log_write_buffer_size).map(MemoryPropertyEditor.parse(_).toInt).getOrElse(1024*1024*4)
     log.log_size = log_size
     log.on_log_rotate = ()=> {
       // lets queue a request to checkpoint when



Mime
View raw message