From reviews-return-1760-archive-asf-public=cust-asf.ponee.io@livy.incubator.apache.org Mon Sep 2 08:06:32 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 76929180658 for ; Mon, 2 Sep 2019 10:06:32 +0200 (CEST) Received: (qmail 33266 invoked by uid 500); 2 Sep 2019 08:27:30 -0000 Mailing-List: contact reviews-help@livy.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@livy.incubator.apache.org Delivered-To: mailing list reviews@livy.incubator.apache.org Received: (qmail 33255 invoked by uid 99); 2 Sep 2019 08:27:30 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Sep 2019 08:27:30 +0000 From: GitBox To: reviews@livy.apache.org Subject: [GitHub] [incubator-livy] o-shevchenko commented on a change in pull request #220: [LIVY-654] Ability to validate string before creating state/kind of session/statement Message-ID: <156741159172.19198.13915413956476090620.gitbox@gitbox.apache.org> Date: Mon, 02 Sep 2019 08:06:31 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit o-shevchenko commented on a change in pull request #220: [LIVY-654] Ability to validate string before creating state/kind of session/statement URL: https://github.com/apache/incubator-livy/pull/220#discussion_r319847072 ########## File path: core/src/main/scala/org/apache/livy/sessions/Kind.scala ########## @@ -45,6 +45,12 @@ object Kind { case "sql" => SQL case other => throw new IllegalArgumentException(s"Invalid kind: $other") } + + val kinds: Seq[Kind] = Seq(Spark, PySpark, SparkR, Shared, SQL) + + def isValid(kind: String): Boolean = { Review comment: to verify that we can create StateSession object from a string without additional logic for catching exceptions. There is the example in the description. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services