From: <mrp...@us...> - 2013-09-28 18:23:33
|
Revision: 7419 http://bigdata.svn.sourceforge.net/bigdata/?rev=7419&view=rev Author: mrpersonick Date: 2013-09-28 18:23:26 +0000 (Sat, 28 Sep 2013) Log Message: ----------- remote query cancellation - intermediate commit 1 Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/StatusServlet.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/IPreparedSparqlUpdate.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/StatusServlet.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/StatusServlet.java 2013-09-26 14:52:49 UTC (rev 7418) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/StatusServlet.java 2013-09-28 18:23:26 UTC (rev 7419) @@ -151,7 +151,7 @@ * The name of a request parameter whose value is the {@link UUID} of a * top-level query. */ - private static final String QUERY_ID = "queryId"; + public static final String QUERY_ID = "queryId"; /** * The name of a request parameter used to cancel a running query. At least @@ -160,7 +160,7 @@ * * @see #QUERY_ID */ - static final String CANCEL_QUERY = "cancelQuery"; + public static final String CANCEL_QUERY = "cancelQuery"; /** * Request a snapshot of the journal (HA only). The snapshot will be written Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/IPreparedSparqlUpdate.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/IPreparedSparqlUpdate.java 2013-09-26 14:52:49 UTC (rev 7418) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/IPreparedSparqlUpdate.java 2013-09-28 18:23:26 UTC (rev 7419) @@ -27,6 +27,8 @@ package com.bigdata.rdf.sail.webapp.client; +import java.util.UUID; + /** * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * @version $Id$ @@ -34,5 +36,7 @@ public interface IPreparedSparqlUpdate { void evaluate() throws Exception; + + UUID getQueryId(); } \ No newline at end of file Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2013-09-26 14:52:49 UTC (rev 7418) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2013-09-28 18:23:26 UTC (rev 7419) @@ -74,6 +74,7 @@ import org.openrdf.model.impl.ValueFactoryImpl; import org.openrdf.query.BindingSet; import org.openrdf.query.GraphQueryResult; +import org.openrdf.query.QueryEvaluationException; import org.openrdf.query.TupleQueryResult; import org.openrdf.query.TupleQueryResultHandlerBase; import org.openrdf.query.impl.MapBindingSet; @@ -97,6 +98,8 @@ import org.xml.sax.Attributes; import org.xml.sax.ext.DefaultHandler2; +import com.bigdata.rdf.sail.webapp.StatusServlet; + // Note: Do not import. Not part of the bigdata-client.jar // //import com.bigdata.rdf.sparql.ast.service.RemoteServiceOptions; @@ -529,9 +532,9 @@ final ConnectOptions opts = newUpdateConnectOptions(); - opts.addRequestParam("cancelQuery"); + opts.addRequestParam(StatusServlet.CANCEL_QUERY); - opts.addRequestParam("queryId", queryId.toString()); + opts.addRequestParam(StatusServlet.QUERY_ID, queryId.toString()); checkResponseCode(doConnect(opts)); @@ -1000,32 +1003,13 @@ } + @Override public TupleQueryResult evaluate() throws Exception { - HttpResponse response = null; -// try { - setupConnectOptions(); - checkResponseCode(response = doConnect(opts)); + return tupleResults(opts, getQueryId()); - return tupleResults(response); - -// } finally { -// -// try { -// -// if (response != null) -// EntityUtils.consume(response.getEntity()); -// -// } catch (Exception ex) { -// -// log.warn(ex); -// -// } -// -// } - } } @@ -1556,7 +1540,7 @@ HttpEntity entity = null; BackgroundTupleResult result = null; try { - + entity = response.getEntity(); final String contentType = entity.getContentType().getValue(); @@ -1624,6 +1608,151 @@ } /** + * Extracts the solutions from a SPARQL query. + * + * @param response + * The connection from which to read the results. + * + * @return The results. + * + * @throws Exception + * If anything goes wrong. + */ + public TupleQueryResult tupleResults(final ConnectOptions opts, final UUID queryId) + throws Exception { + + HttpEntity entity = null; + BackgroundTupleResult result = null; + boolean needToCancel = false; + try { + + /* + * If we put this after the doConnect we risk an interruption in + * between the doConnect and the setting the flag to true, which + * would result in a query running on the server that should have + * been canceled. + */ + needToCancel = true; + + final HttpResponse response = doConnect(opts); + + checkResponseCode(response); + + entity = response.getEntity(); + + final String contentType = entity.getContentType().getValue(); + + final MiniMime mimeType = new MiniMime(contentType); + + final TupleQueryResultFormat format = TupleQueryResultFormat + .forMIMEType(mimeType.getMimeType()); + + if (format == null) + throw new IOException( + "Could not identify format for service response: serviceURI=" + + sparqlEndpointURL + ", contentType=" + contentType + + " : response=" + getResponseBody(response)); + + final TupleQueryResultParserFactory parserFactory = TupleQueryResultParserRegistry + .getInstance().get(format); + + if (parserFactory == null) + throw new IOException( + "No parser for format for service response: serviceURI=" + + sparqlEndpointURL + ", contentType=" + contentType + + ", format=" + format + " : response=" + + getResponseBody(response)); + + final TupleQueryResultParser parser = parserFactory.getParser(); + + final InputStream in = entity.getContent(); + + result = new BackgroundTupleResult(parser, in, entity); + + executor.execute(result); + + final MapBindingSet bindings = new MapBindingSet(); + + final InsertBindingSetCursor cursor = + new InsertBindingSetCursor(result, bindings); + + final List<String> list = new ArrayList<String>( + result.getBindingNames()); + + final TupleQueryResultImpl tqrImpl = new TupleQueryResultImpl(list, cursor) { + + transient boolean done = false; + + @Override + public boolean hasNext() throws QueryEvaluationException { + + final boolean hasNext = super.hasNext(); + + if (hasNext == false) { + + done = true; + + } + + return hasNext; + + } + + @Override + public synchronized void close() throws QueryEvaluationException { + + super.close(); + + if (!done) { + + try { + cancel(queryId); + } catch (Exception ex) { + throw new QueryEvaluationException(ex); + } + + done = true; + + } + + }; + + }; + + needToCancel = false; + + return tqrImpl; + +// final TupleQueryResultBuilder handler = new TupleQueryResultBuilder(); +// +// parser.setTupleQueryResultHandler(handler); +// +// parser.parse(entity.getContent()); +// +// // done. +// return handler.getQueryResult(); + + } finally { + +// // terminate the http connection. +// response.disconnect(); + if (result == null) { + try { + EntityUtils.consume(entity); + } catch (IOException ex) { } + } + + if (needToCancel) { + try { + cancel(queryId); + } catch(Exception ex) { } + } + + } + + } + + /** * Builds a graph from an RDF result set (statements, not binding sets). * * @param response This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2013-11-08 20:24:07
|
Revision: 7517 http://bigdata.svn.sourceforge.net/bigdata/?rev=7517&view=rev Author: thompsonbry Date: 2013-11-08 20:24:01 +0000 (Fri, 08 Nov 2013) Log Message: ----------- Added ability to specify which digests should be computed (All, None, Journal, Snapshots, HALogs) and made the default when "digests=" is specified "Journal". This makes the digest computation request through the /status page useable when there are a LOT of HALog files on hand. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HAStatusServletUtil.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/StatusServlet.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HAStatusServletUtil.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HAStatusServletUtil.java 2013-11-08 19:42:57 UTC (rev 7516) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HAStatusServletUtil.java 2013-11-08 20:24:01 UTC (rev 7517) @@ -62,6 +62,7 @@ import com.bigdata.quorum.Quorum; import com.bigdata.quorum.zk.ZKQuorumClient; import com.bigdata.quorum.zk.ZKQuorumImpl; +import com.bigdata.rdf.sail.webapp.StatusServlet.DigestEnum; import com.bigdata.zookeeper.DumpZookeeper; /** @@ -162,7 +163,19 @@ quorumService = t; } - final boolean digests = req.getParameter(StatusServlet.DIGESTS) != null; + final DigestEnum digestEnum; + { + final String str = req.getParameter(StatusServlet.DIGESTS); + if (str == null) { + digestEnum = null; + } else { + if (str.trim().isEmpty()) { + digestEnum = StatusServlet.DEFAULT_DIGESTS; + } else { + digestEnum = DigestEnum.valueOf(str.trim()); + } + } + } current.node("h1", "High Availability"); @@ -270,7 +283,8 @@ final File file = journal.getFile(); if (file != null) { String digestStr = null; - if (digests) { + if (digestEnum != null + && (digestEnum == DigestEnum.All || digestEnum == DigestEnum.Journal)) { try { final MessageDigest digest = MessageDigest .getInstance("MD5"); @@ -361,7 +375,8 @@ + (currentFile == null ? "N/A" : currentFile .getName())).node("br").close(); } - if (digests) { + if (digestEnum != null + && (digestEnum == DigestEnum.All || digestEnum == DigestEnum.HALogs)) { /* * List each historical HALog file together with its digest. * @@ -379,7 +394,7 @@ final IHALogReader r = nexus.getHALogWriter() .getReader(closingCommitCounter); try { - if (digests && !r.isEmpty()) { + if (!r.isEmpty()) { try { final MessageDigest digest = MessageDigest .getInstance("MD5"); @@ -462,7 +477,8 @@ // final File file = journal.getSnapshotManager() // .getSnapshotFile(rb.getCommitCounter()); String digestStr = null; - if (digests) { + if (digestEnum != null + && (digestEnum == DigestEnum.All || digestEnum == DigestEnum.Snapshots)) { try { final MessageDigest digest = MessageDigest .getInstance("MD5"); Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/StatusServlet.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/StatusServlet.java 2013-11-08 19:42:57 UTC (rev 7516) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/StatusServlet.java 2013-11-08 20:24:01 UTC (rev 7517) @@ -175,9 +175,19 @@ * on the journal are only valid if there are no concurrent writes on the * journal and the journal has been through either a commit or an abort * protocol. + * <p> + * The value is a {@link DigestEnum} and defaults to + * {@link DigestEnum#Journal} when {@link #DIGESTS} is specified without an + * explicit {@link DigestEnum} value. */ static final String DIGESTS = "digests"; + + static final DigestEnum DEFAULT_DIGESTS = DigestEnum.Journal; + static enum DigestEnum { + None, Journal, HALogs, Snapshots, All; + } + /** * Special HA status request designed for clients that poll to determine the * status of an HAJournalServer. This option is exclusive of other This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2013-11-13 17:37:19
|
Revision: 7545 http://bigdata.svn.sourceforge.net/bigdata/?rev=7545&view=rev Author: thompsonbry Date: 2013-11-13 17:37:13 +0000 (Wed, 13 Nov 2013) Log Message: ----------- Override annotations. made some methods static. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/DeleteServlet.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/InsertServlet.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/QueryServlet.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/UpdateServlet.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/DeleteServlet.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/DeleteServlet.java 2013-11-13 17:34:59 UTC (rev 7544) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/DeleteServlet.java 2013-11-13 17:37:13 UTC (rev 7545) @@ -36,7 +36,6 @@ import org.openrdf.model.Statement; import org.openrdf.model.URI; import org.openrdf.model.Value; -import org.openrdf.model.impl.URIImpl; import org.openrdf.rio.RDFFormat; import org.openrdf.rio.RDFHandlerException; import org.openrdf.rio.RDFParser; @@ -414,6 +413,7 @@ } } + @Override public void handleStatement(final Statement stmt) throws RDFHandlerException { Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/InsertServlet.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/InsertServlet.java 2013-11-13 17:34:59 UTC (rev 7544) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/InsertServlet.java 2013-11-13 17:37:13 UTC (rev 7545) @@ -546,6 +546,7 @@ } } + @Override public void handleStatement(final Statement stmt) throws RDFHandlerException { Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/QueryServlet.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/QueryServlet.java 2013-11-13 17:34:59 UTC (rev 7544) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/QueryServlet.java 2013-11-13 17:37:13 UTC (rev 7545) @@ -658,17 +658,19 @@ * linked data GET by turning it into a SPARQL DESCRIBE query. * @throws IOException */ - private String getQueryString(final HttpServletRequest req) throws IOException { - if (RESTServlet.hasMimeType(req, MIME_SPARQL_QUERY)) { - // return the body of the POST, see trac 711 - return readFully( req.getReader() ); - } - return req.getParameter(ATTR_QUERY) != null ? req + static private String getQueryString(final HttpServletRequest req) + throws IOException { + if (RESTServlet.hasMimeType(req, MIME_SPARQL_QUERY)) { + // return the body of the POST, see trac 711 + return readFully(req.getReader()); + } + return req.getParameter(ATTR_QUERY) != null ? req .getParameter(ATTR_QUERY) : (String) req .getAttribute(ATTR_QUERY); - } - - private String getUpdateString(final HttpServletRequest req) throws IOException { + } + + static private String getUpdateString(final HttpServletRequest req) + throws IOException { if (RESTServlet.hasMimeType(req, MIME_SPARQL_UPDATE)) { // return the body of the POST, see trac 711 return readFully( req.getReader() ); @@ -676,9 +678,10 @@ return req.getParameter(ATTR_UPDATE); } - static String readFully(Reader reader) throws IOException { - char[] arr = new char[8*1024]; // 8K at a time - StringBuffer buf = new StringBuffer(); + // Note: Referenced by the test suite. Should be moved to utility class. + static String readFully(final Reader reader) throws IOException { + final char[] arr = new char[8*1024]; // 8K at a time + final StringBuffer buf = new StringBuffer(); int numChars; while ((numChars = reader.read(arr, 0, arr.length)) > 0) { Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/UpdateServlet.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/UpdateServlet.java 2013-11-13 17:34:59 UTC (rev 7544) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/UpdateServlet.java 2013-11-13 17:37:13 UTC (rev 7545) @@ -355,7 +355,7 @@ if (ServletFileUpload.isMultipartContent(req)) { - doUpdateWithBody(req, resp); + doUpdateWithBody(req, resp); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-05-05 12:29:08
|
Revision: 8195 http://sourceforge.net/p/bigdata/code/8195 Author: thompsonbry Date: 2014-05-05 12:29:04 +0000 (Mon, 05 May 2014) Log Message: ----------- Modified the GangliaLBSPolicy to explicitly check for a null hostname (can be caused by a failed RMI). Modified the HA status page to include the proxy object for the RMI interface for the local service. I want to use this to diagnose situations where one service as a proxy for another but the proxy that is has does not respond and is, hence, probably dead. Note that moving into an error state on that service whose exported proxy is not responding is not enough to get the service to become responsive. This is probably because the error state does not unexport the proxy. However, it does not explain why/how a bad proxy got out there in the first place. See #624 (HA LBS) Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HAStatusServletUtil.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/policy/ganglia/GangliaLBSPolicy.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HAStatusServletUtil.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HAStatusServletUtil.java 2014-05-05 11:59:15 UTC (rev 8194) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HAStatusServletUtil.java 2014-05-05 12:29:04 UTC (rev 8195) @@ -242,6 +242,9 @@ .close(); p.text("Service: path=" + quorumService.getServiceDir()) .node("br").close(); + p.text("Service: proxy=" + + journal.getHAJournalServer().getProxy()) + .node("br").close(); } Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/policy/ganglia/GangliaLBSPolicy.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/policy/ganglia/GangliaLBSPolicy.java 2014-05-05 11:59:15 UTC (rev 8194) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/policy/ganglia/GangliaLBSPolicy.java 2014-05-05 12:29:04 UTC (rev 8195) @@ -625,8 +625,12 @@ for (ServiceScore serviceScore : serviceScores) { if (serviceScore == null) // should never be null. continue; - tmp.add(serviceScore.getHostname()); + final String hostname = serviceScore.getHostname(); + if (hostname == null) // should never be null. + continue; + tmp.add(hostname); } + // dense array of hosts names for services. hosts = tmp.toArray(new String[tmp.size()]); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-05-14 13:58:30
|
Revision: 8310 http://sourceforge.net/p/bigdata/code/8310 Author: thompsonbry Date: 2014-05-14 13:58:26 +0000 (Wed, 14 May 2014) Log Message: ----------- Modified the HA load balancer: - Added additional normalization logic. - Added counters for tracking the #of local forwards, the #of proxies, and the #of errors. - Increased the information rendered on the /status page for the HA load balancer. Note: I have not yet fixed up the unit tests for the normalized scoring policy. I expect 2 failures for those tests. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HALoadBalancerServlet.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HAStatusServletUtil.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractHostLBSPolicy.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractLBSPolicy.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/HostScore.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/HostTable.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/IHALoadBalancerPolicy.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/ServiceScore.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/policy/NOPLBSPolicy.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HALoadBalancerServlet.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HALoadBalancerServlet.java 2014-05-14 13:56:29 UTC (rev 8309) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HALoadBalancerServlet.java 2014-05-14 13:58:26 UTC (rev 8310) @@ -38,6 +38,7 @@ import org.eclipse.jetty.proxy.ProxyServlet; import com.bigdata.BigdataStatics; +import com.bigdata.counters.CAT; import com.bigdata.journal.AbstractJournal; import com.bigdata.journal.IIndexManager; import com.bigdata.journal.jini.ha.HAJournal; @@ -133,6 +134,38 @@ } + /* + * Static declarations of some common exceptions to reduce overhead + * associated with filling in the stack traces. + */ + + /** + * There is no {@link IHALoadBalancerPolicy} currently declared. + */ + private static final RuntimeException CAUSE_NO_LBS_POLICY = new RuntimeException( + "No LBS policy"); + + /** + * The <code>Request-URI</code> does not map to either {@link #PATH_LEADER} + * or {@link #PATH_READ}. + */ + private static final RuntimeException CAUSE_BAD_REQUEST_URI = new RuntimeException( + "Bad Request-URI"); + + /** + * There is no {@link IHARequestURIRewriter} currently declared. + */ + private static final RuntimeException CAUSE_NO_REWRITER_POLICY = new RuntimeException( + "No rewriter policy"); + + /** + * The destination could not be validated. + * + * @see #validateDestination(String, int) + */ + private static final RuntimeException CAUSE_DESTINATION_NOT_VALID = new RuntimeException( + "Could not validate destination"); + public HALoadBalancerServlet() { super(); @@ -192,6 +225,24 @@ private final AtomicReference<IHARequestURIRewriter> rewriterRef = new AtomicReference<IHARequestURIRewriter>(); /** + * The number of requests that were forwarded to the local service. + */ + private final CAT nforward = new CAT(); + + /** + * The number of requests that were proxied some service. + */ + private final CAT nproxy = new CAT(); + + /** + * The number of requests for which {@link #rewriteURI(HttpServletRequest)} + * trapped an error. + * <p> + * Note: Such requests wind up being forwarded to the local service. + */ + private final CAT nerror = new CAT(); + + /** * Change the {@link IHALoadBalancerPolicy} associated with this instance of * this servlet. The new policy will be installed iff it can be initialized * successfully. The old policy will be destroyed iff the new policy is @@ -524,30 +575,44 @@ * @return The {@link IHALoadBalancerPolicy}[] -or- <code>null</code> if * there are no {@link HALoadBalancerServlet}s. */ - public static IHALoadBalancerPolicy[] getLBSPolicy( - final ServletContext servletContext) { + public static String toString(final ServletContext servletContext) { final HALoadBalancerServlet[] servlets = getServlets(servletContext); if (servlets == null || servlets.length == 0) { // None running. - return null; + return "Not running"; } - final IHALoadBalancerPolicy[] a = new IHALoadBalancerPolicy[servlets.length]; - + final StringBuilder sb = new StringBuilder(); + for (int i = 0; i < servlets.length; i++) { - a[i] = servlets[i].getLBSPolicy(); + sb.append(servlets[i].toString()); } + + return sb.toString(); + + } - return a; + @Override + public String toString() { + return super.toString()// + + "{prefix=" + prefix// + + ",policy=" + policyRef.get()// + + ",rewriter=" + rewriterRef.get()// + + ",nforward=" + nforward.estimate_get()// + + ",nproxy=" + nproxy.estimate_get()// + + ",nerror=" + nerror.estimate_get()// + + "}"// + ; + } - + /** * {@inheritDoc} * <p> @@ -714,7 +779,7 @@ * LBS is disabled. Strip LBS prefix from the requestURI and forward * the request to servlet on this host (NOP LBS). */ - forwardToThisService(isLeaderRequest,request, response); + forwardToLocalService(isLeaderRequest,request, response); return; } @@ -730,7 +795,7 @@ * this service is not the leader. Look at it again under a debugger * and optimize the code paths. */ - if (policy.service(isLeaderRequest, request, response)) { + if (policy.service(isLeaderRequest, this, request, response)) { // Return immediately if the response was committed. return; @@ -760,7 +825,7 @@ * @throws IOException * @throws ServletException */ - static public void forwardToThisService(// + public void forwardToLocalService(// final boolean isLeaderRequest,// final HttpServletRequest request, // final HttpServletResponse response// @@ -817,15 +882,17 @@ * stripped off the prefix for the LBS. */ - if (log.isInfoEnabled()) - log.info("forward: " + path + " => " + newPath); - // Get dispatched for the new requestURL path. final RequestDispatcher requestDispatcher = request .getRequestDispatcher(newPath); try { + + nforward.increment(); + if (log.isInfoEnabled()) + log.info("forward: " + path + " => " + newPath); + // forward to a local servlet. requestDispatcher.forward(request, response); @@ -848,76 +915,152 @@ * * @return The full prefix. * - * TODO This may need to be configurable. It is currently static - * since - * {@link #forwardToThisService(boolean, HttpServletRequest, HttpServletResponse)} - * is static. + * TODO This may need to be configurable. */ - private static String getFullPrefix(final boolean isLeaderRequest, + private String getFullPrefix(final boolean isLeaderRequest, final String prefix) { - final String full_prefix = isLeaderRequest ? prefix + "/leader" - : prefix + "/read"; + final String full_prefix = isLeaderRequest ? prefix + PATH_LEADER + : prefix + PATH_READ; return full_prefix; } /** + * Wrapper invokes {@link #doRewriteURI(HttpServletRequest)} and handles + * any thrown exceptions. + * + * @see #doRewriteURI(HttpServletRequest) + */ + @Override + final protected URI rewriteURI(final HttpServletRequest request) { + + try { + + final URI rewritten = doRewriteURI(request); + + if (rewritten != null) { + + // Track #of requests that are proxied. + nproxy.increment(); + + } + + return rewritten; + + } catch (Throwable t) { + + /* + * Could not rewrite. + */ + + if (InnerCause.isInnerCause(t, InterruptedException.class)) { + + throw new RuntimeException(t); + + } + + nerror.increment(); + + if (log.isDebugEnabled()) { + // full stack trace. + log.warn(t, t); + } else { + // just the message. + log.warn(t); + } + + /* + * Could not rewrite. + * + * Return [null]. This will cause the onRewriteFailed() to be + * invoked. That will do a local forward. If the request can not be + * handled locally, then the local service will generate an error + * message. + * + * Note: This pattern means that we do not throw errors arising from + * the decision to rewrite the request. They are logger (above) and + * then the local forwarding logic is applied. This can mask some + * errors since they will only appear in the log. However, this does + * make the rewrite logic more robust. + */ + + return null; + + } + + } + + /** + * Hook allows the servlet to rewrite the request. + * * For update requests, rewrite the requestURL to the service that is the * quorum leader. For read requests, rewrite the requestURL to the service * having the least load. + * + * @param request + * The request. + * + * @return Return the {@link URI} if the request should be proxied to + * another service -or- <code>null</code> if the request should be + * locally forwarded. */ - @Override - protected URI rewriteURI(final HttpServletRequest request) { - + protected URI doRewriteURI(final HttpServletRequest request) { + final IHALoadBalancerPolicy policy = policyRef.get(); if (policy == null) { - // Could not rewrite. - return null; + // No policy. Can not rewrite. + throw CAUSE_NO_LBS_POLICY; } final String originalRequestURI = request.getRequestURI(); - if (!originalRequestURI.startsWith(prefix)) - return null; + if (!originalRequestURI.startsWith(prefix)) { + // Request is not for this servlet. + throw CAUSE_BAD_REQUEST_URI; + } final Boolean isLeaderRequest = isLeaderRequest(request); if (isLeaderRequest == null) { // Neither /LBS/leader -nor- /LBS/read. - return null; + throw CAUSE_BAD_REQUEST_URI; } final String proxyToRequestURI; - - if(isLeaderRequest) { - // Proxy to leader. - proxyToRequestURI = policy.getLeaderURI(request); - } else { - // Proxy to any joined service. - proxyToRequestURI = policy.getReaderURI(request); - } - - if (log.isDebugEnabled()) - log.debug("proxyToRequestURI=" + proxyToRequestURI); + { - if (proxyToRequestURI == null) { - // Could not rewrite. - return null; + if (isLeaderRequest) { + // Proxy to leader. + proxyToRequestURI = policy.getLeaderURI(request); + } else { + // Proxy to any joined service. + proxyToRequestURI = policy.getReaderURI(request); + } + + if (log.isDebugEnabled()) + log.debug("proxyToRequestURI=" + proxyToRequestURI); + + if (proxyToRequestURI == null) { + /* + * The LBS policy made a choice not to rewrite this request (not + * an error, but a deliberate choice). + */ + return null; + } + } - // the full LBS prefix (includes /leader or /read). + // The full LBS prefix (includes /leader or /read). final String full_prefix = getFullPrefix(isLeaderRequest, prefix); // The configured Request-URL rewriter. final IHARequestURIRewriter rewriter = rewriterRef.get(); if (rewriter == null) { - // Could not rewrite. - log.warn("No rewriter: requestURI=" + originalRequestURI); - return null; + throw CAUSE_NO_REWRITER_POLICY; } // Re-write requestURL. @@ -932,13 +1075,15 @@ // Normalize the request. final URI rewrittenURI = URI.create(uri.toString()).normalize(); - if (!validateDestination(rewrittenURI.getHost(), rewrittenURI.getPort())) - return null; + if (!validateDestination(rewrittenURI.getHost(), rewrittenURI.getPort())) { + throw CAUSE_DESTINATION_NOT_VALID; + } if (log.isInfoEnabled()) log.info("rewrote: " + originalRequestURI + " => " + rewrittenURI); return rewrittenURI; + } /** @@ -969,7 +1114,7 @@ } // Forward to this service (let it generate an error message). - forwardToThisService(isLeaderRequest, request, response); + forwardToLocalService(isLeaderRequest, request, response); // response.sendError(HttpServletResponse.SC_FORBIDDEN); Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HAStatusServletUtil.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HAStatusServletUtil.java 2014-05-14 13:56:29 UTC (rev 8309) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HAStatusServletUtil.java 2014-05-14 13:58:26 UTC (rev 8310) @@ -30,7 +30,6 @@ import java.security.DigestException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; -import java.util.Arrays; import java.util.Iterator; import java.util.UUID; import java.util.concurrent.TimeoutException; @@ -65,7 +64,6 @@ import com.bigdata.quorum.zk.ZKQuorumClient; import com.bigdata.quorum.zk.ZKQuorumImpl; import com.bigdata.rdf.sail.webapp.StatusServlet.DigestEnum; -import com.bigdata.rdf.sail.webapp.lbs.IHALoadBalancerPolicy; import com.bigdata.zookeeper.DumpZookeeper; /** @@ -290,15 +288,12 @@ + journal.getSnapshotManager().getRestorePolicy()) .node("br").close(); - // LBS policy + // HA Load Balancer. { - final IHALoadBalancerPolicy[] a = HALoadBalancerServlet - .getLBSPolicy(req.getServletContext()); - p.text("Service: LBSPolicy=" - + (a == null ? "N/A" : Arrays.toString(a))) - .node("br").close(); + + HALoadBalancerServlet.toString(req + .getServletContext())).node("br").close(); } // if(true) { // /* Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractHostLBSPolicy.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractHostLBSPolicy.java 2014-05-14 13:56:29 UTC (rev 8309) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractHostLBSPolicy.java 2014-05-14 13:58:26 UTC (rev 8310) @@ -23,7 +23,6 @@ package com.bigdata.rdf.sail.webapp.lbs; import java.io.IOException; -import java.util.Arrays; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -47,6 +46,7 @@ import com.bigdata.journal.Journal; import com.bigdata.journal.PlatformStatsPlugIn; import com.bigdata.journal.jini.ha.HAJournal; +import com.bigdata.quorum.Quorum; import com.bigdata.rdf.sail.webapp.HALoadBalancerServlet; import com.bigdata.util.InnerCause; @@ -127,10 +127,42 @@ } + /* + * Static declarations of some common exceptions to reduce overhead + * associated with filling in the stack traces. + */ + /** + * The {@link HostTable} is empty (no hosts). + */ + private static final RuntimeException CAUSE_EMPTY_HOST_TABLE = new RuntimeException( + "Empty host table."); + + /** + * The service table is empty (no services). + */ + private static final RuntimeException CAUSE_EMPTY_SERVICE_TABLE = new RuntimeException( + "Empty service table."); + + /** + * The load balancing logic failed to select a host to handle the + * request. + */ + private static final RuntimeException CAUSE_NO_HOST_SELECTED = new RuntimeException( + "No host selected for request."); + + /** + * The load balancing logic failed to select a service to handle the + * request. + */ + private static final RuntimeException CAUSE_NO_SERVICE_SELECTED = new RuntimeException( + "No service selected for request."); + + /** * @see InitParams#LOCAL_FORWARD_THRESHOLD */ private final AtomicReference<Double> localForwardThresholdRef = new AtomicReference<Double>(); + /** * The rule used to score the {@link IHostMetrics}. * @@ -465,6 +497,9 @@ final HostTable newHostTable = normalizeHostScores(scoringRule, hostMetricsMap); + if (log.isTraceEnabled()) + log.trace("newHostTable=" + newHostTable); + // Set the host table. hostTableRef.set(newHostTable); @@ -472,13 +507,18 @@ /** * Compute and return the normalized load across the known hosts. + * <p> + * Note: This needs to be done only for those hosts that are associated with + * the {@link Quorum} members. If we do it for the other hosts then the + * normalization is not meaningful since we will only load balance across + * the services that are joined with a met {@link Quorum}. * * @param scoringRule * The {@link IHostScoringRule} used to integrate the per-host * performance metrics. * @param hostMetricsMap * The per-host performance metrics for the known hosts. - * + * * @return The normalized host workload. */ private static HostTable normalizeHostScores( @@ -505,24 +545,39 @@ { + /* + * TODO Since the scoring rule does not produce normalized host + * scores, we do not know how the NO_INFO will be ordered with + * respect to those hosts for which the scoring rule was + * successfully applied. This could be made to work either by + * flagging hosts without metrics or by pushing down the handling of + * a [null] metrics reference into the scoring rule, which would + * know how to return a "median" value. + */ + final double NO_INFO = .5d; + int i = 0; for (Map.Entry<String, IHostMetrics> e : hostMetricsMap.entrySet()) { final String hostname = e.getKey(); + assert hostname != null; // Note: map keys are never null. + final IHostMetrics metrics = e.getValue(); if (log.isDebugEnabled()) log.debug("hostname=" + hostname + ", metrics=" + metrics); - double hostScore = scoringRule.getScore(metrics); + // flag host if no load information is available. + double hostScore = metrics == null ? NO_INFO : scoringRule + .getScore(metrics); if (hostScore < 0) { log.error("Negative score: " + hostname); - hostScore = 0d; + hostScore = NO_INFO; } @@ -530,21 +585,29 @@ hostScores[i] = hostScore; + metrics2[i] = metrics; + totalScore += hostScore; i++; } + if (totalScore == 0) { + + /* + * If totalScore is zero, then weight all hosts equally as + * (1/nhosts). + */ + + totalScore = nhosts; + + } + } /* * Normalize the per-hosts scores. - * - * Note: This needs to be done only for those hosts that are associated - * with the quorum members. If we do it for the other hosts then the - * normalization is not meaningful. That is why we first filter for only - * those hosts that are running services associated with this quorum. */ HostScore thisHostScore = null; @@ -555,28 +618,13 @@ final String hostname = hostnames[i]; - final HostScore hostScore; - if (totalScore == 0d) { + // Normalize host scores. + final HostScore hostScore = scores[i] = new HostScore(hostname, + hostScores[i], totalScore, metrics2[i], scoringRule); - /* - * If totalScore is zero, then weight all hosts equally as - * (1/nhosts). - */ - hostScore = new HostScore(hostname, 1d, nhosts, - scoringRule, metrics2[i]); + if (thisHostScore != null && hostScore.isThisHost()) { - } else { - - // Normalize host scores. - hostScore = new HostScore(hostname, hostScores[i], - totalScore, scoringRule, metrics2[i]); - - } - - scores[i] = hostScore; - - if (hostScore.isThisHost()) { - + // The first score discovered for this host. thisHostScore = hostScore; } @@ -585,9 +633,6 @@ } - // sort into ascending order (increasing activity). - Arrays.sort(scores); - // for (int i = 0; i < scores.length; i++) { // // scores[i].rank = i; @@ -596,21 +641,24 @@ // // } - if (scores.length > 0) { +// // Sort into order by decreasing load. +// Arrays.sort(scores); - if (log.isDebugEnabled()) { +// if (scores.length > 0) { +// +// if (log.isDebugEnabled()) { +// +// log.debug("The most active index was: " +// + scores[scores.length - 1]); +// +// log.debug("The least active index was: " + scores[0]); +// +// log.debug("This host: " + thisHostScore); +// +// } +// +// } - log.debug("The most active index was: " - + scores[scores.length - 1]); - - log.debug("The least active index was: " + scores[0]); - - log.debug("This host: " + thisHostScore); - - } - - } - return new HostTable(thisHostScore, scores); } @@ -626,32 +674,41 @@ final ServiceScore[] serviceScores = serviceTableRef.get(); if (hostScores == null || hostScores.length == 0) { - // Can't do anything. - log.warn("Empty host table."); - return null; - + throw CAUSE_EMPTY_HOST_TABLE; } if (serviceScores == null) { + // No services. + throw CAUSE_EMPTY_SERVICE_TABLE; + } - // No services. Can't proxy. - log.warn("No service scores."); - return null; + final HostScore hostScore = getHost(rand.nextDouble(), hostScores); + if (hostScore == null) { + // None found. + throw CAUSE_NO_HOST_SELECTED; } - final HostScore hostScore = getHost(rand.nextDouble(), hostScores); - final ServiceScore serviceScore = getService(rand, hostScore, serviceScores); - if(serviceScore == null) { + if (serviceScore == null) { // None found. - return null; + throw CAUSE_NO_SERVICE_SELECTED; } - - if(serviceScore.getServiceUUID().equals(serviceIDRef.get())) { + + /* + * Track #of requests to each service. + * + * Note: ServiceScore.nrequests is incremented before we make the + * decision to do a local forward when the target is *this* host. This + * means that the /status page will still show the effect of the load + * balancer for local forwards. This is a deliberate decision. + */ + serviceScore.nrequests.increment(); + + if (serviceScore.getServiceUUID().equals(serviceIDRef.get())) { /* * The target is *this* service. As an optimization, we return * [null] so that the caller will perform a local forward (as part @@ -720,17 +777,15 @@ /* * Multiple hosts. * - * Note: Choice is inversely proportional to normalized - * workload. + * Note: Choice is inversely proportional to normalized workload + * (1 - load). */ double sum = 0d; - for (int i = 0; i < hostScores.length; i++) { - hostScore = hostScores[i]; - sum += hostScore.getScore(); // score:=freeCapacity - if (hostScore.getHostname() == null) // can't use w/o hostname. - continue; - if (d >= sum) // scan further. - continue; + for (HostScore tmp : hostScores) { + hostScore = tmp; + sum += (1d - hostScore.getScore()); + if (sum >= d) // scan further. + break; break; } } @@ -812,16 +867,6 @@ final ServiceScore serviceScore = foundServices.get(n); - /* - * Track #of requests to each service. - * - * Note: ServiceScore.nrequests is incremented before we make the - * decision to do a local forward when the target is *this* host. This - * means that the /status page will still show the effect of the load - * balancer for local forwards. This is a deliberate decision. - */ - serviceScore.nrequests.increment(); - return serviceScore; } @@ -835,8 +880,10 @@ */ @Override protected boolean conditionallyForwardReadRequest( - final HttpServletRequest request, final HttpServletResponse response) - throws IOException { + final HALoadBalancerServlet servlet,// + final HttpServletRequest request, // + final HttpServletResponse response// + ) throws IOException { final HostTable hostTable = hostTableRef.get(); @@ -846,8 +893,8 @@ if (thisHostScore != null && thisHostScore.getScore() <= localForwardThresholdRef.get()) { - HALoadBalancerServlet.forwardToThisService( - false/* isLeaderRequest */, request, response); + servlet.forwardToLocalService(false/* isLeaderRequest */, request, + response); // request was handled. return true; Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractLBSPolicy.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractLBSPolicy.java 2014-05-14 13:56:29 UTC (rev 8309) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractLBSPolicy.java 2014-05-14 13:58:26 UTC (rev 8310) @@ -197,9 +197,12 @@ } @Override - public boolean service(final boolean isLeaderRequest, - final HttpServletRequest request, final HttpServletResponse response) - throws ServletException, IOException { + public boolean service(// + final boolean isLeaderRequest, + final HALoadBalancerServlet servlet,// + final HttpServletRequest request, // + final HttpServletResponse response// + ) throws ServletException, IOException { /* * Figure out whether the quorum is met and if this is the quorum @@ -239,8 +242,7 @@ * * @see #forwardToThisService() */ - HALoadBalancerServlet.forwardToThisService(isLeaderRequest, - request, response); + servlet.forwardToLocalService(isLeaderRequest, request, response); // request was handled. return true; @@ -258,7 +260,7 @@ * Provide an opportunity to forward a read request to the local * service. */ - if (conditionallyForwardReadRequest(request, response)) { + if (conditionallyForwardReadRequest(servlet, request, response)) { // Handled. return true; @@ -282,8 +284,10 @@ * @throws IOException */ protected boolean conditionallyForwardReadRequest( - final HttpServletRequest request, final HttpServletResponse response) - throws IOException { + final HALoadBalancerServlet servlet, + final HttpServletRequest request, // + final HttpServletResponse response// + ) throws IOException { return false; Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/HostScore.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/HostScore.java 2014-05-14 13:56:29 UTC (rev 8309) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/HostScore.java 2014-05-14 13:58:26 UTC (rev 8310) @@ -25,8 +25,9 @@ import com.bigdata.counters.AbstractStatisticsCollector; /** - * Helper class assigns a raw and a normalized score to each host based on its - * per-host. + * Helper class assigns a raw score (load) and a normalized score (normalized + * load) to each host based on its per-host metrics and a rule for computing the + * load of a host from those metrics. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> */ @@ -48,13 +49,13 @@ private final double rawScore; /** - * The normalized score computed for that host. + * The normalized score for that host. * <p> * Note: The {@link #rawScore} is a measure of the <em>load</em> on a host. - * The normalized {@link #score} is based on - * <code>1-{@link #rawScore}</code> and is a measure of the normalized - * amount of capacity to do more work on a host. Load balancing decision are - * based on this normalized {@link #score}. + * The normalized {@link #score} is a measure of the normalized + * <em>load</em> on a host. Load balancing decision are based on this + * normalized {@link #score} (work is assigned to a host in inverse + * proportion to its normalized {@link #score}). */ private final double score; @@ -78,23 +79,22 @@ // public double drank = -1d; /** - * Return the raw score for a host, which is a measure of the load on that - * host. The measure is computed based on {@link IHostMetrics} using some - * {@link IHostScoringRule}. + * Return the raw score (aka load) for a host. This raw score is an + * unnormalized measure of the load on that host. The measure is computed + * based on {@link IHostMetrics} using some {@link IHostScoringRule}. */ public double getRawScore() { return rawScore; } /** - * Return the measure of free capacity to do work on the host. + * Return the normalized load for the host. * <p> * Note: The {@link #getRawScore() rawScore} is a measure of the - * <em>load</em> on a host. The normalized {@link #getScore() score} is - * based on <code>1-{@link #getRawScore() rawScore}</code> and is a measure - * of the normalized amount of capacity to do more work on a host. Load - * balancing decision are based on this normalized {@link #getScore() score} - * . + * <em>load</em> on a host. The normalized {@link #getScore() score} is the + * normalized load for a host. Load balancing decision are based on this + * normalized {@link #getScore() score} (work is assigned to hosts in + * inverse proportion to the normalized load of the host). */ public double getScore() { return score; @@ -106,10 +106,9 @@ } /** - * The {@link IHostMetrics} associated with this host (this is - * informational. The {@link #getMetrics()} provide the detailed per-host - * performance metrics that were intepreted by the {@link #getScoringRule()} - * . + * The {@link IHostMetrics} associated with this host (optional). The + * {@link #getMetrics()} provide the detailed per-host performance metrics + * that were intepreted by the {@link #getScoringRule()} . */ public IHostMetrics getMetrics() { return metrics; @@ -117,7 +116,7 @@ /** * The {@link IHostScoringRule} used to convert the {@link #getMetrics()} - * into the {@link #getRawScore()}. + * into the {@link #getRawScore()} (optional). */ public IHostScoringRule getScoringRule() { return scoringRule; @@ -141,13 +140,32 @@ // + ", rank=" + rank // // + ", drank=" + drank // + ", metrics=" + metrics // + + ", scoringRule=" + scoringRule // + "}"; } - public HostScore(final String hostname, final double rawScore, - final double totalRawScore, final IHostScoringRule scoringRule, - final IHostMetrics metrics) { + /** + * + * @param hostname + * The hostname (required, must be non-empty). + * @param rawScore + * The unnormalized load for that host. + * @param totalRawScore + * The total unnormalized load across all hosts. + * @param metrics + * The performance metrics used to compute the unnormalized load + * for each host (optional). + * @param scoringRule + * The rule used to score those metrics (optional). + */ + public HostScore(// + final String hostname,// + final double rawScore,// + final double totalRawScore, // + final IHostMetrics metrics,// + final IHostScoringRule scoringRule// + ) { if (hostname == null) throw new IllegalArgumentException(); @@ -190,25 +208,38 @@ } - return (1d - rawScore) / totalRawScore; + final double score = rawScore / totalRawScore; + if (score < 0 || score > 1) { + + throw new RuntimeException("score(" + score + ") := rawScore(" + + rawScore + ") / totalRawScore(" + totalRawScore + ")"); + + } + + return score; + } /** - * Places elements into order by increasing normalized {@link #getScore()}. - * The {@link #getHostname()} is used to break any ties (but this does not - * help when all services are on the same host). + * Places elements into order by decreasing {@link #getScore() normalized + * load}. The {@link #getHostname()} is used to break any ties (but this + * does not help when all services are on the same host). + * <p> + * Note: The ordering is not really material to anything. Stochastic load + * balancing decisions can be made without regard to this ordering using the + * {@link #getScore() normalized load}. */ @Override public int compareTo(final HostScore arg0) { if (score < arg0.score) { - return -1; + return 1; } else if (score > arg0.score) { - return 1; + return -1; } Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/HostTable.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/HostTable.java 2014-05-14 13:56:29 UTC (rev 8309) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/HostTable.java 2014-05-14 13:58:26 UTC (rev 8310) @@ -24,7 +24,6 @@ import java.util.Arrays; - /** * Class bundles together the set of {@link HostScore}s for services that are * joined with the met quorum and the {@link HostScore} for this service (iff it Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/IHALoadBalancerPolicy.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/IHALoadBalancerPolicy.java 2014-05-14 13:56:29 UTC (rev 8309) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/IHALoadBalancerPolicy.java 2014-05-14 13:58:26 UTC (rev 8310) @@ -50,6 +50,10 @@ * balanced over the joined services. UPDATEs MUST be handled by * the leader. Read requests can be handled by any service that * is joined with the met quorum. + * @param servlet + * The {@link HALoadBalancerServlet}. This is exposed in order to + * allow the {@link IHALoadBalancerPolicy} to perform a local + * forward of the request. * @param request * The request. * @param response @@ -57,9 +61,12 @@ * * @return <code>true</code> iff the request was handled. */ - boolean service(final boolean isLeaderRequest, - final HttpServletRequest request, final HttpServletResponse response) - throws ServletException, IOException; + boolean service(// + final boolean isLeaderRequest, + final HALoadBalancerServlet servlet,// + final HttpServletRequest request, // + final HttpServletResponse response// + ) throws ServletException, IOException; /** * Return the Request-URI to which a non-idempotent request will be proxied. Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/ServiceScore.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/ServiceScore.java 2014-05-14 13:56:29 UTC (rev 8309) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/ServiceScore.java 2014-05-14 13:58:26 UTC (rev 8310) @@ -34,12 +34,6 @@ /** * Helper class caches metadata about an {@link HAGlue} service. - * <p> - * Note: This class is written fairly defensively. The fields can wind up being - * left at their default values (typically <code>null</code>) if we are not able - * to find the necessary information for the {@link HAGlue} service. Users of - * this class must test for <code>null</code> values and skip over those - * services since they have not been pre-resolved to a host and requestURL. */ public class ServiceScore { @@ -131,6 +125,18 @@ } + /** + * + * @param serviceUUID + * The {@link UUID} for the service. + * @param hostname + * The hostname of the host on which the service is running. + * @param requestURI + * The Request-URI for the service. + * + * @throws IllegalArgumentException + * if any argument is <code>null</code>. + */ ServiceScore(final UUID serviceUUID, final String hostname, final String requestURI) { @@ -151,10 +157,38 @@ } + /** + * Factory for {@link ServiceScore} instances. + * + * @param indexManager + * The index manager (required). + * @param contextPath + * The Context-Path of the web application (/bigdata). + * @param serviceUUID + * The {@link UUID} of the service. + * + * @return The {@link ServiceScore}. + * + * @throws IllegalArgumentException + * if any argument is <code>null</code>. + * @throws ClassCastException + * if the {@link IIndexManager} is not an {@link HAJournal}. + * @throws IOException + * If an RMI to the {@link HAGlue} proxy fails. + * @throws RuntimeException + * if anything else goes wrong. + */ static public ServiceScore newInstance(final IIndexManager indexManager, final String contextPath, final UUID serviceUUID) - throws IOException, RuntimeException { + throws IllegalArgumentException, ClassCastException, IOException, + RuntimeException { + if (indexManager == null) + throw new IllegalArgumentException(); + + if (contextPath == null) + throw new IllegalArgumentException(); + if (serviceUUID == null) throw new IllegalArgumentException(); Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/policy/NOPLBSPolicy.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/policy/NOPLBSPolicy.java 2014-05-14 13:56:29 UTC (rev 8309) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/policy/NOPLBSPolicy.java 2014-05-14 13:58:26 UTC (rev 8310) @@ -49,15 +49,17 @@ private static final long serialVersionUID = 1L; @Override - public boolean service(final boolean isLeaderRequest, - final HttpServletRequest request, final HttpServletResponse response) - throws IOException, ServletException { + public boolean service(// + final boolean isLeaderRequest,// + final HALoadBalancerServlet servlet,// + final HttpServletRequest request, // + final HttpServletResponse response// + ) throws IOException, ServletException { if (!isLeaderRequest) { // Always handle read requests locally. - HALoadBalancerServlet.forwardToThisService(isLeaderRequest, - request, response); + servlet.forwardToLocalService(isLeaderRequest, request, response); // Request was handled. return true; @@ -65,7 +67,7 @@ } // Proxy update requests to the quorum leader. - return super.service(isLeaderRequest, request, response); + return super.service(isLeaderRequest, servlet, request, response); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-05-14 20:10:37
|
Revision: 8326 http://sourceforge.net/p/bigdata/code/8326 Author: thompsonbry Date: 2014-05-14 20:10:34 +0000 (Wed, 14 May 2014) Log Message: ----------- Modified to use the namespace for the servlet init-params only for the policy classes. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HALoadBalancerServlet.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractHostLBSPolicy.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HALoadBalancerServlet.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HALoadBalancerServlet.java 2014-05-14 19:52:16 UTC (rev 8325) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HALoadBalancerServlet.java 2014-05-14 20:10:34 UTC (rev 8326) @@ -419,8 +419,8 @@ { // Get the as-configured policy. final IHALoadBalancerPolicy policy = newInstance(servletConfig, - IHALoadBalancerPolicy.class, InitParams.POLICY, - InitParams.DEFAULT_POLICY); + null/* owningClass */, IHALoadBalancerPolicy.class, + InitParams.POLICY, InitParams.DEFAULT_POLICY); // Set the as-configured policy. setLBSPolicy(policy); @@ -429,8 +429,8 @@ { final IHARequestURIRewriter rewriter = newInstance(servletConfig, - IHARequestURIRewriter.class, InitParams.REWRITER, - InitParams.DEFAULT_REWRITER); + null/* owningClass */, IHARequestURIRewriter.class, + InitParams.REWRITER, InitParams.DEFAULT_REWRITER); setRewriter(rewriter); @@ -661,30 +661,44 @@ /** * Return the configured value of the named parameter. This method checks * the environment variables first for a fully qualified value for the - * parameter using <code>HALoadBalancerServer</code><i>name</i>. If no value - * is found for that variable, it checks the {@link ServletContext} for - * <i>name</i>. If no value is found again, it returns the default value - * specified by the caller. This makes it possible to configure the behavior - * of the {@link HALoadBalancerServlet} using environment variables. + * parameter using <i>owningClass</i>.<i>name</i> (or just <i>name</i> if + * <i>owningClass</i> is <code>null</code>). If no value is found for that + * variable, it checks the {@link ServletContext} for <i>name</i>. If no + * value is found again, it returns the default value specified by the + * caller. This makes it possible to configure the behavior of the + * {@link HALoadBalancerServlet} using environment variables. * * @param servletConfig * The {@link ServletConfig}. - * - * @param iface - * The interface that the type must implement. + * @param owningClass + * The name of the class that provides the namespace for the + * <code>init-param</code> (optional - not used by the outer + * servlet, just by the inner policy classes). * @param name - * The name of the servlet init parameter. + * The name of the servlet <code>init-param</code>. * @param def - * The default value for the servlet init parameter. + * The default value for the servlet <code>init-param</code>. * @return */ public static String getConfigParam(final ServletConfig servletConfig, + final Class<? extends IHAPolicyLifeCycle> owningClass, final String name, final String def) { + String s = null; + // Look at environment variables for an override. - String s = System.getProperty(HALoadBalancerServlet.class.getName() - + "." + name); + if (owningClass != null) { + // namespace is the owningClass. + System.getProperty(owningClass.getName() + "." + name); + + } else { + + // no namespace. + System.getProperty(name); + + } + if (s == null || s.trim().length() == 0) { // Look at ServletConfig for the configured value. @@ -725,10 +739,11 @@ */ @SuppressWarnings("unchecked") public static <T> T newInstance(final ServletConfig servletConfig, + final Class<? extends IHAPolicyLifeCycle> owningClass, final Class<? extends T> iface, final String name, final String def) throws ServletException { - final String s = getConfigParam(servletConfig, name, def); + final String s = getConfigParam(servletConfig, owningClass, name, def); final T t; final Class<? extends T> cls; Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractHostLBSPolicy.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractHostLBSPolicy.java 2014-05-14 19:52:16 UTC (rev 8325) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractHostLBSPolicy.java 2014-05-14 20:10:34 UTC (rev 8326) @@ -290,7 +290,9 @@ { final String s = HALoadBalancerServlet.getConfigParam( - servletConfig, InitParams.LOCAL_FORWARD_THRESHOLD, + servletConfig, // + AbstractHostLBSPolicy.class,// owningClass + InitParams.LOCAL_FORWARD_THRESHOLD, InitParams.DEFAULT_LOCAL_FORWARD_THRESHOLD); final double d = Double.valueOf(s); @@ -304,7 +306,9 @@ { - scoringRuleRef.set(HALoadBalancerServlet.newInstance(servletConfig, + scoringRuleRef.set(HALoadBalancerServlet.newInstance(// + servletConfig,// + AbstractHostLBSPolicy.class,// owningClass IHostScoringRule.class, InitParams.HOST_SCORING_RULE, getDefaultScoringRule())); @@ -317,7 +321,9 @@ { final String s = HALoadBalancerServlet.getConfigParam( - servletConfig, InitParams.HOST_DISCOVERY_INITIAL_DELAY, + servletConfig, // + AbstractHostLBSPolicy.class,// owningClass + InitParams.HOST_DISCOVERY_INITIAL_DELAY, InitParams.DEFAULT_HOST_DISCOVERY_INITIAL_DELAY); hostDiscoveryInitialDelay = Long.valueOf(s); @@ -330,8 +336,10 @@ { - final String s = HALoadBalancerServlet.getConfigParam( - servletConfig, InitParams.HOST_DISCOVERY_DELAY, + final String s = HALoadBalancerServlet.getConfigParam(// + servletConfig, // + AbstractHostLBSPolicy.class,// owningClass + InitParams.HOST_DISCOVERY_DELAY,// InitParams.DEFAULT_HOST_DISCOVERY_DELAY); hostDiscoveryDelay = Long.valueOf(s); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-05-14 20:27:21
|
Revision: 8330 http://sourceforge.net/p/bigdata/code/8330 Author: thompsonbry Date: 2014-05-14 20:27:18 +0000 (Wed, 14 May 2014) Log Message: ----------- More games with the HA LBS init-param overrides. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HALoadBalancerServlet.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractHostLBSPolicy.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HALoadBalancerServlet.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HALoadBalancerServlet.java 2014-05-14 20:19:50 UTC (rev 8329) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/HALoadBalancerServlet.java 2014-05-14 20:27:18 UTC (rev 8330) @@ -667,16 +667,21 @@ * the environment variables first for a fully qualified value for the * parameter using <i>owningClass</i>.<i>name</i> (or just <i>name</i> if * <i>owningClass</i> is <code>null</code>). If no value is found for that - * variable, it checks the {@link ServletContext} for <i>name</i>. If no - * value is found again, it returns the default value specified by the - * caller. This makes it possible to configure the behavior of the - * {@link HALoadBalancerServlet} using environment variables. + * variable, it checks the {@link ServletContext} for <i>name</i> (if the + * owningClass:=HALoadBalancerServlet) and otherwise for + * <i>owningClass.name</i>. If no value is found again, it returns the + * default value specified by the caller. This makes it possible to + * configure the behavior of the {@link HALoadBalancerServlet} using + * environment variables. * * @param servletConfig * The {@link ServletConfig}. * @param owningClass * The class that declares the init-param (required). This serves - * as a namespace when searching the environment variables. + * as a namespace when searching the environment variables. This + * is also used to impose a namespace when searching + * <code>web.xml</code> when + * <code>owningClass!=HALoadBalancerServlet</code>. * @param name * The name of the servlet <code>init-param</code>. * @param def @@ -692,8 +697,26 @@ if (s == null || s.trim().length() == 0) { // Look at ServletConfig for the configured value. - s = servletConfig.getInitParameter(name); + if (owningClass == HALoadBalancerServlet.class) { + /* + * The HALoadBalancerServlet does not use a namespace prefix for + * its web.xml declarations. + */ + s = servletConfig.getInitParameter(name); + + } else { + + /* + * The other policy objects DO use their owningClass as a + * namespace prefix. This is done to avoid collisions among the + * different policy classes. + */ + s = servletConfig.getInitParameter(owningClass.getName() + "." + + name); + + } + } if (s == null || s.trim().length() == 0) { Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractHostLBSPolicy.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractHostLBSPolicy.java 2014-05-14 20:19:50 UTC (rev 8329) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/lbs/AbstractHostLBSPolicy.java 2014-05-14 20:27:18 UTC (rev 8330) @@ -65,6 +65,12 @@ */ private static final long serialVersionUID = 1L; + /** + * + * @see HALoadBalancerServlet#getConfigParam(ServletConfig, Class, String, + * String) for how these <code>init-param</code> values can be set in + * <code>web.xml</code> and via environment variables. + */ public interface InitParams extends AbstractLBSPolicy.InitParams { /** @@ -81,8 +87,7 @@ * Note: The default policy is specific to the concrete instance of the * outer class. */ - String HOST_SCORING_RULE = AbstractHostLBSPolicy.class.getName() - + ".hostScoringRule"; + String HOST_SCORING_RULE = "hostScoringRule"; /** * Read requests are forwarded to the local service if the availability @@ -100,8 +105,7 @@ * {@link IHALoadBalancerPolicy} takes over only when there is a severe * workload imbalance (as defined by the value of this parameter). */ - String LOCAL_FORWARD_THRESHOLD = AbstractHostLBSPolicy.class.getName() - + ".localForwardThreshold"; + String LOCAL_FORWARD_THRESHOLD = "localForwardThreshold"; String DEFAULT_LOCAL_FORWARD_THRESHOLD = "1.0"; @@ -111,8 +115,7 @@ * the joined services (default * {@value #DEFAULT_HOST_DISCOVERY_INITIAL_DELAY}). */ - String HOST_DISCOVERY_INITIAL_DELAY = AbstractHostLBSPolicy.class.getName() - + ".hostDiscoveryInitialDelay"; + String HOST_DISCOVERY_INITIAL_DELAY = "hostDiscoveryInitialDelay"; String DEFAULT_HOST_DISCOVERY_INITIAL_DELAY = "10000"; // ms. @@ -121,8 +124,7 @@ * in-memory snapshots of the performance metrics for the joined * services (default {@value #DEFAULT_HOST_DISCOVERY_DELAY}). */ - String HOST_DISCOVERY_DELAY = AbstractHostLBSPolicy.class.getName() - + ".hostDiscoveryDelay"; + String HOST_DISCOVERY_DELAY = "hostDiscoveryDelay"; String DEFAULT_HOST_DISCOVERY_DELAY = "10000"; // ms. @@ -236,6 +238,8 @@ sb.append(",localForwardThreshold=" + localForwardThresholdRef.get()); + sb.append(",hostDiscoveryInitialDelay=" + hostDiscoveryInitialDelay); + sb.append(",hostDiscoveryDelay=" + hostDiscoveryDelay); sb.append(",scoringRule=" + scoringRuleRef.get()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-05-15 15:26:58
|
Revision: 8337 http://sourceforge.net/p/bigdata/code/8337 Author: thompsonbry Date: 2014-05-15 15:26:56 +0000 (Thu, 15 May 2014) Log Message: ----------- renamed the http header to X-BIGDATA-MAX-QUERY-MILLIS. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java 2014-05-15 15:14:55 UTC (rev 8336) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/BigdataRDFContext.java 2014-05-15 15:26:56 UTC (rev 8337) @@ -217,7 +217,7 @@ * * @see http://trac.bigdata.com/ticket/914 (Set timeout on remote query) */ - static private final String HTTP_HEADER_BIGDATA_MAX_QUERY_MILLIS = "BIGDATA_MAX_QUERY_MILLIS"; + static private final String HTTP_HEADER_BIGDATA_MAX_QUERY_MILLIS = "X-BIGDATA-MAX-QUERY-MILLIS"; private final SparqlEndpointConfig m_config; Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2014-05-15 15:14:55 UTC (rev 8336) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/client/RemoteRepository.java 2014-05-15 15:26:56 UTC (rev 8337) @@ -192,7 +192,7 @@ * * @see http://trac.bigdata.com/ticket/914 (Set timeout on remote query) */ - static private final String HTTP_HEADER_BIGDATA_MAX_QUERY_MILLIS = "BIGDATA_MAX_QUERY_MILLIS"; + static private final String HTTP_HEADER_BIGDATA_MAX_QUERY_MILLIS = "X-BIGDATA-MAX-QUERY-MILLIS"; /** * When <code>true</code>, the REST API methods will use the load balancer This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |