From: <tho...@us...> - 2014-03-05 13:47:55
|
Revision: 7914 http://sourceforge.net/p/bigdata/code/7914 Author: thompsonbry Date: 2014-03-05 13:47:48 +0000 (Wed, 05 Mar 2014) Log Message: ----------- Merging from the main development branch into the RDR branch. This will pick up the changes in the jetty configuration and the changes in the structuring of the webapp in bigdata-war. {{{ At revision 7913. merge https://svn.code.sf.net/p/bigdata/code/branches/BIGDATA_RELEASE_1_3_0 /Users/bryan/Documents/workspace/RDR_NEW_SVN --- Merging r7836 through r7913 into /Users/bryan/Documents/workspace/RDR_NEW_SVN D /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-war/src/html/result-to-html.xsl C /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-war/src/html/index.html A /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-war/src/result-to-html.xsl A /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-war/src/WEB-INF A /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-war/src/WEB-INF/RWStore.properties A /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-war/src/WEB-INF/web.xml A /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-war/src/WEB-INF/classes A /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-war/src/WEB-INF/classes/log4j.properties A /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-war/src/WEB-INF/jetty.xml A /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-war/src/index.html D /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-war/src/resources/RWStore.properties D /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-war/src/resources/WEB-INF D /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-war/src/resources/log4j.properties U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-B.config U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-A.config U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-C.config U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3ChangeLeader.java U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java A /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-jini/src/java/com/bigdata/journal/jini/ha/NoSnapshotException.java U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal.java U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-A.config U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-B.config U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-C.config U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HARestore.java U /Users/bryan/Documents/workspace/RDR_NEW_SVN/src/resources/HAJournal/log4jHA.properties U /Users/bryan/Documents/workspace/RDR_NEW_SVN/src/resources/HAJournal/HAJournal.config U /Users/bryan/Documents/workspace/RDR_NEW_SVN/src/resources/HAJournal/startHAServices.config U /Users/bryan/Documents/workspace/RDR_NEW_SVN/src/resources/bin/startHAServices U /Users/bryan/Documents/workspace/RDR_NEW_SVN/src/resources/etc/bigdata/bigdataHA.config U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata/src/test/com/bigdata/journal/TestCommitCounterUtility.java U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata/src/java/com/bigdata/search/FullTextIndex.java U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata/src/java/com/bigdata/btree/Node.java U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata/src/java/com/bigdata/journal/CommitCounterUtility.java U /Users/bryan/Documents/workspace/RDR_NEW_SVN/build.xml --- Merging r7836 through r7913 into /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFServletContextListener.java U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/ConfigParams.java D /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/WebAppUnassembled.java --- Merging r7836 through r7913 into /Users/bryan/Documents/workspace/RDR_NEW_SVN U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/BigdataValueCentricFullTextIndex.java U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/cache/DescribeBindingsCollector.java U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/cache/DescribeCacheUpdater.java U /Users/bryan/Documents/workspace/RDR_NEW_SVN/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/ASTEvalHelper.java U /Users/bryan/Documents/workspace/RDR_NEW_SVN Merge complete. ===== File Statistics: ===== Deleted: 5 Added: 9 Updated: 28 ==== Property Statistics: ===== Updated: 1 ==== Conflict Statistics: ===== Tree conflicts: 1 }}} The only conflict is on index.html. I am going to use the version from the RDR branch, but move it into the new location in bigdata-war/src/index.html. This may break some of the style sheet, new html pages, etc. that TobyC has been working on. I am leaving index.html in place under bigdata-war/src/html/index.html as well. These files are now copies of one another. I am also leaving the result-to-html.xls file in place under bigdata-war/src/result-to-html.xls. This style sheet was probably replaced in the RDR branch, but I will leave it to TobyC to clear that up. Note: I have reverted the bigdata-war/src/html directory. This means that it will be unchanged by this merge. TobyC will need to look at both index.html and result-to-html.xls within the bigdata-war/src/html directory and look at whether those files should remain or disappear. The location of the startup file (index.html) is specified in jetty.xml and NanoSparqlServer.java. The jetty.xml version is used by the HAJournalServer. The NanoSparqlServer version is used by the main() routine in that class. I can help verify that the HAJournalServer is able to correctly resolve index.html when we reconcile these files. See #526 (RDR) See #730 (Allow configuration of embedded NSS jetty server using jetty-web.xml) Revision Links: -------------- http://sourceforge.net/p/bigdata/code/7913 http://sourceforge.net/p/bigdata/code/7836 http://sourceforge.net/p/bigdata/code/7913 http://sourceforge.net/p/bigdata/code/7836 http://sourceforge.net/p/bigdata/code/7913 http://sourceforge.net/p/bigdata/code/7836 http://sourceforge.net/p/bigdata/code/7913 Modified Paths: -------------- branches/RDR/bigdata/src/java/com/bigdata/btree/Node.java branches/RDR/bigdata/src/java/com/bigdata/journal/CommitCounterUtility.java branches/RDR/bigdata/src/java/com/bigdata/search/FullTextIndex.java branches/RDR/bigdata/src/test/com/bigdata/journal/TestCommitCounterUtility.java branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-A.config branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-B.config branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-C.config branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal.java branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HARestore.java branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-A.config branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-B.config branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-C.config branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3ChangeLeader.java branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/BigdataValueCentricFullTextIndex.java branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/cache/DescribeBindingsCollector.java branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/cache/DescribeCacheUpdater.java branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/ASTEvalHelper.java branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFServletContextListener.java branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/ConfigParams.java branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java branches/RDR/build.xml branches/RDR/src/resources/HAJournal/HAJournal.config branches/RDR/src/resources/HAJournal/log4jHA.properties branches/RDR/src/resources/HAJournal/startHAServices.config branches/RDR/src/resources/bin/startHAServices branches/RDR/src/resources/etc/bigdata/bigdataHA.config Added Paths: ----------- branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/NoSnapshotException.java branches/RDR/bigdata-war/src/WEB-INF/ branches/RDR/bigdata-war/src/WEB-INF/RWStore.properties branches/RDR/bigdata-war/src/WEB-INF/classes/ branches/RDR/bigdata-war/src/WEB-INF/classes/log4j.properties branches/RDR/bigdata-war/src/WEB-INF/jetty.xml branches/RDR/bigdata-war/src/WEB-INF/web.xml branches/RDR/bigdata-war/src/index.html branches/RDR/bigdata-war/src/result-to-html.xsl Removed Paths: ------------- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/WebAppUnassembled.java branches/RDR/bigdata-war/src/WEB-INF/RWStore.properties branches/RDR/bigdata-war/src/WEB-INF/classes/ branches/RDR/bigdata-war/src/WEB-INF/classes/log4j.properties branches/RDR/bigdata-war/src/WEB-INF/jetty.xml branches/RDR/bigdata-war/src/WEB-INF/web.xml branches/RDR/bigdata-war/src/resources/RWStore.properties branches/RDR/bigdata-war/src/resources/WEB-INF/ branches/RDR/bigdata-war/src/resources/log4j.properties Property Changed: ---------------- branches/RDR/ branches/RDR/bigdata/lib/jetty/ branches/RDR/bigdata/src/java/com/bigdata/bop/aggregate/ branches/RDR/bigdata/src/java/com/bigdata/bop/joinGraph/ branches/RDR/bigdata/src/java/com/bigdata/bop/util/ branches/RDR/bigdata/src/java/com/bigdata/htree/raba/ branches/RDR/bigdata/src/java/com/bigdata/jsr166/ branches/RDR/bigdata/src/test/com/bigdata/bop/joinGraph/ branches/RDR/bigdata/src/test/com/bigdata/bop/util/ branches/RDR/bigdata/src/test/com/bigdata/jsr166/ branches/RDR/bigdata/src/test/com/bigdata/util/httpd/ branches/RDR/bigdata-compatibility/ branches/RDR/bigdata-jini/src/java/com/bigdata/attr/ branches/RDR/bigdata-jini/src/java/com/bigdata/disco/ branches/RDR/bigdata-jini/src/java/com/bigdata/util/config/ branches/RDR/bigdata-perf/ branches/RDR/bigdata-perf/btc/ branches/RDR/bigdata-perf/btc/src/resources/ branches/RDR/bigdata-perf/lubm/ branches/RDR/bigdata-perf/uniprot/ branches/RDR/bigdata-perf/uniprot/src/ branches/RDR/bigdata-rdf/src/java/com/bigdata/bop/rdf/aggregate/ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/changesets/ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/error/ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/internal/ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/relation/ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/util/ branches/RDR/bigdata-rdf/src/samples/ branches/RDR/bigdata-rdf/src/test/com/bigdata/bop/rdf/aggregate/ branches/RDR/bigdata-rdf/src/test/com/bigdata/rdf/internal/ branches/RDR/bigdata-rdf/src/test/com/bigdata/rdf/relation/ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/bench/ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/changesets/ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/ branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/bench/ branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/ branches/RDR/dsi-utils/ branches/RDR/dsi-utils/LEGAL/ branches/RDR/dsi-utils/lib/ branches/RDR/dsi-utils/src/ branches/RDR/dsi-utils/src/java/ branches/RDR/dsi-utils/src/java/it/ branches/RDR/dsi-utils/src/java/it/unimi/ branches/RDR/dsi-utils/src/test/ branches/RDR/dsi-utils/src/test/it/unimi/ branches/RDR/dsi-utils/src/test/it/unimi/dsi/ branches/RDR/lgpl-utils/src/java/it/unimi/dsi/fastutil/bytes/custom/ branches/RDR/lgpl-utils/src/test/it/unimi/dsi/fastutil/bytes/custom/ branches/RDR/osgi/ branches/RDR/src/resources/bin/config/ Index: branches/RDR =================================================================== --- branches/RDR 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR 2014-03-05 13:47:48 UTC (rev 7914) Property changes on: branches/RDR ___________________________________________________________________ Modified: svn:ignore ## -28,3 +28,4 ## CI bsbm10-dataset.nt.gz bsbm10-dataset.nt.zip +benchmark* Modified: svn:mergeinfo ## -1,6 +1,6 ## /branches/BIGDATA_OPENRDF_2_6_9_UPDATE:6769-6785 /branches/BIGDATA_RELEASE_1_2_0:6766-7380 -/branches/BIGDATA_RELEASE_1_3_0:7665-7836 +/branches/BIGDATA_RELEASE_1_3_0:7665-7913 /branches/BTREE_BUFFER_BRANCH:2004-2045 /branches/DEV_BRANCH_27_OCT_2009:2270-2546,2548-2782 /branches/INT64_BRANCH:4486-4522 \ No newline at end of property Index: branches/RDR/bigdata/lib/jetty =================================================================== --- branches/RDR/bigdata/lib/jetty 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata/lib/jetty 2014-03-05 13:47:48 UTC (rev 7914) Property changes on: branches/RDR/bigdata/lib/jetty ___________________________________________________________________ Modified: svn:mergeinfo ## -1,6 +1,6 ## /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/lib/jetty:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/lib/jetty:6766-7380 -/branches/BIGDATA_RELEASE_1_3_0/bigdata/lib/jetty:7665-7836 +/branches/BIGDATA_RELEASE_1_3_0/bigdata/lib/jetty:7665-7913 /branches/INT64_BRANCH/bigdata/lib/jetty:4486-4522 /branches/MGC_1_3_0/bigdata/lib/jetty:7609-7752 /branches/QUADS_QUERY_BRANCH/bigdata/lib/jetty:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 \ No newline at end of property Index: branches/RDR/bigdata/src/java/com/bigdata/bop/aggregate =================================================================== --- branches/RDR/bigdata/src/java/com/bigdata/bop/aggregate 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata/src/java/com/bigdata/bop/aggregate 2014-03-05 13:47:48 UTC (rev 7914) Property changes on: branches/RDR/bigdata/src/java/com/bigdata/bop/aggregate ___________________________________________________________________ Modified: svn:mergeinfo ## -1,6 +1,6 ## /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/java/com/bigdata/bop/aggregate:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/bop/aggregate:6766-7380 -/branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/aggregate:7665-7836 +/branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/aggregate:7665-7913 /branches/INT64_BRANCH/bigdata/src/java/com/bigdata/bop/aggregate:4486-4522 /branches/MGC_1_3_0/bigdata/src/java/com/bigdata/bop/aggregate:7609-7752 /branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/aggregate:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 \ No newline at end of property Index: branches/RDR/bigdata/src/java/com/bigdata/bop/joinGraph =================================================================== --- branches/RDR/bigdata/src/java/com/bigdata/bop/joinGraph 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata/src/java/com/bigdata/bop/joinGraph 2014-03-05 13:47:48 UTC (rev 7914) Property changes on: branches/RDR/bigdata/src/java/com/bigdata/bop/joinGraph ___________________________________________________________________ Modified: svn:mergeinfo ## -1,6 +1,6 ## /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/java/com/bigdata/bop/joinGraph:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/bop/joinGraph:6766-7380 -/branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/joinGraph:7665-7836 +/branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/joinGraph:7665-7913 /branches/INT64_BRANCH/bigdata/src/java/com/bigdata/bop/joinGraph:4486-4522 /branches/MGC_1_3_0/bigdata/src/java/com/bigdata/bop/joinGraph:7609-7752 /branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/joinGraph:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 \ No newline at end of property Index: branches/RDR/bigdata/src/java/com/bigdata/bop/util =================================================================== --- branches/RDR/bigdata/src/java/com/bigdata/bop/util 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata/src/java/com/bigdata/bop/util 2014-03-05 13:47:48 UTC (rev 7914) Property changes on: branches/RDR/bigdata/src/java/com/bigdata/bop/util ___________________________________________________________________ Modified: svn:mergeinfo ## -1,6 +1,6 ## /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/java/com/bigdata/bop/util:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/bop/util:6766-7380 -/branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/util:7665-7836 +/branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/util:7665-7913 /branches/INT64_BRANCH/bigdata/src/java/com/bigdata/bop/util:4486-4522 /branches/MGC_1_3_0/bigdata/src/java/com/bigdata/bop/util:7609-7752 /branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/util:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 \ No newline at end of property Modified: branches/RDR/bigdata/src/java/com/bigdata/btree/Node.java =================================================================== --- branches/RDR/bigdata/src/java/com/bigdata/btree/Node.java 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata/src/java/com/bigdata/btree/Node.java 2014-03-05 13:47:48 UTC (rev 7914) @@ -2304,6 +2304,11 @@ // Tunnel through to the mutable keys object. final MutableKeyBuffer keys = (MutableKeyBuffer) this.getKeys(); final MutableNodeData data = (MutableNodeData) this.data; + + // check for persistent storage to be recycled for the removed child + if (data.childAddr[index] != 0) { + btree.recycle(data.childAddr[index]); + } if (lengthKeyCopy > 0) { Index: branches/RDR/bigdata/src/java/com/bigdata/htree/raba =================================================================== --- branches/RDR/bigdata/src/java/com/bigdata/htree/raba 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata/src/java/com/bigdata/htree/raba 2014-03-05 13:47:48 UTC (rev 7914) Property changes on: branches/RDR/bigdata/src/java/com/bigdata/htree/raba ___________________________________________________________________ Modified: svn:mergeinfo ## -1,6 +1,6 ## /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/java/com/bigdata/htree/raba:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/htree/raba:6766-7380 -/branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/htree/raba:7665-7836 +/branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/htree/raba:7665-7913 /branches/INT64_BRANCH/bigdata/src/java/com/bigdata/htree/raba:4486-4522 /branches/MGC_1_3_0/bigdata/src/java/com/bigdata/htree/raba:7609-7752 /branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/htree/raba:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 \ No newline at end of property Modified: branches/RDR/bigdata/src/java/com/bigdata/journal/CommitCounterUtility.java =================================================================== --- branches/RDR/bigdata/src/java/com/bigdata/journal/CommitCounterUtility.java 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata/src/java/com/bigdata/journal/CommitCounterUtility.java 2014-03-05 13:47:48 UTC (rev 7914) @@ -26,10 +26,15 @@ import java.io.File; import java.io.FileFilter; import java.io.IOException; +import java.util.Arrays; +import java.util.Comparator; import java.util.Formatter; import org.apache.log4j.Logger; +import com.bigdata.ha.halog.IHALogReader; +import com.bigdata.journal.jini.ha.SnapshotManager; + /** * Utility class for operations on files that are named using a commit counter. * @@ -247,4 +252,91 @@ } + /** + * Find and return the {@link File} associated with the greatest commit + * counter. This uses a reverse order search to locate the most recent file + * very efficiently. + * + * @param f + * The root of the directory structure for the snapshot or HALog + * files. + * @param fileFilter + * Either the {@link SnapshotManager#SNAPSHOT_FILTER} or the + * {@link IHALogReader#HALOG_FILTER}. + * + * @return The file from the directory structure associated with the + * greatest commit counter. + * + * @throws IOException + */ + public static File findGreatestCommitCounter(final File f, + final FileFilter fileFilter) throws IOException { + + if (f == null) + throw new IllegalArgumentException(); + + if (fileFilter == null) + throw new IllegalArgumentException(); + + if (f.isDirectory()) { + + final File[] files = f.listFiles(fileFilter); + + /* + * Sort into (reverse) lexical order to force visitation in + * (reverse) lexical order. + * + * Note: This should work under any OS. Files will be either + * directory names (3 digits) or filenames (21 digits plus the file + * extension). Thus the comparison centers numerically on the digits + * that encode either part of a commit counter (subdirectory) or an + * entire commit counter (HALog file). + */ + Arrays.sort(files,ReverseFileComparator.INSTANCE); + + for (int i = 0; i < files.length; i++) { + + final File tmp = findGreatestCommitCounter(files[i], fileFilter); + + if (tmp != null) { + + // Done. + return tmp; + + } + + } + + } else if (fileFilter.accept(f)) { + + // Match + return f; + + } + + // No match. + return null; + + } + + /** + * Impose a reverse sort on files. + * + * @author <a href="mailto:tho...@us...">Bryan + * Thompson</a> + */ + private static class ReverseFileComparator implements Comparator<File> { + + @Override + public int compare(final File o1, final File o2) { + + return o2.compareTo(o1); + + } + + /** Impose a reverse sort on files. */ + private static final Comparator<File> INSTANCE = new ReverseFileComparator(); + + } + } Index: branches/RDR/bigdata/src/java/com/bigdata/jsr166 =================================================================== --- branches/RDR/bigdata/src/java/com/bigdata/jsr166 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata/src/java/com/bigdata/jsr166 2014-03-05 13:47:48 UTC (rev 7914) Property changes on: branches/RDR/bigdata/src/java/com/bigdata/jsr166 ___________________________________________________________________ Modified: svn:mergeinfo ## -1,6 +1,6 ## /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/java/com/bigdata/jsr166:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/java/com/bigdata/jsr166:6766-7380 -/branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/jsr166:7665-7836 +/branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/jsr166:7665-7913 /branches/INT64_BRANCH/bigdata/src/java/com/bigdata/jsr166:4486-4522 /branches/MGC_1_3_0/bigdata/src/java/com/bigdata/jsr166:7609-7752 /branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/jsr166:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 \ No newline at end of property Modified: branches/RDR/bigdata/src/java/com/bigdata/search/FullTextIndex.java =================================================================== --- branches/RDR/bigdata/src/java/com/bigdata/search/FullTextIndex.java 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata/src/java/com/bigdata/search/FullTextIndex.java 2014-03-05 13:47:48 UTC (rev 7914) @@ -1151,6 +1151,14 @@ log.info("Interrupted - only partial results will be returned."); } + /* + * Yes, let's toss it. We were getting into a situation + * where the ExecutionHelper above received an interrupt + * but we still went through the heavy-weight filtering + * operations below (matchExact or matchRegex). + */ + throw new RuntimeException(ex); + } catch (ExecutionException ex) { throw new RuntimeException(ex); Index: branches/RDR/bigdata/src/test/com/bigdata/bop/joinGraph =================================================================== --- branches/RDR/bigdata/src/test/com/bigdata/bop/joinGraph 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata/src/test/com/bigdata/bop/joinGraph 2014-03-05 13:47:48 UTC (rev 7914) Property changes on: branches/RDR/bigdata/src/test/com/bigdata/bop/joinGraph ___________________________________________________________________ Modified: svn:mergeinfo ## -1,6 +1,6 ## /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/test/com/bigdata/bop/joinGraph:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/test/com/bigdata/bop/joinGraph:6766-7380 -/branches/BIGDATA_RELEASE_1_3_0/bigdata/src/test/com/bigdata/bop/joinGraph:7665-7836 +/branches/BIGDATA_RELEASE_1_3_0/bigdata/src/test/com/bigdata/bop/joinGraph:7665-7913 /branches/INT64_BRANCH/bigdata/src/test/com/bigdata/bop/joinGraph:4486-4522 /branches/MGC_1_3_0/bigdata/src/test/com/bigdata/bop/joinGraph:7609-7752 /branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/joinGraph:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 \ No newline at end of property Index: branches/RDR/bigdata/src/test/com/bigdata/bop/util =================================================================== --- branches/RDR/bigdata/src/test/com/bigdata/bop/util 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata/src/test/com/bigdata/bop/util 2014-03-05 13:47:48 UTC (rev 7914) Property changes on: branches/RDR/bigdata/src/test/com/bigdata/bop/util ___________________________________________________________________ Modified: svn:mergeinfo ## -1,6 +1,6 ## /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/test/com/bigdata/bop/util:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/test/com/bigdata/bop/util:6766-7380 -/branches/BIGDATA_RELEASE_1_3_0/bigdata/src/test/com/bigdata/bop/util:7665-7836 +/branches/BIGDATA_RELEASE_1_3_0/bigdata/src/test/com/bigdata/bop/util:7665-7913 /branches/INT64_BRANCH/bigdata/src/test/com/bigdata/bop/util:4486-4522 /branches/MGC_1_3_0/bigdata/src/test/com/bigdata/bop/util:7609-7752 /branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/util:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 \ No newline at end of property Modified: branches/RDR/bigdata/src/test/com/bigdata/journal/TestCommitCounterUtility.java =================================================================== --- branches/RDR/bigdata/src/test/com/bigdata/journal/TestCommitCounterUtility.java 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata/src/test/com/bigdata/journal/TestCommitCounterUtility.java 2014-03-05 13:47:48 UTC (rev 7914) @@ -27,6 +27,8 @@ package com.bigdata.journal; import java.io.File; +import java.io.FileFilter; +import java.io.IOException; import junit.framework.TestCase2; @@ -63,4 +65,117 @@ } + public void test_findGreatestCommitCounter() throws IOException { + + final String ext = ".tmp"; + + final FileFilter fileFilter = new FileFilter() { + + @Override + public boolean accept(final File f) { + if (f.isDirectory()) { + + return true; + + } + return f.getName().endsWith(ext); + } + + }; + + // temp directory for this test. + final File dir = File.createTempFile(getName(), ""); + try { + + if (!dir.delete()) + fail("Could not delete: " + dir); + if (!dir.mkdirs()) + fail("Could not create: " + dir); + + final File f1 = CommitCounterUtility.getCommitCounterFile(dir, 1L, + ext); + final File f10 = CommitCounterUtility.getCommitCounterFile(dir, + 10L, ext); + final File f100 = CommitCounterUtility.getCommitCounterFile(dir, + 100L, ext); + final File f1000 = CommitCounterUtility.getCommitCounterFile(dir, + 1000L, ext); + final File f10000 = CommitCounterUtility.getCommitCounterFile(dir, + 10000L, ext); + + // No files. Returns null. + assertEquals(null, CommitCounterUtility.findGreatestCommitCounter( + dir, fileFilter)); + + // Create directory structure. + if (!f10.getParentFile().mkdirs()) + fail("Could not create directory structure: " + f1000); + + // No files. Returns null. + assertEquals(null, CommitCounterUtility.findGreatestCommitCounter( + dir, fileFilter)); + + if (!f10.createNewFile()) + fail("Could not create: " + f10); + + // This is the only file. It should be returned. + assertEquals(f10, CommitCounterUtility.findGreatestCommitCounter( + dir, fileFilter)); + + // Create a file with a commit counter LT that file. + if (!f1.createNewFile()) + fail("Could not create: " + f1); + + // The return value should not change. + assertEquals(f10, CommitCounterUtility.findGreatestCommitCounter( + dir, fileFilter)); + + // Create a file with a larger commit counter. + if (!f100.createNewFile()) + fail("Could not create: " + f100); + + // That file should now be returned. + assertEquals(f100, CommitCounterUtility.findGreatestCommitCounter( + dir, fileFilter)); + + // Create a file with a larger commit counter. The commit counter + // will cause another directory to be created. + if (!f1000.getParentFile().mkdirs()) + fail("Could not create directory structure: " + f1000); + if (!f1000.createNewFile()) + fail("Could not create: " + f1000); + + // That file should now be returned. + assertEquals(f1000, CommitCounterUtility.findGreatestCommitCounter( + dir, fileFilter)); + + // Create a new directory structure, but do not add a file. The new + // directory structure is ordered GT the existing files. For this + // case the algorithm needs to work backwards to see if it can find + // a non-empty directory. + if (!f10000.getParentFile().mkdirs()) + fail("Could not create directory structure: " + f10000); + + // The same file should be returned since the new dir is empty. + assertEquals(f1000, CommitCounterUtility.findGreatestCommitCounter( + dir, fileFilter)); + + // Add a file to that directory. + if (!f10000.createNewFile()) + fail("Could not create: " + f10000); + + // That file should be returned. + assertEquals(f10000, + CommitCounterUtility.findGreatestCommitCounter(dir, + fileFilter)); + + } finally { + + CommitCounterUtility.recursiveDelete(false/* errorIfDeleteFails */, + dir, fileFilter); + + } + + } + } Index: branches/RDR/bigdata/src/test/com/bigdata/jsr166 =================================================================== --- branches/RDR/bigdata/src/test/com/bigdata/jsr166 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata/src/test/com/bigdata/jsr166 2014-03-05 13:47:48 UTC (rev 7914) Property changes on: branches/RDR/bigdata/src/test/com/bigdata/jsr166 ___________________________________________________________________ Modified: svn:mergeinfo ## -1,6 +1,6 ## /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/test/com/bigdata/jsr166:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/test/com/bigdata/jsr166:6766-7380 -/branches/BIGDATA_RELEASE_1_3_0/bigdata/src/test/com/bigdata/jsr166:7665-7836 +/branches/BIGDATA_RELEASE_1_3_0/bigdata/src/test/com/bigdata/jsr166:7665-7913 /branches/INT64_BRANCH/bigdata/src/test/com/bigdata/jsr166:4486-4522 /branches/MGC_1_3_0/bigdata/src/test/com/bigdata/jsr166:7609-7752 /branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/jsr166:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 \ No newline at end of property Index: branches/RDR/bigdata/src/test/com/bigdata/util/httpd =================================================================== --- branches/RDR/bigdata/src/test/com/bigdata/util/httpd 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata/src/test/com/bigdata/util/httpd 2014-03-05 13:47:48 UTC (rev 7914) Property changes on: branches/RDR/bigdata/src/test/com/bigdata/util/httpd ___________________________________________________________________ Modified: svn:mergeinfo ## -1,6 +1,6 ## /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata/src/test/com/bigdata/util/httpd:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata/src/test/com/bigdata/util/httpd:6766-7380 -/branches/BIGDATA_RELEASE_1_3_0/bigdata/src/test/com/bigdata/util/httpd:7665-7836 +/branches/BIGDATA_RELEASE_1_3_0/bigdata/src/test/com/bigdata/util/httpd:7665-7913 /branches/INT64_BRANCH/bigdata/src/test/com/bigdata/util/httpd:4486-4522 /branches/MGC_1_3_0/bigdata/src/test/com/bigdata/util/httpd:7609-7752 /branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/util/httpd:4525-4531,4533-4548,4550-4584,4586-4609,4611-4632,4634-4643,4646-4672,4674-4685,4687-4693,4697-4735,4737-4782,4784-4792,4794-4796,4798-4801 \ No newline at end of property Index: branches/RDR/bigdata-compatibility =================================================================== --- branches/RDR/bigdata-compatibility 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata-compatibility 2014-03-05 13:47:48 UTC (rev 7914) Property changes on: branches/RDR/bigdata-compatibility ___________________________________________________________________ Modified: svn:mergeinfo ## -1,6 +1,6 ## /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata-compatibility:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata-compatibility:6766-7380 -/branches/BIGDATA_RELEASE_1_3_0/bigdata-compatibility:7665-7836 +/branches/BIGDATA_RELEASE_1_3_0/bigdata-compatibility:7665-7913 /branches/INT64_BRANCH/bigdata-compatibility:4486-4522 /branches/LARGE_LITERALS_REFACTOR/bigdata-compatibility:4175-4387 /branches/MGC_1_3_0/bigdata-compatibility:7609-7752 \ No newline at end of property Index: branches/RDR/bigdata-jini/src/java/com/bigdata/attr =================================================================== --- branches/RDR/bigdata-jini/src/java/com/bigdata/attr 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata-jini/src/java/com/bigdata/attr 2014-03-05 13:47:48 UTC (rev 7914) Property changes on: branches/RDR/bigdata-jini/src/java/com/bigdata/attr ___________________________________________________________________ Modified: svn:mergeinfo ## -1,6 +1,6 ## /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata-jini/src/java/com/bigdata/attr:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata-jini/src/java/com/bigdata/attr:6766-7380 -/branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/attr:7665-7836 +/branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/attr:7665-7913 /branches/BTREE_BUFFER_BRANCH/bigdata-jini/src/java/com/bigdata/attr:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-jini/src/java/com/bigdata/attr:2270-2546,2548-2782 /branches/INT64_BRANCH/bigdata-jini/src/java/com/bigdata/attr:4486-4522 \ No newline at end of property Index: branches/RDR/bigdata-jini/src/java/com/bigdata/disco =================================================================== --- branches/RDR/bigdata-jini/src/java/com/bigdata/disco 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata-jini/src/java/com/bigdata/disco 2014-03-05 13:47:48 UTC (rev 7914) Property changes on: branches/RDR/bigdata-jini/src/java/com/bigdata/disco ___________________________________________________________________ Modified: svn:mergeinfo ## -1,6 +1,6 ## /branches/BIGDATA_OPENRDF_2_6_9_UPDATE/bigdata-jini/src/java/com/bigdata/disco:6769-6785 /branches/BIGDATA_RELEASE_1_2_0/bigdata-jini/src/java/com/bigdata/disco:6766-7380 -/branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/disco:7665-7836 +/branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/disco:7665-7913 /branches/BTREE_BUFFER_BRANCH/bigdata-jini/src/java/com/bigdata/disco:2004-2045 /branches/DEV_BRANCH_27_OCT_2009/bigdata-jini/src/java/com/bigdata/disco:2270-2546,2548-2782 /branches/INT64_BRANCH/bigdata-jini/src/java/com/bigdata/disco:4486-4522 \ No newline at end of property Modified: branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-A.config =================================================================== --- branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-A.config 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-A.config 2014-03-05 13:47:48 UTC (rev 7914) @@ -60,9 +60,6 @@ private static fedname = "benchmark"; - // NanoSparqlServer (http) port. - private static nssPort = 8090; - // write replication pipeline port (listener). private static haPort = 9090; @@ -276,20 +273,3 @@ }, bigdata.kb); } - -/* - * NanoSparqlServer configuration. - */ -com.bigdata.rdf.sail.webapp.NanoSparqlServer { - - namespace = bigdata.namespace; - - create = true; - - queryThreadPoolSize = 16; - - describeEachNamedGraph = true; - - port = bigdata.nssPort; - -} Modified: branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-B.config =================================================================== --- branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-B.config 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-B.config 2014-03-05 13:47:48 UTC (rev 7914) @@ -275,20 +275,3 @@ }, bigdata.kb); } - -/* - * NanoSparqlServer configuration. - */ -com.bigdata.rdf.sail.webapp.NanoSparqlServer { - - namespace = bigdata.namespace; - - create = true; - - queryThreadPoolSize = 16; - - describeEachNamedGraph = true; - - port = bigdata.nssPort; - -} Modified: branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-C.config =================================================================== --- branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-C.config 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-C.config 2014-03-05 13:47:48 UTC (rev 7914) @@ -60,9 +60,6 @@ private static fedname = "benchmark"; - // NanoSparqlServer (http) port. - private static nssPort = ConfigMath.add(8090,2); - // write replication pipeline port (listener). private static haPort = ConfigMath.add(9090,2); @@ -275,20 +272,3 @@ }, bigdata.kb); } - -/* - * NanoSparqlServer configuration. - */ -com.bigdata.rdf.sail.webapp.NanoSparqlServer { - - namespace = bigdata.namespace; - - create = true; - - queryThreadPoolSize = 16; - - describeEachNamedGraph = true; - - port = bigdata.nssPort; - -} Modified: branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal.java =================================================================== --- branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal.java 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal.java 2014-03-05 13:47:48 UTC (rev 7914) @@ -93,7 +93,6 @@ import com.bigdata.journal.ITx; import com.bigdata.journal.Journal; import com.bigdata.journal.jini.ha.HAJournalServer.HAQuorumService; -import com.bigdata.journal.jini.ha.HAJournalServer.NSSConfigurationOptions; import com.bigdata.journal.jini.ha.HAJournalServer.RunStateEnum; import com.bigdata.quorum.Quorum; import com.bigdata.resources.StoreManager.IStoreManagerCounters; @@ -2193,26 +2192,43 @@ * Misc. */ + /** + * {@inheritDoc} + * <p> + * Note: The actual port depends on how jetty was configured in + * <code>jetty.xml</code>. This returns the port associated with the + * first jetty connection. + * + * @see <a + * href="http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty"> + * Embedding Jetty </a> + */ @Override public int getNSSPort() { - final String COMPONENT = NSSConfigurationOptions.COMPONENT; + return server.getNSSPort(); - try { - - final Integer port = (Integer) server.config.getEntry( - COMPONENT, NSSConfigurationOptions.PORT, Integer.TYPE, - NSSConfigurationOptions.DEFAULT_PORT); - - return port; - - } catch (ConfigurationException e) { - - throw new RuntimeException(e); - - } - } +// @Override +// public int getNSSPort() { +// +// final String COMPONENT = NSSConfigurationOptions.COMPONENT; +// +// try { +// +// final Integer port = (Integer) server.config.getEntry( +// COMPONENT, NSSConfigurationOptions.PORT, Integer.TYPE, +// NSSConfigurationOptions.DEFAULT_PORT); +// +// return port; +// +// } catch (ConfigurationException e) { +// +// throw new RuntimeException(e); +// +// } +// +// } @Override public RunState getRunState() { Modified: branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java =================================================================== --- branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java 2014-03-05 13:47:48 UTC (rev 7914) @@ -33,9 +33,7 @@ import java.nio.ByteBuffer; import java.nio.channels.ClosedByInterruptException; import java.rmi.Remote; -import java.util.LinkedHashMap; import java.util.List; -import java.util.Map; import java.util.UUID; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; @@ -59,6 +57,7 @@ import org.apache.zookeeper.ZooKeeper; import org.apache.zookeeper.data.ACL; import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.webapp.WebAppContext; import com.bigdata.concurrent.FutureTaskMon; import com.bigdata.ha.HAGlue; @@ -440,28 +439,60 @@ */ boolean DEFAULT_ONLINE_DISASTER_RECOVERY = false; - } - - /** - * Configuration options for the {@link NanoSparqlServer}. - */ - public interface NSSConfigurationOptions extends ConfigParams { - - String COMPONENT = NanoSparqlServer.class.getName(); - /** - * The port at which the embedded {@link NanoSparqlServer} will respond - * to HTTP requests (default {@value #DEFAULT_PORT}). This MAY be ZERO - * (0) to use a random open port. + * The location of the <code>jetty.xml</code> file that will be used to + * configure jetty (default {@value #DEFAULT_JETTY_XML}). * - * TODO We should be able to specify the interface, not just the port. Is - * there any way to do that with jetty? + * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/730" > + * Allow configuration of embedded NSS jetty server using + * jetty-web.xml </a> + * + * @see #DEFAULT_JETTY_XML */ - String PORT = "port"; + String JETTY_XML = "jettyXml"; - int DEFAULT_PORT = 8080; - + /** + * The default value works when deployed under the IDE with the + * <code>bigdata-war/src</code> directory on the classpath. When + * deploying outside of that context, the value needs to be set + * explicitly. + */ + String DEFAULT_JETTY_XML = "WEB-INF/jetty.xml"; + } + +// /** +// * Configuration options for the {@link NanoSparqlServer}. +// * +// * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/730" > +// * Allow configuration of embedded NSS jetty server using jetty-web.xml +// * </a> +// */ +// @Deprecated +// public interface NSSConfigurationOptions extends ConfigParams { +// +// @Deprecated +// String COMPONENT = NanoSparqlServer.class.getName(); +// +// /** +// * The port at which the embedded {@link NanoSparqlServer} will respond +// * to HTTP requests (default {@value #DEFAULT_PORT}). This MAY be ZERO +// * (0) to use a random open port. +// * +// * @deprecated This has been replaced by the use of <code>web.xml</code> +// * and <code>jetty.xml</code>. +// * +// * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/730" > +// * Allow configuration of embedded NSS jetty server using +// * jetty-web.xml </a> +// */ +// @Deprecated +// String PORT = "port"; +// +// @Deprecated +// int DEFAULT_PORT = 8080; +// +// } /** * The journal. @@ -4466,65 +4497,85 @@ * Note: We need to wait for a quorum meet since this will create the KB * instance if it does not exist and we can not write on the * {@link HAJournal} until we have a quorum meet. + * + * @see <a href="http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty"> + * Embedding Jetty </a> + * @see <a href="http://trac.bigdata.com/ticket/730" > Allow configuration + * of embedded NSS jetty server using jetty-web.xml </a> */ private void startNSS() { try { - final String COMPONENT = NSSConfigurationOptions.COMPONENT; + if (jettyServer != null && jettyServer.isRunning()) { - final String namespace = (String) config.getEntry(COMPONENT, - NSSConfigurationOptions.NAMESPACE, String.class, - NSSConfigurationOptions.DEFAULT_NAMESPACE); + throw new RuntimeException("Already running"); - final Integer queryPoolThreadSize = (Integer) config.getEntry( - COMPONENT, NSSConfigurationOptions.QUERY_THREAD_POOL_SIZE, - Integer.TYPE, - NSSConfigurationOptions.DEFAULT_QUERY_THREAD_POOL_SIZE); - - final boolean create = (Boolean) config.getEntry(COMPONENT, - NSSConfigurationOptions.CREATE, Boolean.TYPE, - NSSConfigurationOptions.DEFAULT_CREATE); - - final Integer port = (Integer) config.getEntry(COMPONENT, - NSSConfigurationOptions.PORT, Integer.TYPE, - NSSConfigurationOptions.DEFAULT_PORT); - - final String servletContextListenerClass = (String) config - .getEntry( - COMPONENT, - NSSConfigurationOptions.SERVLET_CONTEXT_LISTENER_CLASS, - String.class, - NSSConfigurationOptions.DEFAULT_SERVLET_CONTEXT_LISTENER_CLASS); - - log.warn("Starting NSS: port=" + port); - - final Map<String, String> initParams = new LinkedHashMap<String, String>(); - { - - initParams.put(ConfigParams.NAMESPACE, namespace); - - initParams.put(ConfigParams.QUERY_THREAD_POOL_SIZE, - queryPoolThreadSize.toString()); - - // Note: Create will be handled by the QuorumListener (above). - initParams.put(ConfigParams.CREATE, Boolean.toString(create)); - - initParams.put(ConfigParams.SERVLET_CONTEXT_LISTENER_CLASS, - servletContextListenerClass); - } - if (jettyServer != null && jettyServer.isRunning()) { +// if(!USE_WEB_XML) { +// +// final String COMPONENT = NSSConfigurationOptions.COMPONENT; +// +// final String namespace = (String) config.getEntry(COMPONENT, +// NSSConfigurationOptions.NAMESPACE, String.class, +// NSSConfigurationOptions.DEFAULT_NAMESPACE); +// +// final Integer queryPoolThreadSize = (Integer) config.getEntry( +// COMPONENT, NSSConfigurationOptions.QUERY_THREAD_POOL_SIZE, +// Integer.TYPE, +// NSSConfigurationOptions.DEFAULT_QUERY_THREAD_POOL_SIZE); +// +// final boolean create = (Boolean) config.getEntry(COMPONENT, +// NSSConfigurationOptions.CREATE, Boolean.TYPE, +// NSSConfigurationOptions.DEFAULT_CREATE); +// +// final Integer port = (Integer) config.getEntry(COMPONENT, +// NSSConfigurationOptions.PORT, Integer.TYPE, +// NSSConfigurationOptions.DEFAULT_PORT); +// +// final String servletContextListenerClass = (String) config +// .getEntry( +// COMPONENT, +// NSSConfigurationOptions.SERVLET_CONTEXT_LISTENER_CLASS, +// String.class, +// NSSConfigurationOptions.DEFAULT_SERVLET_CONTEXT_LISTENER_CLASS); +// +// final Map<String, String> initParams = new LinkedHashMap<String, String>(); +// { +// +// initParams.put(ConfigParams.NAMESPACE, namespace); +// +// initParams.put(ConfigParams.QUERY_THREAD_POOL_SIZE, +// queryPoolThreadSize.toString()); +// +// // Note: Create will be handled by the QuorumListener (above). +// initParams.put(ConfigParams.CREATE, Boolean.toString(create)); +// +// initParams.put(ConfigParams.SERVLET_CONTEXT_LISTENER_CLASS, +// servletContextListenerClass); +// +// } +// +// // Setup the embedded jetty server for NSS webapp. +// jettyServer = NanoSparqlServer.newInstance(port, journal, +// initParams); +// +// } else { - throw new RuntimeException("Already running"); + // The location of the jetty.xml file. + final String jettyXml = (String) config.getEntry( + ConfigurationOptions.COMPONENT, + ConfigurationOptions.JETTY_XML, String.class, + ConfigurationOptions.DEFAULT_JETTY_XML); - } + // Setup the embedded jetty server for NSS webapp. + jettyServer = NanoSparqlServer.newInstance(jettyXml, journal); - // Setup the embedded jetty server for NSS webapp. - jettyServer = NanoSparqlServer.newInstance(port, journal, - initParams); +// } + log.warn("Starting NSS"); + // Start the server. jettyServer.start(); @@ -4539,8 +4590,9 @@ final String serviceURL; { - final int actualPort = jettyServer.getConnectors()[0] - .getLocalPort(); + final int actualPort = getNSSPort(); +// final int actualPort = jettyServer.getConnectors()[0] +// .getLocalPort(); String hostAddr = NicUtil.getIpAddress("default.nic", "default", true/* loopbackOk */); @@ -4560,7 +4612,7 @@ System.out.println(msg); if (log.isInfoEnabled()) - log.info(msg); + log.warn(msg); } @@ -4573,10 +4625,49 @@ } +// /** +// * When <code>true</code>, the {@link HAJournalServer} will use +// * <code>jetty.xml</code> and <code>web.xml</code> to configure the +// * {@link NanoSparqlServer}. +// * +// * @see <a href="http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty"> +// * Embedding Jetty </a> +// * @see <a href="http://trac.bigdata.com/ticket/730" > Allow configuration +// * of embedded NSS jetty server using jetty-web.xml </a> +// * +// * @deprecated Once #730 is closed, get rid of this and the old code paths +// * in the method above and in the {@link NanoSparqlServer}. +// */ +// private final boolean USE_WEB_XML = true; + /** - * Conditionally create the default KB instance as identified by the - * {@link NSSConfigurationOptions}. + * The actual port depends on how jetty was configured in + * <code>jetty.xml</code>. This returns the port associated with the first + * connection for the jetty {@link Server}. * + * @return The port associated with the first connection for the jetty + * {@link Server}. + * + * @throws IllegalArgumentException + * if the jetty {@link Server} is not running. + */ + int getNSSPort() { + + final Server tmp = jettyServer; + + if (tmp == null) + throw new IllegalStateException("Server is not running"); + + return tmp.getConnectors()[0].getLocalPort(); + + } + + /** + * Conditionally create the default KB instance as identified in + * <code>web.xml</code>. + * + * @see ConfigParams + * * @throws ConfigurationException * @throws ExecutionException * @throws InterruptedException @@ -4584,16 +4675,60 @@ private void conditionalCreateDefaultKB() throws ConfigurationException, InterruptedException, ExecutionException { - final String COMPONENT = NSSConfigurationOptions.COMPONENT; + final Server server = this.jettyServer; - final String namespace = (String) config.getEntry(COMPONENT, - NSSConfigurationOptions.NAMESPACE, String.class, - NSSConfigurationOptions.DEFAULT_NAMESPACE); + if (server == null) + throw new IllegalStateException(); - final boolean create = (Boolean) config.getEntry(COMPONENT, - NSSConfigurationOptions.CREATE, Boolean.TYPE, - NSSConfigurationOptions.DEFAULT_CREATE); + /* + * TODO This currently relies on the WebAppContext's initParams. This is + * somewhat fragile, but that is where this information is declared. + */ + final WebAppContext wac = NanoSparqlServer.getWebApp(server); + if (wac == null) + throw new RuntimeException("Could not locate webapp."); + + final String namespace; + { + + String s = wac.getInitParameter(ConfigParams.NAMESPACE); + + if (s == null) + s = ConfigParams.DEFAULT_NAMESPACE; + + namespace = s; + + if (log.isInfoEnabled()) + log.info(ConfigParams.NAMESPACE + "=" + namespace); + + } + + final boolean create; + { + + final String s = wac.getInitParameter(ConfigParams.CREATE); + + if (s != null) + create = Boolean.valueOf(s); + else + create = ConfigParams.DEFAULT_CREATE; + + if (log.isInfoEnabled()) + log.info(ConfigParams.CREATE + "=" + create); + + } + +// final String COMPONENT = NSSConfigurationOptions.COMPONENT; +// +// final String namespace = (String) config.getEntry(COMPONENT, +// NSSConfigurationOptions.NAMESPACE, String.class, +// NSSConfigurationOptions.DEFAULT_NAMESPACE); +// +// final boolean create = (Boolean) config.getEntry(COMPONENT, +// NSSConfigurationOptions.CREATE, Boolean.TYPE, +// NSSConfigurationOptions.DEFAULT_CREATE); + if (create) { final Future<Void> ft = journal.getExecutorService().submit( Modified: branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HARestore.java =================================================================== --- branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HARestore.java 2014-03-05 12:58:16 UTC (rev 7913) +++ branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HARestore.java 2014-03-05 13:47:48 UTC (rev 7914) @@ -40,6 +40,7 @@ import com.bigdata.io.DirectBufferPool; import com.bigdata.io.IBufferAccess; import com.bigdata.io.writecache.WriteCache; +import com.bigdata.journal.CommitCounterUtility; import com.bigdata.journal.IHABufferStrategy; import com.bigdata.journal.IRootBlockView; import com.bigdata.journal.Journal; @@ -58,9 +59,21 @@ */ private static final Logger haLog = Logger.getLogger("com.bigdata.haLog"); + /** The journal to be rolled forward. */ private final Journal journal; + /** + * The directory containing the HALog files to be applied to that journal. + */ private final File haLogDir; + /** + * + * @param journal + * The journal to be rolled forward. + * @param haLogDir + * The directory containing the HALog files to be applied to that + * journal. + */ public HARestore(final Journal journal, final File haLogDir) { if (journal == null) @@ -349,43 +362,54 @@ } /*... [truncated message content] |