Return-Path: X-Original-To: apmail-oodt-dev-archive@www.apache.org Delivered-To: apmail-oodt-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1A577F155 for ; Sun, 21 Apr 2013 05:51:39 +0000 (UTC) Received: (qmail 22146 invoked by uid 500); 21 Apr 2013 05:51:38 -0000 Delivered-To: apmail-oodt-dev-archive@oodt.apache.org Received: (qmail 22044 invoked by uid 500); 21 Apr 2013 05:51:37 -0000 Mailing-List: contact dev-help@oodt.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@oodt.apache.org Delivered-To: mailing list dev@oodt.apache.org Delivered-To: moderator for dev@oodt.apache.org Received: (qmail 4128 invoked by uid 99); 21 Apr 2013 05:40:37 -0000 Content-Type: multipart/alternative; boundary="===============8006454196501031432==" MIME-Version: 1.0 Subject: Re: Review Request: OODT-470: Modified RSSProductTransferServlet to allow setup via XML configuration file (similar to RDF and RSS product servlets) From: "Chris Mattmann" To: "Chris Mattmann" Cc: "Ross Laidlaw" , "oodt" Date: Sun, 21 Apr 2013 05:40:32 -0000 Message-ID: <20130421054032.1656.30070@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "Chris Mattmann" X-ReviewGroup: oodt X-ReviewRequest-URL: https://reviews.apache.org/r/10611/ X-Sender: "Chris Mattmann" References: <20130418210920.4549.51487@reviews.apache.org> In-Reply-To: <20130418210920.4549.51487@reviews.apache.org> Reply-To: "Chris Mattmann" --===============8006454196501031432== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/10611/#review19507 ----------------------------------------------------------- Ship it! Ship It! - Chris Mattmann On April 18, 2013, 9:09 p.m., Ross Laidlaw wrote: > = > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/10611/ > ----------------------------------------------------------- > = > (Updated April 18, 2013, 9:09 p.m.) > = > = > Review request for oodt and Chris Mattmann. > = > = > Description > ------- > = > This change allows the RSSProductTransferServlet to be configured using a= n external XML configuration file, rather than using hard-coded properties = within the class. > = > I added a default configuration file 'rss-transfer-conf.xml' to the webap= p/fmprod/src/main/resources directory. This contains configurations that w= ere originally in the RSSProductTransferServlet class, such as the cas name= space and three 'cas' prefixed tags assigned to metadata fields (BytesTrans= ferred, TotalBytes and PercentComplete). > = > I then modified the RSSProductTransferServlet class to read the data from= this configuration file. To allow the servlet to locate the file, I added= a parameter named "filemgr.rss-transfer-conf.file" to the cas-product-tomc= at-5.5.9.xml properties file and a constant RSS_TRANSFER_CONF_KEY (set to t= he same parameter name "filemgr.rss-transfer-conf.file") to the RSSConfigMe= tKeys interface. > = > In the RSSProductTransferServlet class, I removed the hard-coded NS_MAP H= ashMap for namespaces and I also removed the calls to XMLUtils.addNode() wi= th hard-coded cas-prefixed tags. I then added code to read this informatio= n from the configuration file as an RSSConfig object. Two for-each loops a= re used - the first to read namespaces and the second to read tags from the= configuration file. The three properties - BytesTransferred, TotalBytes a= nd PercentComplete - are computed for each product and stored as metadata f= or access by tags. > = > = > This addresses bug OODT-470. > https://issues.apache.org/jira/browse/OODT-470 > = > = > Diffs > ----- > = > /trunk/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSC= onfigMetKeys.java 1468408 = > /trunk/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSP= roductTransferServlet.java 1468408 = > /trunk/webapp/fmprod/src/main/resources/cas-product-tomcat-5.5.9.xml 14= 68408 = > /trunk/webapp/fmprod/src/main/resources/rss-transfer-conf.xml PRE-CREAT= ION = > = > Diff: https://reviews.apache.org/r/10611/diff/ > = > = > Testing > ------- > = > To test this change I performed the following steps: > = > = > Set up the cas-product webapp: > = > 1) cd webapp/fmprod and then mvn clean install to compile the cas-product= webapp > 2) cp target/cas-product-xx.war and target/classes/*.xml to /usr/local/oo= dt/webapp/fmprod > 3) add a soft-link (ln -s) from $CATALINA_HOME/localhost/fmprod.xml to /u= sr/local/oodt/webapp/fmprod/cas-product-tomcat-5.5.9.xml > 4) edit /usr/local/oodt/webapp/fmprod/cas-product-tomcat-5.5.9.xml to poi= nt to the right locations for config files, in particular: > = > > = > = > Start File Manager, then start Tomcat: > = > 1) cd oodt/filemgr/bin > ./filemgr start > = > 2) start tomcat > = > = > Ingest file(s) with the File Manager Client and access the RSS product tr= ansfer servlet while the files are being ingested: > = > 1) ingest large file(s) using the file manager client. > 2) while the files are being ingested, in a separate terminal window run = the following: > = > curl http://localhost:8080/fmprod/viewTransfers > = > = > Example output: > = > > > > File Manager Transfers > http://localhost:8080/fmprod/viewTransfers > Current Files Being Transferred to the File Manager > en-us > Copyright 2010: Apache Software Foundation > Thu, 18 Apr 2013 21:47:11 BST > data transfer > CAS File Manager > Thu, 18 Apr 2013 21:47:11 BST > > test2.txt > GenericFile > http://localhost:8080/fmprod/viewTransfer?ref=3Dfile:///tmp/t= est2.txt&size=3D2278362129 > Thu, 18 Apr 2013 22:46:50 BST > 202670080 > 2278362129 > 0.08895428756488077 > > > test.txt > GenericFile > http://localhost:8080/fmprod/viewTransfer?ref=3Dfile:///tmp/t= est.txt&size=3D2278362129 > Thu, 18 Apr 2013 22:46:46 BST > 491655168 > 2278362129 > 0.2157932497832525 > > > > = > = > This showed that the namespace information (xmlns:cas=3D"http://oodt.apac= he.org/ns/cas") and the three cas-prefixed metadata tags (cas:bytesTransfer= red, cas:totalBytes and cas:percentComplete) were successfully read from th= e configuration file and inserted into the output RSS XML. > = > = > Thanks, > = > Ross Laidlaw > = > --===============8006454196501031432==--