hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r464716 - in /lucene/hadoop/trunk: CHANGES.txt conf/hadoop-default.xml src/java/org/apache/hadoop/dfs/DataNode.java src/java/org/apache/hadoop/dfs/FSConstants.java
Date Mon, 16 Oct 2006 23:11:24 GMT
Author: cutting
Date: Mon Oct 16 16:11:22 2006
New Revision: 464716

URL: http://svn.apache.org/viewvc?view=rev&rev=464716
Log:
HADOOP-514.  Make DFS heartbeat interval configurable.  Contributed by Milind.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/conf/hadoop-default.xml
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DataNode.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSConstants.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=464716&r1=464715&r2=464716
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Mon Oct 16 16:11:22 2006
@@ -17,6 +17,9 @@
  4. HADOOP-586.  Use the jar name for otherwise un-named jobs.
     (Sanjay Dahiya via cutting)
 
+ 5. HADOOP-514.  Make DFS heartbeat interval configurable.
+    (Milind Bhandarkar via cutting)
+
 
 Release 0.7.1 - 2006-10-11
 

Modified: lucene/hadoop/trunk/conf/hadoop-default.xml
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/conf/hadoop-default.xml?view=diff&rev=464716&r1=464715&r2=464716
==============================================================================
--- lucene/hadoop/trunk/conf/hadoop-default.xml (original)
+++ lucene/hadoop/trunk/conf/hadoop-default.xml Mon Oct 16 16:11:22 2006
@@ -244,7 +244,13 @@
 <property>
   <name>dfs.blockreport.intervalMsec</name>
   <value>3600000</value>
-  <description>Determines block reporting interval.</description>
+  <description>Determines block reporting interval in milliseconds.</description>
+</property>
+
+<property>
+  <name>dfs.heartbeat.interval</name>
+  <value>3</value>
+  <description>Determines datanode heartbeat interval in seconds.</description>
 </property>
 
 <property>

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DataNode.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DataNode.java?view=diff&rev=464716&r1=464715&r2=464716
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DataNode.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DataNode.java Mon Oct 16 16:11:22 2006
@@ -95,6 +95,7 @@
     int xmitsInProgress = 0;
     Daemon dataXceiveServer = null;
     long blockReportInterval;
+    long heartBeatInterval;
     private DataStorage storage = null;
     private StatusHttpServer infoServer;
     private static InetSocketAddress nameNodeAddr;
@@ -231,6 +232,7 @@
         conf.getLong("dfs.blockreport.intervalMsec", BLOCKREPORT_INTERVAL);
       this.blockReportInterval =
         blockReportIntervalBasis - new Random().nextInt((int)(blockReportIntervalBasis/10));
+      this.heartBeatInterval = conf.getLong("dfs.heartbeat.interval", HEARTBEAT_INTERVAL)
* 1000L;
       this.nameNodeAddr = nameNodeAddr;
     }
 
@@ -330,7 +332,7 @@
           //
           // Every so often, send heartbeat or block-report
           //
-          if (now - lastHeartbeat > HEARTBEAT_INTERVAL) {
+          if (now - lastHeartbeat > heartBeatInterval) {
             //
             // All heartbeat messages include following info:
             // -- Datanode name
@@ -426,7 +428,7 @@
           // There is no work to do;  sleep until hearbeat timer elapses, 
           // or work arrives, and then iterate again.
           //
-          long waitTime = HEARTBEAT_INTERVAL - (System.currentTimeMillis() - lastHeartbeat);
+          long waitTime = heartBeatInterval - (System.currentTimeMillis() - lastHeartbeat);
           synchronized( receivedBlockList ) {
             if (waitTime > 0 && receivedBlockList.size() == 0) {
               try {

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSConstants.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSConstants.java?view=diff&rev=464716&r1=464715&r2=464716
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSConstants.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSConstants.java Mon Oct 16 16:11:22
2006
@@ -100,7 +100,7 @@
     //
     // Timeouts, constants
     //
-    public static long HEARTBEAT_INTERVAL = 3 * 1000;
+    public static long HEARTBEAT_INTERVAL = 3;
     public static long EXPIRE_INTERVAL = 10 * 60 * 1000;
     public static long BLOCKREPORT_INTERVAL = 60 * 60 * 1000;
     public static long LEASE_PERIOD = 60 * 1000;



Mime
View raw message