mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
[ZEPPELIN-116] renamed add_mahout_interpreters.py and overwrite_existing feature
This commit is contained in:
parent
e7d4e120da
commit
ed6eff0f26
3 changed files with 17 additions and 5 deletions
|
|
@ -65,6 +65,11 @@ The `add_mahout.py` script contains several command line arguments for advanced
|
|||
<td>This flag will force the script to re-download the binary even if it already exists. This is useful for previously failed downloads.</td>
|
||||
<td>NA</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>--overwrite_existing</td>
|
||||
<td>This flag will force the script to overwrite existing `%sparkMahout` and `%flinkMahout` interpreters. Useful when you want to just start over.</td>
|
||||
<td>NA</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
__NOTE 1:__ Apache Mahout at this time only supports Spark 1.5 and Spark 1.6 and Scala 2.10. If the user is using another version of Spark (e.g. 2.0), the `%sparkMahout` will likely not work. The `%flinkMahout` interpreter will still work and the user is encouraged to develop with that engine as the code can be ported via copy and paste, as is evidenced by the tutorial notebook.
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@
|
|||
},
|
||||
{
|
||||
"title": "Convenience Paragraph if you started Zeppelin by \u0027bin/zeppelin-daemon.sh start\u0027",
|
||||
"text": "%sh\npython scripts/mahout/add_mahout.py",
|
||||
"text": "%sh\npython scripts/mahout/add_mahout_interpreters.py",
|
||||
"dateUpdated": "Sep 27, 2016 5:26:49 AM",
|
||||
"config": {
|
||||
"colWidth": 12.0,
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ parser.add_argument("--force_download", help="force download Apache Mahout", act
|
|||
parser.add_argument("--restart_later", help="force download Apache Mahout", action="store_true")
|
||||
parser.add_argument("--zeppelin_home", help="path to ZEPPELIN_HOME")
|
||||
parser.add_argument("--mahout_home", help="path to MAHOUT_HOME, use this if you have already installed Apache Mahout")
|
||||
parser.add_argument("--overwrite_existing", help="if %sparkMahout or %flinkMahout exist, delete them and create new ones. Otherwise Fail.", action="store_true")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
|
|
@ -63,11 +64,17 @@ class ZeppelinTerpWrangler:
|
|||
return False
|
||||
return True
|
||||
|
||||
def createTerp(self, original_terp_name, new_terp_name ):
|
||||
def createTerp(self, original_terp_name, new_terp_name, overwrite_existing=True ):
|
||||
|
||||
new_terp_id = new_terp_name
|
||||
if self._terpExists(new_terp_name):
|
||||
del self.interpreter_json['interpreterSettings'][self._getTerpID(new_terp_name)]
|
||||
print "Found existing '%s' interpreter..." % new_terp_name
|
||||
if overwrite_existing:
|
||||
print "deleting %s from interpreter.json" %new_terp_name
|
||||
del self.interpreter_json['interpreterSettings'][self._getTerpID(new_terp_name)]
|
||||
else:
|
||||
print "exiting program."
|
||||
exit(1)
|
||||
|
||||
orig_terp_id = self._getTerpID(original_terp_name)
|
||||
|
||||
|
|
@ -235,8 +242,8 @@ else:
|
|||
#######################################################################################################################
|
||||
|
||||
z._readTerpJson()
|
||||
z.createTerp("spark", "sparkMahout")
|
||||
z.createTerp("flink", "flinkMahout")
|
||||
z.createTerp("spark", "sparkMahout", args.overwrite_existing)
|
||||
z.createTerp("flink", "flinkMahout", args.overwrite_existing)
|
||||
z.addMahoutConfig("sparkMahout", mahout_home, mahout_version)
|
||||
z.addMahoutConfig("flinkMahout", mahout_home, mahout_version)
|
||||
z._writeTerpJson()
|
||||
Loading…
Reference in a new issue