This list is closed, nobody may subscribe to it.
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(139) |
Aug
(94) |
Sep
(232) |
Oct
(143) |
Nov
(138) |
Dec
(55) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(127) |
Feb
(90) |
Mar
(101) |
Apr
(74) |
May
(148) |
Jun
(241) |
Jul
(169) |
Aug
(121) |
Sep
(157) |
Oct
(199) |
Nov
(281) |
Dec
(75) |
2012 |
Jan
(107) |
Feb
(122) |
Mar
(184) |
Apr
(73) |
May
(14) |
Jun
(49) |
Jul
(26) |
Aug
(103) |
Sep
(133) |
Oct
(61) |
Nov
(51) |
Dec
(55) |
2013 |
Jan
(59) |
Feb
(72) |
Mar
(99) |
Apr
(62) |
May
(92) |
Jun
(19) |
Jul
(31) |
Aug
(138) |
Sep
(47) |
Oct
(83) |
Nov
(95) |
Dec
(111) |
2014 |
Jan
(125) |
Feb
(60) |
Mar
(119) |
Apr
(136) |
May
(270) |
Jun
(83) |
Jul
(88) |
Aug
(30) |
Sep
(47) |
Oct
(27) |
Nov
(23) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <tob...@us...> - 2014-03-11 20:53:24
|
Revision: 7932 http://sourceforge.net/p/bigdata/code/7932 Author: tobycraig Date: 2014-03-11 20:53:18 +0000 (Tue, 11 Mar 2014) Log Message: ----------- #844 - Use new URL for retrieving default namespace Modified Paths: -------------- branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-11 20:42:49 UTC (rev 7931) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-11 20:53:18 UTC (rev 7932) @@ -114,7 +114,7 @@ $('#namespace-create').submit(createNamespace); function getDefaultNamespace() { - $.get('/bigdata/sparql', function(data) { + $.get('/bigdata/namespace?describe-each-named-graph=false&describe-default-namespace=true', function(data) { // Chrome does not work with rdf\:Description, so look for Description too var defaultDataset = $(data).find('rdf\\:Description[rdf\\:nodeID=defaultDataset], Description[rdf\\:nodeID=defaultDataset]'); DEFAULT_NAMESPACE = defaultDataset.find('title')[0].textContent; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-03-11 20:42:52
|
Revision: 7931 http://sourceforge.net/p/bigdata/code/7931 Author: tobycraig Date: 2014-03-11 20:42:49 +0000 (Tue, 11 Mar 2014) Log Message: ----------- #843 - Initial implementation of Status and Performance tabs. Needs work to prevent user being taken away from workbench. Modified Paths: -------------- branches/RDR/bigdata-war/src/html/js/workbench.js branches/RDR/bigdata-war/src/html/new.html Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-11 20:16:38 UTC (rev 7930) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-11 20:42:49 UTC (rev 7931) @@ -691,4 +691,20 @@ $('#explore-results').html('Error! ' + textStatus + ' ' + errorThrown); } +/* Status */ + +$('#tab-selector a[data-target=status]').click(function(e) { + $.get('/bigdata/status', function(data) { + $('#status-tab .box').html(data); + }); }); + +/* Performance */ + +$('#tab-selector a[data-target=performance]').click(function(e) { + $.get('/bigdata/counters', function(data) { + $('#performance-tab .box').html(data); + }); +}); + +}); Modified: branches/RDR/bigdata-war/src/html/new.html =================================================================== --- branches/RDR/bigdata-war/src/html/new.html 2014-03-11 20:16:38 UTC (rev 7930) +++ branches/RDR/bigdata-war/src/html/new.html 2014-03-11 20:42:49 UTC (rev 7931) @@ -24,6 +24,7 @@ <a data-target="query">Query</a> <a data-target="explore">Explore</a> <a data-target="status">Status</a> + <a data-target="performance">Performance</a> <a data-target="namespaces">Namespaces</a> </div> @@ -146,9 +147,18 @@ </div> </div> - <div class="tab" id="status-tab">status + <div class="tab" id="status-tab"> + + <div class="box"></div> + </div> + <div class="tab" id="performance-tab"> + + <div class="box"></div> + + </div> + <div class="tab" id="namespaces-tab"> <div class="box"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-03-11 20:16:43
|
Revision: 7930 http://sourceforge.net/p/bigdata/code/7930 Author: thompsonbry Date: 2014-03-11 20:16:38 +0000 (Tue, 11 Mar 2014) Log Message: ----------- Probably fix for the HA CI builds in the RDR branch. There were two problems. 1. paths to files inside of the serviceDir need to be different in the parent context and the child context. Here I punted and just copied the webapp to the serviceDir. This gives the right behavior by default. 2. The NanoSparqlServer was using file://jetty.xml but should have been using file:jetty.xml for a relative URL to a file in the local file system. See #730 (jetty configuration). Modified Paths: -------------- branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java 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-11 20:10:35 UTC (rev 7929) +++ branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java 2014-03-11 20:16:38 UTC (rev 7930) @@ -4569,6 +4569,12 @@ ConfigurationOptions.JETTY_XML, String.class, ConfigurationOptions.DEFAULT_JETTY_XML); + // Note: if we do this, push the serviceDir down into newInstance(). +// if (!jettyXml.startsWith("/")) { +// // Assume that the path is relative to the serviceDir. +// jettyXml = getServiceDir() + File.separator + jettyXml; +// } + // Setup the embedded jetty server for NSS webapp. jettyServer = NanoSparqlServer.newInstance(jettyXml, journal); Modified: branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java =================================================================== --- branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java 2014-03-11 20:10:35 UTC (rev 7929) +++ branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java 2014-03-11 20:16:38 UTC (rev 7930) @@ -1768,16 +1768,20 @@ * well. This is a bit brute force, but maybe it is more useful for * that. * - * TODO This might break in CI if the bigdata-war directory is not - * staged to the testing area. + * TODO The webapp is being deployed to the serviceDir in order + * to avoid complexities with the parent and child process paths + * to the serviceDir and the webappDir. */ - final File webAppDir = new File(serviceDir, "bigdata-war/src"); - if (!webAppDir.exists() && !webAppDir.mkdirs()) { - throw new IOException("Could not create directory: " - + webAppDir); + { + final File webAppDir = serviceDir; + // webAppDir = new File(serviceDir, "bigdata-war/src"); + if (!webAppDir.exists() && !webAppDir.mkdirs()) { + throw new IOException("Could not create directory: " + + webAppDir); + } + copyFiles(new File("bigdata-war/src"), webAppDir); } - copyFiles(new File("bigdata-war/src"), webAppDir); - + // log4j configuration. copyFile(new File( "bigdata/src/resources/logging/log4j-dev.properties"), @@ -1810,8 +1814,14 @@ // Add override for the serviceDir. final String[] overrides = ConfigMath.concat( - new String[] { - "bigdata.serviceDir=new java.io.File(\"" + serviceDir + "\")", + new String[] { // + // The service directory. + "bigdata.serviceDir=new java.io.File(\"" + serviceDir + "\")", +// // Where to find jetty.xml +// HAJournalServer.ConfigurationOptions.COMPONENT + "." +// + HAJournalServer.ConfigurationOptions.JETTY_XML +// + "=\"bigdata-war/src/jetty.xml\"", +// + "=\"" + serviceDir + "/bigdata-war/src/jetty.xml\"", }, testOverrides); Modified: branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java =================================================================== --- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java 2014-03-11 20:10:35 UTC (rev 7929) +++ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java 2014-03-11 20:16:38 UTC (rev 7930) @@ -484,7 +484,8 @@ if (new File(jettyXml).exists()) { // Check the file system. - jettyXmlUrl = new URL("file://" + jettyXml); +// jettyXmlUrl = new File(jettyXml).toURI(); + jettyXmlUrl = new URL("file:" + jettyXml); } else { @@ -552,6 +553,13 @@ // Set the IIndexManager attribute on the WebAppContext. wac.setAttribute(IIndexManager.class.getName(), indexManager); + /* + * FIXME We could use setInitParameter() here to override the init + * parameters in web.xml based on those given on the command line to + * main(). If we do this, we should be able to get rid of the + * non-web.xml based versions of newInstance(). + */ + } return server; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2014-03-11 20:10:40
|
Revision: 7929 http://sourceforge.net/p/bigdata/code/7929 Author: mrpersonick Date: 2014-03-11 20:10:35 +0000 (Tue, 11 Mar 2014) Log Message: ----------- Added two new request parameters - one to override the describe each named graph init param and one to only describe the default namespace. See ticket 819. Modified Paths: -------------- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/MultiTenancyServlet.java Modified: branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/MultiTenancyServlet.java =================================================================== --- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/MultiTenancyServlet.java 2014-03-11 19:00:37 UTC (rev 7928) +++ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/MultiTenancyServlet.java 2014-03-11 20:10:35 UTC (rev 7929) @@ -75,6 +75,18 @@ static private final transient Logger log = Logger.getLogger(MultiTenancyServlet.class); /** + * URL query parameter used to override the servlet init parameter + * {@link ConfigParams#DESCRIBE_EACH_NAMED_GRAPH}. + */ + protected static final String DESCRIBE_EACH_NAMED_GRAPH = "describe-each-named-graph"; + + /** + * URL query parameter used to specify that only the default namespace + * should be described. + */ + protected static final String DESCRIBE_DEFAULT_NAMESPACE = "describe-default-namespace"; + + /** * Delegate for the sparql end point expressed by * <code>.../namespace/NAMESPACE/sparql</code>. */ @@ -498,52 +510,93 @@ } - /* - * The set of registered namespaces for KBs. - */ - final List<String> namespaces = getBigdataRDFContext() - .getNamespaces(timestamp); - + final boolean describeEachNamedGraph; + { + final String s = req.getParameter(DESCRIBE_EACH_NAMED_GRAPH); + + describeEachNamedGraph = s != null ? + Boolean.valueOf(s) : + getBigdataRDFContext().getConfig().describeEachNamedGraph; + } + + final boolean describeDefaultNamespace; + { + final String s = req.getParameter(DESCRIBE_DEFAULT_NAMESPACE); + + describeDefaultNamespace = s != null ? + Boolean.valueOf(s) : + false; + } + final Graph g = new GraphImpl(); - for(String namespace : namespaces) { - - // Get a view onto that KB instance for that timestamp. - final AbstractTripleStore tripleStore = getBigdataRDFContext() - .getTripleStore(namespace, timestamp); + if (describeDefaultNamespace) { + + final String namespace = getBigdataRDFContext().getConfig().namespace; + + describeNamespace(req, g, namespace, describeEachNamedGraph, timestamp); + + } else { + + /* + * The set of registered namespaces for KBs. + */ + final List<String> namespaces = getBigdataRDFContext() + .getNamespaces(timestamp); - if (tripleStore == null) { + for(String namespace : namespaces) { - /* - * There is no such triple/quad store instance (could be a - * concurrent delete of the namespace). - */ - - continue; - + describeNamespace(req, g, namespace, describeEachNamedGraph, timestamp); + } - final BNode aDataSet = g.getValueFactory().createBNode(); - + } + + sendGraph(req, resp, g); + + } + + /** + * Describe a namespace into the supplied Graph object. + */ + private void describeNamespace(final HttpServletRequest req, + final Graph g, final String namespace, + final boolean describeEachNamedGraph, final long timestamp) + throws IOException { + + // Get a view onto that KB instance for that timestamp. + final AbstractTripleStore tripleStore = getBigdataRDFContext() + .getTripleStore(namespace, timestamp); + + if (tripleStore == null) { + /* - * Figure out the service end point. - * - * Note: This is just the requestURL as reported. This makes is - * possible to support virtual hosting and similar http proxy - * patterns since the SPARQL end point is just the URL at which the - * service is responding. + * There is no such triple/quad store instance (could be a + * concurrent delete of the namespace). */ - final String serviceURI = req.getRequestURL().toString(); - final VoID v = new VoID(g, tripleStore, serviceURI, aDataSet); - - v.describeDataSet(false/* describeStatistics */, - getBigdataRDFContext().getConfig().describeEachNamedGraph); - + return; + } - sendGraph(req, resp, g); + final BNode aDataSet = g.getValueFactory().createBNode(); + /* + * Figure out the service end point. + * + * Note: This is just the requestURL as reported. This makes is + * possible to support virtual hosting and similar http proxy + * patterns since the SPARQL end point is just the URL at which the + * service is responding. + */ + final String serviceURI = req.getRequestURL().toString(); + + final VoID v = new VoID(g, tripleStore, serviceURI, aDataSet); + + v.describeDataSet(false/* describeStatistics */, +// getBigdataRDFContext().getConfig().describeEachNamedGraph); + describeEachNamedGraph); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-03-11 19:00:42
|
Revision: 7928 http://sourceforge.net/p/bigdata/code/7928 Author: thompsonbry Date: 2014-03-11 19:00:37 +0000 (Tue, 11 Mar 2014) Log Message: ----------- Bug fix to the GASService when multiple in vertices were specified. It was initializing the new frontier in a loop, but the frontier was being reset before each value was inserted.... Modified Paths: -------------- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java 2014-03-11 18:57:20 UTC (rev 7927) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java 2014-03-11 19:00:37 UTC (rev 7928) @@ -748,22 +748,27 @@ if (initialFrontier != null) { + /* + * FIXME Why can't we pass in the Value (with a defined IV) + * and not the IV? This should work. Passing in the IV is + * against the grain of the API and the generalized + * abstraction as Values. Of course, having the IV is + * necessary since this is an internal, high performance, + * and close to the indices operation. + */ + final IV[] tmp = new IV[initialFrontier.length]; + // Setup the initial frontier. + int i = 0; for (Value startingVertex : initialFrontier) { - /* - * FIXME Why can't we pass in the Value (with a defined - * IV) and not the IV? This should work. Passing in the - * IV is against the grain of the API and the - * generalized abstraction as Values. Of course, having - * the IV is necessary since this is an internal, high - * performance, and close to the indices operation. - */ - gasState.setFrontier(gasContext, - ((BigdataValue) startingVertex).getIV()); + tmp[i++] = ((BigdataValue) startingVertex).getIV(); } + // set the frontier. + gasState.setFrontier(gasContext, tmp); + } // Run the analytic. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-03-11 18:57:23
|
Revision: 7927 http://sourceforge.net/p/bigdata/code/7927 Author: tobycraig Date: 2014-03-11 18:57:20 +0000 (Tue, 11 Mar 2014) Log Message: ----------- #842 - Prevent user from deleting default namespace Modified Paths: -------------- branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-11 15:53:10 UTC (rev 7926) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-11 18:57:20 UTC (rev 7927) @@ -73,8 +73,13 @@ } function deleteNamespace(namespace) { + // prevent default namespace from being deleted + if(namespace == DEFAULT_NAMESPACE) { + alert('You may not delete the default namespace.'); + return; + } + if(confirm('Are you sure you want to delete the namespace ' + namespace + '?')) { - // FIXME: should we check if the default namespace is the one being deleted? if(namespace == NAMESPACE) { // FIXME: what is the desired behaviour when deleting the current namespace? } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-03-11 15:53:14
|
Revision: 7926 http://sourceforge.net/p/bigdata/code/7926 Author: thompsonbry Date: 2014-03-11 15:53:10 +0000 (Tue, 11 Mar 2014) Log Message: ----------- Modified an SSSP test to verify that the code respect the link type constraint (there is a link that will be visited if the link type constraint is not respected). Modified Paths: -------------- branches/RDR/bigdata-gas/src/test/com/bigdata/rdf/graph/data/smallWeightedGraph.ttl branches/RDR/bigdata-rdf/src/test/com/bigdata/rdf/graph/impl/bd/TestSSSP.java Modified: branches/RDR/bigdata-gas/src/test/com/bigdata/rdf/graph/data/smallWeightedGraph.ttl =================================================================== --- branches/RDR/bigdata-gas/src/test/com/bigdata/rdf/graph/data/smallWeightedGraph.ttl 2014-03-11 13:25:05 UTC (rev 7925) +++ branches/RDR/bigdata-gas/src/test/com/bigdata/rdf/graph/data/smallWeightedGraph.ttl 2014-03-11 15:53:10 UTC (rev 7926) @@ -8,6 +8,23 @@ bd:1 foaf:knows bd:2 . <<bd:1 foaf:knows bd:2 >> bd:weight "100"^^xsd:int . +# Note: This uses a different link type. if the link type constraint is +# not respected, then the hops and weighted distance between (1) and +# (5) will be wrong (the hops will become 1 instead of 2, the weighted +# distance will be 100-23=77 less than expected.) + bd:1 foaf:knows2 bd:5 . +<<bd:1 foaf:knows2 bd:5 >> bd:weight "13"^^xsd:int . + +# This vertex property should be ignored by traversal if the test sets up +# a constraint that only "links" are visited by the GAS traversal. + bd:1 rdf:label "blue" . + +# Note: This uses a different link attribute type for the weight. if the +# link attribute type is used and not restricted to bd:weight2, then this +# link will be "visible" and the weighted distance between (1) and (2) will +# change. +#<<bd:1 foaf:knows bd:2 >> bd:weight2 "7"^^xsd:int . + bd:1 foaf:knows bd:3 . <<bd:1 foaf:knows bd:3 >> bd:weight "100"^^xsd:int . Modified: branches/RDR/bigdata-rdf/src/test/com/bigdata/rdf/graph/impl/bd/TestSSSP.java =================================================================== --- branches/RDR/bigdata-rdf/src/test/com/bigdata/rdf/graph/impl/bd/TestSSSP.java 2014-03-11 13:25:05 UTC (rev 7925) +++ branches/RDR/bigdata-rdf/src/test/com/bigdata/rdf/graph/impl/bd/TestSSSP.java 2014-03-11 15:53:10 UTC (rev 7926) @@ -117,6 +117,7 @@ // Converge. gasContext.call(); + // check #of hops. assertEquals(0, gasState.getState(p.getV1()).dist()); assertEquals(1, gasState.getState(p.getV2()).dist()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-03-11 13:25:08
|
Revision: 7925 http://sourceforge.net/p/bigdata/code/7925 Author: thompsonbry Date: 2014-03-11 13:25:05 +0000 (Tue, 11 Mar 2014) Log Message: ----------- Fix for RDR CI branch. The CI junit tests were failing to locate index.html. This commit fixes that issue in local CI runs. However, there are still some unresolved issues with where to place the contents of bigdata-war/src, as discussed below. For the moment, I have taken the coward's way out and simply modified CI to look in dist/bigdata/var/jetty. This leaves open an ambiguity since the files are also in the JAR and it is unclear whether we can actually run the NSS using the JAR (and outside of the IDE) because the files are currently in the classes/bigdata-war/src directory of the JAR rather than at classes/. This probably means that they can not be discovered. The problem with putting them in the right location is that it makes it difficult to override those files (class path ordering problems could cause a different version of jetty.xml to be silently used). {{{ - There is still an issue with the location to which we deploy the WAR resources. The JAR had classes/bigdata-war/src/... in recent commits of the RDR branch. This was causing "ant test" to fail since the WAR resources were not being located. That can be fixed either by copying those files to the correct location in the classes directory (per below) or by adding the dist/bigdata/var/jetty path to the classpath for CI. <!-- Copy WAR resources for the embedded NanoSparqlServer. --> <!-- TODO: This could cause problem since the files exist in --> <!-- both the JAR and the staged artifact (bigdata/var/jetty). --> <fileset dir="${bigdata.dir}/bigdata-war/src"> <include name="**"/> </fileset> See also this line in the "run-junit" target, which has very much the same effect (CI works). <!--pathelement location="${dist.var.jetty}" --> This raises a question (again) about how we are to configure jetty. It also raises the question of whether we can ALWAYS rely on jetty.xml and web.xml to start the NSS, either using a version on the classpath or a version identified by the JETTY_XXX environment variables. This would be quite nice since it would let us simplify the NanoSparqlServer newInstance() code base significantly. One approach is to change the WAR. Rather than having the JAR's classes embedded into it, the WAR could just have those files that are in bigdata-war and the bigdata.jar could deployed into the WEB-INF/classes/lib directory. This could be done when we stage the WAR. }}} See #730 (embedded jetty configuration). Modified Paths: -------------- branches/RDR/build.xml Modified: branches/RDR/build.xml =================================================================== --- branches/RDR/build.xml 2014-03-11 06:59:48 UTC (rev 7924) +++ branches/RDR/build.xml 2014-03-11 13:25:05 UTC (rev 7925) @@ -277,7 +277,16 @@ <fileset dir="${bigdata.dir}/bigdata-sails/src/resources/sesame-server"> <include name="META-INF/**" /> </fileset> - <!-- Copy WAR resources for the embedded NanoSparqlServer --> + <!-- Copy WAR resources for the embedded NanoSparqlServer. --> + <!-- TODO: This could cause problem since the files exist in --> + <!-- both the JAR and the staged artifact (bigdata/var/jetty). --> + <!-- This makes it difficult to override the ones in the JAR. --> + <!-- See also "run-junit" for an alterative to getting CI to run. --> + <!-- newer approach. --> + <!--fileset dir="${bigdata.dir}/bigdata-war/src"> + <include name="**"/> + </fileset--> + <!-- older approach. --> <fileset dir="." includes="bigdata-war/src/**"/> </copy> </target> @@ -2074,6 +2083,7 @@ <pathelement location="${sesame-sparql-test.jar}" /> <pathelement location="${sesame-store-test.jar}" /> <pathelement location="${sesame-rio-test.jar}" /> + <pathelement location="${dist.var.jetty}"/> <pathelement location="${dist.lib}/bigdata.jar" /> <pathelement location="${dist.lib}/colt.jar" /> <pathelement location="${dist.lib}/highscalelib.jar" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-03-11 06:59:51
|
Revision: 7924 http://sourceforge.net/p/bigdata/code/7924 Author: tobycraig Date: 2014-03-11 06:59:48 +0000 (Tue, 11 Mar 2014) Log Message: ----------- #827 - Query results are now linked to the Explore pane. Currently only working for vertices. Modified Paths: -------------- branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-11 05:23:16 UTC (rev 7923) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-11 06:59:48 UTC (rev 7924) @@ -78,7 +78,7 @@ if(namespace == NAMESPACE) { // FIXME: what is the desired behaviour when deleting the current namespace? } - var url = '/namespace/' + namespace; + var url = '/bigdata/namespace/' + namespace; var settings = { type: 'DELETE', success: getNamespaces, @@ -104,7 +104,7 @@ success: getNamespaces, error: function(jqXHR, textStatus, errorThrown) { alert(errorThrown); } }; - $.ajax('/namespace', settings); + $.ajax('/bigdata/namespace', settings); } $('#namespace-create').submit(createNamespace); @@ -538,15 +538,19 @@ for(var j=0; j<vars.length; j++) { if(vars[j] in data.results.bindings[i]) { var binding = data.results.bindings[i][vars[j]]; + var text = binding.value; if(binding.type == 'typed-literal') { var tdData = ' class="literal" data-datatype="' + binding.datatype + '"'; } else { + if(binding.type == 'uri') { + text = '<a href="#">' + text + '</a>'; + } var tdData = ' class="' + binding.type + '"'; if(binding['xml:lang']) { tdData += ' data-lang="' + binding['xml:lang'] + '"'; } } - tr.append('<td' + tdData + '>' + binding.value + '</td>'); + tr.append('<td' + tdData + '>' + text + '</td>'); } else { // no binding tr.append('<td class="unbound">'); @@ -554,6 +558,13 @@ } table.append(tr); } + + $('#query-response a').click(function(e) { + e.preventDefault(); + var uri = $(this).text(); + loadURI(uri); + showTab('explore'); + }); } } @@ -613,7 +624,7 @@ success: updateExploreStart, error: updateExploreError }; - $.ajax('/sparql', settings); + $.ajax(NAMESPACE_URL, settings); } function updateExploreStart(data) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-03-11 05:23:20
|
Revision: 7923 http://sourceforge.net/p/bigdata/code/7923 Author: tobycraig Date: 2014-03-11 05:23:16 +0000 (Tue, 11 Mar 2014) Log Message: ----------- #829 - Added JSON export Modified Paths: -------------- branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-11 05:20:26 UTC (rev 7922) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-11 05:23:16 UTC (rev 7923) @@ -45,7 +45,7 @@ /* Namespaces */ function getNamespaces() { - $.get('/namespace', function(data) { + $.get('/bigdata/namespace', function(data) { $('#namespaces-list').empty(); var rdf = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'; var namespaces = namespaces = data.getElementsByTagNameNS(rdf, 'Description') @@ -109,7 +109,7 @@ $('#namespace-create').submit(createNamespace); function getDefaultNamespace() { - $.get('/sparql', function(data) { + $.get('/bigdata/sparql', function(data) { // Chrome does not work with rdf\:Description, so look for Description too var defaultDataset = $(data).find('rdf\\:Description[rdf\\:nodeID=defaultDataset], Description[rdf\\:nodeID=defaultDataset]'); DEFAULT_NAMESPACE = defaultDataset.find('title')[0].textContent; @@ -393,6 +393,7 @@ }); $('#query-export-csv').click(exportCSV); +$('#query-export-json').click(exportJSON); $('#query-export-xml').click(exportXML); function exportXML() { @@ -430,6 +431,44 @@ downloadFile(xml, 'application/sparql-results+xml', 'export.xml'); } +function exportJSON() { + var json = {} + if($('#query-response table').hasClass('boolean')) { + json.head = {}; + json['boolean'] = $('#query-response td').text(); + } else { + json.head = {vars: []}; + $('#query-response thead tr td').each(function(i, td) { + json.head.vars.push(td.textContent); + }); + json.bindings = []; + $('#query-response tbody tr').each(function(i, tr) { + var binding = {}; + $(tr).find('td').each(function(j, td) { + var bindingFields = {} + var bindingType = td.className; + if(bindingType == 'unbound') { + return; + } + bindingFields.type = bindingType; + var dataType = $(td).data('datatype'); + if(dataType) { + bindingFields.type = dataType; + } + var lang = $(td).data('lang'); + if(lang) { + bindingFields.lang = lang; + } + bindingFields.value = td.textContent; + binding[json.head.vars[j]] = bindingFields; + }); + json.bindings.push(binding); + }); + } + json = JSON.stringify(json); + downloadFile(json, 'application/sparql-results+json', 'export.json'); +} + function exportCSV() { // FIXME: escape commas var csv = ''; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-03-11 05:20:31
|
Revision: 7922 http://sourceforge.net/p/bigdata/code/7922 Author: tobycraig Date: 2014-03-11 05:20:26 +0000 (Tue, 11 Mar 2014) Log Message: ----------- Replaced empty file with actual content Modified Paths: -------------- branches/RDR/bigdata-war/src/html/js/vendor/jquery.min.js Modified: branches/RDR/bigdata-war/src/html/js/vendor/jquery.min.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/vendor/jquery.min.js 2014-03-10 21:15:00 UTC (rev 7921) +++ branches/RDR/bigdata-war/src/html/js/vendor/jquery.min.js 2014-03-11 05:20:26 UTC (rev 7922) @@ -0,0 +1,6 @@ +/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license +//@ sourceMappingURL=jquery.min.map +*/ +(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t +}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone... [truncated message content] |
From: <tho...@us...> - 2014-03-10 21:15:10
|
Revision: 7921 http://sourceforge.net/p/bigdata/code/7921 Author: thompsonbry Date: 2014-03-10 21:15:00 +0000 (Mon, 10 Mar 2014) Log Message: ----------- - The jetty.xml file has been moved to be outside of the WEB-INF directory. All static content has been pushed down into an "html/" directory of the webapp. I've added several tests to verify the basic structure of the webapp. - BigdataStatics.getContextPath() consolidates references to the "/bigdata" context path for the web application. It should be possible to override this using an environment variable when deploying the redpoint skin. - RemoteServiceCallImpl now uses a standard policy to follow redirects. Not sure if this is strictly necessary, but you can otherwise have a failure to resolve a URL such as http://localhost:8080/ when you are being redirected to http://localhost:8080/bigdata. - Increased sanity in NanoSparqlServer.java. - Added some unit tests to com.bigdata.rdf.sail.webapp.TestNanoSparqlClient to verify correct resolution of various bits of the web application as deployed under test suite control. - It looks like some environment variables were not being propagated to the ServiceStarter in startHAServices (GROUPS, LOCATORS, ZK_SERVERS). {{{ # Laptop setup. cd /Users/bryan/Documents/workspace/RDR_NEW_SVN #svn update ant clean stage export wd=/Users/bryan/Documents/workspace/RDR_NEW_SVN export FEDNAME=benchmark3 export LOGICAL_SERVICE_ID=HAJournal-1 export FED_DIR=$wd export LOCATORS="jini://localhost" export ZK_SERVERS="localhost:2081" export JETTY_XML=${wd}/dist/bigdata/var/jetty/jetty.xml export JETTY_WEB_XML=${wd}/dist/bigdata/var/jetty/WEB-INF/web.xml export JETTY_PORT=8090 dist/bigdata/bin/startHAServices tail -f HAJournalServer.log | egrep '(ERROR|WARN|FATAL)' }}} See #730 (Jetty.xml configuration) Modified Paths: -------------- branches/RDR/bigdata/src/java/com/bigdata/BigdataStatics.java branches/RDR/bigdata-gom/src/samples/com/bigdata/gom/samples/Example1.java branches/RDR/bigdata-gom/src/samples/com/bigdata/gom/samples/Example2.java branches/RDR/bigdata-gom/src/test/com/bigdata/gom/Example1.java branches/RDR/bigdata-gom/src/test/com/bigdata/gom/LocalGOMTestCase.java branches/RDR/bigdata-gom/src/test/com/bigdata/gom/RemoteGOMTestCase.java branches/RDR/bigdata-gom/src/test/com/bigdata/gom/TestRemoteGOM.java branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHAJournalServerTestCase.java branches/RDR/bigdata-perf/chem2bio2rdf/src/test/com/bigdata/perf/chem2bio2rdf/TestQuery.java branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/RemoteServiceCallImpl.java branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/remote/BigdataSailRemoteRepository.java branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/AbstractNanoSparqlServerTestCase.java branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/AbstractProtocolTest.java branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/AbstractTestNanoSparqlClient.java branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestFederatedQuery.java branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestNanoSparqlClient.java branches/RDR/bigdata-war/src/WEB-INF/web.xml branches/RDR/bigdata-war/src/html/index.html branches/RDR/bigdata-war/src/html/new.html branches/RDR/build.xml branches/RDR/src/resources/bin/startHAServices Added Paths: ----------- branches/RDR/bigdata-war/src/html/favicon.ico Removed Paths: ------------- branches/RDR/bigdata-war/src/html/favicon.ico Modified: branches/RDR/bigdata/src/java/com/bigdata/BigdataStatics.java =================================================================== --- branches/RDR/bigdata/src/java/com/bigdata/BigdataStatics.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata/src/java/com/bigdata/BigdataStatics.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -80,5 +80,19 @@ */ public static final boolean runKnownBadTests = Boolean .getBoolean("com.bigdata.runKnownBadTests"); + + /** + * Return the web application context path for the default deployment of the + * bigdata web application. + * + * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/730" > + * Allow configuration of embedded NSS jetty server using jetty-web.xml + * </a> + */ + public static final String getContextPath() { + + return "/bigdata"; + + } } Modified: branches/RDR/bigdata-gom/src/samples/com/bigdata/gom/samples/Example1.java =================================================================== --- branches/RDR/bigdata-gom/src/samples/com/bigdata/gom/samples/Example1.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-gom/src/samples/com/bigdata/gom/samples/Example1.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -11,6 +11,7 @@ import org.openrdf.model.Resource; import org.openrdf.model.Statement; +import com.bigdata.BigdataStatics; import com.bigdata.gom.gpo.IGPO; import com.bigdata.gom.om.IObjectManager; import com.bigdata.gom.om.NanoSparqlObjectManager; @@ -82,7 +83,8 @@ /** * The top-level SPARQL end point for a NanoSparqlServer instance. */ - final String sparqlEndpointURL = "http://localhost:8080/sparql/"; + final String sparqlEndpointURL = "http://localhost:8080" + + BigdataStatics.getContextPath() + "/sparql/"; /** * The namespace of the KB instance that you want to connect to on that Modified: branches/RDR/bigdata-gom/src/samples/com/bigdata/gom/samples/Example2.java =================================================================== --- branches/RDR/bigdata-gom/src/samples/com/bigdata/gom/samples/Example2.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-gom/src/samples/com/bigdata/gom/samples/Example2.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -18,6 +18,7 @@ import org.openrdf.model.vocabulary.RDFS; import org.openrdf.query.BindingSet; +import com.bigdata.BigdataStatics; import com.bigdata.gom.gpo.IGPO; import com.bigdata.gom.gpo.ILinkSet; import com.bigdata.gom.om.IObjectManager; @@ -288,7 +289,8 @@ /** * The top-level SPARQL end point for a NanoSparqlServer instance. */ - final String sparqlEndpointURL = "http://localhost:8080/sparql/"; + final String sparqlEndpointURL = "http://localhost:8080/" + + BigdataStatics.getContextPath() + "/sparql/"; /** * The namespace of the KB instance that you want to connect to on that Modified: branches/RDR/bigdata-gom/src/test/com/bigdata/gom/Example1.java =================================================================== --- branches/RDR/bigdata-gom/src/test/com/bigdata/gom/Example1.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-gom/src/test/com/bigdata/gom/Example1.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -11,6 +11,7 @@ import org.openrdf.model.Resource; import org.openrdf.model.Statement; +import com.bigdata.BigdataStatics; import com.bigdata.gom.gpo.IGPO; import com.bigdata.gom.om.IObjectManager; import com.bigdata.gom.om.NanoSparqlObjectManager; @@ -82,7 +83,8 @@ /** * The top-level SPARQL end point for a NanoSparqlServer instance. */ - final String sparqlEndpointURL = "http://localhost:8080/sparql/"; + final String sparqlEndpointURL = "http://localhost:8080/" + + BigdataStatics.getContextPath() + "/sparql/"; /** * The namespace of the KB instance that you want to connect to on that Modified: branches/RDR/bigdata-gom/src/test/com/bigdata/gom/LocalGOMTestCase.java =================================================================== --- branches/RDR/bigdata-gom/src/test/com/bigdata/gom/LocalGOMTestCase.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-gom/src/test/com/bigdata/gom/LocalGOMTestCase.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -29,7 +29,6 @@ import java.io.InputStreamReader; import java.io.Reader; import java.net.URL; -import java.util.Iterator; import java.util.Properties; import junit.extensions.proxy.ProxyTestSuite; @@ -37,26 +36,20 @@ import junit.framework.TestCase; import org.apache.log4j.Logger; -import org.openrdf.model.Value; import org.openrdf.model.ValueFactory; -import org.openrdf.model.vocabulary.RDFS; import org.openrdf.repository.RepositoryException; import org.openrdf.rio.RDFFormat; import org.openrdf.rio.RDFParseException; -import com.bigdata.bop.fed.QueryEngineFactory; -import com.bigdata.gom.gpo.IGPO; -import com.bigdata.gom.gpo.ILinkSet; +import com.bigdata.BigdataStatics; import com.bigdata.gom.om.IObjectManager; import com.bigdata.gom.om.ObjectManager; import com.bigdata.journal.BufferMode; -import com.bigdata.journal.Journal; import com.bigdata.journal.Journal.Options; import com.bigdata.rdf.sail.BigdataSail; import com.bigdata.rdf.sail.BigdataSailRepository; import com.bigdata.rdf.sail.BigdataSailRepositoryConnection; import com.bigdata.rdf.store.AbstractTripleStore; -import com.bigdata.rwstore.TestRWJournal; public class LocalGOMTestCase extends TestCase implements IGOMProxy { @@ -67,7 +60,6 @@ protected ValueFactory m_vf; protected IObjectManager om; - public LocalGOMTestCase() { } @@ -130,8 +122,9 @@ m_repo.initialize(); m_vf = m_sail.getValueFactory(); // Note: This uses a mock endpoint URL. - om = new ObjectManager("http://localhost/sparql", m_repo); - + om = new ObjectManager("http://localhost" + + BigdataStatics.getContextPath() + "/sparql", m_repo); + } protected void tearDown() throws Exception { Modified: branches/RDR/bigdata-gom/src/test/com/bigdata/gom/RemoteGOMTestCase.java =================================================================== --- branches/RDR/bigdata-gom/src/test/com/bigdata/gom/RemoteGOMTestCase.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-gom/src/test/com/bigdata/gom/RemoteGOMTestCase.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -54,6 +54,7 @@ import org.openrdf.rio.RDFFormat; import org.openrdf.rio.RDFParseException; +import com.bigdata.BigdataStatics; import com.bigdata.gom.gpo.IGPO; import com.bigdata.gom.gpo.ILinkSet; import com.bigdata.gom.om.IObjectManager; @@ -203,7 +204,8 @@ } - m_serviceURL = new URL("http", hostAddr, port, "/sparql"/* file */) + m_serviceURL = new URL("http", hostAddr, port, + BigdataStatics.getContextPath() + "/sparql"/* file */) .toExternalForm(); // final HttpClient httpClient = new DefaultHttpClient(); Modified: branches/RDR/bigdata-gom/src/test/com/bigdata/gom/TestRemoteGOM.java =================================================================== --- branches/RDR/bigdata-gom/src/test/com/bigdata/gom/TestRemoteGOM.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-gom/src/test/com/bigdata/gom/TestRemoteGOM.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -52,6 +52,7 @@ import org.openrdf.rio.RDFFormat; import org.openrdf.rio.RDFParseException; +import com.bigdata.BigdataStatics; import com.bigdata.gom.gpo.IGPO; import com.bigdata.gom.gpo.ILinkSet; import com.bigdata.gom.om.IObjectManager; @@ -173,7 +174,8 @@ } - m_serviceURL = new URL("http", hostAddr, port, "/sparql"/* file */) + m_serviceURL = new URL("http", hostAddr, port, + BigdataStatics.getContextPath() + "/sparql"/* file */) .toExternalForm(); // final HttpClient httpClient = new DefaultHttpClient(); 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-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -457,7 +457,7 @@ * deploying outside of that context, the value needs to be set * explicitly. */ - String DEFAULT_JETTY_XML = "WEB-INF/jetty.xml"; + String DEFAULT_JETTY_XML = "jetty.xml"; } Modified: branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHAJournalServerTestCase.java =================================================================== --- branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHAJournalServerTestCase.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHAJournalServerTestCase.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -61,6 +61,7 @@ import org.openrdf.query.BindingSet; import org.openrdf.query.TupleQueryResult; +import com.bigdata.BigdataStatics; import com.bigdata.btree.BytesUtil; import com.bigdata.ha.HAGlue; import com.bigdata.ha.HAStatusEnum; @@ -524,7 +525,8 @@ protected String getNanoSparqlServerURL(final HAGlue haGlue) throws IOException { - return "http://localhost:" + haGlue.getNSSPort(); + return "http://localhost:" + haGlue.getNSSPort() + + BigdataStatics.getContextPath(); } Modified: branches/RDR/bigdata-perf/chem2bio2rdf/src/test/com/bigdata/perf/chem2bio2rdf/TestQuery.java =================================================================== --- branches/RDR/bigdata-perf/chem2bio2rdf/src/test/com/bigdata/perf/chem2bio2rdf/TestQuery.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-perf/chem2bio2rdf/src/test/com/bigdata/perf/chem2bio2rdf/TestQuery.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -8,6 +8,7 @@ import org.openrdf.query.GraphQueryResult; import org.openrdf.query.TupleQueryResult; +import com.bigdata.BigdataStatics; import com.bigdata.rdf.sail.webapp.client.DefaultClientConnectionManagerFactory; import com.bigdata.rdf.sail.webapp.client.IPreparedGraphQuery; import com.bigdata.rdf.sail.webapp.client.IPreparedTupleQuery; @@ -60,8 +61,9 @@ */ public static void main(String[] args) throws Exception { - final String serviceURL = "http://localhost:8080/sparql"; - + final String serviceURL = "http://localhost:8080" + + BigdataStatics.getContextPath() + "/sparql"; + final HttpClient httpClient = new DefaultHttpClient(DefaultClientConnectionManagerFactory.getInstance().newInstance()); Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/RemoteServiceCallImpl.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/RemoteServiceCallImpl.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/service/RemoteServiceCallImpl.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -31,6 +31,7 @@ import org.apache.http.HttpResponse; import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.impl.client.DefaultRedirectStrategy; import org.openrdf.query.BindingSet; import org.openrdf.query.QueryEvaluationException; import org.openrdf.query.TupleQueryResult; @@ -142,8 +143,14 @@ o.addRequestParam("queryId", queryId.toString()); - final RemoteRepository repo = new RemoteRepository(uriStr, - new DefaultHttpClient(params.getClientConnectionManager()), + final DefaultHttpClient httpClient = new DefaultHttpClient( + params.getClientConnectionManager()); + + // Setup a standard strategy for following redirects. + httpClient.setRedirectStrategy(new DefaultRedirectStrategy()); + + final RemoteRepository repo = new RemoteRepository(uriStr,// + httpClient,// params.getTripleStore().getExecutorService() ); Modified: branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/remote/BigdataSailRemoteRepository.java =================================================================== --- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/remote/BigdataSailRemoteRepository.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/remote/BigdataSailRemoteRepository.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -28,9 +28,9 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import org.apache.http.client.HttpClient; import org.apache.http.conn.ClientConnectionManager; import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.impl.client.DefaultRedirectStrategy; import org.openrdf.model.ValueFactory; import org.openrdf.repository.Repository; import org.openrdf.repository.RepositoryConnection; @@ -76,8 +76,15 @@ this.ccm = DefaultClientConnectionManagerFactory.getInstance() .newInstance(); - final HttpClient httpClient = new DefaultHttpClient(ccm); + final DefaultHttpClient httpClient = new DefaultHttpClient(ccm); + /* + * Enable a standard http redirect policy. This allows references to + * http://localhost:8080 to be redirected to + * http://localhost:8080/bigdata. + */ + httpClient.setRedirectStrategy(new DefaultRedirectStrategy()); + this.nss = new RemoteRepository( sparqlEndpointURL, httpClient, executor); Modified: branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java =================================================================== --- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -72,6 +72,7 @@ import org.openrdf.rio.RDFWriterRegistry; import org.openrdf.sail.SailException; +import com.bigdata.BigdataStatics; import com.bigdata.bop.BufferAnnotations; import com.bigdata.bop.IPredicate; import com.bigdata.bop.engine.IRunningQuery; @@ -171,7 +172,8 @@ * * @see #XSL_STYLESHEET */ - protected static final String DEFAULT_XSL_STYLESHEET = "/bigdata/html/result-to-html.xsl"; + protected static final String DEFAULT_XSL_STYLESHEET = BigdataStatics + .getContextPath() + "/html/result-to-html.xsl"; /** * URL Query parameter used to request an incremental XHTML representation Modified: branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java =================================================================== --- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -38,6 +38,7 @@ import org.eclipse.jetty.server.handler.DefaultHandler; import org.eclipse.jetty.server.handler.HandlerList; import org.eclipse.jetty.server.handler.ResourceHandler; +import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.resource.Resource; @@ -45,6 +46,7 @@ import org.eclipse.jetty.xml.XmlConfiguration; import com.bigdata.Banner; +import com.bigdata.BigdataStatics; import com.bigdata.journal.IIndexManager; import com.bigdata.journal.ITx; import com.bigdata.journal.Journal; @@ -76,6 +78,32 @@ * @todo Remote command to advance the read-behind point. This will let people * bulk load a bunch of stuff before advancing queries to read from the * new consistent commit point. + * + * @todo Note: There appear to be plenty of ways to setup JSP support for + * embedded jetty, and plenty of ways to get it wrong. I wound up adding + * to the classpath the following jars for jetty 7.2.2 to get this + * running: + * + * <pre> + * com.sun.el_1.0.0.v201004190952.jar + * ecj-3.6.jar + * javax.el_2.1.0.v201004190952.jar + * javax.servlet.jsp.jstl_1.2.0.v201004190952.jar + * javax.servlet.jsp_2.1.0.v201004190952.jar + * jetty-jsp-2.1-7.2.2.v20101205.jar + * org.apache.jasper.glassfish_2.1.0.v201007080150.jar + * org.apache.taglibs.standard.glassfish_1.2.0.v201004190952.jar + * </pre> + * + * Note: JSP pages for the servlet 2.5 specification add the following + * dependencies: + * + * <pre> + * ant-1.6.5.jar + * core-3.1.1.jar + * jsp-2.1.jar + * jsp-api-2.1.jar + * </pre> */ public class NanoSparqlServer { @@ -349,16 +377,16 @@ final Server server = new Server(port); - final ServletContextHandler context = getContextHandler(//server, - initParams); + final ServletContextHandler context = getContextHandler(initParams); - // Force the use of the caller's IIndexManager. - context.setAttribute(IIndexManager.class.getName(), indexManager); - final ResourceHandler resourceHandler = new ResourceHandler(); setupStaticResources(NanoSparqlServer.class.getClassLoader(), resourceHandler); + + // same resource base. + context.setResourceBase(resourceHandler.getResourceBase()); + context.setWelcomeFiles(resourceHandler.getWelcomeFiles()); final HandlerList handlers = new HandlerList(); @@ -369,11 +397,62 @@ }); server.setHandler(handlers); - + + // Force the use of the caller's IIndexManager. + context.setAttribute(IIndexManager.class.getName(), indexManager); + return server; } + + /** + * Variant used when the life cycle of the {@link IIndexManager} will be + * managed by the server - this form is used by {@link #main(String[])}. + * <p> + * Note: This is mostly a convenience for scripts that do not need to take + * over the detailed control of the jetty container and the bigdata webapp. + * + * @param port + * The port on which the service will run -OR- ZERO (0) for any + * open port. + * @param propertyFile + * The <code>.properties</code> file (for a standalone database + * instance) or the <code>.config</code> file (for a federation). + * @param initParams + * Initialization parameters for the web application as specified + * by {@link ConfigParams}. + * + * @return The server instance. + */ + static public Server newInstance(final int port, final String propertyFileIsNotUsed, + final Map<String, String> initParams) throws Exception { + final Server server = new Server(port); + + final ServletContextHandler context = getContextHandler(initParams); + + final ResourceHandler resourceHandler = new ResourceHandler(); + + setupStaticResources(NanoSparqlServer.class.getClassLoader(), + resourceHandler); + + // same resource base. + context.setResourceBase(resourceHandler.getResourceBase()); + context.setWelcomeFiles(resourceHandler.getWelcomeFiles()); + + final HandlerList handlers = new HandlerList(); + + handlers.setHandlers(new Handler[] {// + context,// maps servlets + resourceHandler,// maps welcome files. + new DefaultHandler() // responsible for anything not explicitly served. + }); + + server.setHandler(handlers); + + return server; + } + /** * Variant used when you already have the {@link IIndexManager} on hand and * want to use <code>web.xml</code> to configure the {@link WebAppContext} @@ -404,11 +483,14 @@ final URL jettyXmlUrl; if (new File(jettyXml).exists()) { + // Check the file system. jettyXmlUrl = new URL("file://" + jettyXml); } else { - jettyXmlUrl = getStaticResourceURL(classLoader, jettyXml); + // Check the classpath. + jettyXmlUrl = classLoader.getResource(jettyXml); +// jettyXmlUrl = classLoader.getResource("bigdata-war/src/jetty.xml"); } @@ -500,74 +582,6 @@ } /** - * Variant used when the life cycle of the {@link IIndexManager} will be - * managed by the server - this form is used by {@link #main(String[])}. - * <p> - * Note: This is mostly a convenience for scripts that do not need to take - * over the detailed control of the jetty container and the bigdata webapp. - * - * @param port - * The port on which the service will run -OR- ZERO (0) for any - * open port. - * @param propertyFile - * The <code>.properties</code> file (for a standalone database - * instance) or the <code>.config</code> file (for a federation). - * @param initParams - * Initialization parameters for the web application as specified - * by {@link ConfigParams}. - * - * @return The server instance. - */ - static public Server newInstance(final int port, final String propertyFile, - final Map<String, String> initParams) throws Exception { - - final Server server = new Server(port); - - final ServletContextHandler context = getContextHandler(//server, - initParams); - - final ResourceHandler resourceHandler = new ResourceHandler(); - - setupStaticResources(NanoSparqlServer.class.getClassLoader(), - resourceHandler); - - /** - * Note: There appear to be plenty of ways to setup JSP support for - * embedded jetty, and plenty of ways to get it wrong. I wound up adding - * to the classpath the following jars for jetty 7.2.2 to get this - * running: - * - * <pre> - * com.sun.el_1.0.0.v201004190952.jar - * ecj-3.6.jar - * javax.el_2.1.0.v201004190952.jar - * javax.servlet.jsp.jstl_1.2.0.v201004190952.jar - * javax.servlet.jsp_2.1.0.v201004190952.jar - * jetty-jsp-2.1-7.2.2.v20101205.jar - * org.apache.jasper.glassfish_2.1.0.v201007080150.jar - * org.apache.taglibs.standard.glassfish_1.2.0.v201004190952.jar - * </pre> - * - * With those jars on the class path, the following code will run - * JSP pages. - * - * Note: In order for this to work, it must also be supported in the - * alternative newInstance() method above. - */ - final HandlerList handlers = new HandlerList(); - - handlers.setHandlers(new Handler[] {// - context,// maps servlets - resourceHandler,// maps welcome files. - new DefaultHandler() // responsible for anything not explicitly served. - }); - - server.setHandler(handlers); - - return server; - } - - /** * Construct a {@link ServletContextHandler}. * <p> * Note: The {@link ContextHandler} uses the longest prefix of the request @@ -580,7 +594,6 @@ * The init parameters, per the web.xml definition. */ static private ServletContextHandler getContextHandler( -// final Server server, final Map<String, String> initParams) throws Exception { if (initParams == null) @@ -592,13 +605,8 @@ ); // Path to the webapp. - context.setContextPath("/bigdata"); - -// /* -// * Setup resolution for the static web app resources (index.html). -// */ -// setupStaticResources(server, context); - + context.setContextPath(BigdataStatics.getContextPath()); + /* * Register a listener which will handle the life cycle events for the * ServletContext. @@ -638,6 +646,14 @@ } + // html directory. + context.addServlet(new ServletHolder(new DefaultServlet()), + "/html/*"); + + // Appears necessary for http://localhost:8080/bigdata to bring up index.html. + context.addServlet(new ServletHolder(new DefaultServlet()), + "/"); + // Performance counters. context.addServlet(new ServletHolder(new CountersServlet()), "/counters"); @@ -651,25 +667,11 @@ // Multi-Tenancy API. context.addServlet(new ServletHolder(new MultiTenancyServlet()), "/namespace/*"); - + // Incremental truth maintenance context.addServlet(new ServletHolder(new InferenceServlet()), "/inference"); - /** - * Note: JSP pages for the servlet 2.5 specification add the following - * dependencies: - * - * <pre> - * ant-1.6.5.jar - * core-3.1.1.jar - * jsp-2.1.jar - * jsp-api-2.1.jar - * </pre> - * - * @see http://docs.codehaus.org/display/JETTY/Embedding+Jetty - */ - // context.setResourceBase("bigdata-war/src/html"); // // context.setWelcomeFiles(new String[]{"index.html"}); @@ -716,21 +718,45 @@ context.setDirectoriesListed(false); // Nope! - final String file = "index.html"; + final String file = "html/index.html"; - final URL url = getStaticResourceURL(classLoader, file); + final URL url; + { - if (url == null) - throw new RuntimeException("Could not locate file: " + file); + URL tmp = null; + + if (tmp == null) { +// // project local file system path. +// classLoader.getResource("bigdata-war/src/html/" + file); + + } + + if (tmp == null) { + + // Check the classpath. + tmp = classLoader.getResource(file); + + } + + url = tmp; + + if (url == null) { + + throw new RuntimeException("Could not locate index.html"); + + } + + } + /* * We have located the resource. Set it as the resource base from which * static content will be served. */ - final String indexHtml = url.toExternalForm(); + final String indexHtmlUrl = url.toExternalForm(); - final String webDir = indexHtml.substring(0, - indexHtml.length() - file.length()); + final String webDir = indexHtmlUrl.substring(0, indexHtmlUrl.length() + - file.length()); // Path to the content in the local file system or JAR. context.setResourceBase(webDir); @@ -739,65 +765,69 @@ * Note: replace with "new.html" for the new UX. Also change in * web.xml. */ - context.setWelcomeFiles(new String[]{"index.html"}); + context.setWelcomeFiles(new String[]{"html/index.html"}); + if (log.isInfoEnabled()) + log.info("\nindex.html: =" + indexHtmlUrl + "\nresourceBase=" + + webDir); + } - /** - * Return the URL for the static web app resources (for example, - * <code>index.html</code>). - * - * @param classLoader - * The {@link ClassLoader} that will be used to locate the - * resource (required). - * @param path - * The path for the resource (required) - * - * @return The URL for the web app resource directory -or- <code>null</code> - * if it could not be found on the class path. - * - * @see https://sourceforge.net/apps/trac/bigdata/ticket/330 - */ - private static URL getStaticResourceURL(final ClassLoader classLoader, - final String path) { +// /** +// * Return the URL for the static web app resources (for example, +// * <code>index.html</code>). +// * +// * @param classLoader +// * The {@link ClassLoader} that will be used to locate the +// * resource (required). +// * @param path +// * The path for the resource (required) +// * +// * @return The URL for the web app resource directory -or- <code>null</code> +// * if it could not be found on the class path. +// * +// * @see https://sourceforge.net/apps/trac/bigdata/ticket/330 +// */ +// private static URL getStaticResourceURL(final ClassLoader classLoader, +// final String path) { +// +// if (classLoader == null) +// throw new IllegalArgumentException(); +// +// if (path == null) +// throw new IllegalArgumentException(); +// +// /* +// * This is the resource path in the JAR. +// */ +// final String WEB_DIR_JAR = "bigdata-war/src/html" +// + (path == null ? "" : "/" + path); +// +// /* +// * This is the resource path in the IDE when NOT using the JAR. +// * +// * Note: You MUST have "bigdata-war/src" on the build path for the IDE. +// */ +// final String WEB_DIR_IDE = "html/" + path; // "html"; +// +// URL url = classLoader.getResource(WEB_DIR_JAR); +// +// if (url == null && path != null) { +// +// url = classLoader.getResource(WEB_DIR_IDE);// "html"); +// +// } +// +// if (url == null) { +// +// log.error("Could not locate: " + WEB_DIR_JAR + ", " + WEB_DIR_IDE +// + ", -or- " + path); +// } +// +// return url; +// +// } - if (classLoader == null) - throw new IllegalArgumentException(); - - if (path == null) - throw new IllegalArgumentException(); - - /* - * This is the resource path in the JAR. - */ - final String WEB_DIR_JAR = "bigdata-war/src/html" - + (path == null ? "" : "/" + path); - - /* - * This is the resource path in the IDE when NOT using the JAR. - * - * Note: You MUST have "bigdata-war/src" on the build path for the IDE. - */ - final String WEB_DIR_IDE = "html/" + path; // "html"; - - URL url = classLoader.getResource(WEB_DIR_JAR); - - if (url == null && path != null) { - - url = classLoader.getResource(WEB_DIR_IDE);// "html"); - - } - - if (url == null) { - - log.error("Could not locate: " + WEB_DIR_JAR + ", " + WEB_DIR_IDE - + ", -or- " + path); - } - - return url; - - } - /** * Print the optional message on stderr, print the usage information on * stderr, and then force the program to exit with the given status code. Modified: branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java =================================================================== --- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -1497,7 +1497,7 @@ } - static protected HttpUriRequest newRequest(final String uri, + static public HttpUriRequest newRequest(final String uri, final String method) { if (method.equals("GET")) { return new HttpGet(uri); @@ -1547,6 +1547,7 @@ } + // TODO EntityUtils.toString(response.getEntity())? protected static String getResponseBody(final HttpResponse response) throws IOException { Modified: branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/AbstractNanoSparqlServerTestCase.java =================================================================== --- branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/AbstractNanoSparqlServerTestCase.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/AbstractNanoSparqlServerTestCase.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -78,7 +78,8 @@ protected String m_serviceURL; /** - * The request path for the REST API under test. + * The request path for the REST API under test (does not include the + * ContextPath). */ protected static final String requestPath = "/sparql"; Modified: branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/AbstractProtocolTest.java =================================================================== --- branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/AbstractProtocolTest.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/AbstractProtocolTest.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -42,6 +42,7 @@ import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; +import com.bigdata.BigdataStatics; import com.bigdata.journal.IIndexManager; import com.bigdata.rdf.sail.webapp.client.ConnectOptions; import com.bigdata.rdf.sail.webapp.client.DefaultClientConnectionManagerFactory; @@ -91,11 +92,15 @@ private String accept = null; private boolean permit400s = false; + private final String getSparqlURL(final String serviceURL) { + return serviceURL + "/sparql"; + } + private final RequestFactory GET = new RequestFactory(){ @Override public HttpUriRequest createRequest(String... params) { - final StringBuffer url = new StringBuffer(m_serviceURL); - url.append("/sparql"); + final StringBuffer url = new StringBuffer(); + url.append(getSparqlURL(m_serviceURL)); char sep = '?'; for (int i=0;i<params.length;i+=2) { url.append(sep); @@ -184,7 +189,7 @@ * @return the data returned by the server. * @throws IOException */ - protected String serviceRequest(String ... paramValues) throws IOException { + protected String serviceRequest(final String ... paramValues) throws IOException { HttpUriRequest req; responseContentType = null; try { @@ -244,7 +249,7 @@ requestFactory = new RequestFactory(){ @Override public HttpUriRequest createRequest(String... params) { - final HttpPost rslt = new HttpPost(m_serviceURL+"/sparql"); + final HttpPost rslt = new HttpPost(getSparqlURL(m_serviceURL)); try { rslt.setEntity(ConnectOptions.getFormEntity(pairs2map(params))); } catch (final Exception e) { @@ -272,8 +277,8 @@ @Override public HttpUriRequest createRequest(String... params) { - final StringBuffer url = new StringBuffer(m_serviceURL); - url.append("/sparql"); + final StringBuffer url = new StringBuffer(); + url.append(getSparqlURL(m_serviceURL)); char sep = '?'; for (int i=0;i<params.length;i+=2) { url.append(sep); Modified: branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/AbstractTestNanoSparqlClient.java =================================================================== --- branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/AbstractTestNanoSparqlClient.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/AbstractTestNanoSparqlClient.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -41,6 +41,7 @@ import org.apache.http.client.HttpClient; import org.apache.http.conn.ClientConnectionManager; import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.impl.client.DefaultRedirectStrategy; import org.eclipse.jetty.server.Server; import org.openrdf.model.Graph; import org.openrdf.model.Literal; @@ -71,6 +72,7 @@ import org.openrdf.rio.helpers.StatementCollector; import org.openrdf.sail.SailException; +import com.bigdata.BigdataStatics; import com.bigdata.journal.IIndexManager; import com.bigdata.journal.ITx; import com.bigdata.journal.Journal; @@ -123,16 +125,33 @@ */ private ClientConnectionManager m_cm; + /** + * Exposed to tests that do direct HTTP GET/POST operations. + */ + protected HttpClient m_httpClient = null; + /** * The client-API wrapper to the NSS. */ protected RemoteRepositoryManager m_repo; /** - * The effective {@link NanoSparqlServer} http end point. - */ + * The effective {@link NanoSparqlServer} http end point (including the + * ContextPath). + */ protected String m_serviceURL; + /** + * The URL of the root of the web application server. This does NOT include + * the ContextPath for the webapp. + * + * <pre> + * http://localhost:8080 -- root URL + * http://localhost:8080/bigdata -- webapp URL (includes "/bigdata" context path. + * </pre> + */ + protected String m_rootURL; + // /** // * The request path for the REST API under test. // */ @@ -275,14 +294,16 @@ } - m_serviceURL = new URL("http", hostAddr, port, // - "" // file -// "/sparql/"// file + m_rootURL = new URL("http", hostAddr, port, ""/* contextPath */ ).toExternalForm(); + m_serviceURL = new URL("http", hostAddr, port, + BigdataStatics.getContextPath()).toExternalForm(); + if (log.isInfoEnabled()) - log.info("Setup done: name=" + getName() + ", namespace=" - + namespace + ", serviceURL=" + m_serviceURL); + log.info("Setup done: \nname=" + getName() + "\nnamespace=" + + namespace + "\nrootURL=" + m_rootURL + "\nserviceURL=" + + m_serviceURL); // final HttpClient httpClient = new DefaultHttpClient(); @@ -291,8 +312,20 @@ m_cm = DefaultClientConnectionManagerFactory.getInstance() .newInstance(); + final DefaultHttpClient httpClient = new DefaultHttpClient(m_cm); + m_httpClient = httpClient; + + /* + * Ensure that the client follows redirects using a standard policy. + * + * Note: This is necessary for tests of the webapp structure since the + * container may respond with a redirect (302) to the location of the + * webapp when the client requests the root URL. + */ + httpClient.setRedirectStrategy(new DefaultRedirectStrategy()); + m_repo = new RemoteRepositoryManager(m_serviceURL, - new DefaultHttpClient(m_cm), + m_httpClient, m_indexManager.getExecutorService()); } @@ -333,12 +366,18 @@ } - m_repo = null; - - log.info("tear down done"); - - super.tearDown(); + m_httpClient = null; + + m_repo = null; + m_serviceURL = null; + + m_rootURL = null; + + log.info("tear down done"); + + super.tearDown(); + } /** Modified: branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestFederatedQuery.java =================================================================== --- branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestFederatedQuery.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestFederatedQuery.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -106,6 +106,7 @@ import org.openrdf.rio.helpers.StatementCollector; import org.openrdf.sail.SailException; +import com.bigdata.BigdataStatics; import com.bigdata.journal.IIndexManager; import com.bigdata.rdf.sail.BigdataSail; import com.bigdata.rdf.sail.BigdataSailRepository; @@ -214,8 +215,9 @@ protected String getRepositoryUrlBase() { - return m_serviceURL + requestPath + "/namespace/" + namespace + "_"; - + return m_serviceURL + BigdataStatics.getContextPath() + requestPath + + "/namespace/" + namespace + "_"; + } /** Modified: branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestNanoSparqlClient.java =================================================================== --- branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestNanoSparqlClient.java 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestNanoSparqlClient.java 2014-03-10 21:15:00 UTC (rev 7921) @@ -26,10 +26,17 @@ import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; +import java.util.Arrays; import java.util.Collection; +import java.util.Map; import junit.framework.Test; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; +import org.apache.http.client.methods.HttpUriRequest; +import org.apache.http.util.EntityUtils; import org.openrdf.model.Graph; import org.openrdf.model.Literal; import org.openrdf.model.Resource; @@ -50,6 +57,8 @@ import org.openrdf.rio.RDFWriterRegistry; import com.bigdata.journal.IIndexManager; +import com.bigdata.rdf.sail.webapp.client.ConnectOptions; +import com.bigdata.rdf.sail.webapp.client.HttpException; import com.bigdata.rdf.sail.webapp.client.IPreparedBooleanQuery; import com.bigdata.rdf.sail.webapp.client.IPreparedGraphQuery; import com.bigdata.rdf.sail.webapp.client.IPreparedTupleQuery; @@ -77,15 +86,381 @@ } public static Test suite() { - return ProxySuiteHelper.suiteWhenStandalone(TestNanoSparqlClient.class, "test.*DELETE.*", TestMode.quads,TestMode.sids,TestMode.triples); + + return ProxySuiteHelper.suiteWhenStandalone(TestNanoSparqlClient.class, + "test.*DELETE.*", TestMode.quads, TestMode.sids, + TestMode.triples); + } + public void test_startup() throws Exception { assertTrue("open", m_fixture.isRunning()); } - + + /* + * Verify the correct structure of the webapp. + * + * TODO There should be tests here to verify that we do not allow listing of + * the directory contents in the web application. This appears to be allowed + * by default and we do not test to ensure that this option is disabled. E.g. + * + * http://172.16.0.185:8090/bigdata/html/ + * + * might list the directory contents. + */ + /** + * A marker placed into index.html so we can recognize when that page is + * served. + */ + private static final String JUNIT_TEST_MARKER_INDEX_HTML = "junit test marker: index.html"; + + /** + * bare URL of the server + * + * <pre> + * http://localhost:8080 + * </pre> + * + * The response is should be <code>index.html</code> since we want the + * bigdata webapp to respond for the top-level context. + * + * <p> + * Note: You must ensure that the client follows redirects using a standard + * policy. This is necessary for tests of the webapp structure since the + * container may respond with a redirect (302) to the location of the webapp + * when the client requests the root URL. + */ + public void test_webapp_structure_rootURL() throws Exception { + + final String content = doGET(m_rootURL); + + assertTrue(content.contains(JUNIT_TEST_MARKER_INDEX_HTML)); + + } + + /** + * URL with correct context path + * + * <pre> + * http://localhost:8080/bigdata + * </pre> + * + * The response is should be <code>index.html</code>, which is specified + * through the welcome files list. + */ + public void test_webapp_structure_contextPath() throws Exception { + + final String content = doGET(m_serviceURL); + + assertTrue(content.contains(JUNIT_TEST_MARKER_INDEX_HTML)); + } + + /** + * URL with context path and index.html reference + * + * <pre> + * http://localhost:8080/bigdata/index.html + * </pre> + * + * This URL does NOT get mapped to anything (404). + */ + public void test_webapp_structure_contextPath_indexHtml() throws Exception { + + try { + + doGET(m_serviceURL + "/index.html"); + + } catch (HttpException ex) { + + assertEquals(404, ex.getStatusCode()); + + } + + } + + /** + * The <code>favicon.ico</code> file. + * + * @see <a href="http://www.w3.org/2005/10/howto-favicon"> How to add a + * favicon </a> + */ + public void test_webapp_structure_favicon() throws Exception { + + doGET(m_serviceURL + "/html/favicon.ico"); + + } + + /** + * The <code>/status</code> servlet responds. + */ + public void test_webapp_structure_status() throws Exception { + + doGET(m_serviceURL + "/status"); + + } + + /** + * The <code>/counters</code> servlet responds. + */ + public void test_webapp_structure_counters() throws Exception { + + doGET(m_serviceURL + "/counters"); + + } + +// /** +// * The <code>/namespace/</code> servlet responds (multi-tenancy API). +// */ +// public void test_webapp_structure_namespace() throws Exception { +// +// doGET(m_serviceURL + "/namespace/"); +// +// } + + /** + * The fully qualified URL for <code>index.html</code> + * + * <pre> + * http://localhost:8080/bigdata/html/index.html + * </pre> + * + * The response is should be <code>index.html</code>, which is specified + * through the welcome files list. + */ + public void test_webapp_structure_contextPath_html_indexHtml() throws Exception { + + doGET(m_serviceURL + "/html/index.html"); + } + + private String doGET(final String url) throws Exception { + + HttpResponse response = null; + HttpEntity entity = null; + + try { + + final ConnectOptions opts = new ConnectOptions(url); + opts.method = "GET"; + + response = doConnect(opts); + + checkResponseCode(url, response); + + entity = response.getEntity(); + + final String content = EntityUtils.toString(response.getEntity()); + + return content; + + } finally { + + try { + EntityUtils.consume(entity); + } catch (IOException ex) { + } + + } + + } + + /** + * Throw an exception if the status code does not indicate success. + * + * @param response + * The response. + * + * @return The response. + * + * @throws IOException + */ + private static HttpResponse checkResponseCode(final String url, + final HttpResponse response) throws IOException { + + final int rc = response.getStatusLine().getStatusCode(); + + if (rc < 200 || rc >= 300) { + throw new HttpException(rc, "StatusCode=" + rc + ", StatusLine=" + + response.getStatusLine() + ", headers=" + + Arrays.toString(response.getAllHeaders()) + + ", ResponseBody=" + + EntityUtils.toString(response.getEntity())); + + } + + if (log.isDebugEnabled()) { + /* + * write out the status list, headers, etc. + */ + log.debug("*** Response ***"); + log.debug("Status Line: " + response.getStatusLine()); + } + + return response; + + } + + /** + * Connect to a SPARQL end point (GET or POST query only). + * + * @param opts + * The connection options. + * + * @return The connection. + * + * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/619"> + * RemoteRepository class should use application/x-www-form-urlencoded + * for large POST requests </a> + */ + private HttpResponse doConnect(final ConnectOptions opts) throws Exception { + + /* + * Generate the fully formed and encoded URL. + */ + + final StringBuilder urlString = new StringBuilder(opts.serviceURL); + + ConnectOptions.addQueryParams(urlString, opts.requestParams); + + final boolean isLongRequestURL = urlString.length() > 1024; + + if (isLongRequestURL && opts.method.equals("POST") + && opts.entity == null) { + + /* + * URL is too long. Reset the URL to just the service endpoint and + * use application/x-www-form-urlencoded entity instead. Only in + * cases where there is not already a request entity (SPARQL query + * and SPARQL update). + */ + + urlString.setLength(0); + urlString.append(opts.serviceURL); + + opts.entity = ConnectOptions.getFormEntity(opts.requestParams); + + } else if (isLongRequestURL && opts.method.equals("GET") + && opts.entity == null) { + + /* + * Convert automatically to a POST if the request URL is too long. + * + * Note: [opts.entity == null] should always be true for a GET so + * this bit is a paranoia check. + */ + + opts.method = "POST"; + + urlString.setLength(0); + urlString.append(opts.serviceURL); + + opts.entity = ConnectOptions.getFormEntity(opts.requestParams); + + } + + if (log.isDebugEnabled()) { + log.debug("*** Request ***"); + log.debug(opts.serviceURL); + log.debug(opts.method); + log.debug("query=" + opts.getRequestParam("query")); + log.debug(urlString.toString()); + } + + HttpUriRequest request = null; + try { + + request = RemoteRepository.newRequest(urlString.toString(), opts.method); + + if (opts.requestHeaders != null) { + + for (Map.Entry<String, String> e : opts.requestHeaders + .entrySet()) { + + request.addHeader(e.getKey(), e.getValue()); + + if (log.isDebugEnabled()) + log.debug(e.getKey() + ": " + e.getValue()); + + } + + } + +// // conn = doConnect(urlString.toString(), opts.method); +// final URL url = new URL(urlString.toString()); +// conn = (HttpURLConnection) url.openConnection(); +// conn.setRequestMethod(opts.method); +// conn.setDoOutput(true); +// conn.setDoInput(true); +// conn.setUseCaches(false); +// conn.setReadTimeout(opts.timeout); +// conn.setRequestProperty("Accept", opts.acceptHeader); +// if (log.isDebugEnabled()) +// log.debug("Accept: " + opts.acceptHeader); + + if (opts.entity != null) { + +// if (opts.data == null) +// throw new AssertionError(); + +// final String contentLength = Integer.toString(opts.data.length); + +// conn.setRequestProperty("Content-Type", opts.contentType); +// conn.setRequestProperty("Content-Length", contentLength); + +// if (log.isDebugEnabled()) { +// log.debug("Content-Type: " + opts.contentType); +// log.debug("Content-Length: " + contentLength); +// } + +// final ByteArrayEntity entity = new ByteArrayEntity(opts.data); +// entity.setContentType(opts.contentType); + + ((HttpEntityEnclosingRequestBase) request).setEntity(opts.entity); + +// final OutputStream os = conn.getOutputStream(); +// try { +// os.write(opts.data); +// os.flush(); +// } finally { +// os.close(); +// } + + } + + final HttpResponse response = m_httpClient.execute(request); + + return response; + +// // connect. +// conn.connect(); +// +// return conn; + + } catch (Throwable t) { + /* + * If something goes wrong, then close the http connection. + * Otherwise, the connection will be closed by the caller. + */ + try { + + if (request != null) + request.abort(); + +// // clean up the connection resources +// if (conn != null) +// conn.disconnect(); + + } catch (Throwable t2) { + // ignored. + } + throw new RuntimeException(opts.serviceURL + " : " + t, t); + } + + } + + /** * Request the SPARQL SERVICE DESCRIPTION for the end point. */ public void test_SERVICE_DESCRIPTION() throws Exception { Modified: branches/RDR/bigdata-war/src/WEB-INF/web.xml =================================================================== --- branches/RDR/bigdata-war/src/WEB-INF/web.xml 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-war/src/WEB-INF/web.xml 2014-03-10 21:15:00 UTC (rev 7921) @@ -89,8 +89,8 @@ </welcome-file-list> <!-- Serve anything under /html/* as a simple file. --> <servlet-mapping> - <servlet-name>default</servlet-name> - <url-pattern>/html/*</url-pattern> + <servlet-name>default</servlet-name> + <url-pattern>/html/*</url-pattern> </servlet-mapping> <!-- Mapping for the default KB namespace (as configured above). --> <servlet-mapping> Deleted: branches/RDR/bigdata-war/src/html/favicon.ico =================================================================== (Binary files differ) Added: branches/RDR/bigdata-war/src/html/favicon.ico =================================================================== --- branches/RDR/bigdata-war/src/html/favicon.ico (rev 0) +++ branches/RDR/bigdata-war/src/html/favicon.ico 2014-03-10 21:15:00 UTC (rev 7921) @@ -0,0 +1,3 @@ ++UX dB&3$.Ae\ No newline at end of file Modified: branches/RDR/bigdata-war/src/html/index.html =================================================================== --- branches/RDR/bigdata-war/src/html/index.html 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-war/src/html/index.html 2014-03-10 21:15:00 UTC (rev 7921) @@ -1,10 +1,14 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> -<head> +<head profile="http://www.w3.org/2005/10/profile"> +<link rel="icon" + type="image/png" + href="/bigdata/html/favicon.ico" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <title>bigdata® NanoSparqlServer</title> <!-- $Id$ --> +<!-- junit test marker: index.html --> </head> <body> Modified: branches/RDR/bigdata-war/src/html/new.html =================================================================== --- branches/RDR/bigdata-war/src/html/new.html 2014-03-08 16:03:33 UTC (rev 7920) +++ branches/RDR/bigdata-war/src/html/new.html 2014-03-10 21:15:00 UTC (rev 7921) @@ -1,7 +1,11 @@ <!DOCTYPE html> <html lang="en"> - <head> - <meta charset="utf-8"> + <head profile="http://www.w3.org/2005/10/profile"> + <link rel="icon" + type="image/png" + href="/bigdata/html/favicon.ico" /> + <!-- meta charset="utf-8" --> + <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <title>Bigdata Workbench</title> <link re... [truncated message content] |
From: <mrp...@us...> - 2014-03-08 16:03:38
|
Revision: 7920 http://sourceforge.net/p/bigdata/code/7920 Author: mrpersonick Date: 2014-03-08 16:03:33 +0000 (Sat, 08 Mar 2014) Log Message: ----------- stubbed out tests and client wrappers for setting TM and running DB at once closure over the REST API. see ticket #840 Modified Paths: -------------- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java Modified: branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java =================================================================== --- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2014-03-08 16:00:40 UTC (rev 7919) +++ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2014-03-08 16:03:33 UTC (rev 7920) @@ -318,6 +318,9 @@ } + /** + * Set incremental truth maintenance to either true or false on the server. + */ public void setTruthMaintenance(final boolean tm) throws Exception { final ConnectOptions opts = newConnectOptions(); @@ -327,7 +330,10 @@ checkResponseCode(doConnect(opts)); } - + + /** + * Compute database at once closure on the server and do a commit. + */ public long doClosure() throws Exception { final ConnectOptions opts = newConnectOptions(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2014-03-08 16:00:46
|
Revision: 7919 http://sourceforge.net/p/bigdata/code/7919 Author: mrpersonick Date: 2014-03-08 16:00:40 +0000 (Sat, 08 Mar 2014) Log Message: ----------- stubbed out tests and client wrappers for setting TM and running DB at once closure over the REST API. see ticket #840 Modified Paths: -------------- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestNanoSparqlClient2.java Modified: branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java =================================================================== --- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2014-03-07 19:20:47 UTC (rev 7918) +++ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2014-03-08 16:00:40 UTC (rev 7919) @@ -318,6 +318,46 @@ } + public void setTruthMaintenance(final boolean tm) throws Exception { + + final ConnectOptions opts = newConnectOptions(); + + opts.addRequestParam("truthMaintenance", String.valueOf(tm)); + + checkResponseCode(doConnect(opts)); + + } + + public long doClosure() throws Exception { + + final ConnectOptions opts = newConnectOptions(); + + opts.addRequestParam("doClosure"); + + HttpResponse response = null; + try { + + opts.setAcceptHeader(ConnectOptions.MIME_APPLICATION_XML); + + checkResponseCode(response = doConnect(opts)); + + final MutationResult result = mutationResults(response); + + return result.mutationCount; + + } finally { + + try { + + if (response != null) + EntityUtils.consume(response.getEntity()); + + } catch (Exception ex) { } + + } + + } + /** * Return the SPARQL 1.1 Service Description for the end point. */ Modified: branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestNanoSparqlClient2.java =================================================================== --- branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestNanoSparqlClient2.java 2014-03-07 19:20:47 UTC (rev 7918) +++ branches/RDR/bigdata-sails/src/test/com/bigdata/rdf/sail/webapp/TestNanoSparqlClient2.java 2014-03-08 16:00:40 UTC (rev 7919) @@ -24,10 +24,16 @@ package com.bigdata.rdf.sail.webapp; import junit.framework.Test; -import junit.framework.TestSuite; +import org.openrdf.model.Graph; +import org.openrdf.model.URI; +import org.openrdf.model.impl.GraphImpl; +import org.openrdf.model.impl.URIImpl; +import org.openrdf.model.vocabulary.RDF; +import org.openrdf.model.vocabulary.RDFS; + import com.bigdata.journal.IIndexManager; -import com.bigdata.rdf.sail.webapp.client.RemoteRepositoryManager; +import com.bigdata.rdf.sail.webapp.client.RemoteRepository.AddOp; /** * Proxied test suite. @@ -52,14 +58,55 @@ } /** - * Delete everything matching an access path description. + * Test bulk load and database at once closure. */ - public void test_IMPLEMENT_ME() throws Exception { + public void test_INFERENCE() throws Exception { - final RemoteRepositoryManager rrm = super.m_repo; + final URI person = new URIImpl("bd:/person"); + final URI company = new URIImpl("bd:/company"); + final URI entity = new URIImpl("bd:/entity"); + final URI mike = new URIImpl("bd:/mike"); + final URI bryan = new URIImpl("bd:/bryan"); + final URI systap = new URIImpl("bd:/sytap"); + // - // do something here - + final Graph ontology = new GraphImpl(); + ontology.add(person, RDFS.SUBCLASSOF, entity); + ontology.add(company, RDFS.SUBCLASSOF, entity); + + assertEquals(m_repo.add(new AddOp(ontology)), 2); + + { // batch 1 + + m_repo.setTruthMaintenance(false); + + final Graph data = new GraphImpl(); + data.add(mike, RDF.TYPE, person); + data.add(bryan, RDF.TYPE, person); + + m_repo.add(new AddOp(data)); + + m_repo.doClosure(); + + m_repo.setTruthMaintenance(true); + + } + + { // batch 2 + + m_repo.setTruthMaintenance(false); + + final Graph data = new GraphImpl(); + data.add(systap, RDF.TYPE, company); + + m_repo.add(new AddOp(data)); + + m_repo.doClosure(); + + m_repo.setTruthMaintenance(true); + + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-03-07 19:20:51
|
Revision: 7918 http://sourceforge.net/p/bigdata/code/7918 Author: tobycraig Date: 2014-03-07 19:20:47 +0000 (Fri, 07 Mar 2014) Log Message: ----------- #840 - Incremental truth maintenance servlet. Not yet fully working/tested. doClosure causes a hang after the first run. If truth maintenance is not configured, toggle should probably provide a response other than a 500. Modified Paths: -------------- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java Added Paths: ----------- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/InferenceServlet.java Added: branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/InferenceServlet.java =================================================================== --- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/InferenceServlet.java (rev 0) +++ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/InferenceServlet.java 2014-03-07 19:20:47 UTC (rev 7918) @@ -0,0 +1,128 @@ +/** +Copyright (C) SYSTAP, LLC 2006-2014. All rights reserved. + +Contact: + SYSTAP, LLC + 4501 Tower Road + Greensboro, NC 27410 + lic...@bi... + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +package com.bigdata.rdf.sail.webapp; + +import java.io.IOException; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; + +import com.bigdata.rdf.sail.BigdataSail.BigdataSailConnection; +import com.bigdata.rdf.sail.BigdataSailRepositoryConnection; + +/** + * Incremental truth maintenance servlet. Turns incremental truth maintenance + * on and off, and allows database at once closure. + * + * @see <a href="http://trac.bigdata.com/ticket/840">ticket</a> + * + * @author tobycraig + */ +public class InferenceServlet extends BigdataRDFServlet { + + /** + * + */ + private static final long serialVersionUID = 1L; + + static private final transient Logger log = Logger.getLogger(MultiTenancyServlet.class); + + /** + * Set to true or false, this parameter indicates the state that incremental + * truth maintenance should be set to. + */ + private static final String TOGGLE = "toggle"; + + /** + * If present, compute closure. + */ + private static final String DO_CLOSURE= "doClosure"; + + public InferenceServlet() { + + } + + /** + * Handle incremental truth maintenance. + */ + @Override + protected void doPost(final HttpServletRequest req, + final HttpServletResponse resp) throws IOException { + + final boolean toggle = req.getParameter(TOGGLE) != null; + final boolean doClosure= req.getParameter(DO_CLOSURE) != null; + + if(toggle) { + doToggle(req, resp); + } + + if(doClosure) { + doClosure(req, resp); + } + } + + /* + * Set incremental truth maintenance according to request + */ + private void doToggle(final HttpServletRequest req, + final HttpServletResponse resp) throws IOException { + + final String toggle = req.getParameter(TOGGLE); + final String namespace = getNamespace(req); + try { + BigdataSailRepositoryConnection conn = getBigdataRDFContext() + .getUnisolatedConnection(namespace); + BigdataSailConnection sailConn = conn.getSailConnection(); + + if(toggle.equals("true")) { + sailConn.setTruthMaintenance(true); + } else if(toggle.equals("false")) { + sailConn.setTruthMaintenance(false); + } + } catch (Exception e) { + throw new RuntimeException(); + } + + } + + /* + * Set off database at once closure. + */ + private void doClosure(final HttpServletRequest req, + final HttpServletResponse resp) throws IOException { + + final String namespace = getNamespace(req); + try { + BigdataSailRepositoryConnection conn = getBigdataRDFContext() + .getUnisolatedConnection(namespace); + BigdataSailConnection sailConn = conn.getSailConnection(); + sailConn.computeClosure(); + } catch (Exception e) { + throw new RuntimeException(); + } + + } + +} Property changes on: branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/InferenceServlet.java ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Date Revision Author HeadURL \ No newline at end of property Modified: branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java =================================================================== --- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java 2014-03-07 17:42:40 UTC (rev 7917) +++ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java 2014-03-07 19:20:47 UTC (rev 7918) @@ -652,6 +652,10 @@ context.addServlet(new ServletHolder(new MultiTenancyServlet()), "/namespace/*"); + // Incremental truth maintenance + context.addServlet(new ServletHolder(new InferenceServlet()), + "/inference"); + /** * Note: JSP pages for the servlet 2.5 specification add the following * dependencies: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2014-03-07 17:42:46
|
Revision: 7917 http://sourceforge.net/p/bigdata/code/7917 Author: martyncutcher Date: 2014-03-07 17:42:40 +0000 (Fri, 07 Mar 2014) Log Message: ----------- merge main branch and add initial HA1 and HA5 tests Modified Paths: -------------- branches/MGC_1_3_0/.classpath branches/MGC_1_3_0/bigdata/src/java/com/bigdata/btree/Node.java branches/MGC_1_3_0/bigdata/src/java/com/bigdata/journal/CommitCounterUtility.java branches/MGC_1_3_0/bigdata/src/java/com/bigdata/search/FullTextIndex.java branches/MGC_1_3_0/bigdata/src/test/com/bigdata/journal/TestCommitCounterUtility.java branches/MGC_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HARestore.java branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHAJournalServerTestCase.java branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA3ChangeLeader.java branches/MGC_1_3_0/bigdata-perf/bsbm3/build.properties branches/MGC_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/BigdataValueCentricFullTextIndex.java branches/MGC_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/cache/DescribeBindingsCollector.java branches/MGC_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/cache/DescribeCacheUpdater.java branches/MGC_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/ASTEvalHelper.java branches/MGC_1_3_0/build.properties branches/MGC_1_3_0/build.xml branches/MGC_1_3_0/src/resources/HAJournal/HAJournal.config Added Paths: ----------- branches/MGC_1_3_0/EMC/ branches/MGC_1_3_0/EMC/bigdata/ branches/MGC_1_3_0/EMC/bigdata/sample/ branches/MGC_1_3_0/EMC/bigdata/sample/BloatTest.java branches/MGC_1_3_0/EMC/history retention.txt branches/MGC_1_3_0/EMC/zero retention.txt branches/MGC_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/NoSnapshotException.java branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA5JournalServerTestCase.java branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-D.config branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-E.config branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA1JournalServer.java branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/TestHA5JournalServer.java branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-D.properties branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/log4j-template-E.properties branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/zkClient1.config branches/MGC_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/zkClient5.config Modified: branches/MGC_1_3_0/.classpath =================================================================== --- branches/MGC_1_3_0/.classpath 2014-03-06 22:38:54 UTC (rev 7916) +++ branches/MGC_1_3_0/.classpath 2014-03-07 17:42:40 UTC (rev 7917) @@ -31,6 +31,7 @@ <classpathentry kind="src" path="bigdata-gom/src/samples"/> <classpathentry kind="src" path="bigdata-gas/src/java"/> <classpathentry kind="src" path="bigdata-gas/src/test"/> + <classpathentry kind="src" path="EMC"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/dsi-utils-1.0.6-020610.jar"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/lgpl-utils-1.0.6-020610.jar"/> <classpathentry kind="lib" path="bigdata-jini/lib/apache/zookeeper-3.3.3.jar"/> Added: branches/MGC_1_3_0/EMC/bigdata/sample/BloatTest.java =================================================================== --- branches/MGC_1_3_0/EMC/bigdata/sample/BloatTest.java (rev 0) +++ branches/MGC_1_3_0/EMC/bigdata/sample/BloatTest.java 2014-03-07 17:42:40 UTC (rev 7917) @@ -0,0 +1,195 @@ + +package bigdata.sample; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import junit.framework.TestCase; + +import org.openrdf.model.Literal; +import org.openrdf.model.URI; +import org.openrdf.model.ValueFactory; +import org.openrdf.repository.Repository; +import org.openrdf.repository.RepositoryConnection; +import org.openrdf.repository.RepositoryException; + +import com.bigdata.journal.DumpJournal; +import com.bigdata.journal.Journal; +import com.bigdata.journal.RWStrategy; +import com.bigdata.rdf.sail.BigdataSail; +import com.bigdata.rdf.sail.BigdataSailRepository; +import com.bigdata.rdf.store.AbstractTripleStore; +import com.bigdata.rwstore.RWStore; + +public class BloatTest extends TestCase { + + private static final int NUM_LOOPS = 40; + private static final int NUM_ITEMS = 10000; + private static final int NUM_STATIC_STATEMENTS = 13; + private static final long SLEEP_MILLIS = 10; // was 1000, but no need to sleep when testing journal commitsS + + public void test() throws RepositoryException, InterruptedException, IOException { + final File jnlFile = new File("/volumes/NonSSD/bigdata/emc/bloat.jnl"); + + if (jnlFile.exists()) { + jnlFile.delete(); + } + + Properties props = new Properties(); + props.setProperty("com.bigdata.rdf.sail.namespace", "topology.kb"); + props.setProperty("com.bigdata.journal.AbstractJournal.bufferMode", "DiskRW"); + props.setProperty("com.bigdata.btree.writeRetentionQueue.capacity", "4000"); + props.setProperty("com.bigdata.btree.BTree.branchingFactor", "128"); + props.setProperty("com.bigdata.service.AbstractTransactionService.minReleaseAge", "1"); // set to zero to avoid mess with history + props.setProperty("com.bigdata.rdf.store.AbstractTripleStore.textIndex", "false"); + props.setProperty( + "com.bigdata.rdf.rules.InferenceEngine.forwardChainOwlTransitiveProperty", "false"); + props.setProperty("com.bigdata.rdf.rules.InferenceEngine.forwardChainOwlSameAsClosure", + "false"); + props.setProperty("com.bigdata.rdf.rules.InferenceEngine.forwardChainOwlSameAsProperties", + "false"); + props.setProperty("com.bigdata.rdf.rules.InferenceEngine.forwardChainOwlInverseOf", "false"); + props.setProperty("com.bigdata.rdf.rules.InferenceEngine.forwardChainOwlEquivalentClass", + "false"); + props.setProperty( + "com.bigdata.rdf.rules.InferenceEngine.forwardChainOwlEquivalentProperty", "false"); + props.setProperty("com.bigdata.rdf.rules.InferenceEngine.forwardChainOwlHasValue", "false"); + props.setProperty("com.bigdata.rdf.rules.InferenceEngine.forwardChainRdfTypeRdfsResource", + "false"); + props.setProperty("com.bigdata.rdf.store.AbstractTripleStore.axiomsClass", + "com.bigdata.rdf.axioms.NoAxioms"); + props.setProperty("com.bigdata.rdf.sail.truthMaintenance", "false"); + props.setProperty("com.bigdata.rdf.store.AbstractTripleStore.justify", "false"); + props.setProperty("com.bigdata.rdf.store.AbstractTripleStore.statementIdentifiers", "false"); + props.setProperty("com.bigdata.rdf.store.AbstractTripleStore.quadsMode", "true"); + props.setProperty("com.bigdata.journal.AbstractJournal.maximumExtent", "209715200"); + props.setProperty("com.bigdata.service.IBigdataClient.collectPlatformStatistics", "false"); + props.setProperty("com.bigdata.service.IBigdataClient.httpdPort", "-1"); + // props.setProperty("com.bigdata.rdf.sail.bufferCapacity", "100000"); + props.setProperty("com.bigdata.rdf.sail.bufferCapacity", "100000"); + props.setProperty("com.bigdata.rdf.store.AbstractTripleStore.bloomFilter", "false"); + + props.setProperty(BigdataSail.Options.CREATE_TEMP_FILE, Boolean.FALSE.toString()); + props.setProperty(BigdataSail.Options.FILE, jnlFile.toString()); + + BigdataSail sail = new BigdataSail(props); + Repository repo = new BigdataSailRepository(sail); + repo.initialize(); + + final AbstractTripleStore store = sail.getDatabase(); + final Journal jrnl = ((Journal) store.getIndexManager()); + final RWStrategy rwstrat = (RWStrategy) jrnl.getBufferStrategy(); + final RWStore rw = rwstrat.getStore(); + + { + final StringBuilder sb = new StringBuilder(); + sb.append(storeStats(rw)); + //rw.showAllocators(sb); + + System.err.println(sb.toString()); + + } + + long prevBytes = 0; + for (int loop = 0; loop < NUM_LOOPS; ++loop) { + RepositoryConnection conn = repo.getConnection(); + conn.setAutoCommit(false); + + if (loop == 0) { + applyInitialStatements(conn); + } else { + applyChurningStatements(conn); + } + + long currBytes = jnlFile.length(); + if (currBytes > prevBytes) { + System.err.println("Loop " + loop + " journal file is " + currBytes + + " bytes <------ JUMP!"); + + prevBytes = currBytes; + } + conn.commit(); + conn.close(); + + if (loop % 20 == 0) { + System.out.println("Loop " + loop + " journal file is " + currBytes + " bytes"); + final StringBuilder sb = new StringBuilder(); + sb.append(storeStats(rw)); + // rw.showAllocators(sb); + + System.err.println(sb.toString()); + + // dumpJournal(loop, 128, jrnl); + } + + Thread.sleep(SLEEP_MILLIS); + } + + { + final StringBuilder sb = new StringBuilder(); + sb.append(storeStats(rw)); + rw.showAllocators(sb); + + System.err.println(sb.toString()); + // dumpJournal(NUM_LOOPS, 128, jrnl); + } + + } + + private String storeStats(final RWStore rw) { + final long allocs = rw.getTotalAllocations(); + final long frees = rw.getTotalFrees(); + + return "RW allocations: " + allocs + ", frees: " + frees + ", net: " + (allocs-frees) + "\n"; + } + + private void applyInitialStatements(RepositoryConnection conn) throws RepositoryException { + System.out.println("Applying initial statements"); + ValueFactory vf = conn.getValueFactory(); + for (int item = 0; item < NUM_ITEMS; ++item) { + URI c = vf.createURI("context:item" + item); + URI s = vf.createURI("subject:item" + item); + for (int x = 0; x < NUM_STATIC_STATEMENTS; ++x) { + URI p = vf.createURI("predicate:" + x); + Literal o = vf.createLiteral("SomeValue"); + conn.add(s, p, o, c); + } + } + } + + private void applyChurningStatements(RepositoryConnection conn) throws RepositoryException { + ValueFactory vf = conn.getValueFactory(); + for (int item = 0; item < NUM_ITEMS; ++item) { + URI s = vf.createURI("context:item" + item); + URI p = vf.createURI("predicate:lastUpdateTime"); + conn.remove(s, p, null); + conn.add(s, p, vf.createLiteral(System.currentTimeMillis())); + } + + } + + private void dumpJournal(final int loop, final int bf, final Journal journal) throws IOException { + final File file = new File("/volumes/NonSSD/bigdata/emc/dumpJournal_loop_" + loop + "_bf_" + bf + ".txt"); + + final PrintWriter writer = new PrintWriter(new FileWriter(file)); + + final List<String> nsList = new ArrayList<String>(); + + nsList.add("topology.kb"); + + final DumpJournal dumpJournal = new DumpJournal(journal); + + dumpJournal.dumpJournal(writer, nsList, false, true, true, false); + + writer.close(); + + System.err.println("DumpJournal written to " + file.getAbsolutePath()); + + + } +} Added: branches/MGC_1_3_0/EMC/history retention.txt =================================================================== --- branches/MGC_1_3_0/EMC/history retention.txt (rev 0) +++ branches/MGC_1_3_0/EMC/history retention.txt 2014-03-07 17:42:40 UTC (rev 7917) @@ -0,0 +1,307 @@ + +BIGDATA(R) + + Flexible + Reliable + Affordable + Web-Scale Computing for the Enterprise + +Copyright SYSTAP, LLC 2006-2013. All rights reserved. + +192.168.0.4 +Tue Feb 25 10:30:24 GMT 2014 +Mac OS X/10.9 x86_64 +Mac OS X 10.9 x86_64 #CPU=8 +Oracle Corporation 1.7.0_11 +freeMemory=9734656 +buildVersion=1.3.0 + +Dependency License +ICU http://source.icu-project.org/repos/icu/icu/trunk/license.html +bigdata-ganglia http://www.apache.org/licenses/LICENSE-2.0.html +colt http://acs.lbl.gov/software/colt/license.html +commons-codec http://www.apache.org/licenses/LICENSE-2.0.html +commons-fileupload http://www.apache.org/licenses/LICENSE-2.0.html +commons-io http://www.apache.org/licenses/LICENSE-2.0.html +commons-logging http://www.apache.org/licenses/LICENSE-2.0.html +dsiutils http://www.gnu.org/licenses/lgpl-2.1.html +fastutil http://www.apache.org/licenses/LICENSE-2.0.html +flot http://www.opensource.org/licenses/mit-license.php +high-scale-lib http://creativecommons.org/licenses/publicdomain +httpclient http://www.apache.org/licenses/LICENSE-2.0.html +httpclient-cache http://www.apache.org/licenses/LICENSE-2.0.html +httpcore http://www.apache.org/licenses/LICENSE-2.0.html +httpmime http://www.apache.org/licenses/LICENSE-2.0.html +jetty http://www.apache.org/licenses/LICENSE-2.0.html +jquery https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt +log4j http://www.apache.org/licenses/LICENSE-2.0.html +lucene http://www.apache.org/licenses/LICENSE-2.0.html +nanohttp http://elonen.iki.fi/code/nanohttpd/#license +nxparser http://sw.deri.org/2006/08/nxparser/license.txt +river http://www.apache.org/licenses/LICENSE-2.0.html +servlet-api http://www.apache.org/licenses/LICENSE-2.0.html +sesame http://www.openrdf.org/download.jsp +slf4j http://www.slf4j.org/license.html +zookeeper http://www.apache.org/licenses/LICENSE-2.0.html + +INFO: com.bigdata.util.config.LogUtil: Configure: file:/Users/mgc/Eclipse/workspace/BIGDATA_ALLURA_1_3_0/bin/log4j.properties +WARN : 0 main info.aduna.lang.service.ServiceRegistry.<init>(ServiceRegistry.java:47): New service class org.openrdf.rio.rdfxml.RDFXMLParserFactory replaces existing service class com.bigdata.rdf.rio.rdfxml.BigdataRDFXMLParserFactory +WARN : 10 main info.aduna.lang.service.ServiceRegistry.<init>(ServiceRegistry.java:47): New service class org.openrdf.rio.rdfxml.RDFXMLWriterFactory replaces existing service class com.bigdata.rdf.rio.rdfxml.BigdataRDFXMLWriterFactory +allocations: 59, frees: 14, net: 45, commits: 1 + +------------------------- +RWStore Allocator Summary +------------------------- +AllocatorSize AllocatorCount SlotsAllocated %SlotsAllocated SlotsRecycled SlotChurn SlotsInUse %SlotsInUse MeanAllocation SlotsReserved %SlotsUnused BytesReserved BytesAppData %SlotWaste %AppData %StoreFile %TotalWaste %FileWaste +64 1 10 16.95 1 1.11 9 20.00 37 1024 99.12 65536 337 99.49 1.50 4.17 4.21 4.15 +128 1 1 1.69 0 1.00 1 2.22 81 512 99.80 65536 81 99.88 0.36 4.17 4.22 4.16 +192 1 2 3.39 0 1.00 2 4.44 161 1024 99.80 196608 323 99.84 1.44 12.50 12.66 12.48 +320 1 26 44.07 13 2.00 13 28.89 224 1024 98.73 327680 2964 99.10 13.19 20.83 20.94 20.64 +512 1 2 3.39 0 1.00 2 4.44 385 256 99.22 131072 770 99.41 3.43 8.33 8.40 8.28 +768 0 0 0.00 0 0.00 0 0.00 0 0 0.00 0 0 0.00 0.00 0.00 0.00 0.00 +1024 1 12 20.34 0 1.00 12 26.67 817 256 95.31 262144 9804 96.26 43.62 16.67 16.28 16.04 +2048 1 6 10.17 0 1.00 6 13.33 1366 256 97.66 524288 8198 98.44 36.47 33.33 33.29 32.81 +3072 0 0 0.00 0 0.00 0 0.00 0 0 0.00 0 0 0.00 0.00 0.00 0.00 0.00 +4096 0 0 0.00 0 0.00 0 0.00 0 0 0.00 0 0 0.00 0.00 0.00 0.00 0.00 +8192 0 0 0.00 0 0.00 0 0.00 0 0 0.00 0 0 0.00 0.00 0.00 0.00 0.00 + +------------------------- +BLOBS +------------------------- +Bucket(K) Allocations Allocated Deletes Deleted Current Data Mean Churn +16 0 0 0 0 0 0 0 0.00 +32 0 0 0 0 0 0 0 0.00 +64 0 0 0 0 0 0 0 0.00 +128 0 0 0 0 0 0 0 0.00 +256 0 0 0 0 0 0 0 0.00 +512 0 0 0 0 0 0 0 0.00 +1024 0 0 0 0 0 0 0 0.00 +2048 0 0 0 0 0 0 0 0.00 +4096 0 0 0 0 0 0 0 0.00 +8192 0 0 0 0 0 0 0 0.00 +16384 0 0 0 0 0 0 0 0.00 +32768 0 0 0 0 0 0 0 0.00 +65536 0 0 0 0 0 0 0 0.00 +2097151 0 0 0 0 0 0 0 0.00 + +Applying initial statements +Loop 0 journal file is 90177536 bytes <------ JUMP! +Loop 0 journal file is 90177536 bytes +allocations: 33058, frees: 16, net: 33042, commits: 2 + +------------------------- +RWStore Allocator Summary +------------------------- +AllocatorSize AllocatorCount SlotsAllocated %SlotsAllocated SlotsRecycled SlotChurn SlotsInUse %SlotsInUse MeanAllocation SlotsReserved %SlotsUnused BytesReserved BytesAppData %SlotWaste %AppData %StoreFile %TotalWaste %FileWaste +64 3 20010 60.53 1 1.00 20009 60.56 23 20480 2.30 1310720 478117 63.52 3.05 4.82 7.24 3.06 +128 1 4 0.01 0 1.00 4 0.01 89 512 99.22 65536 359 99.45 0.00 0.24 0.57 0.24 +192 1 3 0.01 0 1.00 3 0.01 151 1024 99.71 196608 455 99.77 0.00 0.72 1.71 0.72 +320 1 37 0.11 14 1.61 23 0.07 224 1024 97.75 327680 5344 98.37 0.03 1.20 2.80 1.19 +512 1 7 0.02 0 1.00 7 0.02 424 256 97.27 131072 2974 97.73 0.02 0.48 1.11 0.47 +768 1 2034 6.15 0 1.00 2034 6.16 608 2048 0.68 1572864 1237913 21.30 7.88 5.78 2.91 1.23 +1024 1 44 0.13 0 1.00 44 0.13 903 256 82.81 262144 39771 84.83 0.25 0.96 1.93 0.82 +2048 2 10900 32.97 1 1.00 10899 32.99 1274 11008 0.99 22544384 13891705 38.38 88.48 82.89 75.26 31.81 +3072 1 19 0.06 0 1.00 19 0.06 2295 256 92.58 786432 43616 94.45 0.28 2.89 6.46 2.73 +4096 0 0 0.00 0 0.00 0 0.00 0 0 0.00 0 0 0.00 0.00 0.00 0.00 0.00 +8192 0 0 0.00 0 0.00 0 0.00 0 0 0.00 0 0 0.00 0.00 0.00 0.00 0.00 + +------------------------- +BLOBS +------------------------- +Bucket(K) Allocations Allocated Deletes Deleted Current Data Mean Churn +16 0 0 0 0 0 0 0 0.00 +32 0 0 0 0 0 0 0 0.00 +64 0 0 0 0 0 0 0 0.00 +128 0 0 0 0 0 0 0 0.00 +256 0 0 0 0 0 0 0 0.00 +512 0 0 0 0 0 0 0 0.00 +1024 0 0 0 0 0 0 0 0.00 +2048 0 0 0 0 0 0 0 0.00 +4096 0 0 0 0 0 0 0 0.00 +8192 0 0 0 0 0 0 0 0.00 +16384 0 0 0 0 0 0 0 0.00 +32768 0 0 0 0 0 0 0 0.00 +65536 0 0 0 0 0 0 0 0.00 +2097151 0 0 0 0 0 0 0 0.00 + +Loop 20 journal file is 90177536 bytes +allocations: 128582, frees: 80142, net: 48440, commits: 22 + +------------------------- +RWStore Allocator Summary +------------------------- +AllocatorSize AllocatorCount SlotsAllocated %SlotsAllocated SlotsRecycled SlotChurn SlotsInUse %SlotsInUse MeanAllocation SlotsReserved %SlotsUnused BytesReserved BytesAppData %SlotWaste %AppData %StoreFile %TotalWaste %FileWaste +64 3 20032 15.58 27 1.00 20005 41.30 23 20480 2.32 1310720 478225 63.51 1.21 1.90 2.84 1.21 +128 1 25 0.02 20 5.00 5 0.01 97 512 99.02 65536 539 99.18 0.00 0.10 0.22 0.09 +192 1 4 0.00 1 1.33 3 0.01 146 1024 99.71 196608 441 99.78 0.00 0.29 0.67 0.28 +320 1 220 0.17 190 7.33 30 0.06 224 1024 97.07 327680 9716 97.03 0.02 0.48 1.08 0.46 +512 1 87 0.07 54 2.64 33 0.07 430 256 87.11 131072 14277 89.11 0.04 0.19 0.40 0.17 +768 1 5138 4.00 72 1.01 5066 10.46 650 5120 1.05 3932160 3293934 16.23 8.33 5.71 2.18 0.93 +1024 1 132 0.10 36 1.38 96 0.20 863 256 62.50 262144 82883 68.38 0.21 0.38 0.61 0.26 +2048 4 102701 79.87 79544 4.43 23157 47.81 1462 28672 19.23 58720256 35537604 39.48 89.83 85.25 79.08 33.66 +3072 1 155 0.12 120 4.43 35 0.07 2490 256 86.33 786432 91066 88.42 0.23 1.14 2.37 1.01 +4096 1 48 0.04 42 8.00 6 0.01 3334 256 97.66 1048576 20462 98.05 0.05 1.52 3.51 1.49 +8192 1 40 0.03 36 10.00 4 0.01 8192 256 98.44 2097152 32912 98.43 0.08 3.04 7.04 3.00 + +------------------------- +BLOBS +------------------------- +Bucket(K) Allocations Allocated Deletes Deleted Current Data Mean Churn +16 0 0 0 0 0 0 0 0.00 +32 0 0 18 320052 -18 -320052 0 0.00 +64 0 0 0 0 0 0 0 0.00 +128 0 0 0 0 0 0 0 0.00 +256 0 0 0 0 0 0 0 0.00 +512 0 0 0 0 0 0 0 0.00 +1024 0 0 0 0 0 0 0 0.00 +2048 0 0 0 0 0 0 0 0.00 +4096 0 0 0 0 0 0 0 0.00 +8192 0 0 0 0 0 0 0 0.00 +16384 0 0 0 0 0 0 0 0.00 +32768 0 0 0 0 0 0 0 0.00 +65536 0 0 0 0 0 0 0 0.00 +2097151 0 0 0 0 0 0 0 0.00 + +Loop 40 journal file is 90177536 bytes +allocations: 224082, frees: 169482, net: 54600, commits: 42 + +------------------------- +RWStore Allocator Summary +------------------------- +AllocatorSize AllocatorCount SlotsAllocated %SlotsAllocated SlotsRecycled SlotChurn SlotsInUse %SlotsInUse MeanAllocation SlotsReserved %SlotsUnused BytesReserved BytesAppData %SlotWaste %AppData %StoreFile %TotalWaste %FileWaste +64 3 20052 8.95 47 1.00 20005 36.64 23 20480 2.32 1310720 478225 63.51 1.00 1.53 2.18 0.97 +128 1 45 0.02 40 9.00 5 0.01 97 512 99.02 65536 567 99.13 0.00 0.08 0.17 0.08 +192 1 4 0.00 1 1.33 3 0.01 146 1024 99.71 196608 441 99.78 0.00 0.23 0.51 0.23 +320 1 400 0.18 370 13.33 30 0.05 224 1024 97.07 327680 12516 96.18 0.03 0.38 0.82 0.37 +512 1 167 0.07 114 3.15 53 0.10 431 256 79.30 131072 22937 82.50 0.05 0.15 0.28 0.13 +768 2 8288 3.70 152 1.02 8136 14.90 660 8192 0.68 6291456 5377105 14.53 11.27 7.32 2.39 1.06 +1024 1 170 0.08 75 1.79 95 0.17 863 256 62.89 262144 82050 68.70 0.17 0.31 0.47 0.21 +2048 5 194506 86.80 168278 7.42 26228 48.04 1473 35840 26.82 73400320 41591889 43.34 87.18 85.43 83.25 37.02 +3072 1 275 0.12 242 8.33 33 0.06 2478 256 87.11 786432 83201 89.42 0.17 0.92 1.84 0.82 +4096 1 95 0.04 87 11.88 8 0.01 3337 256 96.88 1048576 27327 97.39 0.06 1.22 2.67 1.19 +8192 1 80 0.04 76 20.00 4 0.01 8192 256 98.44 2097152 33072 98.42 0.07 2.44 5.40 2.40 + +------------------------- +BLOBS +------------------------- +Bucket(K) Allocations Allocated Deletes Deleted Current Data Mean Churn +16 0 0 0 0 0 0 0 0.00 +32 0 0 38 677012 -38 -677012 0 0.00 +64 0 0 0 0 0 0 0 0.00 +128 0 0 0 0 0 0 0 0.00 +256 0 0 0 0 0 0 0 0.00 +512 0 0 0 0 0 0 0 0.00 +1024 0 0 0 0 0 0 0 0.00 +2048 0 0 0 0 0 0 0 0.00 +4096 0 0 0 0 0 0 0 0.00 +8192 0 0 0 0 0 0 0 0.00 +16384 0 0 0 0 0 0 0 0.00 +32768 0 0 0 0 0 0 0 0.00 +65536 0 0 0 0 0 0 0 0.00 +2097151 0 0 0 0 0 0 0 0.00 + +Loop 60 journal file is 90177536 bytes +allocations: 319582, frees: 258822, net: 60760, commits: 62 + +------------------------- +RWStore Allocator Summary +------------------------- +AllocatorSize AllocatorCount SlotsAllocated %SlotsAllocated SlotsRecycled SlotChurn SlotsInUse %SlotsInUse MeanAllocation SlotsReserved %SlotsUnused BytesReserved BytesAppData %SlotWaste %AppData %StoreFile %TotalWaste %FileWaste +64 3 20072 6.28 67 1.00 20005 32.92 23 20480 2.32 1310720 478225 63.51 0.86 1.48 2.52 0.94 +128 1 65 0.02 60 13.00 5 0.01 98 512 99.02 65536 598 99.09 0.00 0.07 0.20 0.07 +192 1 4 0.00 1 1.33 3 0.00 146 1024 99.71 196608 441 99.78 0.00 0.22 0.59 0.22 +320 1 580 0.18 550 19.33 30 0.05 224 1024 97.07 327680 15316 95.33 0.03 0.37 0.95 0.35 +512 1 247 0.08 174 3.38 73 0.12 431 256 71.48 131072 31597 75.89 0.06 0.15 0.30 0.11 +768 2 11438 3.58 232 1.02 11206 18.44 664 11264 0.51 8650752 7451419 13.86 13.47 9.80 3.64 1.36 +1024 1 210 0.07 114 2.19 96 0.16 864 256 62.50 262144 83109 68.30 0.15 0.30 0.54 0.20 +2048 5 286324 89.59 257025 9.77 29299 48.22 1477 35840 18.25 73400320 47100812 35.83 85.18 83.15 79.75 29.79 +3072 1 383 0.12 350 11.61 33 0.05 2476 256 87.11 786432 82989 89.45 0.15 0.89 2.13 0.80 +4096 1 139 0.04 133 23.17 6 0.01 3336 256 97.66 1048576 20585 98.04 0.04 1.19 3.12 1.16 +8192 1 120 0.04 116 30.00 4 0.01 8192 256 98.44 2097152 33232 98.42 0.06 2.38 6.26 2.34 + +------------------------- +BLOBS +------------------------- +Bucket(K) Allocations Allocated Deletes Deleted Current Data Mean Churn +16 0 0 0 0 0 0 0 0.00 +32 0 0 58 1033972 -58 -1033972 0 0.00 +64 0 0 0 0 0 0 0 0.00 +128 0 0 0 0 0 0 0 0.00 +256 0 0 0 0 0 0 0 0.00 +512 0 0 0 0 0 0 0 0.00 +1024 0 0 0 0 0 0 0 0.00 +2048 0 0 0 0 0 0 0 0.00 +4096 0 0 0 0 0 0 0 0.00 +8192 0 0 0 0 0 0 0 0.00 +16384 0 0 0 0 0 0 0 0.00 +32768 0 0 0 0 0 0 0 0.00 +65536 0 0 0 0 0 0 0 0.00 +2097151 0 0 0 0 0 0 0 0.00 + +Loop 72 journal file is 177799168 bytes <------ JUMP! +Loop 80 journal file is 177799168 bytes +allocations: 415082, frees: 348162, net: 66920, commits: 82 + +------------------------- +RWStore Allocator Summary +------------------------- +AllocatorSize AllocatorCount SlotsAllocated %SlotsAllocated SlotsRecycled SlotChurn SlotsInUse %SlotsInUse MeanAllocation SlotsReserved %SlotsUnused BytesReserved BytesAppData %SlotWaste %AppData %StoreFile %TotalWaste %FileWaste +64 3 20092 4.84 87 1.00 20005 29.89 23 20480 2.32 1310720 478225 63.51 0.76 1.24 1.95 0.79 +128 1 85 0.02 80 17.00 5 0.01 98 512 99.02 65536 614 99.06 0.00 0.06 0.15 0.06 +192 1 4 0.00 1 1.33 3 0.00 146 1024 99.71 196608 441 99.78 0.00 0.19 0.46 0.19 +320 1 760 0.18 730 25.33 30 0.04 224 1024 97.07 327680 18116 94.47 0.03 0.31 0.73 0.29 +512 1 327 0.08 234 3.52 93 0.14 431 256 63.67 131072 40257 69.29 0.06 0.12 0.21 0.09 +768 2 14588 3.51 312 1.02 14276 21.33 666 14336 0.42 11010048 9519526 13.54 15.20 10.45 3.49 1.42 +1024 1 249 0.06 153 2.59 96 0.14 864 256 62.50 262144 83127 68.29 0.13 0.25 0.42 0.17 +2048 6 378147 91.10 345777 11.68 32370 48.37 1479 43008 24.73 88080384 52363294 40.55 83.60 83.63 83.69 33.91 +3072 1 482 0.12 450 15.06 32 0.05 2474 256 87.50 786432 79509 89.89 0.13 0.75 1.66 0.67 +4096 1 188 0.05 182 31.33 6 0.01 3333 256 97.66 1048576 20184 98.08 0.03 1.00 2.41 0.98 +8192 1 160 0.04 156 40.00 4 0.01 8192 256 98.44 2097152 33392 98.41 0.05 1.99 4.84 1.96 + +------------------------- +BLOBS +------------------------- +Bucket(K) Allocations Allocated Deletes Deleted Current Data Mean Churn +16 0 0 0 0 0 0 0 0.00 +32 0 0 78 1390932 -78 -1390932 0 0.00 +64 0 0 0 0 0 0 0 0.00 +128 0 0 0 0 0 0 0 0.00 +256 0 0 0 0 0 0 0 0.00 +512 0 0 0 0 0 0 0 0.00 +1024 0 0 0 0 0 0 0 0.00 +2048 0 0 0 0 0 0 0 0.00 +4096 0 0 0 0 0 0 0 0.00 +8192 0 0 0 0 0 0 0 0.00 +16384 0 0 0 0 0 0 0 0.00 +32768 0 0 0 0 0 0 0 0.00 +65536 0 0 0 0 0 0 0 0.00 +2097151 0 0 0 0 0 0 0 0.00 + +allocations: 505806, frees: 433035, net: 72771, commits: 101 + +------------------------- +RWStore Allocator Summary +------------------------- +AllocatorSize AllocatorCount SlotsAllocated %SlotsAllocated SlotsRecycled SlotChurn SlotsInUse %SlotsInUse MeanAllocation SlotsReserved %SlotsUnused BytesReserved BytesAppData %SlotWaste %AppData %StoreFile %TotalWaste %FileWaste +64 3 20111 3.98 106 1.01 20005 27.49 23 20480 2.32 1310720 478225 63.51 0.69 1.22 2.18 0.77 +128 1 104 0.02 99 20.80 5 0.01 98 512 99.02 65536 628 99.04 0.00 0.06 0.17 0.06 +192 1 4 0.00 1 1.33 3 0.00 146 1024 99.71 196608 441 99.78 0.00 0.18 0.51 0.18 +320 1 931 0.18 901 31.03 30 0.04 224 1024 97.07 327680 20776 93.66 0.03 0.30 0.80 0.29 +512 1 403 0.08 291 3.60 112 0.15 431 256 56.25 131072 48484 63.01 0.07 0.12 0.22 0.08 +768 3 17579 3.48 388 1.02 17191 23.62 667 17408 1.25 13369344 11484364 14.10 16.53 12.42 4.94 1.75 +1024 1 286 0.06 189 2.95 97 0.13 864 256 62.11 262144 83877 68.00 0.12 0.24 0.47 0.17 +2048 6 465382 92.01 430096 13.19 35286 48.49 1480 43008 17.95 88080384 57230575 35.02 82.37 81.80 80.77 28.65 +3072 1 575 0.11 545 19.17 30 0.04 2475 256 88.28 786432 75336 90.42 0.11 0.73 1.86 0.66 +4096 1 233 0.05 225 29.13 8 0.01 3334 256 96.88 1048576 27015 97.42 0.04 0.97 2.67 0.95 +8192 1 198 0.04 194 49.50 4 0.01 8192 256 98.44 2097152 33544 98.40 0.05 1.95 5.40 1.92 + +Visited 0 tuples in 0ms +Visited 20016 tuples in 112ms +Visited 20016 tuples in 7ms +Visited 140000 tuples in 33ms +Visited 140000 tuples in 30ms +Visited 140000 tuples in 28ms +Visited 140000 tuples in 32ms +Visited 140000 tuples in 49ms +Visited 140000 tuples in 28ms +DumpJournal written to /volumes/NonSSD/bigdata/emc/dumpJournal_loop_100_bf_128.txt Added: branches/MGC_1_3_0/EMC/zero retention.txt =================================================================== --- branches/MGC_1_3_0/EMC/zero retention.txt (rev 0) +++ branches/MGC_1_3_0/EMC/zero retention.txt 2014-03-07 17:42:40 UTC (rev 7917) @@ -0,0 +1,114 @@ +allocations: 33068, frees: 36, net: 33032, commits: 2 +allocations: 34891, frees: 630, net: 34261, commits: 4 +allocations: 36606, frees: 1728, net: 34878, commits: 6 +allocations: 38322, frees: 2826, net: 35496, commits: 8 +allocations: 40037, frees: 3925, net: 36112, commits: 10 +allocations: 40895, frees: 4474, net: 36421, commits: 11 + + +This run maintained the connection, and showed no change, so creating and closing a connec n makes no difference + +allocations: 33068, frees: 36, net: 33032, commits: 2 +allocations: 34891, frees: 630, net: 34261, commits: 4 +allocations: 36606, frees: 1728, net: 34878, commits: 6 +allocations: 40037, frees: 3925, net: 36112, commits: 10 +allocations: 40895, frees: 4474, net: 36421, commits: 11 + + +Loop 2 journal file is 90177536 bytes +RW allocations: 34891, frees: 630, net: 34261, commits: 4, BTree recycles: 622, allocations: 34804 (34182) + +------------------------- +RWStore Allocator Summary +------------------------- +AllocatorSize AllocatorCount SlotsAllocated %SlotsAllocated SlotsRecycled SlotChurn SlotsInUse %SlotsInUse MeanAllocation SlotsReserved %SlotsUnused BytesReserved BytesAppData %SlotWaste %AppData %StoreFile %TotalWaste %FileWaste +64 3 20012 57.36 9 1.00 20003 58.38 23 20480 2.33 1310720 477936 63.54 2.69 4.18 6.10 2.65 +128 1 8 0.02 5 2.67 3 0.01 103 512 99.41 65536 347 99.47 0.00 0.21 0.48 0.21 +192 1 2 0.01 0 1.00 2 0.01 161 1024 99.80 196608 323 99.84 0.00 0.63 1.44 0.63 +320 1 57 0.16 44 4.38 13 0.04 224 1024 98.73 327680 3496 98.93 0.02 1.04 2.37 1.03 +512 1 9 0.03 3 1.50 6 0.02 397 256 97.66 131072 2240 98.29 0.01 0.42 0.94 0.41 +768 1 2049 5.87 12 1.01 2037 5.95 608 2048 0.54 1572864 1239919 21.17 6.99 5.01 2.44 1.06 +1024 1 84 0.24 5 1.06 79 0.23 943 256 69.14 262144 74808 71.46 0.42 0.84 1.37 0.60 +2048 2 12389 35.51 507 1.04 11882 34.68 1302 12544 5.28 25690112 15307541 40.41 86.29 81.84 76.05 33.07 +3072 1 205 0.59 29 1.16 176 0.51 2307 256 31.25 786432 400890 49.02 2.26 2.51 2.82 1.23 +4096 1 76 0.22 16 1.27 60 0.18 3844 256 76.56 1048576 232770 77.80 1.31 3.34 5.98 2.60 +8192 0 0 0.00 0 0.00 0 0.00 0 0 0.00 0 0 0.00 0.00 0.00 0.00 0.00 + + +RW allocations: 40895, frees: 4474, net: 36421, commits: 11, BTree recycles: 4444, allocations: 40711 (36267) + +RW increase: 2160 vs BTree increase: 2079 + +RW allocations: 40037, frees: 3925, net: 36112, commits: 10, BTree recycles: 3899, allocations: 39875 (35976) +RW allocations: 40895, frees: 4474, net: 36421, commits: 11, BTree recycles: 4445, allocations: 40721 (36276) +RW Net: 309 +BTree Net: 300 + +So there is an amount not accounted for, but BTree is main culprit + +RW allocations: 34891, frees: 630, net: 34261, commits: 4, BTree recycles: 622, allocations: 34807, newNodes: 14803 +RW allocations: 36606, frees: 1728, net: 34878, commits: 6, BTree recycles: 1714 (1092), allocations: 36495 (1688), newNodes: 16493 (1690) +RW allocations: 38322, frees: 2826, net: 35496, commits: 8, BTree recycles: 2806 (1092), allocations: 38184 (1689), newNodes: 18185 (1692) + + +RW allocations: 38322, frees: 2826, net: 35496, commits: 8, BTree recycles: 2806, allocations: 38177, newNodes: 18181, rawDels: 0 +RW allocations: 40037, frees: 3925, net: 36112, commits: 10, BTree recycles: 3899, allocations: 39859, newNodes: 19867, rawDels: 0 +RW allocations: 40895, frees: 4474, net: 36421, commits: 11, BTree recycles: 4445, allocations: 40705, newNodes: 20712, rawDels: 0 + +So this looks odd. Looks like it never recycles? So where do the recycles come from? + +Called from replaceChildRef .. copyOnWrite ... nowhere ... [truncated message content] |
From: <tho...@us...> - 2014-03-06 22:38:59
|
Revision: 7916 http://sourceforge.net/p/bigdata/code/7916 Author: thompsonbry Date: 2014-03-06 22:38:54 +0000 (Thu, 06 Mar 2014) Log Message: ----------- Checkpoint in the RDR branch on a continued refactoring to support both the web.xml and jetty.xml based configuration of the HAJournalServer, the restructuring of the webapp, and forward movement to jetty 9.1. jetty 9.1 will give us the ability to transparently map http://localhost:8080 onto http://localhost:8080/bigdata (which we can probably accomplish anyway with jetty-rewrite). It will also provide us with a supportable basis for the ProxyServlet to support transparent load balancing. Finally, jetty 9.1 has a new IO layer and could potentially increase http performance - it is certainly the starting point for optimization at that layer. See #730 (Allow configuration of embedded NSS jetty server using jetty-web.xml) See #624 (Transparent proxy of requests for HA) Modified Paths: -------------- branches/RDR/.classpath branches/RDR/bigdata/src/java/com/bigdata/btree/BytesUtil.c branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java branches/RDR/bigdata-war/src/WEB-INF/web.xml branches/RDR/bigdata-war/src/html/index.html branches/RDR/bigdata-war/src/html/new.html branches/RDR/build.properties branches/RDR/build.xml 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/lib/jetty/jetty-rewrite-7.2.2.v20101205.jar branches/RDR/bigdata-war/src/html/css/ branches/RDR/bigdata-war/src/html/css/style.css branches/RDR/bigdata-war/src/html/images/ branches/RDR/bigdata-war/src/html/images/logo.png branches/RDR/bigdata-war/src/html/js/ branches/RDR/bigdata-war/src/html/js/vendor/ branches/RDR/bigdata-war/src/html/js/vendor/jquery.hotkeys.js branches/RDR/bigdata-war/src/html/js/vendor/jquery.min.js branches/RDR/bigdata-war/src/html/js/workbench.js branches/RDR/bigdata-war/src/jetty.xml Removed Paths: ------------- branches/RDR/bigdata-war/src/WEB-INF/jetty.xml branches/RDR/bigdata-war/src/html/jquery.hotkeys.js branches/RDR/bigdata-war/src/html/jquery.min.js branches/RDR/bigdata-war/src/html/logo.png branches/RDR/bigdata-war/src/html/style.css branches/RDR/bigdata-war/src/html/workbench.js branches/RDR/bigdata-war/src/images/ branches/RDR/bigdata-war/src/index.html branches/RDR/bigdata-war/src/jsp/ branches/RDR/bigdata-war/src/resources/ branches/RDR/bigdata-war/src/result-to-html.xsl Modified: branches/RDR/.classpath =================================================================== --- branches/RDR/.classpath 2014-03-05 18:18:32 UTC (rev 7915) +++ branches/RDR/.classpath 2014-03-06 22:38:54 UTC (rev 7916) @@ -67,6 +67,7 @@ <classpathentry exported="true" kind="lib" path="bigdata/lib/unimi/fastutil-5.1.5.jar"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/lucene/lucene-analyzers-3.0.0.jar"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/lucene/lucene-core-3.0.0.jar"/> + <classpathentry kind="lib" path="bigdata/lib/jetty/jetty-rewrite-7.2.2.v20101205.jar"/> <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/high-scale-lib-v1.1.2.jar"/> <classpathentry exported="true" kind="lib" path="bigdata/lib/junit-ext-1.1-b3-dev.jar"/> Added: branches/RDR/bigdata/lib/jetty/jetty-rewrite-7.2.2.v20101205.jar =================================================================== (Binary files differ) Index: branches/RDR/bigdata/lib/jetty/jetty-rewrite-7.2.2.v20101205.jar =================================================================== --- branches/RDR/bigdata/lib/jetty/jetty-rewrite-7.2.2.v20101205.jar 2014-03-05 18:18:32 UTC (rev 7915) +++ branches/RDR/bigdata/lib/jetty/jetty-rewrite-7.2.2.v20101205.jar 2014-03-06 22:38:54 UTC (rev 7916) Property changes on: branches/RDR/bigdata/lib/jetty/jetty-rewrite-7.2.2.v20101205.jar ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: branches/RDR/bigdata/src/java/com/bigdata/btree/BytesUtil.c =================================================================== --- branches/RDR/bigdata/src/java/com/bigdata/btree/BytesUtil.c 2014-03-05 18:18:32 UTC (rev 7915) +++ branches/RDR/bigdata/src/java/com/bigdata/btree/BytesUtil.c 2014-03-06 22:38:54 UTC (rev 7916) @@ -1,6 +1,6 @@ /** -Copyright (C) SYSTAP, LLC 2006-2007. All rights reserved. +Copyright (C) SYSTAP, LLC 2006-2014. All rights reserved. Contact: SYSTAP, LLC @@ -32,29 +32,60 @@ * Compile the Java class and then generate the C header file from that class. * From the bigdata directory, do: -javac src/java/com/bigdata/btree/BytesUtil.java +# Note: This approach no longer works as executed due to new imports that +# can not be trivially resolved by javac. +# +# cd bigdata +# javac src/java/com/bigdata/btree/BytesUtil.java +# javah -classpath src/java com.bigdata.btree.BytesUtil -javah -classpath src/java com.bigdata.btree.BytesUtil +# The easiest thing to do is "ant jar" first to generate the class files. +# Then you can do something like: +# +ant bundleJar # generate the class files, the jar, and colocate the dependency jars. +cd bigdata +javah -classpath ../ant-build/classes com.bigdata.btree.BytesUtil - * This places the .class file in the source directory and the .h files in the - * bigdata directory. - */ +This places the .h files in the bigdata directory. -/* Now compile the C file. You can compile this under linix as follows: - * +Now compile the C file. You can compile this under linux as follows: -set JAVA_HOME="/usr/java/j2sdk1.4.2_05" +## For linux. +export JAVA_HOME="/usr/java/jdk1.7.0_25" +export JAVA_INCLUDE=$JAVA_HOME/include +## For OSX +export JAVA_HOME=$(/usr/libexec/java_home) +export JAVA_INCLUDE=/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -export PATH=$PATH:/$JAVA_HOME/bin +# For both : put the java version on the command path. +export PATH=$JAVA_HOME/bin:$PATH +# For linux. +gcc -fPIC -g -I$JAVA_INCLUDE -I$JAVA_INCLUDE/linux -c src/java/com/bigdata/btree/BytesUtil.c +# +# For OSX +gcc -fPIC -g -I. -I$JAVA_INCLUDE -c src/java/com/bigdata/btree/BytesUtil.c + +# Works for linux/OSX. +gcc -shared -W1,-soname,libBytesUtil.so -o libBytesUtil.so BytesUtil.o -lc + +## At this point you have something like the following in the cwd: +# header files from javac. +# com_bigdata_btree_BytesUtil.h +# com_bigdata_btree_BytesUtil_UnsignedByteArrayComparator.h +# Compiled version of BytesUtil.c +# BytesUtil.o +# Shared library for BytesUtil.o +# libBytesUtil.so - shared library. + +# For both : specify the location of the shared libraries (once compiled). export LD_LIBRARY_PATH=. -gcc -fPIC -g -I$JAVA_HOME/include -I$JAVA_HOME/include/linux -c BytesUtil.c +# Execute the test program: +java -Dcom.bigdata.btree.BytesUtil.jni=true -classpath ../ant-build/classes:../ant-build/lib/log4j-1.2.17.jar com.bigdata.btree.BytesUtil -gcc -shared -W1,-soname,libBytesUtil.so -olibBytesUtil.so BytesUtil.o -lc +---- -java -classpath src/java com.bigdata.btree.BytesUtil - * On Win32, the following command builds a dynamic link library (DLL) * using the Microsoft Visual C++ compiler: Modified: branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java =================================================================== --- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java 2014-03-05 18:18:32 UTC (rev 7915) +++ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java 2014-03-06 22:38:54 UTC (rev 7916) @@ -171,7 +171,7 @@ * * @see #XSL_STYLESHEET */ - protected static final String DEFAULT_XSL_STYLESHEET = "result-to-html.xsl"; + protected static final String DEFAULT_XSL_STYLESHEET = "/bigdata/html/result-to-html.xsl"; /** * URL Query parameter used to request an incremental XHTML representation Modified: branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java =================================================================== --- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java 2014-03-05 18:18:32 UTC (rev 7915) +++ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java 2014-03-06 22:38:54 UTC (rev 7916) @@ -35,6 +35,7 @@ import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.ContextHandler; +import org.eclipse.jetty.server.handler.DefaultHandler; import org.eclipse.jetty.server.handler.HandlerList; import org.eclipse.jetty.server.handler.ResourceHandler; import org.eclipse.jetty.servlet.ServletContextHandler; @@ -354,17 +355,17 @@ // Force the use of the caller's IIndexManager. context.setAttribute(IIndexManager.class.getName(), indexManager); - final HandlerList handlers = new HandlerList(); - final ResourceHandler resourceHandler = new ResourceHandler(); setupStaticResources(NanoSparqlServer.class.getClassLoader(), resourceHandler); + final HandlerList handlers = new HandlerList(); + handlers.setHandlers(new Handler[] { - context,// - resourceHandler,// -// new DefaultHandler()// + context,// maps servlets + resourceHandler,// maps welcome files. + new DefaultHandler() // responsible for anything not explicitly served. }); server.setHandler(handlers); @@ -525,8 +526,6 @@ final ServletContextHandler context = getContextHandler(//server, initParams); - final HandlerList handlers = new HandlerList(); - final ResourceHandler resourceHandler = new ResourceHandler(); setupStaticResources(NanoSparqlServer.class.getClassLoader(), @@ -555,9 +554,12 @@ * Note: In order for this to work, it must also be supported in the * alternative newInstance() method above. */ + final HandlerList handlers = new HandlerList(); + handlers.setHandlers(new Handler[] {// - context,// - resourceHandler,// + context,// maps servlets + resourceHandler,// maps welcome files. + new DefaultHandler() // responsible for anything not explicitly served. }); server.setHandler(handlers); @@ -589,6 +591,9 @@ // | ServletContextHandler.NO_SESSIONS ); + // Path to the webapp. + context.setContextPath("/bigdata"); + // /* // * Setup resolution for the static web app resources (index.html). // */ @@ -723,8 +728,13 @@ final String webDir = indexHtml.substring(0, indexHtml.length() - file.length()); + // Path to the content in the local file system or JAR. context.setResourceBase(webDir); - + + /* + * Note: replace with "new.html" for the new UX. Also change in + * web.xml. + */ context.setWelcomeFiles(new String[]{"index.html"}); } @@ -756,7 +766,7 @@ /* * This is the resource path in the JAR. */ - final String WEB_DIR_JAR = "bigdata-war/src" + final String WEB_DIR_JAR = "bigdata-war/src/html" + (path == null ? "" : "/" + path); /* @@ -764,13 +774,13 @@ * * Note: You MUST have "bigdata-war/src" on the build path for the IDE. */ - final String WEB_DIR_IDE = path; // "html"; + final String WEB_DIR_IDE = "html/" + path; // "html"; URL url = classLoader.getResource(WEB_DIR_JAR); if (url == null && path != null) { - url = classLoader.getResource(path);// "html"); + url = classLoader.getResource(WEB_DIR_IDE);// "html"); } Deleted: branches/RDR/bigdata-war/src/WEB-INF/jetty.xml =================================================================== --- branches/RDR/bigdata-war/src/WEB-INF/jetty.xml 2014-03-05 18:18:32 UTC (rev 7915) +++ branches/RDR/bigdata-war/src/WEB-INF/jetty.xml 2014-03-06 22:38:54 UTC (rev 7916) @@ -1,60 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> -<!-- See http://www.eclipse.org/jetty/documentation/current/ --> -<!-- See http://wiki.eclipse.org/Jetty/Reference/jetty.xml_syntax --> -<Configure id="Server" class="org.eclipse.jetty.server.Server"> - - <!-- =========================================================== --> - <!-- Server Thread Pool --> - <!-- =========================================================== --> - <Set name="ThreadPool"> - <!-- Default queued blocking threadpool --> - <New class="org.eclipse.jetty.util.thread.QueuedThreadPool"> - <Set name="minThreads">10</Set> - <Set name="maxThreads">64</Set> - </New> - </Set> - - <!-- =========================================================== --> - <!-- Set connectors --> - <!-- =========================================================== --> - - <Call name="addConnector"> - <Arg> - <New class="org.eclipse.jetty.server.nio.SelectChannelConnector"> - <Set name="host"><SystemProperty name="jetty.host" /></Set> - <Set name="port"><SystemProperty name="jetty.port" default="8080"/></Set> - </New> - </Arg> - </Call> - - <!-- =========================================================== --> - <!-- Set handler Collection Structure --> - <!-- =========================================================== --> - <Set name="handler"> - <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection"> - <Set name="handlers"> - <Array type="org.eclipse.jetty.server.Handler"> - <Item> - <New id="WebAppContext" class="org.eclipse.jetty.webapp.WebAppContext"> - <!-- The location of the top-level of the bigdata webapp. --> - <Set name="resourceBase"> - <SystemProperty name="jetty.resourceBase" default="bigdata-war/src" /> - </Set> - <Set name="contextPath">/</Set> - <Set name="descriptor">WEB-INF/web.xml</Set> - <Set name="parentLoaderPriority">true</Set> - <Set name="extractWAR">false</Set> - <Set name="welcomeFiles"> - <Array type="java.lang.String"> - <Item>index.html</Item> - </Array> - </Set> - </New> - </Item> - </Array> - </Set> - </New> - </Set> - -</Configure> \ No newline at end of file Modified: branches/RDR/bigdata-war/src/WEB-INF/web.xml =================================================================== --- branches/RDR/bigdata-war/src/WEB-INF/web.xml 2014-03-05 18:18:32 UTC (rev 7915) +++ branches/RDR/bigdata-war/src/WEB-INF/web.xml 2014-03-06 22:38:54 UTC (rev 7916) @@ -83,6 +83,15 @@ <description>Performance counters.</description> <servlet-class>com.bigdata.rdf.sail.webapp.CountersServlet</servlet-class> </servlet> + <!-- Map the initial request into the UI. --> + <welcome-file-list> + <welcome-file>html/index.html</welcome-file> + </welcome-file-list> + <!-- Serve anything under /html/* as a simple file. --> + <servlet-mapping> + <servlet-name>default</servlet-name> + <url-pattern>/html/*</url-pattern> + </servlet-mapping> <!-- Mapping for the default KB namespace (as configured above). --> <servlet-mapping> <servlet-name>REST API</servlet-name> Copied: branches/RDR/bigdata-war/src/html/css/style.css (from rev 7915, branches/RDR/bigdata-war/src/html/style.css) =================================================================== --- branches/RDR/bigdata-war/src/html/css/style.css (rev 0) +++ branches/RDR/bigdata-war/src/html/css/style.css 2014-03-06 22:38:54 UTC (rev 7916) @@ -0,0 +1,178 @@ +/* http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) +*/ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} + + +/* Workbench */ + +body { + margin: 10px; +} + +#container { + /*max-width: 600px;*/ +} + +#top { + text-align: right; + margin-bottom: 20px; +} + +#logo { + float: left; +} + +.shadow { + -webkit-box-shadow: 0px 3px 5px 0px rgba(50, 50, 50, 0.75); + -moz-box-shadow: 0px 3px 5px 0px rgba(50, 50, 50, 0.75); + box-shadow: 0px 3px 5px 0px rgba(50, 50, 50, 0.75); +} + +#tab-selector { + clear: both; +} + +#tab-selector a { + padding: 10px; + border: 1px solid; + border-right: none; + border-bottom: none; + display: inline-block; + float: left; + cursor: pointer; +} + +#tab-selector a:last-of-type { + border-right: 1px solid; +} + +.active { + background: lightgrey; +} + +.tab { + display: none; + clear: both; +} + +.box { + border: 1px solid; + padding: 10px; + border: 1px solid; + border-bottom: none; + min-height: 100px; + overflow-x: scroll; +} + +.box:last-of-type { + border-bottom: 1px solid; +} + +.namespace-shortcuts { + text-align: right; +} + +.namespace-shortcuts li { + display: inline-block; + border: 1px solid; + padding: 5px; + margin-left: 5px; + cursor: pointer; +} + +#large-file-message { + display: none; + margin: 5px 0; +} + +textarea { + margin: 5px 0; + width: 100%; + height: 200px; + box-sizing: border-box; +} + +#rdf-type-container { + display: none; +} + +hr { + background: #929292; + border: none; + height: 5px; + width: 50%; + margin: 20px auto; +} + +#load-load { + margin: 0 auto; + display: block; +} + +#load-buttons { + text-align: center; +} + +.bottom { + border-top: 1px solid; + text-align: right; +} + +#advanced-features, #query-explanation { + display: none; +} + +td { + border: 1px solid; + padding: 5px; +} + +pre { + font-family: monospace; +} + Added: branches/RDR/bigdata-war/src/html/images/logo.png =================================================================== (Binary files differ) Index: branches/RDR/bigdata-war/src/html/images/logo.png =================================================================== --- branches/RDR/bigdata-war/src/html/images/logo.png 2014-03-05 18:18:32 UTC (rev 7915) +++ branches/RDR/bigdata-war/src/html/images/logo.png 2014-03-06 22:38:54 UTC (rev 7916) Property changes on: branches/RDR/bigdata-war/src/html/images/logo.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: branches/RDR/bigdata-war/src/html/index.html =================================================================== --- branches/RDR/bigdata-war/src/html/index.html 2014-03-05 18:18:32 UTC (rev 7915) +++ branches/RDR/bigdata-war/src/html/index.html 2014-03-06 22:38:54 UTC (rev 7916) @@ -5,20 +5,15 @@ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <title>bigdata® NanoSparqlServer</title> <!-- $Id$ --> -<style> -td { - border: 1px solid; -} -</style> </head> <body> <h2>Welcome to bigdata®.</h2> <p>Please consult the -<a href="https://sourceforge.net/apps/mediawiki/bigdata/index.php?title=NanoSparqlServer" +<a href="http://wiki.bigdata.com/wiki/index.php/NanoSparqlServer" target="_blank" > documentation</a> for information on using the NanoSparqlServer's REST Api. </br>See the - <a href="https://sourceforge.net/apps/mediawiki/bigdata/index.php?title=Main_Page" + <a href="http://wiki.bigdata.com/wiki/index.php/Main_Page" target="_blank" >wiki</a> for help on query optimization, bigdata SPARQL extensions, etc. </p> @@ -30,13 +25,13 @@ <dt>http://hostname:port/bigdata</dt> <dd>This page.</dd> <dt>http://hostname:port/bigdata/sparql</dt> -<dd>The SPARQL REST API (<a href="sparql">Service Description + VoID Description</a>).</dd> +<dd>The SPARQL REST API (<a href="/bigdata/sparql">Service Description + VoID Description</a>).</dd> <dt>http://hostname:port/bigdata/namespace</dt> -<dd>VoID <a href="namespace">graph of available KBs</a> from this service.</dd> +<dd>VoID <a href="/bigdata/namespace">graph of available KBs</a> from this service.</dd> <dt>http://hostname:port/bigdata/status</dt> -<dd>A <a href="status">status</a> page.</dd> +<dd>A <a href="/bigdata/status">status</a> page.</dd> <dt>http://hostname:port/bigdata/counters</dt> -<dd>A <a href="counters"> performance counters</a> page.</dd> +<dd>A <a href="/bigdata/counters"> performance counters</a> page.</dd> </dl> <p> @@ -44,13 +39,6 @@ which this page was accessed. </p> -<h2>Linked Data Navigation</h2> -<form action="navigate" method="get"> - <p>Enter a URI to navigate to <input type="text" name="uri"></p> - <p>Tenant Namespace <input type="text" name="namespace" title="Tenant namespace."> (leave empty for default KB)</p> - <input type="submit" value="Send" title="Submit query."> -</form> - <!-- Note: Some applications (firefox 7) can not handle a GET with a very long URL. For that reason ONLY this operation defaults to a POST. You SHOULD use GET for database queries since they are, by and large, idempotent. @@ -59,7 +47,7 @@ title="W3C SPARQL 1.1 Query Recommendation" target="_blank" > SPARQL Query </a></h2> -<FORM action="sparql" method="post" name="QUERY"> +<FORM action="/bigdata/sparql" method="post" name="QUERY"> <P> <TEXTAREA name="query" rows="10" cols="80" title="Enter SPARQL Query." >SELECT * { ?s ?p ?o } LIMIT 1</TEXTAREA> @@ -93,7 +81,7 @@ title="W3C SPARQL Update Recommendation" target="_blank" >SPARQL Update</a></h2> -<FORM action="sparql" method="post"> +<FORM action="/bigdata/sparql" method="post"> <P> <TEXTAREA name="update" rows="10" cols="80" title="Enter SPARQL Update." > @@ -148,48 +136,5 @@ </p> </form> --> - -<h2>Multi-purpose textarea</h2> -<input id="mp-file" type="file" name="file"> -<br> -<input id="mp-hidden" type="hidden" name="large-file-contents"> -<p id="large-file-message" style="display: none;">Your file is too large to display here, but will be uploaded as normal.</p> -<textarea id="mp-box" name="textarea" rows="10" cols="80"></textarea> -<br> -<select id="mp-type"> -<option value="sparql" selected="selected">SPARQL</option> -<option value="rdf">RDF</option> -<option value="path">File path</option> -</select> -<select id="rdf-type" style="display: none;"> -<option value="">Select RDF format</option> -<option value="n-quads">N-Quads</option> -<option value="n-triples">N-Triples</option> -<option value="n3">Notation3</option> -<option value="rdf/xml">RDF/XML</option> -<option value="trig">TriG</option> -<option value="trix">TriX</option> -<option value="turtle">Turtle</option> -</select> -<br> -Tenant Namespace <input type="text" name="namespace" title="Tenant namespace."> (leave empty for default KB) -<br> -<button type="button" id="mp-send">Send</button> -<br> -Response: -<pre id="response"></pre> - -<h2>Navigator</h2> -Enter a URI to begin navigation -<br> -<form id="navigator"> -<input type="text" id="navigator-uri"> -<input type="submit"> -</form> -<div id="navigator-display"></div> - -<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> -<script>window.jQuery || document.write('<script src="/jquery.min.js"><\/script>')</script> -<script src="/workbench.js"></script> </body> </html> \ No newline at end of file Deleted: branches/RDR/bigdata-war/src/html/jquery.hotkeys.js =================================================================== --- branches/RDR/bigdata-war/src/html/jquery.hotkeys.js 2014-03-05 18:18:32 UTC (rev 7915) +++ branches/RDR/bigdata-war/src/html/jquery.hotkeys.js 2014-03-06 22:38:54 UTC (rev 7916) @@ -1,110 +0,0 @@ -/* - * jQuery Hotkeys Plugin - * Copyright 2010, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * - * Based upon the plugin by Tzury Bar Yochay: - * http://github.com/tzuryby/hotkeys - * - * Original idea by: - * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/ -*/ - -/* - * One small change is: now keys are passed by object { keys: '...' } - * Might be useful, when you want to pass some other data to your handler - */ - -(function(jQuery){ - - jQuery.hotkeys = { - version: "0.8", - - specialKeys: { - 8: "backspace", 9: "tab", 10: "return", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause", - 20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home", - 37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del", - 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", - 104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/", - 112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8", - 120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 186: ";", 191: "/", - 220: "\\", 222: "'", 224: "meta" - }, - - shiftNums: { - "`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&", - "8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<", - ".": ">", "/": "?", "\\": "|" - } - }; - - function keyHandler( handleObj ) { - if ( typeof handleObj.data === "string" ) { - handleObj.data = { keys: handleObj.data }; - } - - // Only care when a possible input has been specified - if ( !handleObj.data || !handleObj.data.keys || typeof handleObj.data.keys !== "string" ) { - return; - } - - var origHandler = handleObj.handler, - keys = handleObj.data.keys.toLowerCase().split(" "), - textAcceptingInputTypes = ["text", "password", "number", "email", "url", "range", "date", "month", "week", "time", "datetime", "datetime-local", "search", "color", "tel"]; - - handleObj.handler = function( event ) { - // Don't fire in text-accepting inputs that we didn't directly bind to - if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) || - jQuery.inArray(event.target.type, textAcceptingInputTypes) > -1 ) ) { - return; - } - - var special = jQuery.hotkeys.specialKeys[ event.keyCode ], - character = String.fromCharCode( event.which ).toLowerCase(), - modif = "", possible = {}; - - // check combinations (alt|ctrl|shift+anything) - if ( event.altKey && special !== "alt" ) { - modif += "alt+"; - } - - if ( event.ctrlKey && special !== "ctrl" ) { - modif += "ctrl+"; - } - - // TODO: Need to make sure this works consistently across platforms - if ( event.metaKey && !event.ctrlKey && special !== "meta" ) { - modif += "meta+"; - } - - if ( event.shiftKey && special !== "shift" ) { - modif += "shift+"; - } - - if ( special ) { - possible[ modif + special ] = true; - } - - if ( character ) { - possible[ modif + character ] = true; - possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true; - - // "$" can be triggered as "Shift+4" or "Shift+$" or just "$" - if ( modif === "shift+" ) { - possible[ jQuery.hotkeys.shiftNums[ character ] ] = true; - } - } - - for ( var i = 0, l = keys.length; i < l; i++ ) { - if ( possible[ keys[i] ] ) { - return origHandler.apply( this, arguments ); - } - } - }; - } - - jQuery.each([ "keydown", "keyup", "keypress" ], function() { - jQuery.event.special[ this ] = { add: keyHandler }; - }); - -})( this.jQuery ); Deleted: branches/RDR/bigdata-war/src/html/jquery.min.js =================================================================== Added: branches/RDR/bigdata-war/src/html/js/vendor/jquery.hotkeys.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/vendor/jquery.hotkeys.js (rev 0) +++ branches/RDR/bigdata-war/src/html/js/vendor/jquery.hotkeys.js 2014-03-06 22:38:54 UTC (rev 7916) @@ -0,0 +1,110 @@ +/* + * jQuery Hotkeys Plugin + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * + * Based upon the plugin by Tzury Bar Yochay: + * http://github.com/tzuryby/hotkeys + * + * Original idea by: + * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/ +*/ + +/* + * One small change is: now keys are passed by object { keys: '...' } + * Might be useful, when you want to pass some other data to your handler + */ + +(function(jQuery){ + + jQuery.hotkeys = { + version: "0.8", + + specialKeys: { + 8: "backspace", 9: "tab", 10: "return", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause", + 20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home", + 37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del", + 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", + 104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/", + 112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8", + 120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 186: ";", 191: "/", + 220: "\\", 222: "'", 224: "meta" + }, + + shiftNums: { + "`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&", + "8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<", + ".": ">", "/": "?", "\\": "|" + } + }; + + function keyHandler( handleObj ) { + if ( typeof handleObj.data === "string" ) { + handleObj.data = { keys: handleObj.data }; + } + + // Only care when a possible input has been specified + if ( !handleObj.data || !handleObj.data.keys || typeof handleObj.data.keys !== "string" ) { + return; + } + + var origHandler = handleObj.handler, + keys = handleObj.data.keys.toLowerCase().split(" "), + textAcceptingInputTypes = ["text", "password", "number", "email", "url", "range", "date", "month", "week", "time", "datetime", "datetime-local", "search", "color", "tel"]; + + handleObj.handler = function( event ) { + // Don't fire in text-accepting inputs that we didn't directly bind to + if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) || + jQuery.inArray(event.target.type, textAcceptingInputTypes) > -1 ) ) { + return; + } + + var special = jQuery.hotkeys.specialKeys[ event.keyCode ], + character = String.fromCharCode( event.which ).toLowerCase(), + modif = "", possible = {}; + + // check combinations (alt|ctrl|shift+anything) + if ( event.altKey && special !== "alt" ) { + modif += "alt+"; + } + + if ( event.ctrlKey && special !== "ctrl" ) { + modif += "ctrl+"; + } + + // TODO: Need to make sure this works consistently across platforms + if ( event.metaKey && !event.ctrlKey && special !== "meta" ) { + modif += "meta+"; + } + + if ( event.shiftKey && special !== "shift" ) { + modif += "shift+"; + } + + if ( special ) { + possible[ modif + special ] = true; + } + + if ( character ) { + possible[ modif + character ] = true; + possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true; + + // "$" can be triggered as "Shift+4" or "Shift+$" or just "$" + if ( modif === "shift+" ) { + possible[ jQuery.hotkeys.shiftNums[ character ] ] = true; + } + } + + for ( var i = 0, l = keys.length; i < l; i++ ) { + if ( possible[ keys[i] ] ) { + return origHandler.apply( this, arguments ); + } + } + }; + } + + jQuery.each([ "keydown", "keyup", "keypress" ], function() { + jQuery.event.special[ this ] = { add: keyHandler }; + }); + +})( this.jQuery ); Added: branches/RDR/bigdata-war/src/html/js/vendor/jquery.min.js =================================================================== Copied: branches/RDR/bigdata-war/src/html/js/workbench.js (from rev 7915, branches/RDR/bigdata-war/src/html/workbench.js) =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js (rev 0) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-06 22:38:54 UTC (rev 7916) @@ -0,0 +1,639 @@ +$(function() { + +/* Tab selection */ + +$('#tab-selector a').click(function(e) { + showTab($(this).data('target')); +}); + +if(window.location.hash) { + showTab(window.location.hash.substr(1)); +} else { + $('#tab-selector a:first').click(); +} + +function showTab(tab) { + $('.tab').hide(); + $('#' + tab + '-tab').show(); + $('#tab-selector a').removeClass(); + $('a[data-target=' + tab + ']').addClass('active'); + window.location.hash = tab; +} + +function moveTab(next) { + // get current position + var current = $('#tab-selector .active'); + if(next) { + if(current.next().length) { + current.next().click(); + } else { + $('#tab-selector a:first').click(); + } + } else { + if(current.prev().length) { + current.prev().click(); + } else { + $('#tab-selector a:last').click(); + } + } +} + +// these should be , and . but Hotkeys views those keypresses as these characters +$('html, textarea, select').bind('keydown', 'ctrl+¼', function() { moveTab(false); }); +$('html, textarea, select').bind('keydown', 'ctrl+¾', function() { moveTab(true); }); + +/* Namespaces */ + +function getNamespaces() { + $.get('/namespace', function(data) { + $('#namespaces-list').empty(); + var rdf = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'; + var namespaces = namespaces = data.getElementsByTagNameNS(rdf, 'Description') + for(var i=0; i<namespaces.length; i++) { + var title = namespaces[i].getElementsByTagName('title')[0].textContent; + var titleText = title == DEFAULT_NAMESPACE ? title + ' (default)' : title; + var url = namespaces[i].getElementsByTagName('sparqlEndpoint')[0].getAttributeNS(rdf, 'resource'); + $('#namespaces-list').append('<li data-name="' + title + '" data-url="' + url + '">' + titleText + ' - <a href="#" class="use-namespace">Use</a> - <a href="#" class="delete-namespace">Delete</a></li>'); + } + $('.use-namespace').click(function(e) { + e.preventDefault(); + useNamespace($(this).parent().data('name'), $(this).parent().data('url')); + }); + $('.delete-namespace').click(function(e) { + e.preventDefault(); + deleteNamespace($(this).parent().data('name')); + }); + }); +} + +function useNamespace(name, url) { + $('#current-namespace').html(name); + NAMESPACE = name; + NAMESPACE_URL = url; +} + +function deleteNamespace(namespace) { + if(confirm('Are you sure you want to delete the namespace ' + namespace + '?')) { + // FIXME: should we check if the default namespace is the one being deleted? + if(namespace == NAMESPACE) { + // FIXME: what is the desired behaviour when deleting the current namespace? + } + var url = '/namespace/' + namespace; + var settings = { + type: 'DELETE', + success: getNamespaces, + error: function() { alert('Could not delete namespace ' + namespace); } + }; + $.ajax(url, settings); + } +} + +function createNamespace(e) { + e.preventDefault(); + var namespace = $(this).find('input').val(); + if(!namespace) { + return; + } + // TODO: validate namespace + // TODO: allow for other options to be specified + var data = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">\n<properties>\n<entry key="com.bigdata.rdf.sail.namespace">' + namespace + '</entry>\n</properties>'; + var settings = { + type: 'POST', + data: data, + contentType: 'application/xml', + success: getNamespaces, + error: function(jqXHR, textStatus, errorThrown) { alert(errorThrown); } + }; + $.ajax('/namespace', settings); +} +$('#namespace-create').submit(createNamespace); + +function getDefaultNamespace() { + $.get('/sparql', function(data) { + // Chrome does not work with rdf\:Description, so look for Description too + var defaultDataset = $(data).find('rdf\\:Description[rdf\\:nodeID=defaultDataset], Description[rdf\\:nodeID=defaultDataset]'); + DEFAULT_NAMESPACE = defaultDataset.find('title')[0].textContent; + var url = defaultDataset.find('sparqlEndpoint')[0].attributes['rdf:resource'].textContent; + useNamespace(DEFAULT_NAMESPACE, url); + getNamespaces(); + }); +} +var DEFAULT_NAMESPACE, NAMESPACE, NAMESPACE_URL, fileContents; + +getDefaultNamespace(); + + +/* Namespace shortcuts */ + +$('.namespace-shortcuts li').click(function() { + var textarea = $(this).parents('.tab').find('textarea'); + var current = textarea.val(); + var ns = $(this).data('ns'); + + if(current.indexOf(ns) == -1) { + textarea.val(ns + '\n' + current); + } +}); + + +/* Load */ + +function handleDragOver(e) { + e.stopPropagation(); + e.preventDefault(); + e.originalEvent.dataTransfer.dropEffect = 'copy'; +} + +function handleFile(e) { + e.stopPropagation(); + e.preventDefault(); + + if(e.type == 'drop') { + var files = e.originalEvent.dataTransfer.files; + } else { + var files = e.originalEvent.target.files; + } + + // only one file supported + if(files.length > 1) { + alert('Ignoring all but first file'); + } + + var f = files[0]; + + // if file is too large, tell user to supply local path + if(f.size > 1048576 * 100) { + alert('File too large, enter local path to file'); + $('#load-box').val('/path/to/' + f.name); + setType('path'); + $('#load-box').prop('disabled', false) + $('#large-file-message, #clear-file').hide(); + } else { + var fr = new FileReader(); + fr.onload = function(e2) { + if(f.size > 10240) { + // do not use textarea + $('#load-box').prop('disabled', true) + $('#large-file-message, #clear-file').show() + $('#load-box').val(''); + fileContents = e2.target.result; + } else { + // display file contents in the textarea + clearFile(); + $('#load-box').val(e2.target.result); + } + guessType(f.name.split('.').pop().toLowerCase(), e2.target.result); + }; + fr.readAsText(f); + } + + $('#load-file').val(''); +} + +function clearFile(e) { + if(e) { + e.preventDefault(); + } + $('#load-box').prop('disabled', false) + $('#large-file-message, #clear-file').hide() + fileContents = null; +} + +function guessType(extension, content) { + // try to guess type + if(extension == 'rq') { + // SPARQL + setType('sparql'); + } else if(extension in rdf_types) { + // RDF + setType('rdf', rdf_types[extension]); + } else { + // extension is no help, see if we can find some SPARQL commands + setType(identify(content)); + } +} + +function identify(text, considerPath) { + if(considerPath) { + // match Unix, Windows or HTTP paths + // file:// is optional for local paths + // when file:// is not present, Windows paths may use \ or / and must include a : + // when file:// is present, Windows paths must use / and may include a : + // http[s]:// is mandatory for HTTP paths + var unix = /^(file:\/\/)?((\/[^\/]+)+)$/; + var windows = /^((file:\/\/)([A-Za-z]:?([\/][^\/\\]+)+))|([A-Za-z]:([\\\/][^\\\/]+)+)$/; + var http = /^https?:\/((\/[^\/]+)+)$/; + if(unix.test(text.trim()) || windows.test(text.trim()) || http.test(text.trim())) { + return 'path'; + } + } + + text = text.toUpperCase(); + for(var i=0; i<sparql_update_commands.length; i++) { + if(text.indexOf(sparql_update_commands[i]) != -1) { + return 'sparql'; + } + } + + return 'rdf'; +} + +function handlePaste(e) { + // if the input is currently empty, try to identify the pasted content + var that = this; + if(this.value == '') { + setTimeout(function() { setType(identify(that.value, true)); }, 10); + } +} + +function handleTypeChange(e) { + $('#rdf-type-container').toggle($(this).val() == 'rdf'); +} + +function setType(type, format) { + $('#load-type').val(type); + if(type == 'rdf') { + $('#rdf-type-container').show(); + $('#rdf-type').val(format); + } else { + $('#rdf-type-container').hide(); + } +} + +// .xml is used for both RDF and TriX, assume it's RDF +// We could check the parent element to see which it is +var rdf_types = {'nq': 'n-quads', + 'nt': 'n-triples', + 'n3': 'n3', + 'rdf': 'rdf/xml', + 'rdfs': 'rdf/xml', + 'owl': 'rdf/xml', + 'xml': 'rdf/xml', + 'trig': 'trig', + 'trix': 'trix', + //'xml': 'trix', + 'ttl': 'turtle'}; + +var rdf_content_types = {'n-quads': 'application/n-quads', + 'n-triples': 'text/plain', + 'n3': 'text/n3', + 'rdf/xml': 'application/rdf+xml', + 'trig': 'application/trig', + 'trix': 'application/trix', + 'turtle': 'text/turtle'}; + +var sparql_update_commands = ['INSERT', 'DELETE']; + +$('#load-file').change(handleFile); +$('#load-box').on('dragover', handleDragOver) + .on('drop', handleFile) + .on('paste', handlePaste) + .bind('keydown', 'ctrl+return', submitLoad) + .change(handleTypeChange); +$('#clear-file').click(clearFile); + +$('#load-load').click(submitLoad); + +function submitLoad(e) { + e.preventDefault(); + + var settings = { + type: 'POST', + data: fileContents == null ? $('#load-box').val() : fileContents, + success: updateResponseXML, + error: updateResponseError + } + + // determine action based on type + switch($('#load-type').val()) { + case 'sparql': + settings.data = 'update=' + encodeURIComponent(settings.data); + settings.success = updateResponseHTML; + break; + case 'rdf': + var type = $('#rdf-type').val(); + if(!type) { + alert('Please select an RDF content type.'); + return; + } + settings.contentType = rdf_content_types[type]; + break; + case 'path': + // if no scheme is specified, assume a local path + if(!/^(file|(https?)):\/\//.test(settings.data)) { + settings.data = 'file://' + settings.data; + } + settings.data = 'uri=' + encodeURIComponent(settings.data); + break; + } + + $.ajax(NAMESPACE_URL, settings); +} + +$('#load-clear').click(function() { + $('#load-response').text(''); +}); + +$('#advanced-features-toggle').click(function() { + $('#advanced-features').toggle(); + return false; +}); + +function updateResponseHTML(data) { + $('#load-response').html(data); +} + +function updateResponseXML(data) { + var modified = data.childNodes[0].attributes['modified'].value; + var milliseconds = data.childNodes[0].attributes['milliseconds'].value; + $('#load-response').text('Modified: ' + modified + '\nMilliseconds: ' + milliseconds); +} + +function updateResponseError(jqXHR, textStatus, errorThrown) { + $('#load-response').text('Error! ' + textStatus + ' ' + errorThrown); +} + + +/* Query */ + +$('#query-box').bind('keydown', 'ctrl+return', function(e) { e.preventDefault(); $('#query-form').submit(); }); +$('#query-form').submit(submitQuery); + +function submitQuery(e) { + e.preventDefault(); + + var settings = { + type: 'POST', + data: $(this).serialize(), + headers: { 'Accept': 'application/sparql-results+json, application/rdf+xml' }, + success: showQueryResults, + error: queryResultsError + } + + $.ajax(NAMESPACE_URL, settings); + + $('#query-explanation').empty(); + if($('#query-explain').is(':checked')) { + settings = { + type: 'POST', + data: $(this).serialize() + '&explain=details', + dataType: 'html', + success: showQueryExplanation, + error: queryResultsError + }; + $.ajax(NAMESPACE_URL, settings); + } else { + $('#query-explanation').hide(); + } +} + +$('#query-response-clear').click(function() { + $('#query-response, #query-explanation').empty(''); + $('#query-explanation').hide(); +}); + +$('#query-export-csv').click(exportCSV); +$('#query-export-xml').click(exportXML); + +function exportXML() { + var xml = '<?xml version="1.0"?>\n<sparql xmlns="http://www.w3.org/2005/sparql-results#">\n\t<head>\n'; + var bindings = []; + $('#query-response thead tr td').each(function(i, td) { + xml += '\t\t<variable name="' + td.textContent + '"/>\n'; + bindings.push(td.textContent); + }); + xml += '\t</head>\n\t<results>\n'; + $('#query-response tbody tr').each(function(i, tr) { + xml += '\t\t<result>\n'; + $(tr).find('td').each(function(j, td) { + var bindingType = td.className; + if(bindingType == 'unbound') { + return; + } + var dataType = $(td).data('datatype'); + if(dataType) { + dataType = ' datatype="' + dataType + '"'; + } else { + dataType = ''; + } + var lang = $(td).data('lang'); + if(lang) { + lang = ' xml:lang="' + lang + '"'; + } else { + lang = ''; + } + xml += '\t\t\t<binding name="' + bindings[j] + '"><' + bindingType + dataType + lang + '>' + td.textContent + '</' + bindingType + '></binding>\n'; + }); + xml += '\t\t</result>\n'; + }); + xml += '\t</results>\n</sparql>\n'; + downloadFile(xml, 'application/sparql-results+xml', 'export.xml'); +} + +function exportCSV() { + // FIXME: escape commas + var csv = ''; + $('#query-response table tr').each(function(i, tr) { + $(tr).find('td').each(function(j, td) { + if(j > 0) { + csv += ','; + } + csv += td.textContent; + }); + csv += '\n'; + }); + downloadFile(csv, 'application/csv', 'export.csv'); +} + +function downloadFile(data, type, filename) { + var uri = 'data:' + type + ';charset=utf-8,' + encodeURIComponent(data); + $('<a id="download-link" download="' + filename + '" href="' + uri + '">').appendTo('body')[0].click(); + $('#download-link').remove(); +} + +function showQueryResults(data) { + $('#query-response').empty(); + var table = $('<table>').appendTo($('#query-response')); + if(this.dataTypes[1] == 'xml') { + // RDF + table.append($('<thead><tr><td>s</td><td>p</td><td>o</td></tr></thead>')); + var rows = $(data).find('Description'); + for(var i=0; i<rows.length; i++) { + // FIXME: are about and nodeID the only possible attributes here? + var s = rows[i].attributes['rdf:about']; + if(typeof(s) == 'undefined') { + s = rows[i].attributes['rdf:nodeID']; + } + s = s.textContent; + for(var j=0; j<rows[i].children.length; j++) { + var p = rows[i].children[j].tagName; + var o = rows[i].children[j].attributes['rdf:resource']; + // FIXME: is this the correct behaviour? + if(typeof(o) == 'undefined') { + o = rows[i].children[j].textContent; + } else { + o = o.textContent; + } + var tr = $('<tr><td>' + (j == 0 ? s : '') + '</td><td>' + p + '</td><td>' + o + '</td>'); + table.append(tr); + } + } + } else { + // JSON + if(typeof(data.boolean) != 'undefined') { + // ASK query + table.append('<tr><td>' + data.boolean + '</td></tr>').addClass('boolean'); + return; + } + var thead = $('<thead>').appendTo(table); + var vars = []; + var tr = $('<tr>'); + for(var i=0; i<data.head.vars.length; i++) { + tr.append('<td>' + data.head.vars[i] + '</td>'); + vars.push(data.head.vars[i]); + } + thead.append(tr); + table.append(thead); + for(var i=0; i<data.results.bindings.length; i++) { + var tr = $('<tr>'); + for(var j=0; j<vars.length; j++) { + if(vars[j] in data.results.bindings[i]) { + var binding = data.results.bindings[i][vars[j]]; + if(binding.type == 'typed-literal') { + var tdData = ' class="literal" data-datatype="' + binding.datatype + '"'; + } else { + var tdData = ' class="' + binding.type + '"'; + if(binding['xml:lang']) { + tdData += ' data-lang="' + binding['xml:lang'] + '"'; + } + } + tr.append('<td' + tdData + '>' + binding.value + '</td>'); + } else { + // no binding + tr.append('<td class="unbound">'); + } + } + table.append(tr); + } + } +} + +function showQueryExplanation(data) { + $('#query-explanation').html(data).show(); +} + +function queryResultsError(jqXHR, textStatus, errorThrown) { + $('#query-response').text('Error! ' + textStatus + ' ' + errorThrown); +} + + +/* Explore */ + +$('#explore-form').submit(function(e) { + e.preventDefault(); + var uri = $(this).find('input').val(); + if(uri) { + loadURI(uri); + } +}); + +function loadURI(uri) { + // send query to server + var query = 'select * \ + where { \ + bind (<URI> as ?vertex) . \ + { \ + bind (<<?vertex ?p ?o>> as ?sid) . \ + optional \ + { \ + { \ + ?sid ?sidP ?sidO . \ + } union { \ + ?sidS ?sidP ?sid . \ + } \ + } \ + } union { \ + bind (<<?s ?p ?vertex>> as ?sid) . \ + optional \ + { \ + { \ + ?sid ?sidP ?sidO . \ + } union { \ + ?sidS ?sidP ?sid . \ + } \ + } \ + } \ + }'; + + query = query.replace('URI', uri); + var settings = { + type: 'POST', + data: 'query=' + encodeURI(query), + dataType: 'json', + accepts: {'json': 'application/sparql-results+json'}, + success: updateExploreStart, + error: updateExploreError + }; + $.ajax('/sparql', settings); +} + +function updateExploreStart(data) { + var disp = $('#explore-results'); + disp.html(''); + // see if we got any results + if(data.results.bindings.length == 0) { + disp.append('No vertex found!'); + return; + } + + var vertex = data.results.bindings[0].vertex; + disp.append('<h3>' + vertex.value + '</h3>'); + var outbound=[], inbound=[], attributes=[]; + for(var i=0; i<data.results.bindings.length; i++) { + var binding = data.results.bindings[i]; + // TODO: are attributes always on outbound relationships? + if('o' in binding) { + if(binding.o.type == 'uri') { + outbound.push(binding); + } else { + attributes.push(binding); + } + } else { + inbound.push(binding); + } + } + + if(outbound.length) { + disp.append('<h4>Outbound links</h4>'); + var table = $('<table>').appendTo(disp); + for(var i=0; i<outbound.length; i++) { + var linkAttributes = outbound[i].sidP.value + ': ' + outbound[i].sidO.value; + table.append('<tr><td>' + outbound[i].p.value + '</td><td><a href="#">' + outbound[i].o.value + '</a></td><td>' + linkAttributes + '</td></tr>'); + } + } + + if(inbound.length) { + disp.append('<h4>Inbound links</h4>'); + var table = $('<table>').appendTo(disp); + for(var i=0; i<inbound.length; i++) { + var linkAttributes = inbound[i].sidP.value + ': ' + inbound[i].sidO.value; + table.append('<tr><td><a href="#">' + inbound[i].s.value + '</a></td><td>' + inbound[i].p.value + '</td><td>' + linkAttributes + '</td></tr>'); + } + } + + if(attributes.length) { + disp.append('<h4>Attributes</h4>'); + var table = $('<table>').appendTo(disp); + for(var i=0; i<attributes.length; i++) { + table.append('<tr><td>' + attributes[i].p.value + '</td><td>' + attributes[i].o.value + '</td></tr>'); + } + } + + disp.find('a').click(function(e) { e.preventDefault(); loadURI(this.text); }); +} + +function updateExploreError(jqXHR, textStatus, errorThrown) { + $('#explore-results').html('Error! ' + textStatus + ' ' + errorThrown); +} + +}); Deleted: branches/RDR/bigdata-war/src/html/logo.png =================================================================== (Binary files differ) Modified: branches/RDR/bigdata-war/src/html/new.html =================================================================== --- branches/RDR/bigdata-war/src/html/new.html 2014-03-05 18:18:32 UTC (rev 7915) +++ branches/RDR/bigdata-war/src/html/new.html 2014-03-06 22:38:54 UTC (rev 7916) @@ -2,15 +2,15 @@ <html lang="en"> <head> <meta charset="utf-8"> - <title>RedPoint Workbench</title> - <link rel="stylesheet" href="style.css"> + <title>Bigdata Workbench</title> + <link rel="stylesheet" href="/bigdata/html/css/style.css"> </head> <body> <div id="container"> <div id="top"> - <img src="logo.png" id="logo"> + <img src="/bigdata/html/images/logo.png" id="logo"> <p><label for="search-text">Search:</label> <input type="text" id="search-text"></p> <p>Current namespace: <span id="current-namespace"></span></p> </div> @@ -161,8 +161,8 @@ <!--[if IE]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> - <script>window.jQuery || document.write('<script src="jquery.min.js"><\/script>')</script> - <script src="jquery.hotkeys.js"></script> - <script src="workbench.js"></script> + <script>window.jQuery || document.write('<script src="/bigdata/html/js/vendor/jquery.min.js"><\/script>')</script> + <script src="/bigdata/html/js/vendor/jquery.hotkeys.js"></script> + <script src="/bigdata/html/js/workbench.js"></script> </body> </html> Deleted: branches/RDR/bigdata-war/src/html/style.css =================================================================== --- branches/RDR/bigdata-war/src/html/style.css 2014-03-05 18:18:32 UTC (rev 7915) +++ branches/RDR/bigdata-war/src/html/style.css 2014-03-06 22:38:54 UTC (rev 7916) @@ -1,178 +0,0 @@ -/* http://meyerweb.com/eric/tools/css/reset/ - v2.0 | 20110126 - License: none (public domain) -*/ - -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; -} -/* HTML5 display-role reset for older browsers */ -article, aside, details, figcaption, figure, -footer, header, hgroup, menu, nav, section { - display: block; -} -body { - line-height: 1; -} -ol, ul { - list-style: none; -} -blockquote, q { - quotes: none; -} -blockquote:before, blockquote:after, -q:before, q:after { - content: ''; - content: none; -} -table { - border-collapse: collapse; - border-spacing: 0; -} - - -/* Workbench */ - -body { - margin: 10px; -} - -#container { - /*max-width: 600px;*/ -} - -#top { - text-align: right; - margin-bottom: 20px; -} - -#logo { - float: left; -} - -.shadow { - -webkit-box-shadow: 0px 3px 5px 0px rgba(50, 50, 50, 0.75); - -moz-box-shadow: 0px 3px 5px 0px rgba(50, 50, 50, 0.75); - box-shadow: 0px 3px 5px 0px rgba(50, 50, 50, 0.75); -} - -#tab-selector { - clear: both; -} - -#tab-selector a { - padding: 10px; - border: 1px solid; - border-right: none; - border-bottom: none; - display: inline-block; - float: left; - cursor: pointer; -} - -#tab-selector a:last-of-type { - border-right: 1px solid; -} - -.active { - background: lightgrey; -} - -.tab { - display: none; - clear: both; -} - -.box { - border: 1px solid; - padding: 10px; - border: 1px solid; - border-bottom: none; - min-height: 100px; - overflow-x: scroll; -} - -.box:last-of-type { - border-bottom: 1px solid; -} - -.namespace-shortcuts { - text-align: right; -} - -.namespace-shortcuts li { - display: inline-block; - border: 1px solid; - padding: 5px; - margin-left: 5px; - cursor: pointer; -} - -#large-file-message { - display: none; - margin: 5px 0; -} - -textarea { - margin: 5px 0; - width: 100%; - height: 200px; - box-sizing: border-box; -} - -#rdf-type-container { - display: none; -} - -hr { - background: #929292; - border: none; - height: 5px; - width: 50%; - margin: 20px auto; -} - -#load-load { - margin: 0 auto; - display: block; -} - -#load-buttons { - text-align: center; -} - -.bottom { - border-top: 1px solid; - text-align: right; -} - -#advanced-features, #query-explanation { - display: none; -} - -td { - border: 1px solid; - padding: 5px; -} - -pre { - font-family: monospace; -} - Deleted: branches/RDR/bigdata-war/src/html/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/workbench.js 2014-03-05 18:18:32 UTC (rev 7915) +++ branches/RDR/bigdata-war/src/html/workbench.js 2014-03-06 22:38:54 UTC (rev 7916) @@ -1,639 +0,0 @@ -$(function() { - -/* Tab selection */ - -$('#tab-selector a').click(function(e) { - showTab($(this).data('target')); -}); - -if(window.location.hash) { - showTab(window.location.hash.substr(1)); -} else { - $('#tab-selector a:first').click(); -} - -function showTab(tab) { - $('.tab').hide(); - $('#' + tab + '-tab').show(); - $('#tab-selector a').removeClass(); - $('a[data-target=' + tab + ']').addClass('active'); - window.location.hash = ... [truncated message content] |
From: <tob...@us...> - 2014-03-05 18:18:35
|
Revision: 7915 http://sourceforge.net/p/bigdata/code/7915 Author: tobycraig Date: 2014-03-05 18:18:32 +0000 (Wed, 05 Mar 2014) Log Message: ----------- Added favicon Added Paths: ----------- branches/RDR/bigdata-war/src/html/favicon.ico Added: branches/RDR/bigdata-war/src/html/favicon.ico =================================================================== (Binary files differ) Index: branches/RDR/bigdata-war/src/html/favicon.ico =================================================================== --- branches/RDR/bigdata-war/src/html/favicon.ico 2014-03-05 13:47:48 UTC (rev 7914) +++ branches/RDR/bigdata-war/src/html/favicon.ico 2014-03-05 18:18:32 UTC (rev 7915) Property changes on: branches/RDR/bigdata-war/src/html/favicon.ico ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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] |
From: <tho...@us...> - 2014-03-05 12:58:21
|
Revision: 7913 http://sourceforge.net/p/bigdata/code/7913 Author: thompsonbry Date: 2014-03-05 12:58:16 +0000 (Wed, 05 Mar 2014) Log Message: ----------- Added benchmark* to svn:ingore properties Property Changed: ---------------- branches/BIGDATA_RELEASE_1_3_0/ Index: branches/BIGDATA_RELEASE_1_3_0 =================================================================== --- branches/BIGDATA_RELEASE_1_3_0 2014-03-04 22:43:01 UTC (rev 7912) +++ branches/BIGDATA_RELEASE_1_3_0 2014-03-05 12:58:16 UTC (rev 7913) Property changes on: branches/BIGDATA_RELEASE_1_3_0 ___________________________________________________________________ Modified: svn:ignore ## -28,3 +28,4 ## CI bsbm10-dataset.nt.gz bsbm10-dataset.nt.zip +benchmark* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-03-04 22:43:06
|
Revision: 7912 http://sourceforge.net/p/bigdata/code/7912 Author: tobycraig Date: 2014-03-04 22:43:01 +0000 (Tue, 04 Mar 2014) Log Message: ----------- #838 - Added support for boolean results from ASK queries Modified Paths: -------------- branches/RDR/bigdata-war/src/html/workbench.js Modified: branches/RDR/bigdata-war/src/html/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/workbench.js 2014-03-04 20:46:21 UTC (rev 7911) +++ branches/RDR/bigdata-war/src/html/workbench.js 2014-03-04 22:43:01 UTC (rev 7912) @@ -480,6 +480,11 @@ } } else { // JSON + if(typeof(data.boolean) != 'undefined') { + // ASK query + table.append('<tr><td>' + data.boolean + '</td></tr>').addClass('boolean'); + return; + } var thead = $('<thead>').appendTo(table); var vars = []; var tr = $('<tr>'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-03-04 20:46:25
|
Revision: 7911 http://sourceforge.net/p/bigdata/code/7911 Author: thompsonbry Date: 2014-03-04 20:46:21 +0000 (Tue, 04 Mar 2014) Log Message: ----------- Committing to CI for #730. I still need to test the benchmarking scripts and scale-out query. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-A.config branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-B.config branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-C.config branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal.java branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-A.config branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-B.config branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/HAJournal-C.config branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFServletContextListener.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/ConfigParams.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/WEB-INF/web.xml branches/BIGDATA_RELEASE_1_3_0/build.xml branches/BIGDATA_RELEASE_1_3_0/src/resources/HAJournal/HAJournal.config branches/BIGDATA_RELEASE_1_3_0/src/resources/HAJournal/log4jHA.properties branches/BIGDATA_RELEASE_1_3_0/src/resources/HAJournal/startHAServices.config branches/BIGDATA_RELEASE_1_3_0/src/resources/bin/startHAServices branches/BIGDATA_RELEASE_1_3_0/src/resources/etc/bigdata/bigdataHA.config Added Paths: ----------- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/WEB-INF/ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/WEB-INF/RWStore.properties branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/WEB-INF/classes/ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/WEB-INF/classes/log4j.properties branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/WEB-INF/jetty.xml branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/index.html branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/result-to-html.xsl Removed Paths: ------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/WebAppUnassembled.java branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/result-to-html.xsl branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/resources/RWStore.properties branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/resources/WEB-INF/ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/resources/log4j.properties Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-A.config =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-A.config 2014-03-04 20:38:39 UTC (rev 7910) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-A.config 2014-03-04 20:46:21 UTC (rev 7911) @@ -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/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-B.config =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-B.config 2014-03-04 20:38:39 UTC (rev 7910) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-B.config 2014-03-04 20:46:21 UTC (rev 7911) @@ -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/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-C.config =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-C.config 2014-03-04 20:38:39 UTC (rev 7910) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal-C.config 2014-03-04 20:46:21 UTC (rev 7911) @@ -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/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal.java 2014-03-04 20:38:39 UTC (rev 7910) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournal.java 2014-03-04 20:46:21 UTC (rev 7911) @@ -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/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java 2014-03-04 20:38:39 UTC (rev 7910) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java 2014-03-04 20:46:21 UTC (rev 7911) @@ -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/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java 2014-03-04 20:38:39 UTC (rev 7910) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java 2014-03-04 20:46:21 UTC (rev 7911) @@ -1,3202 +1,3265 @@ -/** - -Copyright (C) SYSTAP, LLC 2006-2007. All rights reserved. - -Contact: - SYSTAP, LLC - 4501 Tower Road - Greensboro, NC 27410 - lic...@bi... - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -package com.bigdata.journal.jini.ha; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.net.InetAddress; -import java.rmi.Remote; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -import junit.framework.AssertionFailedError; -import net.jini.config.Configuration; -import net.jini.config.ConfigurationException; -import net.jini.config.ConfigurationProvider; -import net.jini.core.lookup.ServiceID; -import net.jini.core.lookup.ServiceItem; -import net.jini.core.lookup.ServiceTemplate; -import net.jini.discovery.DiscoveryEvent; -import net.jini.discovery.DiscoveryListener; -import net.jini.discovery.LookupDiscoveryManager; -import net.jini.lease.LeaseRenewalManager; -import net.jini.lookup.ServiceDiscoveryManager; - -import org.apache.system.SystemUtil; -import org.apache.zookeeper.CreateMode; -import org.apache.zookeeper.KeeperException; -import org.apache.zookeeper.KeeperException.ConnectionLossException; -import org.apache.zookeeper.KeeperException.NodeExistsException; -import org.apache.zookeeper.KeeperException.SessionExpiredException; -import org.apache.zookeeper.WatchedEvent; -import org.apache.zookeeper.Watcher; -import org.apache.zookeeper.ZooKeeper; -import org.apache.zookeeper.ZooKeeper.States; -import org.apache.zookeeper.data.ACL; - -import com.bigdata.ha.HAGlue; -import com.bigdata.ha.HAStatusEnum; -import com.bigdata.ha.IndexManagerCallable; -import com.bigdata.ha.RunState; -import com.bigdata.ha.msg.HARootBlockRequest; -import com.bigdata.ha.msg.HASnapshotDigestRequest; -import com.bigdata.ha.msg.IHASnapshotResponse; -import com.bigdata.jini.start.IServiceListener; -import com.bigdata.jini.start.config.JavaServiceConfiguration; -import com.bigdata.jini.start.config.ServiceConfiguration; -import com.bigdata.jini.start.config.ServiceConfiguration.AbstractServiceStarter; -import com.bigdata.jini.start.config.ZookeeperClientConfig; -import com.bigdata.jini.start.process.ProcessHelper; -import com.bigdata.jini.util.ConfigMath; -import com.bigdata.jini.util.JiniUtil; -import com.bigdata.journal.IRootBlockView; -import com.bigdata.journal.StoreState; -import com.bigdata.journal.jini.ha.HAJournalServer.ConfigurationOptions; -import com.bigdata.journal.jini.ha.HAJournalTest.HAGlueTest; -import com.bigdata.quorum.AbstractQuorumClient; -import com.bigdata.quorum.AsynchronousQuorumCloseException; -import com.bigdata.quorum.Quorum; -import com.bigdata.quorum.QuorumClient; -import com.bigdata.quorum.QuorumException; -import com.bigdata.quorum.zk.ZKQuorumClient; -import com.bigdata.quorum.zk.ZKQuorumImpl; -import com.bigdata.rdf.sail.webapp.client.HttpException; -import com.bigdata.service.jini.JiniClientConfig; -import com.bigdata.service.jini.RemoteDestroyAdmin; -import com.bigdata.util.InnerCause; -import com.bigdata.util.config.NicUtil; -import com.bigdata.zookeeper.DumpZookeeper; -import com.bigdata.zookeeper.ZooHelper; - -/** - * Class layers in support to start and stop the {@link HAJournalServer} - * processes. - * - * @author <a href="mailto:tho...@us...">Bryan Thompson</a> - */ -public class AbstractHA3JournalServerTestCase extends - AbstractHAJournalServerTestCase implements DiscoveryListener { - - /** Quorum client used to monitor (or act on) the logical service quorum. */ - protected Quorum<HAGlue, QuorumClient<HAGlue>> quorum = null; - - public AbstractHA3JournalServerTestCase() { - } - - public AbstractHA3JournalServerTestCase(final String name) { - super(name); - } - - /** - * The timeout in milliseconds to await the discovery of a service if there - * is a cache miss (default {@value #DEFAULT_CACHE_MISS_TIMEOUT}). - */ - static final protected long cacheMissTimeout = 2000; - - /** - * Implementation listens for the death of the child process and can be used - * to decide when the child process is no longer executing. - */ - private static class ServiceListener implements IServiceListener { - - private volatile HAGlue haGlue; - private volatile ProcessHelper processHelper; - private volatile boolean dead = false; - private volatile int childPID = 0; - - public ServiceListener() { - - } - - public void setService(final HAGlue haGlue) { - - if (haGlue == null) - throw new IllegalArgumentException(); - - this.haGlue = haGlue; - } - - @SuppressWarnings("unused") - public HAGlue getHAGlue() { - - return haGlue; - - } - - public void add(final ProcessHelper processHelper) { - - if (processHelper == null) - throw new IllegalArgumentException(); - - this.processHelper = processHelper; - - } - - public void remove(final ProcessHelper processHelper) { - - if (processHelper == null) - throw new IllegalArgumentException(); - - if (processHelper != this.processHelper) - throw new AssertionError(); - - /* - * Note: Do not clear the [processHelper] field. - */ - - // Mark the process as known dead. - dead = true; - - } - - public ProcessHelper getProcessHelper() { - - return processHelper; - - } - - public boolean isDead() { - - return dead; - - } - - } - - /** - * Return any overrides to be specified together with the basic - * {@link Configuration}. Each override is the fully qualified name - * of a {@link Configuration} parameter together with its value. For - * example: - * <pre> - * com.bigdata.journal.jini.ha.HAJournalServer.snapshotPolicy=new NoSnapshotPolicy(); - * </pre> - */ - protected String[] getOverrides() { - - return new String[]{}; - - } - - /** - * The {@link Remote} interfaces for these services (if started and - * successfully discovered). - */ - private HAGlue serverA = null, serverB = null, serverC = null; - - /** - * {@link UUID}s for the {@link HAJournalServer}s. - */ - private UUID serverAId = UUID.randomUUID(), serverBId = UUID.randomUUID(), - serverCId = UUID.randomUUID(); - - /** - * These {@link IServiceListener}s are used to reliably detect that the - * corresponding process starts and (most importantly) that it is really - * dies once it has been shutdown or destroyed. - */ - private ServiceListener serviceListenerA = null, serviceListenerB = null; - - private ServiceListener serviceListenerC = null; - - private LookupDiscoveryManager lookupDiscoveryManager = null; - - private ServiceDiscoveryManager serviceDiscoveryManager = null; - - private HAGlueServicesClient discoveryClient = null; - -// /** -// * The {@link ZooKeeperAccessor} used by the {@link #quorum}. -// */ -// private ZooKeeperAccessor zka = null; - - /** - * The {@link ZooKeeper} instance used by the {@link #quorum}. - */ - private ZooKeeper zookeeper = null; - - private ZookeeperClientConfig zkClientConfig = null; - -// /** -// * The {@link ACL}s used by the {@link #quorum}. -// */ -// private List<ACL> acl = null; - - /** - * The {@link ZooKeeper} instance used by the {@link #quorum}. - */ - private ZooKeeper getZookeeper() { - final ZooKeeper zookeeper = this.zookeeper; - if (zookeeper == null) - throw new IllegalStateException(); - return zookeeper; - } - - /** - * Return the negotiated zookeeper session timeout in milliseconds (if - * available) and otherwise the requested zookeeper session timeout. - */ - protected int getZKSessionTimeout() { - final ZooKeeper zookeeper = this.zookeeper; - if (zookeeper != null) { - final int t = zookeeper.getSessionTimeout(); - if (t > 0) - return t; - } - ZookeeperClientConfig t = zkClientConfig; - if (t != null) { - return t.sessionTimeout; - } - return 10000; - } - - /** - * The logicalServiceId (without the zroot prefix). - */ - private String logicalServiceId = null; - - /** - * The zpath of the logical service. - */ - protected String logicalServiceZPath = null; - - @Override - protected void setUp() throws Exception { - - /* - * Destroy the test directory structure. - * - * Note: This is done before we run the test rather than after so we can - * look at the end state of the data after running the test. - */ - { - - final File testDir = getTestDir(); - - if (testDir.exists()) { - - recursiveDelete(testDir); - - } - - } - - super.setUp(); - -// /* -// * Some tests tear down the zookeeper server process. This ensures that -// * we restart that server process before running another test. -// */ -// try { -// assertZookeeperRunning(); -// } catch (AssertionFailedError ex) { -// try { -// log.warn("Forcing ZooKeeper server process restart."); -// startZookeeper(); -// } catch (RuntimeException ex2) { -// log.error(ex2, ex2); -// } -// } - - // Unique for each test. - logicalServiceId = "CI-HAJournal-" + getName() + "-" + UUID.randomUUID(); - - /* - * Read the jini/river configuration file. We need this to setup the - * clients that we will use to lookup the services that we start. - */ - final Configuration config = ConfigurationProvider - .getInstance(new String[] { SRC_PATH + "jiniClient.config" }); - - final JiniClientConfig jiniClientConfig = new JiniClientConfig( - JiniClientConfig.Options.NAMESPACE, config); - - /* - * Note: This class will perform multicast discovery if ALL_GROUPS - * is specified and otherwise requires you to specify one or more - * unicast locators (URIs of hosts running discovery services). As - * an alternative, you can use LookupDiscovery, which always does - * multicast discovery. - */ - lookupDiscoveryManager = new LookupDiscoveryManager( - jiniClientConfig.groups, jiniClientConfig.locators, - this /* DiscoveryListener */, config); - - /* - * Setup a helper class that will be notified as services join or leave - * the various registrars to which the data server is listening. - */ - serviceDiscoveryManager = new ServiceDiscoveryManager( - lookupDiscoveryManager, new LeaseRenewalManager(), config); - - // Setup discovery for HAGlue clients. - discoveryClient = new HAGlueServicesClient(serviceDiscoveryManager, - null/* serviceDiscoveryListener */, cacheMissTimeout); - - if (!isZookeeperRunning()) { - - /* - * Ensure that zookeeper is running. - * - * Note: Some unit tests will tear down the zookeeper server - * process. This ensures that the zookeeper server process is - * restarted before the next test runs. - */ - - startZookeeper(); - - } - - // Setup quorum client. - quorum = newQuorum(); - - } - - @Override - protected void tearDown() throws Exception { - - if (quorum != null && log.isInfoEnabled()) { - - /* - * Echo the final quorum state (as currently reflected). - */ - - log.info(quorum.toString()); - - } - - if (zookeeper != null && log.isInfoEnabled()) { - - /* - * Dump the final zookeeper state for the logical service. - */ - - log.info("Zookeeper State for logical service: \n" + dumpZoo()); - - } - - destroyAll(); - - if (serviceDiscoveryManager != null) { - serviceDiscoveryManager.terminate(); - serviceDiscoveryManager = null; - } - - if (lookupDiscoveryManager != null) { - lookupDiscoveryManager.terminate(); - lookupDiscoveryManager = null; - } - - if (discoveryClient != null) { - discoveryClient.terminate(); - discoveryClient = null; - } - - if (quorum != null) { - quorum.terminate(); - quorum = null; - } - - if (zookeeper != null) { - final String zroot = logicalServiceZPath; - destroyZNodes(zroot, zookeeper); - zookeeper.close(); - zookeeper = null; - zkClientConfig = null; - } - - logicalServiceId = null; - logicalServiceZPath = null; - serverAId = serverBId = serverCId = null; - - super.tearDown(); - - } - - protected void destroyAll() throws AsynchronousQuorumCloseException, - InterruptedException, TimeoutException { - /** - * The most reliable tear down is in reverse pipeline order. - * - * This may not be necessary long term but for now we want to avoid - * destroying the leader first since it can lead to problems as - * followers attempt to reform - */ - final HAGlue leader; - final File leaderServiceDir; - final ServiceListener leaderListener; - if (quorum.isQuorumMet()) { - final long token = quorum.awaitQuorum(awaitQuorumTimeout, - TimeUnit.MILLISECONDS); - /* - * Note: It is possible to resolve a proxy for a service that - * has been recently shutdown or destroyed. This is effectively - * a data race. - */ - final HAGlue t = quorum.getClient().getLeader(token); - if (t.equals(serverA)) { - leader = t; - leaderServiceDir = getServiceDirA(); - leaderListener = serviceListenerA; - } else if (t.equals(serverB)) { - leader = t; - leaderServiceDir = getServiceDirB(); - leaderListener = serviceListenerB; - } else if (t.equals(serverC)) { - leader = t; - leaderServiceDir = getServiceDirC(); - leaderListener = serviceListenerC; - } else { - if (serverA == null && serverB == null && serverC == null) { - /* - * There are no services running and nothing to shutdown. We - * probably resolved a stale proxy to the leader above. - */ - return; - } - throw new IllegalStateException( - "Leader is none of A, B, or C: leader=" + t + ", A=" - + serverA + ", B=" + serverB + ", C=" + serverC); - } - } else { - leader = null; - leaderServiceDir = null; - leaderListener = null; - } - - if (leader == null || !leader.equals(serverA)) { - destroyA(); - } - - if (leader == null || !leader.equals(serverB)) { - destroyB(); - } - - if (leader == null || !leader.equals(serverC)) { - destroyC(); - } - - // Destroy leader last - if (leader != null) { - safeDestroy(leader, leaderServiceDir, leaderListener); - - serverA = serverB = serverC = null; - serviceListenerA = serviceListenerC =serviceListenerB = null; - } - - - } - - protected UUID[] getServices(final HAGlue[] members) throws IOException { - final UUID[] services = new UUID[members.length]; - for (int m = 0; m < members.length; m++) { - services[m] = members[m].getServiceId(); - } - - return services; - } - - /** - * Waits for pipeline in expected order - * - * @param members - * @throws IOException - */ - protected void awaitPipeline(final HAGlue[] members) throws IOException { - awaitPipeline(5, TimeUnit.SECONDS, members); - } - - /** - * Waits for pipeline in expected order - * - * @param members - * @throws IOException - */ - protected void awaitPipeline(final long timeout, final TimeUnit unit, - final HAGlue[] members) throws IOException { - - final UUID[] services = getServices(members); - - assertCondition(new Runnable() { - @Override - public void run() { - try { - assertEquals(services, quorum.getPipeline()); - } catch (Exception e) { - // KB does not exist. - fail(); - } - } - - }, timeout, unit); - - } - - protected void assertReady(final HAGlue[] members) throws IOException { - - for (HAGlue member : members) { - - final HAStatusEnum status = member.getHAStatus(); - - if (log.isInfoEnabled()) - log.info(member.getServiceName() + ": " + status); - - assertFalse(HAStatusEnum.NotReady == status); - - } - - } - - /** - * Waits for joined in expected order - * - * @param members - * @throws IOException - */ - protected void awaitJoined(final HAGlue[] members) throws IOException { - - final UUID[] services = getServices(members); - - assertCondition(new Runnable() { - @Override - public void run() { - try { - assertEquals(services, quorum.getJoined()); - } catch (Exception e) { - // KB does not exist. - fail(); - } - } - - }, 5, TimeUnit.SECONDS); - - } - - /** - * Waits for members in expected order - * - * @param members - * @throws IOException - */ - protected void awaitMembers(final HAGlue[] members) throws IOException { - - final UUID[] services = getServices(members); - - assertCondition(new Runnable() { - @Override - public void run() { - try { - assertEquals(services, quorum.getMembers()); - } catch (Exception e) { - // KB does not exist. - fail(); - } - } - - }, 5, TimeUnit.SECONDS); - - } - - /** - * Start A then B then C. As each service starts, this method waits for that - * service to appear in the pipeline in the proper position. - * - * @return The ordered array of services <code>[A, B, C]</code> - */ - protected HAGlue[] startSequenceABC() throws Exception { - - startA(); - awaitPipeline(new HAGlue[] { serverA }); - - startB(); - awaitPipeline(new HAGlue[] { serverA, serverB }); - - startC(); - awaitPipeline(new HAGlue[] { serverA, serverB, serverC }); - - return new HAGlue[] { serverA, serverB, serverC }; - - } - - /* - * Utility methods to access service HALog file directories - */ - - /** - * The effective name for this test as used to name the directories in which - * we store things. - */ - protected String getEffectiveTestFileName() { - - return effectiveTestFileName; - - } - - /** - * The effective name for this test as used to name the directories in which - * we store things. - * - * TODO If there are method name collisions across the different test - * classes then the test suite name can be added to this. Also, if there are - * file naming problems, then this value can be munged before it is - * returned. - */ - private final String effectiveTestFileName = getClass().getSimpleName() - + "." + getName(); - - /** - * The directory that is the parent of each {@link HAJournalServer}'s - * individual service directory. - */ - protected File getTestDir() { - return new File(TGT_PATH, getEffectiveTestFileName()); - } - - protected File getServiceDirA() { - return new File(getTestDir(), "A"); - } - - protected File getServiceDirB() { - return new File(getTestDir(), "B"); - } - - protected File getServiceDirC() { - return new File(getTestDir(), "C"); - } - - protected File getHAJournalFileA() { - return new File(getServiceDirA(), "bigdata-ha.jnl"); - } - - protected File getHAJournalFileB() { - return new File(getServiceDirB(), "bigdata-ha.jnl"); - } - - protected File getHAJournalFileC() { - return new File(getServiceDirC(), "bigdata-ha.jnl"); - } - - protected File getHALogDirA() { - return new File(getServiceDirA(), "HALog"); - } - - protected File getHALogDirB() { - return new File(getServiceDirB(), "HALog"); - } - - protected File getHALogDirC() { - return new File(getServiceDirC(), "HALog"); - } - - protected File getSnapshotDirA() { - return new File(getServiceDirA(), "snapshot"); - } - - protected File getSnapshotDirB() { - return new File(getServiceDirB(), "snapshot"); - } - - protected File getSnapshotDirC() { - return new File(getServiceDirC(), "snapshot"); - } - - /** - * Clear out everything in zookeeper for the specified zpath. - */ - private void destroyZNodes(final String zpath, final ZooKeeper zookeeper) { - - if (log.isInfoEnabled()) - log.info("zpath=" + zpath); - - try { - - if (zookeeper.exists(zpath, false/* watch */) != null) { - - ZooHelper.destroyZNodes(zookeeper, zpath, 0/* depth */); - } - - } catch (InterruptedException ex) { - - log.warn(ex); - - } catch (SessionExpiredException ex) { - - log.warn(ex); - - } catch (ConnectionLossException ex) { - - log.warn(ex); - - } catch (Exception e) { - - throw new RuntimeException(e); - - } - - } - - /** - * Dump the zookeeper state for the logical service. - */ - protected String dumpZoo() throws KeeperException, InterruptedException { - - final StringWriter sw = new StringWriter(); - - final PrintWriter w = new PrintWriter(sw); - - final ZooKeeper zk = getZookeeper(); - try { - new DumpZookeeper(zk).dump(w, true/* showData */, - logicalServiceZPath, 0/* depth */); - } catch (KeeperException ex) { - /* - * Note: This is expected if you have shut down the zookeeper server - * process under test suite control. - */ - ex.printStackTrace(w); - } - w.flush(); - w.close(); - - sw.flush(); - - return sw.toString(); - - } - - /** - * Safely destroy the service. - * - * @param haGlue - * The service. - */ - protected void safeDestroy(final HAGlue haGlue, final File serviceDir, - final ServiceListener serviceListener) { - - if (log.isInfoEnabled()) - log.info("Destroying service: " + haGlue + ", serviceDir=" - + serviceDir); - - if (haGlue == null) { - - tidyServiceDirectory(serviceDir); // ensure empty - - return; - - } - - try { - - final UUID serviceId = haGlue.getServiceUUID(); - - haGlue.destroy(); - - awaitServiceGone(serviceId, haGlue, serviceDir, serviceListener); - - } catch (Throwable t) { - - if (InnerCause.isInnerCause(t, java.net.ConnectException.class)) { - - log.warn("Service is down (RMI not allowed): " + t); - - } else { - - // Some other problem. - log.error(t, t); - - } - - { - - if (serviceListener != null && serviceListener.childPID != 0) { - - final int childPID = serviceListener.childPID; - - log.warn("Attempting to signal service: " + serviceDir - + ", pid=" + childPID); - - // Try to request a thread dump. - if (trySignal(SignalEnum.QUIT, childPID)) { - - // Give the child a moment to respond. - try { - Thread.sleep(2000/* ms */); - } catch (InterruptedException e) { - // Propagate the interrupt. - Thread.currentThread().interrupt(); - } - - } - - // Sure kill on the child. - trySignal(SignalEnum.KILL, childPID); - - } - - } - - // try and ensure serviceDir is tidied in any event - // Remove *.jnl, HALog/*, snapshot/* - log.warn("Need to clear directory explicitly: " + serviceDir.getAbsolutePath()); - - tidyServiceDirectory(serviceDir); - } - - } - - private void tidyServiceDirectory(final File serviceDir) { - if (serviceDir == null || !serviceDir.exists()) - return; - - for (File file : serviceDir.listFiles()) { - final String name = file.getName(); - - if (name.endsWith(".jnl") || name.equals("snapshot") - || name.equals("HALog")) { - recursiveDelete(file); - } - } - } - - /** - * Some signals understood by Java. - * - * @author <a href="mailto:tho...@us...">Bryan - * Thompson</a> - */ - protected enum SignalEnum { - /** Heap dump. */ - INT(2,"INT"), - /** Thread dump (^C). */ - QUIT(3,"QUIT"), - /** Sure kill. */ - KILL(9,"KILL"); - private final int code; - private final String symbol; - private SignalEnum(int code, String symbol) { - this.code = code; - this.symbol = symbol; - } - public int code() { - return code; - } - public String symbol() { - return symbol; - } - }; - - /** - * Attempt to signal a process (presumably a child process). - * - * @param signalEnum - * The signal. - * @param pid - * The pid of the process. - * - * @return true unless an exception was encountered (a <code>true</code> - * return is not a sure indicator of success). - */ - static protected boolean trySignal(final SignalEnum signalEnum, - final int pid) { - - final String cmd = "kill -" + signalEnum.symbol() + " " + pid; - - log.warn("SIGNAL: " + cmd); - - try { - - Runtime.getRuntime().exec(cmd); - - return true; - - } catch (IOException e) { - - log.error("FAILED: " + cmd, e); - - return false; - - } - - } - - protected void destroyA() { - safeDestroy(serverA, getServiceDirA(), serviceListenerA); - serverA = null; - serviceListenerA = null; - } - - protected void destroyB() { - safeDestroy(serverB, getServiceDirB(), serviceListenerB); - serverB = null; - serviceListenerB = null; - } - - protected void destroyC() { - safeDestroy(serverC, getServiceDirC(), serviceListenerC); - serverC = null; - serviceListenerC = null; - } - - protected void shutdownA() throws IOException { - safeShutdown(serverA, getServiceDirA(), serviceListenerA, true); - - serverA = null; - serviceListenerA = null; - } - - protected void shutdownB() throws IOException { - safeShutdown(serverB, getServiceDirB(), serviceListenerB, true); - - serverB = null; - serviceListenerB = null; - } - - protected void shutdownC() throws IOException { - safeShutdown(serverC, getServiceDirC(), serviceListenerC, true); - - serverC = null; - serviceListenerC = null; - } - - protected void kill(final HAGlue service) throws IOException { - - final int pid = ((HAGlueTest) service).getPID(); - - trySignal(SignalEnum.KILL, pid); - - } - - /** - * NOTE: This relies on equals() being valid for Proxies which isn't - * necessarily something we should rely on - */ - protected void shutdown(final HAGlue service) throws IOException { - if (service == null) { - throw new IllegalArgumentException(); - } - - if (service.equals(serverA)) { - shutdownA(); - } else if (service.equals(serverB)) { - shutdownB(); - } else if (service.equals(serverC)) { - shutdownC(); - } else { - throw new IllegalArgumentException("Unable to match service: " - + service + " possible problem with equals() on Proxy"); - } - } - - protected void shutdownLeader() throws AsynchronousQuorumCloseException, - InterruptedException, TimeoutException, IOException { - - final long token = quorum.awaitQuorum(awaitQuorumTimeout, - TimeUnit.MILLISECONDS); - - final HAGlue leader = quorum.getClient().getLeader(token); - - shutdown(leader); - - } - - protected class SafeShutdownTask implements Callable<Void> { - - private final HAGlue haGlue; - private final File serviceDir; - private final ServiceListener serviceListener; - private final boolean now; - - public SafeShutdownTask(final HAGlue haGlue, final File serviceDir, - final ServiceListener serviceListener) { - - this(haGlue, serviceDir, serviceListener, false/* now */); - - } - - public SafeShutdownTask(final HAGlue haGlue, final File serviceDir, - final ServiceListener serviceListener, final boolean now) { - - this.haGlue = haGlue; - this.serviceDir = serviceDir; - this.serviceListener = serviceListener; - this.now = now; - - } - - @Override - public Void call() { - - safeShutdown(haGlue, serviceDir, serviceListener, now); - - return null; - - } - - } - - protected class SafeShutdownATask extends SafeShutdownTask { - - public SafeShutdownATask() { - this(false/* now */); - } - - public SafeShutdownATask(final boolean now) { - super(serverA, getServiceDirA(), serviceListenerA, now); - } - - } - - protected class SafeShutdownBTask extends SafeShutdownTask { - - public SafeShutdownBTask() { - this(false/* now */); - } - - public SafeShutdownBTask(final boolean now) { - super(serverB, getServiceDirB(), serviceListenerB, now); - } - - } - - protected class SafeShutdownCTask extends SafeShutdownTask { - - public SafeShutdownCTask() { - this(false/* now */); - } - - public SafeShutdownCTask(final boolean now) { - super(serverC, getServiceDirC(), serviceListenerC, now); - } - - } - - /** - * Debug class to explicitly ask one service to remove another. - * - * This emulates the behaviour of the service in receiving correct notification - * of a target service failure -for example after a wire pull or sure kill. - * - */ - protected static class ForceRemoveService extends IndexManagerCallable<Void> { - - private static final long serialVersionUID = 1L; - private final UUID service; - - ForceRemoveService(final UUID service) { - this.service = service; - } - - @Override - public Void call() throws Exception { - - final HAJournal ha = (HAJournal) this.getIndexManager(); - - ha.getQuorum().getActor().forceRemoveService(service); - - return null; - } - - } - - private void safeShutdown(final HAGlue haGlue, final File serviceDir, - final ServiceListener serviceListener) { - - safeShutdown(haGlue, serviceDir, serviceListener, false/* now */); - - } - - private void safeShutdown(final HAGlue haGlue, final File serviceDir, - final ServiceListener serviceListener, final boolean now) { - - if (haGlue == null) - return; - - try { - - final UUID serviceId = haGlue.getServiceUUID(); - - // Shutdown the remote service. - if (now) - ((RemoteDestroyAdmin) haGlue).shutdownNow(); - else - ((RemoteDestroyAdmin) haGlue).shutdown(); - - awaitServiceGone(serviceId, haGlue, serviceDir, serviceListener); - - } catch (Throwable t) { - - if (InnerCause.isInnerCause(t, java.net.ConnectException.class)) { - - log.warn("Service is down: " + t); - - } else { - - // Some other problem. - log.error(t, t); - - } - - } - - } - - /** - * Await positive indication that the service is shutdown. This can mean - * looking for the service {@link RunState} change, looking for the service - * to no longer be discoverable, looking for the service to no longer accept - * RMI requests, etc. - * <p> - * Note: If the child does not shutdown normally, then this will force a - * kill of the child process and throw out an {@link AssertionFailedError}. - * This {@link AssertionFailedError} is a good indication that there is a - * problem with the process shutdown / destroy logic. You should obtain - * thread dumps when this happens and examine them for the root cause of the - * process failing to terminate normally. - */ - private void awaitServiceGone(final UUID serviceId, final HAGlue haGlue, - final File serviceDir, final ServiceListener serviceListener) { - - assertCondition(new Runnable() { - @Override - public void run() { - try { - haGlue.getRunState(); - fail();// still answering RMI requests. - } catch (IOException e) { - // Service is down. - return; - } - } - }); - - assertCondition(new Runnable() { - @Override - ... [truncated message content] |
From: <tho...@us...> - 2014-03-04 20:38:42
|
Revision: 7910 http://sourceforge.net/p/bigdata/code/7910 Author: thompsonbry Date: 2014-03-04 20:38:39 +0000 (Tue, 04 Mar 2014) Log Message: ----------- Placing a tag in SVN before committing the fix to #730 (Configure NSS using jetty.xml) Added Paths: ----------- tags/PRE_JETTY_XML_REFACTOR/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-03-04 20:11:12
|
Revision: 7909 http://sourceforge.net/p/bigdata/code/7909 Author: tobycraig Date: 2014-03-04 20:11:09 +0000 (Tue, 04 Mar 2014) Log Message: ----------- #829 - Added support for language for XML export Modified Paths: -------------- branches/RDR/bigdata-war/src/html/workbench.js Modified: branches/RDR/bigdata-war/src/html/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/workbench.js 2014-03-04 19:50:06 UTC (rev 7908) +++ branches/RDR/bigdata-war/src/html/workbench.js 2014-03-04 20:11:09 UTC (rev 7909) @@ -416,7 +416,13 @@ } else { dataType = ''; } - xml += '\t\t\t<binding name="' + bindings[j] + '"><' + bindingType + dataType + '>' + td.textContent + '</' + bindingType + '></binding>\n'; + var lang = $(td).data('lang'); + if(lang) { + lang = ' xml:lang="' + lang + '"'; + } else { + lang = ''; + } + xml += '\t\t\t<binding name="' + bindings[j] + '"><' + bindingType + dataType + lang + '>' + td.textContent + '</' + bindingType + '></binding>\n'; }); xml += '\t\t</result>\n'; }); @@ -492,6 +498,9 @@ var tdData = ' class="literal" data-datatype="' + binding.datatype + '"'; } else { var tdData = ' class="' + binding.type + '"'; + if(binding['xml:lang']) { + tdData += ' data-lang="' + binding['xml:lang'] + '"'; + } } tr.append('<td' + tdData + '>' + binding.value + '</td>'); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-03-04 19:50:12
|
Revision: 7908 http://sourceforge.net/p/bigdata/code/7908 Author: tobycraig Date: 2014-03-04 19:50:06 +0000 (Tue, 04 Mar 2014) Log Message: ----------- #836 - Added simple create namespace form Modified Paths: -------------- branches/RDR/bigdata-war/src/html/new.html branches/RDR/bigdata-war/src/html/workbench.js Modified: branches/RDR/bigdata-war/src/html/new.html =================================================================== --- branches/RDR/bigdata-war/src/html/new.html 2014-03-04 19:12:18 UTC (rev 7907) +++ branches/RDR/bigdata-war/src/html/new.html 2014-03-04 19:50:06 UTC (rev 7908) @@ -151,6 +151,8 @@ <ul id="namespaces-list"> </ul> + + <form id="namespace-create"><input type="text"> <input type="submit" value="Create namespace"></form> </div> </div> Modified: branches/RDR/bigdata-war/src/html/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/workbench.js 2014-03-04 19:12:18 UTC (rev 7907) +++ branches/RDR/bigdata-war/src/html/workbench.js 2014-03-04 19:50:06 UTC (rev 7908) @@ -88,6 +88,26 @@ } } +function createNamespace(e) { + e.preventDefault(); + var namespace = $(this).find('input').val(); + if(!namespace) { + return; + } + // TODO: validate namespace + // TODO: allow for other options to be specified + var data = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">\n<properties>\n<entry key="com.bigdata.rdf.sail.namespace">' + namespace + '</entry>\n</properties>'; + var settings = { + type: 'POST', + data: data, + contentType: 'application/xml', + success: getNamespaces, + error: function(jqXHR, textStatus, errorThrown) { alert(errorThrown); } + }; + $.ajax('/namespace', settings); +} +$('#namespace-create').submit(createNamespace); + function getDefaultNamespace() { $.get('/sparql', function(data) { // Chrome does not work with rdf\:Description, so look for Description too This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |