hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r704967 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/HColumnDescriptor.java src/java/org/apache/hadoop/hbase/regionserver/HStore.java
Date Wed, 15 Oct 2008 17:35:19 GMT
Author: stack
Date: Wed Oct 15 10:35:18 2008
New Revision: 704967

URL: http://svn.apache.org/viewvc?rev=704967&view=rev
Log:
HBASE-929 clarify that ttl in HColumnDescriptor is seconds

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HColumnDescriptor.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HStore.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=704967&r1=704966&r2=704967&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Wed Oct 15 10:35:18 2008
@@ -26,6 +26,7 @@
    HBASE-925   HRS NPE on way out if no master to connect to
    HBASE-928   NPE throwing RetriesExhaustedException
    HBASE-924   Update hadoop in lib on 0.18 hbase branch to 0.18.1
+   HBASE-929   Clarify that ttl in HColumnDescriptor is seconds
 
   IMPROVEMENTS
    HBASE-901   Add a limit to key length, check key and value length on client side

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HColumnDescriptor.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HColumnDescriptor.java?rev=704967&r1=704966&r2=704967&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HColumnDescriptor.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HColumnDescriptor.java Wed Oct 15
10:35:18 2008
@@ -177,7 +177,7 @@
    * cache
    * @param blockCacheEnabled If true, MapFile blocks should be cached
    * @param maxValueLength Restrict values to <= this value
-   * @param timeToLive Time-to-live of cell contents, in seconds from last timestamp
+   * @param timeToLive Time-to-live of cell contents, in seconds
    * (use HConstants.FOREVER for unlimited TTL)
    * @param bloomFilter Enable the specified bloom filter for this column
    * 
@@ -389,17 +389,15 @@
   }
 
   /**
-   * @return Time to live.
+   * @return Time-to-live of cell contents, in seconds.
    */
   public int getTimeToLive() {
     String value = getValue(TTL);
-    if (value != null)
-      return Integer.valueOf(value);
-    return DEFAULT_TTL;
+    return (value != null)? Integer.valueOf(value).intValue(): DEFAULT_TTL;
   }
 
   /**
-   * @param timeToLive
+   * @param timeToLive Time-to-live of cell contents, in seconds.
    */
   public void setTimeToLive(int timeToLive) {
     setValue(TTL, Integer.toString(timeToLive));
@@ -411,7 +409,7 @@
   public boolean isBlockCacheEnabled() {
     String value = getValue(BLOCKCACHE);
     if (value != null)
-      return Boolean.valueOf(value);
+      return Boolean.valueOf(value).booleanValue();
     return DEFAULT_BLOCKCACHE;
   }
 

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HStore.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HStore.java?rev=704967&r1=704966&r2=704967&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HStore.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HStore.java Wed Oct 15
10:35:18 2008
@@ -85,6 +85,7 @@
   private final SequenceFile.CompressionType compression;
   final FileSystem fs;
   private final HBaseConfiguration conf;
+  // ttl in milliseconds.
   protected long ttl;
   private long majorCompactionTime;
   private int maxFilesToCompact;
@@ -166,9 +167,11 @@
     this.family = family;
     this.fs = fs;
     this.conf = conf;
+    // getTimeToLive returns ttl in seconds.  Convert to milliseconds.
     this.ttl = family.getTimeToLive();
-    if (ttl != HConstants.FOREVER)
+    if (ttl != HConstants.FOREVER) {
       this.ttl *= 1000;
+    }
     this.memcache = new Memcache(this.ttl, info);
     this.compactionDir = HRegion.getCompactionDir(basedir);
     this.storeName = Bytes.toBytes(this.info.getEncodedName() + "/" +



Mime
View raw message