Michael Blow has uploaded a new change for review.
https://asterix-gerrit.ics.uci.edu/1030
Change subject: ASTERIXDB-1459: Enable Debugging for Generated Functions
......................................................................
ASTERIXDB-1459: Enable Debugging for Generated Functions
Change-Id: I0e7816864b91b2ce0e474137b20c9fee2e35c25c
---
M
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/staticcodegen/CodeGenUtil.java
1 file changed, 12 insertions(+), 20 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb
refs/changes/30/1030/1
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<String, String> 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: newchange
Gerrit-Change-Id: I0e7816864b91b2ce0e474137b20c9fee2e35c25c
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <[email protected]>