Return-Path: X-Original-To: apmail-drill-issues-archive@minotaur.apache.org Delivered-To: apmail-drill-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0AEFD1774B for ; Wed, 22 Apr 2015 17:18:59 +0000 (UTC) Received: (qmail 183 invoked by uid 500); 22 Apr 2015 17:18:59 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 166 invoked by uid 500); 22 Apr 2015 17:18:58 -0000 Mailing-List: contact issues-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list issues@drill.apache.org Received: (qmail 156 invoked by uid 99); 22 Apr 2015 17:18:58 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Apr 2015 17:18:58 +0000 Date: Wed, 22 Apr 2015 17:18:58 +0000 (UTC) From: "Chris Westin (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DRILL-2686) Move writeJson() methods from PhysicalPlanReader to corresponding classes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DRILL-2686?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Chris Westin updated DRILL-2686: -------------------------------- Component/s: (was: Execution - Flow) Storage - JSON > Move writeJson() methods from PhysicalPlanReader to corresponding classes > ------------------------------------------------------------------------- > > Key: DRILL-2686 > URL: https://issues.apache.org/jira/browse/DRILL-2686 > Project: Apache Drill > Issue Type: Improvement > Components: Storage - JSON > Affects Versions: 0.7.0 > Reporter: Sudheesh Katkam > Assignee: Chris Westin > Fix For: 1.1.0 > > > From Chris's comment https://reviews.apache.org/r/32795/ > It would have been better to have a writeJson(ObjectMapper) method added to each of OptionList, PhysicalOperator, and ExecutionControls, and for PhysicalPlanReader just to have a getMapper() that is used to get the argument needed for those. In that form, we don't have to add a new method to PhysicalPlanReader for each thing that we want to add to it. We just get its mapper and write whatever it is to it. > We'd have > {code} > final ObjectMapper mapper = reader.getMapper(); > options.writeJson(mapper); > executionControls.writeJson(mapper); > {code} > So as we add more things to the plan, we don't have to add more methods to it. Each object knows how to write itself, given the mapper. And if we ever need to add them to anything else, that object just needs to expose its mapper in a similar way, rather than having a method per item. -- This message was sent by Atlassian JIRA (v6.3.4#6332)