Skip to content
Permalink
Browse files

0001218: bind a logger as the "log" variable to the beanshell router,…

… column transform and load filter to make debugging easier
  • Loading branch information...
chenson42 committed May 15, 2013
1 parent 91f14ee commit 028838d7fb9928e08ad73f1c4c3e8d51ac7b06ed
@@ -56,6 +56,7 @@
private static final String DATA = "data";
private static final String ERROR = "error";
private static final String ENGINE = "engine";
private static final String LOG = "log";
private final String INTERPRETER_KEY = String.format("%d.BshInterpreter", hashCode());
private final String BATCH_COMPLETE_SCRIPTS_KEY = String.format("%d.BatchCompleteScripts",
hashCode());
@@ -125,6 +126,7 @@ protected Interpreter getInterpreter(Context context) {
protected void bind(Interpreter interpreter, DataContext context, Table table, CsvData data, Exception error)
throws EvalError {

interpreter.set(LOG, log);
interpreter.set(ENGINE, this.symmetricEngine);
interpreter.set(CONTEXT, context);
interpreter.set(TABLE, table);
@@ -106,6 +106,7 @@ protected Interpreter getInterpreter(SimpleRouterContext context) {

protected void bind(Interpreter interpreter, DataMetaData dataMetaData, Set<Node> nodes, Set<String> targetNodes)
throws EvalError {
interpreter.set("log", log);
interpreter.set("dataMetaData", dataMetaData);
interpreter.set("nodes", nodes);
interpreter.set("identityNodeId", engine.getNodeService().findIdentityNodeId());
@@ -60,6 +60,7 @@ public String transform(IDatabasePlatform platform,
String newValue, String oldValue) throws IgnoreColumnException, IgnoreRowException {
try {
Interpreter interpreter = getInterpreter(context);
interpreter.set("log", log);
interpreter.set("sqlTemplate", platform.getSqlTemplate());
interpreter.set("currentValue", newValue);
interpreter.set("oldValue", oldValue);

0 comments on commit 028838d

Please sign in to comment.
You can’t perform that action at this time.