> On May 13, 2015, 3:03 p.m., Rajat Khandelwal wrote:
> > lens-cli/src/main/java/org/apache/lens/cli/commands/LensConnectionCommands.java,
> > line 92
> > <https://reviews.apache.org/r/34105/diff/1/?file=956607#file956607line92>
> >
> > Another thing I have in mind is to add all jars of a directory. This
> > will take a directory path as input, look at all `*jar` files there and add
> > them. Added customizability with `jar_order` file in the directory which
> > will govern which order jars need to be added in.
>
> Rajat Khandelwal wrote:
> Some of the code is already present in
> org.apache.lens.server.session.DatabaseResourceService. Might need some
> reshuffling
>
> Yash Sharma wrote:
> Will give it a look and incorporate relevant changes.
>
> Yash Sharma wrote:
> Not Implemented.
>
> I had a look at the code and its pretty straight but it gets tricky for
> regex's which match to multiple directories and we need to fetch the
> jar_order from multiple dirs. Also the same service method becomes complex.
> The backend service Add/Remove resource is used by both File resources
> and Jar resources and also for regex and simple paths.
>
> Should we have different backend service methods ? Thoughts ?
> Will incorporate the changes based on suggestions.
I'm inclined towards something like this:
add(file_path): adds the file
add(dir_path): opens the dir, decides jar order according to jar_order or
if not present, glob order
add(regex): iterates over all paths matching the regex in glob order, and
calls add(x) on them.
- Rajat
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/34105/#review83579
-----------------------------------------------------------
On May 18, 2015, 9:45 p.m., Yash Sharma wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/34105/
> -----------------------------------------------------------
>
> (Updated May 18, 2015, 9:45 p.m.)
>
>
> Review request for lens.
>
>
> Repository: lens
>
>
> Description
> -------
>
> Initial patch for - add jar should be able to take regex path and should be
> able to add multiple jars.
>
> Jira: https://issues.apache.org/jira/browse/LENS-513
>
>
> Diffs
> -----
>
>
> lens-cli/src/test/java/org/apache/lens/cli/TestLensConnectionCliCommands.java
> 3238edb
>
> lens-server/src/main/java/org/apache/lens/server/session/SessionResource.java
> 5ffc086
> lens-server/src/test/java/org/apache/lens/server/TestServerRestart.java
> 01dcf54
>
> Diff: https://reviews.apache.org/r/34105/diff/
>
>
> Testing
> -------
>
> Yes.
>
> Testcases:
> New testcase: TestLensConnectionCliCommands#testJarCommandsWithRegex
> Old testcase modified: TestLensConnectionCliCommands#testJarCommands
>
> Test on CLI:
>
> 1. -ve test scenario:
> lens-shell>add jar /home/yash/Desktop/rt.jarr
> No Jars found in the specified path.
> lens-shell>add jar /home/yash/Desktop/*.jarr
> No Jars found in the specified path.
>
> 2. +ve test scenario:
> lens-shell>add jar /home/yash/Desktop/*.jar
> Add resource succeeded[/home/yash/Desktop/mahout-core-0.9.jar
> /home/yash/Desktop/rt.jar ]
>
> lens-shell>list resources
> type=jar path=/home/yash/Desktop/mahout-core-0.9.jar
> type=jar path=/home/yash/Desktop/rt.jar
>
>
> Complete build with testcases:
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] Lens Checkstyle Rules .............................. SUCCESS [ 2.822
> s]
> [INFO] Lens ............................................... SUCCESS [ 3.751
> s]
> [INFO] Lens API ........................................... SUCCESS [ 19.844
> s]
> [INFO] Lens API for server and extensions ................. SUCCESS [ 23.579
> s]
> [INFO] Lens Cube .......................................... SUCCESS [03:06
> min]
> [INFO] Lens DB storage .................................... SUCCESS [ 22.211
> s]
> [INFO] Lens Query Library ................................. SUCCESS [ 19.126
> s]
> [INFO] Lens Hive Driver ................................... SUCCESS [02:48
> min]
> [INFO] Lens Driver for JDBC ............................... SUCCESS [ 33.738
> s]
> [INFO] Lens Server ........................................ SUCCESS [06:03
> min]
> [INFO] Lens client ........................................ SUCCESS [ 41.219
> s]
> [INFO] Lens CLI ........................................... SUCCESS [02:09
> min]
> [INFO] Lens Examples ...................................... SUCCESS [ 11.513
> s]
> [INFO] Lens Distribution .................................. SUCCESS [ 9.081
> s]
> [INFO] Lens ML Lib ........................................ SUCCESS [01:19
> min]
> [INFO] Lens ML Ext Distribution ........................... SUCCESS [ 2.787
> s]
> [INFO] Lens Regression .................................... SUCCESS [ 8.067
> s]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 18:46 min
> [INFO] Finished at: 2015-05-12T19:44:01+05:30
> [INFO] Final Memory: 120M/389M
> [INFO]
> ------------------------------------------------------------------------
>
>
> Thanks,
>
> Yash Sharma
>
>