Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CFB46200B50 for ; Fri, 29 Jul 2016 19:06:54 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CE2CF160A79; Fri, 29 Jul 2016 17:06:54 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id ED9F7160A6E for ; Fri, 29 Jul 2016 19:06:53 +0200 (CEST) Received: (qmail 93307 invoked by uid 500); 29 Jul 2016 17:06:53 -0000 Mailing-List: contact notifications-help@asterixdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.apache.org Delivered-To: mailing list notifications@asterixdb.apache.org Received: (qmail 93298 invoked by uid 99); 29 Jul 2016 17:06:53 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2016 17:06:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id B906AC8887 for ; Fri, 29 Jul 2016 17:06:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.126 X-Spam-Level: ** X-Spam-Status: No, score=2.126 tagged_above=-999 required=6.31 tests=[MISSING_HEADERS=1.207, SPF_FAIL=0.919] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 3tvBymaRgVnk for ; Fri, 29 Jul 2016 17:06:51 +0000 (UTC) Received: from unhygienix.ics.uci.edu (unhygienix.ics.uci.edu [128.195.14.130]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTP id 1BC8B60CC4 for ; Fri, 29 Jul 2016 17:06:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by unhygienix.ics.uci.edu (Postfix) with ESMTP id 7D3BD242061; Fri, 29 Jul 2016 10:06:50 -0700 (PDT) Date: Fri, 29 Jul 2016 10:06:50 -0700 From: "Michael Blow (Code Review)" CC: Yingyi Bu , Jenkins , Taewoo Kim , abdullah alamoudi Reply-To: mblow@apache.org X-Gerrit-MessageType: merged Subject: Change in asterixdb[master]: ASTERIXDB-1459: Enable Debugging for Generated Functions X-Gerrit-Change-Id: I0e7816864b91b2ce0e474137b20c9fee2e35c25c X-Gerrit-ChangeURL: X-Gerrit-Commit: 018ec4a1d45d7cbd922d31f7a4e2c531e43e6cf1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.8.4 Message-Id: <20160729170650.7D3BD242061@unhygienix.ics.uci.edu> archived-at: Fri, 29 Jul 2016 17:06:55 -0000 Michael Blow has submitted this change and it was merged. Change subject: ASTERIXDB-1459: Enable Debugging for Generated Functions ...................................................................... ASTERIXDB-1459: Enable Debugging for Generated Functions Generate classes as nested classes of original class (including package) to enable debugging. Change-Id: I0e7816864b91b2ce0e474137b20c9fee2e35c25c Reviewed-on: https://asterix-gerrit.ics.uci.edu/1030 Sonar-Qube: Jenkins Tested-by: Jenkins Integration-Tests: Jenkins Reviewed-by: abdullah alamoudi --- M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/staticcodegen/CodeGenUtil.java 1 file changed, 12 insertions(+), 20 deletions(-) Approvals: abdullah alamoudi: Looks good to me, approved Jenkins: Verified; No violations found; Verified diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/staticcodegen/CodeGenUtil.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/staticcodegen/CodeGenUtil.java index 1da88a1..87a9a84 100644 --- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/staticcodegen/CodeGenUtil.java +++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/staticcodegen/CodeGenUtil.java @@ -43,11 +43,8 @@ private final static String EVALUATOR_FACTORY = "EvaluatorFactory"; private final static String EVALUATOR = "Evaluator"; private final static String INNER = "Inner"; - private final static String DESCRIPTOR = "Descriptor"; - private final static String ACCESSOR = "Accessor"; private final static String DOLLAR = "$"; - private final static String PKG_SUFFIX = "/generated"; - private final static String ASTERIXDB_PREFIX = "org/apache/asterix"; + private final static String NESTED_CLASSNAME_PREFIX = "_"; /** * The callback interface for a caller to determine what it needs to do for @@ -165,7 +162,9 @@ int index = nameMappings.size() - 1; for (; index >= 0; --index) { Pair entry = nameMappings.get(index); - result = result.replace(entry.getLeft(), entry.getRight()); + if (result.contains(entry.getLeft())) { + return result.replace(entry.getLeft(), entry.getRight()); + } } return result; } @@ -179,7 +178,7 @@ * the original evaluator factory class name. * @param suffixForGeneratedClass, * the suffix for the generated class. - * @param factoryIndex, + * @param factoryCounter, * the counter for the generated class. * @param nameMappings, * class names that needs to be rewritten in the generated byte code. @@ -235,7 +234,7 @@ * the name of the original evaluator class. * @param suffixForGeneratedClass, * the suffix for the generated class. - * @param evalIndex, + * @param evalCounter, * the counter for the generated class. * @param nameMappings, * class names that needs to be rewritten in the generated byte code. @@ -368,30 +367,23 @@ * the original class, i.e., the source of the generated class. * @param suffix, * the suffix for the generated class. - * @param evalCounter, + * @param counter, * a counter that appearing at the end of the name of the generated class. * @return the name of the generated class. */ private static String getGeneratedClassName(String originalClassName, String suffix, int counter) { StringBuilder sb = new StringBuilder(); - int end = originalClassName.indexOf(DESCRIPTOR); - if (end < 0) { - end = originalClassName.indexOf(ACCESSOR); - } - if (end < 0) { - end = originalClassName.indexOf(DOLLAR); - } + int end = originalClassName.indexOf(DOLLAR); if (end < 0) { end = originalClassName.length(); } String name = originalClassName.substring(0, end); - String lastName = name.substring(ASTERIXDB_PREFIX.length()); - - sb.append(ASTERIXDB_PREFIX); - sb.append(PKG_SUFFIX); - sb.append(lastName); + sb.append(name); + sb.append(DOLLAR); + sb.append(NESTED_CLASSNAME_PREFIX); sb.append(suffix); + if (counter > 0) { sb.append(counter); } -- To view, visit https://asterix-gerrit.ics.uci.edu/1030 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0e7816864b91b2ce0e474137b20c9fee2e35c25c Gerrit-PatchSet: 3 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Michael Blow Gerrit-Reviewer: Jenkins Gerrit-Reviewer: Michael Blow Gerrit-Reviewer: Taewoo Kim Gerrit-Reviewer: Yingyi Bu Gerrit-Reviewer: abdullah alamoudi