瀏覽代碼

HADOOP-2766. Enables setting of HADOOP_OPTS env variable for the hadoop daemons through HOD. Contributed by Vinod Kumar Vavilapalli.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@629344 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das 17 年之前
父節點
當前提交
2299f2f242

+ 3 - 0
CHANGES.txt

@@ -120,6 +120,9 @@ Release 0.16.1 - Unrelease
     HADOOP-2840. Fix gridmix scripts to correctly invoke the java sort through
     HADOOP-2840. Fix gridmix scripts to correctly invoke the java sort through
     the proper jar. (Mukund Madhugiri via cdouglas)
     the proper jar. (Mukund Madhugiri via cdouglas)
 
 
+    HADOOP-2766. Enables setting of HADOOP_OPTS env variable for the hadoop
+    daemons through HOD. (Vinod Kumar Vavilapalli via ddas)
+
 Release 0.16.0 - 2008-02-07
 Release 0.16.0 - 2008-02-07
 
 
   INCOMPATIBLE CHANGES
   INCOMPATIBLE CHANGES

+ 2 - 8
src/contrib/hod/bin/hod

@@ -238,14 +238,11 @@ defList = { 'hod' : (
               True, None, False, True, 'M'),
               True, None, False, True, 'M'),
                
                
              ('envs', 'keyval', 'environment to run this package in',
              ('envs', 'keyval', 'environment to run this package in',
-              False, None, False, False),
+              False, None, False, True),
 
 
              ('final-server-params', 'keyval', 'Hadoop final xml key/val list',
              ('final-server-params', 'keyval', 'Hadoop final xml key/val list',
               False, None, False, True, 'F'),
               False, None, False, True, 'F'),
 
 
-             ('java-opts', 'list', 'java jvm options',
-              False, None, False, False),
-               
              ('pkgs', 'directory', "directory where the package is installed",
              ('pkgs', 'directory', "directory where the package is installed",
               False, None, False, False)), 
               False, None, False, False)), 
                
                
@@ -273,11 +270,8 @@ defList = { 'hod' : (
               False, None, False, True, 'S'),
               False, None, False, True, 'S'),
            
            
              ('envs', 'keyval', 'Environment in which to run this package.',
              ('envs', 'keyval', 'Environment in which to run this package.',
-              False, None, False, False),
+              False, None, False, True),
 
 
-             ('java-opts', 'list', 'java jvm options',
-              False, None, False, False),
-            
              ('pkgs', 'directory', "directory where the package is installed",
              ('pkgs', 'directory', "directory where the package is installed",
               False, None, False, False)),           
               False, None, False, False)),           
              
              

+ 0 - 6
src/contrib/hod/bin/ringmaster

@@ -163,9 +163,6 @@ defList = { 'ringmaster' : (
              ('envs', 'keyval', 'environment to run this package in',
              ('envs', 'keyval', 'environment to run this package in',
               False, None, False, False),
               False, None, False, False),
               
               
-             ('java-opts', 'keyval', 'java jvm options',
-              False, None, False, False),
-               
              ('pkgs', 'directory', "directory where the package is installed",
              ('pkgs', 'directory', "directory where the package is installed",
               False, None, False, True)), 
               False, None, False, True)), 
                
                
@@ -195,9 +192,6 @@ defList = { 'ringmaster' : (
              ('envs', 'keyval', 'Environment in which to run this package.',
              ('envs', 'keyval', 'Environment in which to run this package.',
               False, None, False, False),
               False, None, False, False),
 
 
-             ('java-opts', 'list', 'java jvm options',
-              False, None, False, False),
-            
              ('pkgs', 'directory', "directory where the package is installed",
              ('pkgs', 'directory', "directory where the package is installed",
               False, None, False, True)),          
               False, None, False, True)),          
              
              

+ 0 - 10
src/contrib/hod/hodlib/Common/desc.py

@@ -117,7 +117,6 @@ class ServiceDesc:
 
 
     self.dict.setdefault('external', False)
     self.dict.setdefault('external', False)
     self.dict.setdefault('attrs', {})
     self.dict.setdefault('attrs', {})
-    self.dict.setdefault('java-opts', [])
     self.dict.setdefault('envs', {})
     self.dict.setdefault('envs', {})
     self.dict.setdefault('host',None)
     self.dict.setdefault('host',None)
     self.dict.setdefault('port',None)
     self.dict.setdefault('port',None)
@@ -157,9 +156,6 @@ class ServiceDesc:
   def getfinalAttrs(self):
   def getfinalAttrs(self):
     return self.dict['final-attrs']
     return self.dict['final-attrs']
   
   
-  def getJavaOpts(self):
-    return self.dict['java-opts']
-  
   def getEnvs(self):
   def getEnvs(self):
     return self.dict['envs']
     return self.dict['envs']
 
 
@@ -187,9 +183,6 @@ class ServiceDesc:
     s = Schema('envs', Schema.MAP)
     s = Schema('envs', Schema.MAP)
     schema[s.getName()] = s
     schema[s.getName()] = s
 
 
-    s = Schema('java-opts', Schema.MAP)
-    schema[s.getName()] = s
-
     return schema
     return schema
   
   
   getSchema = staticmethod(getSchema)
   getSchema = staticmethod(getSchema)
@@ -219,9 +212,6 @@ class CommandDesc:
     """return the environment in which the command is to be run"""
     """return the environment in which the command is to be run"""
     return self.dict['envs']
     return self.dict['envs']
   
   
-  def _getJavaOpts(self):
-    return self.dict['java-opts']
-
   def _getPkgDirs(self):
   def _getPkgDirs(self):
     """return the packages for this command"""
     """return the packages for this command"""
     return self.dict['pkgdirs']
     return self.dict['pkgdirs']

+ 3 - 9
src/contrib/hod/hodlib/HodRing/hodRing.py

@@ -56,7 +56,6 @@ class CommandDesc:
     dict.setdefault('argv', [])
     dict.setdefault('argv', [])
     dict.setdefault('version', None)
     dict.setdefault('version', None)
     dict.setdefault('envs', {})
     dict.setdefault('envs', {})
-    dict.setdefault('java-opts', [])
     dict.setdefault('workdirs', [])
     dict.setdefault('workdirs', [])
     dict.setdefault('attrs', {})
     dict.setdefault('attrs', {})
     dict.setdefault('final-attrs', {})
     dict.setdefault('final-attrs', {})
@@ -91,9 +90,6 @@ class CommandDesc:
   def getEnvs(self):
   def getEnvs(self):
     return self.dict['envs']
     return self.dict['envs']
 
 
-  def getJavaOpts(self):
-    return self.dict['java-opts']
-
   def getPkgDirs(self):
   def getPkgDirs(self):
     return self.dict['pkgdirs']
     return self.dict['pkgdirs']
 
 
@@ -311,16 +307,14 @@ class HadoopCommand:
     args.append(self.path)
     args.append(self.path)
     args.extend(desc.getArgv())
     args.extend(desc.getArgv())
     envs = desc.getEnvs()
     envs = desc.getEnvs()
-    javaOpts = desc.getJavaOpts()
     fenvs = os.environ
     fenvs = os.environ
     
     
     for k, v in envs.iteritems():
     for k, v in envs.iteritems():
       fenvs[k] = v
       fenvs[k] = v
     
     
-    self.log.debug(javaOpts)
-    fenvs['HADOOP_OPTS'] = ''
-    for option in javaOpts:
-      fenvs['HADOOP_OPTS'] = "%s%s " % (fenvs['HADOOP_OPTS'], option)
+    if envs.has_key('HADOOP_OPTS'):
+      fenvs['HADOOP_OPTS'] = envs['HADOOP_OPTS']
+      self.log.debug("HADOOP_OPTS : %s" % fenvs['HADOOP_OPTS'])
     
     
     fenvs['JAVA_HOME'] = self.javahome
     fenvs['JAVA_HOME'] = self.javahome
     fenvs['HADOOP_CONF_DIR'] = self.confdir
     fenvs['HADOOP_CONF_DIR'] = self.confdir