Преглед изворни кода

[core] Add defaultValue to properties

Jenny Kim пре 9 година
родитељ
комит
f1d0537cc7

+ 13 - 0
apps/oozie/src/oozie/models2.py

@@ -104,6 +104,12 @@ class WorkflowConfiguration(object):
   PROPERTIES = [
     {
       "multiple": True,
+      "defaultValue": [
+        {
+          'name': 'oozie.use.system.libpath',
+          'value': True
+        }
+      ],
       "value": [
         {
           'name': 'oozie.use.system.libpath',
@@ -116,6 +122,7 @@ class WorkflowConfiguration(object):
       "type": "parameters"
     }, {
       "multiple": False,
+      "defaultValue": '',
       "value": '',
       "nice_name": _("Workspace"),
       "key": "deployment_dir",
@@ -123,6 +130,7 @@ class WorkflowConfiguration(object):
       "type": "hdfs-files"
     }, {
       "multiple": True,
+      "defaultValue": [],
       "value": [],
       "nice_name": _("Hadoop Properties"),
       "key": "properties",
@@ -130,6 +138,7 @@ class WorkflowConfiguration(object):
       "type": "settings"
     }, {
       "multiple": False,
+      "defaultValue": True,
       "value": True,
       "nice_name": _("Show graph arrows"),
       "key": "show_arrows",
@@ -137,6 +146,7 @@ class WorkflowConfiguration(object):
       "type": "boolean"
     }, {
       "multiple": False,
+      "defaultValue": "uri:oozie:workflow:0.5",
       "value": "uri:oozie:workflow:0.5",
       "nice_name": _("Version"),
       "key": "schema_version",
@@ -149,6 +159,7 @@ class WorkflowConfiguration(object):
       ]
     }, {
       "multiple": False,
+      "defaultValue": '',
       "value": '',
       "nice_name": _("Job XML"),
       "key": "job_xml",
@@ -156,6 +167,7 @@ class WorkflowConfiguration(object):
       "type": "hdfs-files"
     }, {
       "multiple": False,
+      "defaultValue": False,
       "value": False,
       "nice_name": _("SLA Enabled"),
       "key": "sla_enabled",
@@ -163,6 +175,7 @@ class WorkflowConfiguration(object):
       "type": "boolean"
     }, {
       "multiple": False,
+      "defaultValue": SLA_DEFAULT,
       "value": SLA_DEFAULT,
       "nice_name": _("SLA Configuration"),
       "key": "sla",

+ 4 - 0
desktop/libs/notebook/src/notebook/connectors/hiveserver2.py

@@ -82,6 +82,7 @@ class HiveConfiguration(object):
   PROPERTIES = [
     {
       "multiple": True,
+      "defaultValue": [],
       "value": [],
       "nice_name": _("Files"),
       "key": "files",
@@ -89,6 +90,7 @@ class HiveConfiguration(object):
       "type": "hdfs-files"
     }, {
       "multiple": True,
+      "defaultValue": [],
       "value": [],
       "nice_name": _("Functions"),
       "key": "functions",
@@ -96,6 +98,7 @@ class HiveConfiguration(object):
       "type": "functions"
     }, {
       "multiple": True,
+      "defaultValue": [],
       "value": [],
       "nice_name": _("Settings"),
       "key": "settings",
@@ -113,6 +116,7 @@ class ImpalaConfiguration(object):
   PROPERTIES = [
     {
       "multiple": True,
+      "defaultValue": [],
       "value": [],
       "nice_name": _("Settings"),
       "key": "settings",

+ 9 - 0
desktop/libs/notebook/src/notebook/connectors/spark_shell.py

@@ -52,6 +52,7 @@ class SparkConfiguration(object):
       "type": "csv-hdfs-files",
       "is_yarn": False,
       "multiple": True,
+      "defaultValue": [],
       "value": [],
     }, {
       "name": "files",
@@ -60,6 +61,7 @@ class SparkConfiguration(object):
       "type": "csv-hdfs-files",
       "is_yarn": False,
       "multiple": True,
+      "defaultValue": [],
       "value": [],
     }, {
       "name": "pyFiles",
@@ -68,6 +70,7 @@ class SparkConfiguration(object):
       "type": "csv-hdfs-files",
       "is_yarn": False,
       "multiple": True,
+      "defaultValue": [],
       "value": [],
     }, {
       "name": "driverMemory",
@@ -76,6 +79,7 @@ class SparkConfiguration(object):
       "type": "jvm",
       "is_yarn": False,
       "multiple": False,
+      "defaultValue": '1G',
       "value": '1G',
     },
     # YARN-only properties
@@ -86,6 +90,7 @@ class SparkConfiguration(object):
       "type": "number",
       "is_yarn": True,
       "multiple": False,
+      "defaultValue": 1,
       "value": 1,
     }, {
       "name": "executorMemory",
@@ -94,6 +99,7 @@ class SparkConfiguration(object):
       "type": "jvm",
       "is_yarn": True,
       "multiple": False,
+      "defaultValue": '1G',
       "value": '1G',
     }, {
       "name": "executorCores",
@@ -102,6 +108,7 @@ class SparkConfiguration(object):
       "type": "number",
       "is_yarn": True,
       "multiple": False,
+      "defaultValue": 1,
       "value": 1,
     }, {
       "name": "queue",
@@ -110,6 +117,7 @@ class SparkConfiguration(object):
       "type": "string",
       "is_yarn": True,
       "multiple": False,
+      "defaultValue": 'default',
       "value": 'default',
     }, {
       "name": "archives",
@@ -118,6 +126,7 @@ class SparkConfiguration(object):
       "type": "csv-hdfs-files",
       "is_yarn": True,
       "multiple": True,
+      "defaultValue": [],
       "value": [],
     }
   ]