is00hcw / tungsten-replicator

Automatically exported from code.google.com/p/tungsten-replicator
0 stars 1 forks source link

Upgrade Rhino for JavaScript #809

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
1. To which tool/application/daemon will this feature apply?

Replicator filtering and batch applier.

2. Describe the feature in general

Rhino version became old and we shall upgrade it.

3. Describe the feature interface

4. Give an idea (if applicable) of a possible implementation

5. Describe pros and cons of this feature.

5a. Why the world will be a better place with this feature.

All the good things that come with newer versions.

5b. What hardship will the human race have to endure if this feature is
implemented.

QA needs to be stepped up to test this.

Original issue reported on code.google.com by linas.vi...@continuent.com on 28 Jan 2014 at 5:02

GoogleCodeExporter commented 9 years ago

Original comment by linas.vi...@continuent.com on 29 Jan 2014 at 3:11

GoogleCodeExporter commented 9 years ago
Primary reasons why an upgrade would be useful: 

Built-in implementation of the XML parser
Built-in implementation of the JSON.stringify() function
Enhanced math and closer to V8 JavaScript implementation will make it easier 
for users to build scripts

Original comment by mc.br...@continuent.com on 5 Feb 2014 at 4:09

GoogleCodeExporter commented 9 years ago
Current version: Rhino 1.7 release 1 2008 03 06

Original comment by linas.vi...@continuent.com on 2 Jun 2014 at 2:51

GoogleCodeExporter commented 9 years ago
More reasons to upgrade:

(1.7R2) Debugger bundled with Rhino distribution
(1.7R3) JS Objects implement Java collections
(1.7R3) Performance improvements
(1.7R4) Make string concatenation with + fast

Backwards-compatibility caution:

(1.7R4) Use JavaScript 1.7 as default version in Rhino shell

Original comment by linas.vi...@continuent.com on 2 Jun 2014 at 2:58

GoogleCodeExporter commented 9 years ago
Little plan:

1. Wait for generalized JavaScript interface to be merged down to trunk from 
replicator-3.0.
2. Convert JavaScriptFilter to use the generalized classes.
3. Add unit tests to try out a few filters with event helper.
4. Upgrade Rhino and check that unit tests still pass.

Original comment by linas.vi...@continuent.com on 2 Jun 2014 at 6:08

GoogleCodeExporter commented 9 years ago
As noted in the previous comment, there is a generalized interface for script 
plugins located in package 
com.continuent.tungsten.replicator.scripting.  Here is a thumbnail of the 
behavior: 

1.) Interface ScriptExecutor denotes an implementation of a scripting plugin. 

2.) JavascriptExecutor implements the aforesaid interface and encapsulates the 
Rhino integration. 

3.) There is also a ScriptExecutorService that implements background execution 
of scripts. I had to implement this for batch apply as we need to run merge 
scripts in parallel at commit time.  It may be useful for other purposes. 

4.) Unit tests for both the JavascriptExecutor and ScriptExecutorService are 
available in the identically named com.continuent.tungsten.replicator.scripting 
package in the test/java directory.  

Aside from the unit tests, examples of usage are available in 
SimpleBatchApplier.  I suspect this can be slotted into the JavaScriptFilter 
without much trouble.  It just takes out any references to the scripting 
implementation. 

Original comment by robert.h...@continuent.com on 2 Jun 2014 at 6:21

GoogleCodeExporter commented 9 years ago
There are too many moving pieces to do the upgrade in this release. I don't 
want to destabilize Hadoop, Vertica and Redshift implementations at this late 
stage.

Original comment by linas.vi...@continuent.com on 11 Sep 2014 at 2:05

GoogleCodeExporter commented 9 years ago

Original comment by linas.vi...@continuent.com on 19 Jan 2015 at 2:20